]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gold/ChangeLog
Fix handling of __ehdr_start when it cannot be defined.
[thirdparty/binutils-gdb.git] / gold / ChangeLog
1 2014-05-02 Cary Coutant <ccoutant@google.com>
2
3 * defstd.cc (in_segment): Define __ehdr_start here...
4 * layout.cc (Layout::finalize): ...Instead of here. Set the
5 output segment when known.
6 * resolve.cc (Symbol::override_base_with_special): Remember
7 the original binding.
8 * symtab.cc (Symbol::set_output_segment): New function.
9 (Symbol::set_undefined): New function.
10 * symtab.h (Symbol::is_weak_undefined): Check original undef
11 binding.
12 (Symbol::is_strong_undefined): New function.
13 (Symbol::set_output_segment): New function.
14 (Symbol::set_undefined): New function.
15 * target-reloc.h (is_strong_undefined): Remove.
16 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
17 Check for hidden undefs.
18 (relocate_section): Call Symbol::is_strong_undefined.
19
20 * testsuite/Makefile.am (ehdr_start_test_1)
21 (ehdr_start_test_2, ehdr_start_test_3)
22 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
23 * testsuite/Makefile.in: Regenerate.
24 * testsuite/ehdr_start_def.cc: New source file.
25 * testsuite/ehdr_start_test.cc: New source file.
26 * testsuite/ehdr_start_test.t: New linker script.
27 * testsuite/ehdr_start_test_4.sh: New shell script.
28
29 2014-04-23 Cary Coutant <ccoutant@google.com>
30
31 PR gold/16870
32 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
33
34 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
35
36 * layout.cc (Layout::include_section): Allow a target to decide
37 whether to include a section.
38 * target.h (Target::should_include_section): New function.
39 (Target::do_should_include_section): New function.
40
41 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
42
43 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
44 inline into ...
45 (Copy_relocs::emit): ... here.
46 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
47 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
48 (Copy_reloc_entry::entries_): Change from private to protected.
49
50 2014-04-02 Sriraman Tallam <tmsriram@google.com>
51
52 * icf.cc (get_section_contents): Replace copies of reloc
53 vectors with const references.
54
55 2014-04-02 Cary Coutant <ccoutant@google.com>
56
57 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
58 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
59 * configure: Regenerate.
60 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
61 -fno-use-linker-plugin.
62 (LINK1, CXXLINK1): Add it to the link command.
63 * testsuite/Makefile.in: Regenerate.
64
65 2014-03-12 Alan Modra <amodra@gmail.com>
66
67 * Makefile.in: Regenerate.
68
69 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
70
71 * symtab.h (Symbol::set_nonvis): New function.
72
73 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
74
75 * symtab.cc (Sized_symbol<32>::init_output_data):
76 Instantiate the template.
77 (Sized_symbol<64>::init_output_data): Likewise.
78
79 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
80
81 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
82 adjust dynamic symbol value.
83 * target.h (Target::adjust_dyn_symbol): New function.
84 (Target::do_adjust_dyn_symbol): New function.
85
86 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
87
88 * output.cc (Output_data_dynamic::Dynamic_entry::write):
89 Get the value of DYNAMIC_CUSTOM dynamic entry.
90 * output.h (Output_data_dynamic::add_custom): New function.
91 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
92 dynamic entry.
93 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
94 * target.h (Target::dynamic_tag_custom_value): New function.
95 (Target::do_dynamic_tag_custom_value): New function.
96
97 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
98
99 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
100 dynsym indexes.
101 * target.h (Target::has_custom_set_dynsym_indexes): New function.
102 (Target::do_has_custom_set_dynsym_indexes): New function.
103 (Target::set_dynsym_indexes): New function.
104 (Target::do_set_dynsym_indexes): New function.
105
106 2014-03-07 Alan Modra <amodra@gmail.com>
107
108 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
109 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
110 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
111 (Powerpc_relocate_functions::has_overflow_bitfield,
112 overflowed): Use the above.
113 (Target_powerpc::Relocate::relocate): Correct overflow checking
114 for a number of relocations. Modify overflow test for 16-bit
115 fields in instructions to signed/unsigned according to whether
116 the field takes a signed or unsigned value.
117
118 2014-03-05 Alan Modra <amodra@gmail.com>
119
120 Update copyright years.
121
122 2014-03-05 Alan Modra <amodra@gmail.com>
123
124 * powerpc.cc (Target_powerpc::Scan::local, global): Support
125 R_PPC64_ADDR64_LOCAL.
126 (Target_powerpc::Relocate::relocate): Likewise.
127
128 2014-03-03 Alan Modra <amodra@gmail.com>
129
130 * dwp.cc (print_version): Update copyright year to current.
131
132 2014-02-10 Alan Modra <amodra@gmail.com>
133
134 * po/gold.pot: Regenerate.
135
136 2014-02-06 Cary Coutant <ccoutant@google.com>
137
138 Fix problem where -u is ignored when a weak undef is seen.
139
140 * archive.cc (Library_base::should_include_member): Reorder
141 code to check for -u option if a weak undef has already been seen.
142 * testsuite/Makefile.am (weak_undef_test_2): New test case.
143 * testsuite/Makefile.in: Regenerate.
144 * testsuite/weak_undef_file3.cc: New file.
145 * testsuite/weak_undef_file4.cc: New file.
146 * testsuite/weak_undef_test_2.cc: New file.
147
148 2014-02-05 Cary Coutant <ccoutant@google.com>
149
150 Fix issues with gold undefined symbol diagnostics.
151
152 PR binutils/15435
153 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
154 check to here.
155 * target-reloc.h (is_strong_undefined): New function.
156 (relocate_section): Move undef vtable symbol check from here.
157 Check for is_strong_undefined.
158
159 2014-02-05 Cary Coutant <ccoutant@google.com>
160
161 Fix problems with the --dynamic-list option.
162
163 PR gold/13577
164 * options.cc (General_options::parse_dynamic_list):
165 Set have_dynamic_list_.
166 (General_options::General_options): Initialize have_dynamic_list_.
167 (General_options::finalize): Turn off -Bsymbolic and
168 -Bsymbolic-functions if --dynamic-list provided.
169 * options.h (General_options::have_dynamic_list): New function.
170 (General_options::have_dynamic_list_): New data member.
171 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
172 correctly.
173
174 PR gold/16530
175 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
176 in --dynamic-list, mark it.
177
178 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
179 (dynamic_list_2): New test case.
180 * testsuite/Makefile.in: Regenerate.
181 * testsuite/dynamic_list_2.cc: New file.
182 * testsuite/dynamic_list_2.t: New file.
183 * testsuite/dynamic_list_lib1.cc: New file.
184 * testsuite/dynamic_list_lib2.cc: New file.
185 * testsuite/gc_dynamic_list_test.c: New file.
186 * testsuite/gc_dynamic_list_test.sh: New file.
187 * testsuite/gc_dynamic_list_test.t: New file.
188
189 2014-01-28 Cary Coutant <ccoutant@google.com>
190
191 Add .gdb_index version 7 support.
192
193 * gold/dwarf_reader.cc: include <utility> (for make_pair).
194 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
195 debug sections.
196 (Dwarf_ranges_table::read_ranges_table): Likewise.
197 (Dwarf_pubnames_table::read_section): Check for GNU-style
198 sections, and for compressed debug sections.
199 (Dwarf_pubnames_table::read_header): Compute end address of table.
200 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
201 for end of list by offset, not by offset == 0.
202 (Dwarf_info_reader::do_read_string_table): Check for compressed
203 debug sections.
204 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
205 Initialize new data members.
206 (Dwarf_pubnames_table::next_name): return flag_byte.
207 (Dwarf_pubnames_table::end_of_table_): New data member.
208 (Dwarf_pubnames_table::is_gnu_style_): New data member.
209 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
210 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
211 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
212 read skeleton type unit DIEs.
213 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
214 (Gdb_index::do_write): Write flag_byte.
215 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
216 (Gdb_index::Cu_vector): Store flags along with cu indexes.
217 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
218 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
219
220 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
221
222 * version.cc (print_version): Update copyright year to 2014.
223
224 2013-12-19 Dimitry Andric <dimitry@andric.com>
225
226 * stringpool.cc (Stringpool_template::reserve): Add
227 HAVE_UNORDERED_MAP case.
228 * stringpool.cc (Stringpool_template::print_stats): Likewise.
229
230 2013-12-18 Cary Coutant <ccoutant@google.com>
231
232 * configure.ac: Check for <unordered_set> and <unordered_map>.
233 * config.in: Regenerate.
234 * configure: Regenerate.
235 * system.h: Use <unordered_set> and <unordered_map> if available.
236
237 2013-12-10 Roland McGrath <mcgrathr@google.com>
238
239 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
240 with $(INSTALL_PROGRAM_ENV).
241 * Makefile.in: Regenerate.
242
243 2013-11-22 Cary Coutant <ccoutant@google.com>
244
245 * configure.ac: Add check for which library is needed for
246 dlopen.
247 * configure: Regenerate.
248
249 2013-11-22 Cary Coutant <ccoutant@google.com>
250
251 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
252 assembler.
253 * testsuite/Makefile.in: Regenerate.
254
255 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
256
257 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
258 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
259 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
260 (Target_x86_64<size>::Scan::local): Likewise.
261 (Target_x86_64<size>::Scan::global): Likewise.
262 (Target_x86_64<size>::Relocate::relocate): Likewise.
263 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
264 Likewise.
265 (Target_x86_64<size>::Scan::check_non_pic(): Handle
266 R_X86_64_PC32_BND.
267
268 * testsuite/Makefile.am (check_PROGRAMS): Add
269 exception_x86_64_bnd_test.
270 (exception_x86_64_bnd_test_SOURCES): New macro.
271 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
272 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
273 (exception_x86_64_bnd_test_LDADD): Likewise.
274 (exception_x86_64_bnd_1.o): New rule.
275 (exception_x86_64_bnd_2.o): Likewise.
276 * testsuite/Makefile.in: Regenerated.
277
278 2013-11-15 Alan Modra <amodra@gmail.com>
279
280 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
281 accessor.
282 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
283 Only call ppc64_local_entry_offset for 64-bit. Restrict
284 symval_for_branch lookup to ELFv1.
285 (Stub_table::add_plt_call_entry): Use unsigned int off.
286 (Output_data_glink::Address, invalid_address): New.
287 (Output_data_glink::add_eh_frame): Move out of line. Add
288 support for ELFv2.
289 (Output_data_glink::add_global_entry, find_global_entry,
290 global_entry_address): New functions.
291 (Output_data_glink::global_entry_stubs_, end_branch_table_,
292 ge_size): New variables.
293 (Output_data_glink::set_final_data_size): Add global entry
294 stub sizing.
295 (Output_data_glink::do_write): Write global entry stubs.
296 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
297 parameter. Return true for ELFv2. Adjust callers.
298 (Target_powerpc::Scan::local, global): Restrict opd lookup to
299 ELFv1. Similarly for ifunc and dynamic relocation processing
300 specific to ELFv1. Recognize that symbols are defined on
301 their plt entries for ELFv2.
302 (Target_powerpc::symval_for_branch): Assert if called for
303 ELFv2 or ppc32.
304 (Target_powerpc::Relocate::relocate): Use global entry plt
305 stub for symbol value if such exists on ELFv2.
306 (Target_powerpc::Relocate::relocate): Don't call
307 symval_for_branch when ELFv2. Do adjust for local entry
308 offset when ELFv2.
309 (Target_powerpc::do_dynsym_value): Set symbols to global entry
310 plt stub for ELFv2.
311 (Target_powerpc::do_plt_address_for_global): Similarly.
312
313 2013-11-14 Cary Coutant <ccoutant@google.com>
314
315 Revert patch -- this did not fix the problem, and there is
316 no race there.
317
318 2013-11-14 Cary Coutant <ccoutant@google.com>
319
320 PR gold/14860
321 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
322 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
323 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
324 updating fde_offsets_.
325 (Eh_frame_hdr::lock_): New data member.
326
327 2013-11-14 Cary Coutant <ccoutant@google.com>
328
329 * dwp.cc (Dwo_file_entry): New type.
330 (File_list): Use Dwo_file_entry.
331 (Dwo_file::verify): New function.
332 (Dwo_file::verify_dwo_list): New function.
333 (Dwo_file::sized_verify_dwo_list): New function.
334 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
335 list.
336 (Dwp_options): New enum type.
337 (dwp_options): Add --verify-only.
338 (usage): Likewise.
339 (main): Likewise.
340 * dwp.h (gold_info): Add declaration.
341
342 2013-11-14 Cary Coutant <ccoutant@google.com>
343
344 PR gold/14860
345 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
346 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
347 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
348 updating fde_offsets_.
349 (Eh_frame_hdr::lock_): New data member.
350
351 2013-11-06 Cary Coutant <ccoutant@google.com>
352
353 PR gold/15758
354 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
355 before reloc sections.
356
357 2013-11-04 Alan Modra <amodra@gmail.com>
358
359 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
360 (Symbol::needs_dynamic_reloc): Test new flag.
361 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
362 (Target_powerpc::Scan::get_reference_flags): Add target param.
363 Return FUNC_DESC_ABI for 64-bit ELFv1.
364 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
365 call.
366 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
367 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
368
369 2013-10-31 Cary Coutant <ccoutant@google.com>
370
371 Restore support for dwp v2 DWARF package file format.
372
373 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
374 tu_length parameter. Adjust all callers.
375 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
376 * dwp.cc: Include dwarf.h.
377 (Section_bounds): New struct type.
378 (Unit_set): New struct type.
379 (Dwo_file::Dwo_file): Initialize new data member.
380 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
381 Combine and rename to...
382 (Dwo_file::read_unit_index): ...this.
383 (Dwo_file::sized_read_compunit_index)
384 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
385 (Dwo_file::sized_read_unit_index): ...this.
386 (Dwo_file::copy_section): Remove section_name, is_str_offsets
387 parameters; add section_id parameter.
388 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
389 (Dwo_file::add_unit_set): ...this.
390 (Dwo_file::shndx_map_): Remove.
391 (Dwo_file::sect_offsets_): New data member.
392 (Dwp_output_file::Dwp_output_file): Initialize new data members.
393 (Dwp_output_file::add_section): Rename to...
394 (Dwp_output_file::add_contribution): ...this.
395 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
396 (Dwp_output_file::add_tu_set): Likewise.
397 (Dwp_output_file::Contribution): New type.
398 (Dwp_output_file::Section::contributions): New data member.
399 (Dwp_output_file::Cu_or_tu_set): Remove.
400 (Dwp_output_file::Section::Section): New ctor.
401 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
402 (Dwp_output_file::Dwp_index::Section_table): New type.
403 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
404 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
405 parameter.
406 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
407 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
408 (Dwp_output_file::Dwp_index::section_table): New member function.
409 (Dwp_output_file::Dwp_index::section_table_end): New member function.
410 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
411 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
412 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
413 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
414 (Dwp_output_file::Dwp_index::section_table_): New data member.
415 (Dwp_output_file::Dwp_index::section_mask_): New data member.
416 (Dwp_output_file::add_output_section): New member function.
417 (Dwp_output_file::write_new_section): New member function.
418 (Dwp_output_file::write_contributions): New member function.
419 (Dwp_output_file::section_id_map_): New data member.
420 (class Dwo_id_info_reader): Remove.
421 (class Unit_reader): New class.
422 (get_dwarf_section_name): New function.
423 (Dwo_file::read_executable): Adjust initializations of class data.
424 (Dwo_file::read): Add support for v2 package file format.
425 (Dwo_file::read_unit_index): Likewise.
426 (Dwo_file::sized_read_unit_index): Likewise.
427 (Dwo_file::copy_section): Likewise.
428 (Dwo_file::add_unit_set): Likewise.
429 (Dwp_output_file::add_output_section): Likewise.
430 (Dwp_output_file::add_contribution): Likewise.
431 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
432 for empty slot.
433 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
434 file format.
435 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
436 slot.
437 (Dwp_output_file::initialize): Remove unused function.
438 (Dwp_output_file::finalize): Add support for v2 package file format.
439 (Dwp_output_file::write_index): Likewise.
440 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
441 function prototype.
442
443 2013-10-31 Cary Coutant <ccoutant@google.com>
444
445 * configure.ac: Fix check for -fmerge-constants.
446 * configure.ac: Regenerate.
447
448 2013-10-30 Roland McGrath <mcgrathr@google.com>
449
450 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
451 Correct 9-byte nop sequence to match what the assembler generates.
452
453 2013-10-30 Alan Modra <amodra@gmail.com>
454
455 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
456 ppc64_local_entry_offset, ppc64_local_entry_offset,
457 do_read_symbols): New functions.
458 (Powerpc_relobj::e_flags_, st_other_): New vars.
459 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
460 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
461 (Powerpc_relobj::e_flags_): New var.
462 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
463 and adjust for ELFv2.
464 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
465 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
466 (Powerpc_dynobj::do_find_special_sections): Likewise.
467 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
468 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
469 to ELFv2 local entry.
470 (Target_powerpc::do_relax): No thread safe barriers needed for
471 ELFv2.
472 (Output_data_plt_powerpc::initial_plt_entry_size_,
473 plt_entry_size): Delete. Replace all uses with
474 first_plt_entry_offset() and plt_entry_size().
475 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
476 reserved_size parm. Update callers.
477 (Output_data_plt_powerpc::entry_count): Update.
478 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
479 and use Target_powerpc::first_plt_entry_offset().
480 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
481 rename to plt_entry_size.
482 (Output_data_plt_powerpc::add_ifunc_entry,
483 add_local_ifunc_entry): Adjust reloc for ELFv2.
484 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
485 (glink_eh_frame_fde_64v2): New.
486 (Stub_table::plt_call_size): Support ELFv2 sizing.
487 (Output_data_glink::add_eh_frame): Use the new FDE.
488 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
489 (Stub_table::do_write): Write ELFv2 stubs and glink.
490 (Target_powerpc::Relocate::relocate): Replaces nop after call
491 with ld 2,24(1) and adjust local offset destination for ELFv2.
492
493 2013-10-30 Alan Modra <amodra@gmail.com>
494
495 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
496 (Target_powerpc::Scan::global, local): Likewise.
497 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
498 on all ppc64 @h and @ha relocs.
499
500 2013-10-14 Alan Modra <amodra@gmail.com>
501
502 * output.h (Output_data_got::add_constant): Tidy.
503 (Output_data_got::add_constant_pair): New function.
504 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
505 methods used so as to first call reserve_ent().
506
507 2013-10-11 Roland McGrath <mcgrathr@google.com>
508
509 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
510 add_got_entry and add_got_entry_pair.
511
512 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
513 (HAVE_PUBNAMES): Likewise.
514 * configure: Regenerate.
515
516 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
517 * testsuite/Makefile.in: Regenerate.
518
519 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
520 Remove const from declaration.
521 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
522 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
523 * output.h (Output_file_header): Remove const from member target_
524 and corresponding constructor argument.
525 * output.cc (Output_file_header::Output_file_header): Update prototype.
526 (Output_file_header::do_sized_write): Use this->target_ in place
527 of parameters()->target().
528
529 * testsuite/undef_symbol.cc (Foo::get_a): New method.
530
531 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
532 * configure: Regenerate.
533 * Makefile.in: Regenerate.
534 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
535 * testsuite/merge_string_literals_2.c: Likewise.
536 * testsuite/Makefile.am
537 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
538 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
539 literal -fmerge-constants.
540 * testsuite/Makefile.in: Regenerate.
541
542 * i386.cc (Target_i386): Remove unused member dynbss_.
543 * arm.cc (Target_arm): Likewise.
544 * powerpc.cc (Target_powerpc): Likewise.
545 * sparc.cc (Target_sparc): Likewise.
546 * tilegx.cc (Target_tilegx): Likewise.
547 * x86_64.cc (Target_x86_64): Likewise.
548 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
549 type_signature_, type_offset_.
550 * plugin.h (Plugin_hook): Remove unused member layout_.
551 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
552 mapfile_.
553 (Read_member): Remove unused members input_objects_, symtab_,
554 mapfile_, layout_.
555 (Check_library): Remove unused member symtab_.
556 * archive.h (Lib_group): Remove unused member lib_.
557 * archive.cc (Lib_group::Lib_group): Update initializer.
558 * incremental.h (Incremental_binary): Remove unused member target_.
559 (Incremental_script_entry): Removed unused member script_.
560 * layout.h (Write_symbols_task): Remove unused member input_objects_.
561 * icf.h (Icf): Remove unused member num_tracked_relocs.
562
563 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
564 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
565 its only use.
566 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
567
568 * archive.h: Use struct rather than class for forward declaration
569 of Read_symbols_data.
570
571 2013-10-07 Cary Coutant <ccoutant@google.com>
572
573 PR gold/16010
574 * testsuite/Makefile.am (icf_test): Fix dependencies.
575 (icf_safe_test): Likewise.
576 (icf_safe_so_test): Likewise.
577 (large_symbol_alignment): Add empty _LDADD rule.
578 * testsuite/Makefile.in: Regenerate.
579
580 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
581
582 PR gold/15927
583 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
584 relocation for R_X86_64_32 on x32.
585
586 2013-08-27 Roland McGrath <mcgrathr@google.com>
587
588 * output.cc (Output_segment::set_section_addresses): Take new
589 Target* argument. If target->isolate_execinstr() and the segment
590 is executable and starts at a target->abi_pagesize() boundary,
591 pad its end out to a target->abi_pagesize() boundary with code fill.
592 * output.h (Output_segment::set_section_addresses): Update decl.
593 * layout.h (Layout::check_output_data_for_reset_values): Take new
594 argument RELAX_OUTPUTS.
595 (Layout): New member relax_output_list_.
596 (Layout::add_relax_output): New method.
597 * layout.cc (Layout::Layout): Update constructor.
598 (Layout::reset_relax_output): New method.
599 (Layout::clean_up_after_relaxation): Call it.
600 (Layout::prepare_for_relaxation): Update caller.
601 (Layout::set_segment_offsets): Update callers of set_section_addresses.
602 Call reset_relax_output before re-processing segments for
603 isolate_execinstr case.
604 (Layout::write_data): Handle relax_output_list_.
605 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
606 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
607
608 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
609
610 PR binutils/15834
611 * object.h: Fix typos.
612
613 2013-08-16 Roland McGrath <mcgrathr@google.com>
614
615 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
616 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
617
618 2013-08-07 Cary Coutant <ccoutant@google.com>
619
620 Revert support for v2 DWP files:
621
622 2013-03-01 Cary Coutant <ccoutant@google.com>
623
624 Add dwp support for v2 DWARF package file format.
625 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
626 tu_length parameter. Adjust all callers.
627 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
628 * dwp.cc: Include dwarf.h.
629 (Section_bounds): New struct type.
630 (Unit_set): New struct type.
631 (Dwo_file::Dwo_file): Initialize new data member.
632 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
633 Combine and rename to...
634 (Dwo_file::read_unit_index): ...this.
635 (Dwo_file::sized_read_compunit_index)
636 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
637 (Dwo_file::sized_read_unit_index): ...this.
638 (Dwo_file::copy_section): Remove section_name, is_str_offsets
639 parameters; add section_id parameter.
640 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
641 (Dwo_file::add_unit_set): ...this.
642 (Dwo_file::shndx_map_): Remove.
643 (Dwo_file::sect_offsets_): New data member.
644 (Dwp_output_file::Dwp_output_file): Initialize new data members.
645 (Dwp_output_file::add_section): Rename to...
646 (Dwp_output_file::add_contribution): ...this.
647 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
648 (Dwp_output_file::add_tu_set): Likewise.
649 (Dwp_output_file::Contribution): New type.
650 (Dwp_output_file::Section::contributions): New data member.
651 (Dwp_output_file::Cu_or_tu_set): Remove.
652 (Dwp_output_file::Section::Section): New ctor.
653 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
654 (Dwp_output_file::Dwp_index::Section_table): New type.
655 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
656 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
657 parameter.
658 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
659 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
660 (Dwp_output_file::Dwp_index::section_table): New member function.
661 (Dwp_output_file::Dwp_index::section_table_end): New member function.
662 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
663 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
664 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
665 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
666 (Dwp_output_file::Dwp_index::section_table_): New data member.
667 (Dwp_output_file::Dwp_index::section_mask_): New data member.
668 (Dwp_output_file::add_output_section): New member function.
669 (Dwp_output_file::write_new_section): New member function.
670 (Dwp_output_file::write_contributions): New member function.
671 (Dwp_output_file::section_id_map_): New data member.
672 (class Dwo_id_info_reader): Remove.
673 (class Unit_reader): New class.
674 (get_dwarf_section_name): New function.
675 (Dwo_file::read_executable): Adjust initializations of class data.
676 (Dwo_file::read): Add support for v2 package file format.
677 (Dwo_file::read_unit_index): Likewise.
678 (Dwo_file::sized_read_unit_index): Likewise.
679 (Dwo_file::copy_section): Likewise.
680 (Dwo_file::add_unit_set): Likewise.
681 (Dwp_output_file::add_output_section): Likewise.
682 (Dwp_output_file::add_contribution): Likewise.
683 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
684 for empty slot.
685 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
686 file format.
687 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
688 slot.
689 (Dwp_output_file::initialize): Remove unused function.
690 (Dwp_output_file::finalize): Add support for v2 package file format.
691 (Dwp_output_file::write_index): Likewise.
692 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
693 function prototype.
694
695 2013-07-31 Cary Coutant <ccoutant@google.com>
696
697 * object.cc (Sized_relobj::do_output_section_address): New function.
698 (Sized_relobj): Instantiate explicitly.
699 * object.h (Object::output_section_address): New function.
700 (Object::do_output_section_address): New function.
701 (Sized_relobj::do_output_section_address): New function.
702 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
703
704 2013-07-30 Cary Coutant <ccoutant@google.com>
705 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
706
707 * parameters.cc (Parameters::entry): Return target-specific entry
708 symbol name.
709 * target.h (Target::entry_symbol_name): New function.
710 (Target_info::entry_symbol_name): New data member.
711
712 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
713 * i386.cc (Target_i386::i386_info): Likewise.
714 (Target_i386_nacl::i386_nacl_info): Likewise.
715 * sparc.cc (Target_sparc::sparc_info): Likewise.
716 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
717 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
718 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
719 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
720
721 2013-07-22 Sterling Augustine <saugustine@google.com>
722
723 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
724 Convert parameter shndx to local variable. Add parameters symtab
725 and symtab_size. Scan over section names. Find relocation
726 section corresponding to current section. Create and initialize
727 reloc_mapper_ and reloc_type_.
728 (Dwarf_pubnames_table::read_header): Add assertion. Change
729 unit_length to off_t. Initialize member unit_length_. Fill in field
730 cu_offset_.
731 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
732 Initialize new fields unit_length_ and cu_offset_.
733 (Dwarf_pubnames_table::read_section): Update prototype.
734 (Dwarf_pubnames_table::cu_offset): New member function.
735 (Dwarf_pubnames_table::subsection_size): Likewise.
736 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
737 New fields.
738 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
739 member functions public.
740 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
741 Update comment. Rework logic. Move repeated parts to...
742 (Gdb_index_info_reader::read_pubtable): ...here. New function.
743 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
744 pubtypes_table_, and stmt_list_offset.
745 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
746 Gdb_index::find_pubtype_offset,
747 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
748 (Gdb_index::pubnames_read): Update prototype and rework logic.
749 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
750 Forward declare.
751 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
752 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
753 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
754 Gdb_index::map_pubtable_to_dies):
755 Declare functions.
756 (Gdb_index::pubnames_read): Update declaration.
757 (Gdb_index::Pubname_offset_map): New type.
758 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
759 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
760 Gdb_index::stmt_list_offset): Declare.
761 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
762 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
763 Gdb_index::pubtypes_offset_): Remove.
764
765 2013-07-19 Roland McGrath <mcgrathr@google.com>
766
767 * options.h (General_options): Add -Trodata-segment option.
768 * parameters.cc (Parameters::check_rodata_segment): New function.
769 (Parameters::set_target_once): Call it.
770 * parameters.h (Parameters): Declare it (private member function).
771 * layout.cc (load_seg_unusable_for_headers): New function, broken
772 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
773 then validate rodata segment rather than text segment.
774 (relaxation_loop_body): Call that.
775 (is_text_segment): New function. Don't admit a non-executable
776 segment if TARGET->isolate_execinstr().
777 (set_segment_offsets): Call it. Honor -Trodata-segment option.
778
779 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
780
781 PR gold/15070
782 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
783 * nacl.h (Sniff_file::View::View): Request aligned view.
784
785 2013-07-11 Cary Coutant <ccoutant@google.com>
786
787 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
788 correct BRLT entry size.
789
790 2013-07-03 Alan Modra <amodra@gmail.com>
791
792 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
793 comment.
794
795 2013-07-01 Cary Coutant <ccoutant@google.com>
796
797 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
798 reloc_type_.
799 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
800 (Dwarf_ranges_table::lookup_reloc): New function.
801 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
802 reloc_type_.
803 (Dwarf_ranges_table::lookup_reloc): New function.
804 (Dwarf_ranges_table::reloc_type_): New data member.
805
806 2013-06-27 Jing Yu <jingyu@google.com>
807
808 PR gold/15662
809 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
810 function.
811 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
812 (Target_powerpc::do_relax): Call the above.
813
814 2013-06-27 Cary Coutant <ccoutant@google.com>
815
816 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
817 on garbage collected .opd section.
818
819 2013-06-27 Alan Modra <amodra@gmail.com>
820
821 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
822 is non-zero.
823 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
824 (Target_powerpc::do_function_location): Likewise for loc->shndx.
825
826 2013-06-14 Cary Coutant <ccoutant@google.com>
827
828 * resolve.cc (Symbol::override_base): Don't override st_type
829 from plugin placeholder symbols.
830 (Symbol_table::resolve): Likewise.
831 (Symbol_table::should_override): Don't complain about TLS mismatch
832 if the TO symbol is a plugin placeholder.
833 * testsuite/Makefile.am (plugin_test_tls): New test.
834 * testsuite/Makefile.in: Regenerate.
835 * testsuite/plugin_test_tls.sh: New test script.
836 * testsuite/two_file_test_2_tls.cc: New test source.
837 * testsuite/two_file_test_tls.cc: New test source.
838
839 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
840
841 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
842 the maximum segment alignment is larger than the page size.
843 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
844 correctly aligns the symbols with large alignemnt.
845 * testsuite/Makefile.in: Regenerate.
846 * testsuite/large_symbol_alignment.cc: New file.
847
848 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
849 Sriraman Tallam <tmsriram@google.com>
850
851 * options.h (sort_section): New option.
852 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
853 Rename from Input_section_sort_section_name_special_ordering_compare.
854 (Input_section_sort_section_name_compare): New struct.
855 * output.cc (Output_section::Input_section_sort_section_name_compare::
856 operator()): New function.
857 (Output_section::sort_attached_input_sections): Use new sort function
858 for .text if --sort-section=name is specified.
859 * layout.cc (Layout::make_output_section):
860 Add sorting by name when --sort-section=name is specified.
861 * testsuite/Makefile.am (text_section_grouping): Test option
862 --sort-section=name.
863 * testsuite/Makefile.in: Regenerate.
864 * testsuite/section_sorting_name.cc: New file.
865 * testsuite/section_sorting_name.sh: New file.
866
867 2013-05-21 Cary Coutant <ccoutant@google.com>
868
869 * symtab.h (Symbol::is_cxx_vtable): New function.
870 * target-reloc.h (relocate_section): Check for vtable symbol.
871 * testsuite/Makefile.am (missing_key_func.sh): New test case.
872 * testsuite/Makefile.in: Regenerate.
873 * testsuite/missing_key_func.cc: New test source.
874 * testsuite/missing_key_func.sh: New test script.
875
876 2013-05-21 Cary Coutant <ccoutant@google.com>
877
878 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
879 type of enclosing symbol.
880 (Relocate_info::location): Check symbol type when describing symbol.
881 * object.h (Symbol_location_info): Remove unused line_number;
882 add enclosing_symbol_type.
883 * testsuite/debug_msg.sh: Adjust expected output.
884
885 2013-05-13 Cary Coutant <ccoutant@google.com>
886
887 * configure.ac: Export DEFAULT_TARGET.
888 * configure: Regenerate.
889 * Makefile.in: Regenerate.
890 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
891 * testsuite/Makefile.in: Regenerate.
892 * testsuite/debug_msg.sh: Delete duplicate tests.
893 Don't check undef_int error message match for powerpc where the
894 source file and line number aren't available.
895
896 2013-05-10 Roland McGrath <mcgrathr@google.com>
897
898 * options.h (General_options): Add --rosegment-gap option.
899 * options.cc (finalize): --rosegment-gap implies --rosegment.
900 * layout.cc (set_segment_offsets): Let user option override
901 target->rosegment_gap().
902
903 2013-05-10 Roland McGrath <mcgrathr@google.com>
904
905 * options.h (General_options): Remove leading space from help
906 messages for -nostdlib and --rosegment.
907
908 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
909
910 PR ld/15365
911 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
912
913 2013-05-03 Alan Modra <amodra@gmail.com>
914
915 * merge.cc (Output_merge_string::do_add_input_section): Correct
916 scan for number of strings. Rename vars to avoid shadowing.
917 Include missing terminator in input_size_.
918
919 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
920
921 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
922 Restore empty string handling.
923
924 2013-05-01 Cary Coutant <ccoutant@google.com>
925
926 * stringpool.cc (Stringpool_template::new_key_offset): Fix
927 uninitialized warning.
928
929 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
930
931 * output.cc (Output_section::add_merge_input_section): Allow
932 to merge sections if the alignment is more than character size.
933 * merge.h (Output_merge_string::Output_merge_string): Remove
934 assert.
935 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
936 only not-null strings. Check the alignment of strings.
937 * stringpool.h
938 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
939 alignment as the argument.
940 (Stringpool_template<Stringpool_char>::addralign_): New class member.
941 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
942 Align non-zero length strings according to the addralign_.
943 (Stringpool_template<Stringpool_char>::set_string_offsets):
944 Updating offsets according to the given alignment.
945 * testsuite/Makefile.am (text_section_grouping): Test if string
946 literals are getting merged.
947 * testsuite/Makefile.in: Regenerate.
948 * testsuite/merge_string_literals_1.c: New file.
949 * testsuite/merge_string_literals_2.c: Ditto.
950 * testsuite/merge_string_literals.sh: Ditto.
951
952 2013-04-26 Ian Lance Taylor <iant@google.com>
953
954 * target-reloc.h (relocate_section): If the reloc offset is out of
955 range, pass VIEW as NULL to relocate.relocate.
956 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
957 * i386.cc (Target_i386::Relocate::relocate): Likewise.
958 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
959 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
960 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
961 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
962
963 2013-04-26 Geoff Pike <gpike@chromium.org>
964
965 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
966 * layout.cc (Hash_task): New class.
967 (Layout::queue_build_id_tasks): New function.
968 (Layout::write_build_id): Handle single-thread portion of build ID
969 computation. (In some cases, all of it is single-threaded.) Replace
970 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
971 functionality in fewer lines of code.
972 * layout.h (Layout::queue_build_id_tasks): New function declaration.
973 * options.h (General_options): make "--build-id" default to tree
974 rather than sha1. Add two new options related to --build-id=tree:
975 --build-id-chunk-size-for-treehash and
976 --build-id-min-file-size-for-treehash.
977 * Makefile.am: add testing of --build-id=tree and related new options
978 (these tests will be invoked by "make check").
979 * Makefile.in: Regenerate.
980
981 2013-04-25 Alan Modra <amodra@gmail.com>
982
983 * configure.tgt: Add powerpcle and powerpc64le.
984
985 2013-04-22 Alan Modra <amodra@gmail.com>
986
987 PR gold/15355
988 * layout.cc (Layout::segment_precedes): Allow more than one
989 segment with the same type and flags.
990
991 2013-04-15 Cary Coutant <ccoutant@google.com>
992
993 * layout.cc (Layout::set_relocatable_section_offsets): Don't
994 allocate space in file for BSS sections.
995
996 2013-04-15 Cary Coutant <ccoutant@google.com>
997
998 * script-sections.cc (Orphan_output_section): Reset address
999 to zero after each orphaned section for relocatable links.
1000
1001 2013-04-15 Cary Coutant <ccoutant@google.com>
1002
1003 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1004 section starting address for relocatable link.
1005 * testsuite/Makefile.am (script_test_11): New test.
1006 * testsuite/Makefile.in: Regenerate.
1007 * testsuite/script_test_11.c: New source file.
1008 * testsuite/script_test_11.t: New linker script.
1009
1010 2013-04-13 Alan Modra <amodra@gmail.com>
1011
1012 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1013 owner when sections are not adjacent and exceed group size.
1014 (Target_powerpc::group_sections): Handle corner case.
1015 (Target_powerpc::Branch_info::make_stub): Handle case where
1016 stub table doesn't exist due to branches in non-exec sections.
1017 (Target_powerpc::Relocate::relocate): Likewise.
1018
1019 2013-04-11 Alan Modra <amodra@gmail.com>
1020
1021 PR gold/15354
1022 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1023 .branch_lt to match bfd ld. Adjust comments throughout file.
1024
1025 2013-04-04 Ian Lance Taylor <iant@google.com>
1026
1027 GCC PR c++/56840
1028 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1029 sections before checking whether they are included in the link.
1030
1031 2013-03-29 Sriraman Tallam <tmsriram@google.com>
1032
1033 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1034 object before calling the plugin claim_file handler. Pass the elf
1035 object of the archive to the plugin. Delete the elf object if the
1036 plugin claims the file.
1037
1038 2013-03-21 Alan Modra <amodra@gmail.com>
1039
1040 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1041 segment when omagic.
1042
1043 2013-03-21 Alan Modra <amodra@gmail.com>
1044
1045 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1046 comparison warning.
1047 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1048 uninitialized" warning.
1049
1050 2013-03-20 Alan Modra <amodra@gmail.com>
1051
1052 * symtab.h (Symbol::clear_version): New function.
1053 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1054 is_needed by weak references. Clear version for symbols defined
1055 in as-needed objects that are not needed.
1056
1057 2013-03-15 Alan Modra <amodra@gmail.com>
1058
1059 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1060 static and public. Add report_err param. Return false for data refs.
1061 (Target_powerpc::rela_dyn_section): New overloaded function.
1062 (Target_powerpc::plt_, iplt_): Elucidate.
1063 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1064 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1065 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1066 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1067 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1068 push_branch and make_plt_entry for ifunc syms when
1069 reloc_needs_plt_for_ifunc.
1070 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1071 for ifunc unless reloc_needs_plt_for_ifunc.
1072
1073 2013-03-15 Alan Modra <amodra@gmail.com>
1074
1075 * gc.h (gc_process_relocs): Don't look through function descriptors.
1076 * icf.cc (get_section_contents): Do so here instead.
1077
1078 2013-03-13 Alan Modra <amodra@gmail.com>
1079
1080 * powerpc.cc (is_branch_reloc): Forward declare.
1081 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1082 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1083 false for 64-bit, true for 32-bit non-branch relocs.
1084 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1085 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1086 nm output.
1087 (icf_safe_test): Generate linker map file as well as nm output.
1088 (icf_safe_so_test): Likewise.
1089 * testsuite/Makefile.in: Regenerate.
1090 * testsuite/icf_test.sh: Parse linker map file to determine
1091 section folding.
1092 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1093 * testsuite/icf_safe_so_test.sh: Likewise.
1094 (X86_32_or_ARM_specific_safe_fold): Merge into..
1095 (arch_specific_safe_fold): ..this.
1096 (X86_64_specific_safe_fold): Delete unused function.
1097
1098 2013-03-12 Alan Modra <amodra@gmail.com>
1099
1100 * gc.h (gc_process_relocs): Look through function descriptors
1101 to determine shndx, symvalue and addend used by ICF. Tidy
1102 variable duplication.
1103
1104 2013-03-11 Alan Modra <amodra@gmail.com>
1105
1106 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1107 * layout.cc (Layout_task_runner::run): ..to here.
1108 * symtab.h (struct Symbol_location): Extract from..
1109 (class Symbol_table): ..here.
1110 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1111 * target.h (class Target): Add function_location and
1112 do_function_location functions.
1113 (class Sized_target): Add do_function_location.
1114 * object.h (class Sized_relobj_file): Move find_shdr..
1115 (class Object): ..to here.
1116 * object.cc: Likewise. Update to suit. Instantiate.
1117 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1118 * powerpc.cc (class Powerpc_dynobj): New.
1119 (Target_powerpc::do_function_location): New function.
1120 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1121 (Powerpc_dynobj::do_read_symbols): New function.
1122 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1123
1124 2013-03-08 Ian Lance Taylor <iant@google.com>
1125
1126 * options.cc (General_options::string_to_object_format): Accept
1127 "default".
1128
1129 2013-03-08 Alan Modra <amodra@gmail.com>
1130
1131 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1132 pointer to Post_fde.
1133 (struct Post_fde): Move definition to here..
1134 * ehframe.cc (struct Post_fde): ..from here.
1135 (Cie::write): Don't alloc Post_fde.
1136 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1137
1138 2013-03-07 Alan Modra <amodra@gmail.com>
1139
1140 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1141 relocation referencing .LC0.
1142 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1143
1144 2013-03-07 Alan Modra <amodra@gmail.com>
1145
1146 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1147 always_inline. Add assembly for powerpc to avoid GOT.
1148
1149 2013-03-07 Alan Modra <amodra@gmail.com>
1150
1151 * testsuite/script_test_10.sh: Don't test .bss section
1152 header number.
1153
1154 2013-03-06 Alan Modra <amodra@gmail.com>
1155
1156 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1157 (Target_powerpc::symval_for_branch): Add symtab param. Update
1158 all callers. Handle folded sections.
1159 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1160 to Powerpc_relobj.
1161 (Global_symbol_visitor_opd::operator()): Likewise.
1162
1163 2013-03-04 Alan Modra <amodra@gmail.com>
1164
1165 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1166 * testsuite/Makefile.in: Regenerate.
1167
1168 2013-03-01 Cary Coutant <ccoutant@google.com>
1169
1170 Add dwp support for v2 DWARF package file format.
1171 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1172 tu_length parameter. Adjust all callers.
1173 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1174 * dwp.cc: Include dwarf.h.
1175 (Section_bounds): New struct type.
1176 (Unit_set): New struct type.
1177 (Dwo_file::Dwo_file): Initialize new data member.
1178 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1179 Combine and rename to...
1180 (Dwo_file::read_unit_index): ...this.
1181 (Dwo_file::sized_read_compunit_index)
1182 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1183 (Dwo_file::sized_read_unit_index): ...this.
1184 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1185 parameters; add section_id parameter.
1186 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1187 (Dwo_file::add_unit_set): ...this.
1188 (Dwo_file::shndx_map_): Remove.
1189 (Dwo_file::sect_offsets_): New data member.
1190 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1191 (Dwp_output_file::add_section): Rename to...
1192 (Dwp_output_file::add_contribution): ...this.
1193 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1194 (Dwp_output_file::add_tu_set): Likewise.
1195 (Dwp_output_file::Contribution): New type.
1196 (Dwp_output_file::Section::contributions): New data member.
1197 (Dwp_output_file::Cu_or_tu_set): Remove.
1198 (Dwp_output_file::Section::Section): New ctor.
1199 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1200 (Dwp_output_file::Dwp_index::Section_table): New type.
1201 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1202 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1203 parameter.
1204 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1205 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1206 (Dwp_output_file::Dwp_index::section_table): New member function.
1207 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1208 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1209 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1210 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1211 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1212 (Dwp_output_file::Dwp_index::section_table_): New data member.
1213 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1214 (Dwp_output_file::add_output_section): New member function.
1215 (Dwp_output_file::write_new_section): New member function.
1216 (Dwp_output_file::write_contributions): New member function.
1217 (Dwp_output_file::section_id_map_): New data member.
1218 (class Dwo_id_info_reader): Remove.
1219 (class Unit_reader): New class.
1220 (get_dwarf_section_name): New function.
1221 (Dwo_file::read_executable): Adjust initializations of class data.
1222 (Dwo_file::read): Add support for v2 package file format.
1223 (Dwo_file::read_unit_index): Likewise.
1224 (Dwo_file::sized_read_unit_index): Likewise.
1225 (Dwo_file::copy_section): Likewise.
1226 (Dwo_file::add_unit_set): Likewise.
1227 (Dwp_output_file::add_output_section): Likewise.
1228 (Dwp_output_file::add_contribution): Likewise.
1229 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1230 for empty slot.
1231 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1232 file format.
1233 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1234 slot.
1235 (Dwp_output_file::initialize): Remove unused function.
1236 (Dwp_output_file::finalize): Add support for v2 package file format.
1237 (Dwp_output_file::write_index): Likewise.
1238 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1239 function prototype.
1240
1241 2013-03-01 Cary Coutant <ccoutant@google.com>
1242
1243 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1244 function into class definition in header file.
1245 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1246 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1247 New function.
1248 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1249
1250 2013-02-28 Alan Modra <amodra@gmail.com>
1251
1252 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1253 * target.cc (Target::do_plt_fde_location): New function.
1254 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1255 accessor function, and constructor param.
1256 (struct Post_fde, Post_fdes): Declare.
1257 (Cie::write): Add post_fdes param.
1258 * ehframe.cc (Fde::write): Use plt_fde_location.
1259 (struct Post_fde): Define.
1260 (Cie::write): Stash FDEs added post merge mapping.
1261 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1262 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1263 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1264 other FDEs.
1265 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1266 (Target_powerpc::has_glink): New function.
1267 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1268 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1269 glink_eh_frame_fde_32, default_fde): New data.
1270 (Stub_table::eh_frame_added_): New var.
1271 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1272 Make const.
1273 (Stub_table::add_eh_frame): New function.
1274 (Output_data_glink::add_eh_frame): New function.
1275 (Target_powerpc::make_glink_section): Call add_eh_frame.
1276
1277 2013-02-15 Ian Lance Taylor <iant@google.com>
1278
1279 * options.h (DEFINE_uint64_alias): Define.
1280 (class General_options): Add -Ttext-segment as an alias for
1281 -Ttext.
1282
1283 2013-02-15 Alan Modra <amodra@gmail.com>
1284
1285 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1286 (Stub_table::do_write): ..here, two places.
1287 (Stub_table::plt_call_size): Use it here too.
1288
1289 2013-02-11 Ian Lance Taylor <iant@google.com>
1290
1291 * descriptors.cc (Descriptors::close_all): New function.
1292 * descriptors.h (class Descriptors): Declare close_all.
1293 (close_all_descriptors): New inline function.
1294 * plugin.cc: Include "descriptors.h".
1295 (Plugin_manager::cleanup): Call close_all_descriptors.
1296
1297 2013-02-06 Alan Modra <amodra@gmail.com>
1298
1299 * README: Update coding style link.
1300
1301 2013-01-28 Cary Coutant <ccoutant@google.com>
1302
1303 * dwp.cc (File_list): New typedef.
1304 (Dwo_name_info_reader): New class.
1305 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1306 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1307 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1308 (Dwo_file::read_executable): New function.
1309 (Dwo_file::read): Move common setup code to ...
1310 (Dwo_file::make_object): ... here.
1311 (dwp_options): Add --exec/-e.
1312 (usage): Likewise.
1313 (main): Likewise.
1314
1315 2013-01-24 Sriraman Tallam <tmsriram@google.com>
1316
1317 * layout.cc (Layout::layout): Check for option text_reorder.
1318 (Layout::make_output_section): Ditto.
1319 * options.h (text_reorder): New option.
1320 * output.cc (Input_section_sort_compare): Remove special ordering
1321 of section names.
1322 (Output_section::
1323 Input_section_sort_section_name_special_ordering_compare::
1324 operator()): New function.
1325 (Output_section::sort_attached_input_sections): Use new sort function
1326 for .text.
1327 * output.h (Input_section_sort_section_name_special_ordering_compare):
1328 New struct.
1329 * testsuite/Makefile.am (text_section_grouping): Test option
1330 --no-text-reorder
1331 * testsuite/Makefile.in: Regenerate.
1332 * testsuite/text_section_grouping.sh: Check order of functions without
1333 default text reordering.
1334
1335 2013-01-18 Mike Frysinger <vapier@gentoo.org>
1336
1337 * options.h (General_options): Change default to true for new_dtags.
1338
1339 2013-01-18 Mike Frysinger <vapier@gentoo.org>
1340
1341 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1342 when enable_new_dtags is false. Only add DT_RUNPATH when
1343 enable_new_dtags is true.
1344
1345 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1346
1347 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1348 used in declaration and definition consistent.
1349 (Target_powerpc::symval_for_branch): Ditto.
1350
1351 2013-01-16 Sriraman Tallam <tmsriram@google.com>
1352
1353 * testsuite/plugin_final_layout.cc: Fix comment.
1354
1355 2013-01-16 Sriraman Tallam <tmsriram@google.com>
1356
1357 * layout.cc (Layout::layout): Do not do default sorting for
1358 text sections when section ordering is specified.
1359 (make_output_section): Ditto.
1360 * testsuite/plugin_final_layout.cc: Name the function sections
1361 to catch reordering issues.
1362
1363 2013-01-15 Alan Modra <amodra@gmail.com>
1364
1365 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1366 plt-thread-safe.
1367
1368 2013-01-15 Alan Modra <amodra@gmail.com>
1369
1370 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1371 * testsuite/Makefile.in: Regenerate.
1372
1373 2013-01-14 Alan Modra <amodra@gmail.com>
1374
1375 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1376 * testsuite/Makefile.in: Regenerate.
1377
1378 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1379
1380 PR bfd/14430
1381 Fix mingw gold build with plugins enabled
1382 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1383 * configure.ac: Export DLOPEN_LIBS and add headers check.
1384 * plugin.cc: Handle non-dlfcn case.
1385 * Makefile.in: Regenerate.
1386 * config.in: Regenerate.
1387 * configure: Regenerate.
1388 * testsuite/Makefile.in: Regenerate.
1389
1390 2013-01-09 Sriraman Tallam <tmsriram@google.com>
1391
1392 * output.h (sort_attached_input_sections): Change to be public.
1393 * script-sections.cc
1394 (Output_section_definition::set_section_addresses): Sort
1395 attached input sections according to section order before linker
1396 script assigns section addresses.
1397 (Orphan_output_section::set_section_addresses): Sort
1398 attached input sections according to section order before linker
1399 script assigns section addresses.
1400 * Makefile.am (final_layout.sh): Use a simple linker script to
1401 check if section ordering still works.
1402 * Makefile.in: Regenerate.
1403
1404 2013-01-09 Ben Cheng <bccheng@google.com>
1405
1406 * arm.cc (Target_arm::attributes_accept_div): New function.
1407 (Target_arm::attributes_forbid_div): New function.
1408 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1409 attribute using the same new functions as what bfd/elf32_arm.c
1410 does.
1411
1412 2013-01-07 Cary Coutant <ccoutant@google.com>
1413
1414 PR gold/14993
1415 * output.cc (Output_section::add_input_section): For incremental
1416 updates, don't track input sections that are allocated from patch
1417 space.
1418
1419 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1420 Ian Lance Taylor <iant@google.com>
1421
1422 PR gold/14897
1423 * configure.ac (--enable-ld): Removed.
1424 (install_as_default): Set to yes only for --enable-gold=default
1425 or --disable-ld.
1426 * configure: Regenerated.
1427
1428 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1429
1430 * options.h (General_options): Add -fuse-ld= for GCC linker
1431 option compatibility.
1432
1433 2013-01-04 Cary Coutant <ccoutant@google.com>
1434
1435 * configure.ac: Fix typo restoring CXXFLAGS.
1436 * configure: Regenerate.
1437
1438 2013-01-04 Cary Coutant <ccoutant@google.com>
1439
1440 * testsuite/Makefile.am (CXXLINK_S): New macro.
1441 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1442 * testsuite/Makefile.in: Regenerate.
1443
1444 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1445
1446 * version.cc (print_version): Update copyright year to 2013.
1447
1448 2012-12-20 Ian Lance Taylor <iant@google.com>
1449
1450 * layout.cc (Layout::special_ordering_of_input_section): New
1451 function.
1452 (Layout::layout): If input section requires special ordering, must
1453 sort input sections.
1454 (Layout::make_output_section): May sort .text input sections.
1455 (Layout::is_section_name_prefix_grouped): Remove.
1456 * layout.h (class Layout): Declare
1457 special_ordering_of_input_section. Don't declare
1458 is_section_name_prefix_grouped.
1459 * output.cc (Output_section::add_input_section): Revert last
1460 change.
1461 (Output_section::Input_section_sort::match_file_name): Don't crash
1462 if called on output section data.
1463 (Output_section::Input_section_sort_compare): Sort based on
1464 special ordering.
1465 (Output_section::Input_section_sort_section_order_index_compare):
1466 Revert last patch.
1467 (Output_section::sort_attached_input_sections): Likewise.
1468
1469 2012-12-18 Sriraman Tallam <tmsriram@google.com>
1470
1471 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
1472 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1473 * output.cc (Output_section::add_input_section): Check if section
1474 name contains special prefix. Keep input sections to sort such
1475 sections.
1476 (Output_section::Input_section_sort_section_order_index_compare
1477 ::operator()): Group sections according to prefixes.
1478 (Output_section::sort_attached_input_sections): Add condition to
1479 Input_section_entry constructor call.
1480 * testsuite/Makefile.am (text_section_grouping): New test.
1481 * testsuite/Makefile.in: Regenerate.
1482 * testsuite/text_section_grouping.cc: New file.
1483 * testsuite/text_section_grouping.sh: New file.
1484
1485 2012-12-17 Nick Clifton <nickc@redhat.com>
1486
1487 * Makefile.am: Add copyright notice.
1488 * NEWS: Likewise.
1489 * README: Likewise.
1490 * configure.ac: Likewise.
1491 * ftruncate.c: Likewise.
1492 * Makefile.in: Regenerate.
1493
1494 2012-12-14 Cary Coutant <ccoutant@google.com>
1495
1496 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1497 --no-as-needed flag.
1498 (exception_separate_shared_12_test): Likewise.
1499 (incremental_copy_test): Likewise.
1500 * testsuite/Makefile.in: Regenerate.
1501
1502 2012-12-14 Cary Coutant <ccoutant@google.com>
1503
1504 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1505 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1506
1507 2012-12-12 Alan Modra <amodra@gmail.com>
1508
1509 * powerpc.cc (class Track_tls): New.
1510 (class Relocate, class Scan): Inherit Track_tls.
1511 (Target_powerpc::Scan::local, global): Track tls optimization
1512 and avoid creating plt entry for __tls_get_addr if all uses
1513 are optimized away.
1514 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1515
1516 2012-12-12 Alan Modra <amodra@gmail.com>
1517
1518 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1519 Replace no_toc_optimize with toc_optimize.
1520 * output.h (Output_section::input_sections): Provide non-const variant.
1521 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1522 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1523 accessors.
1524 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1525 (class Sort_toc_sections): New.
1526 (Target_powerpc::do_finalize_sections): Sort toc sections.
1527 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1528
1529 2012-12-10 Roland McGrath <mcgrathr@google.com>
1530
1531 * testsuite/binary_unittest.cc (read_all): New function.
1532 (Sized_binary_test): Use it instead of ::read.
1533 * fileread.cc (do_read): Don't assume pread always reads the whole
1534 amount in a single call.
1535
1536 2012-12-10 Alan Modra <amodra@gmail.com>
1537
1538 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1539 Set EM_PPC64 or EM_PPC here.
1540 (Target_selector_powerpc::do_recognize): Delete.
1541
1542 2012-12-10 Alan Modra <amodra@gmail.com>
1543
1544 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1545 stub_table_.
1546 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1547
1548 2012-12-07 Roland McGrath <mcgrathr@google.com>
1549
1550 * testsuite/binary_unittest.cc (Sized_binary_test):
1551 Use open_descriptor rather than ::open.
1552
1553 2012-12-07 Alan Modra <amodra@gmail.com>
1554
1555 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1556 typedef and invalid_address constant.
1557 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1558 instantiate constants.
1559
1560 2012-12-06 Roland McGrath <mcgrathr@google.com>
1561
1562 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1563 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1564 * aclocal.m4: Regenerate.
1565 * configure: Regenerate.
1566 * Makefile.in: Regenerate.
1567 * testsuite/Makefile.in: Regenerate.
1568
1569 2012-12-07 Alan Modra <amodra@gmail.com>
1570
1571 * options.h (General_options): Add no_toc_optimize.
1572 * powerpc.cc (ok_lo_toc_insn): New function.
1573 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1574
1575 2012-12-06 Alan Modra <amodra@gmail.com>
1576
1577 * options.h (General_options): Add plt_align, plt_static_chain,
1578 plt_thread_safe. Update stub_group_size help text.
1579 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1580 for new plt_thread_safe_ var.
1581 (use_plt_offset): Correct comments.
1582 (Target_powerpc::do_relax): Look for thread creation symbols to
1583 determine default plt_thread_safe value. Clear plt call stubs
1584 as well as branch stubs each iteration.
1585 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
1586 insn constants.
1587 (l, hi, ha, write_insn): Move earlier.
1588 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
1589 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
1590 plt stubs too.
1591 (Stub_table::update_size): Adjust.
1592 (Stub_table::prev_size, set_prev_size): Delete.
1593 (Stub_table::stub_align): Let --plt-align affect result.
1594 (Stub_table::plt_call_size): Calculate sizes for various stubs.
1595 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
1596 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
1597 (Stub_table::do_write): Support more stub variants.
1598
1599 2012-12-04 Alan Modra <amodra@gmail.com>
1600
1601 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
1602 (Target_powerpc::do_define_standard_symbols): New function.
1603
1604 2012-12-03 Alan Modra <amodra@gmail.com>
1605
1606 * output.h: Formatting, whitespace.
1607
1608 2012-12-03 Alan Modra <amodra@gmail.com>
1609
1610 * layout.h (Layout::get_executable_sections): Declare.
1611 * layout.cc (Layout::get_executable_sections): New function.
1612 * arm.cc (Target_arm::group_sections): Use it.
1613 (Arm_output_section::group_sections): Delete now redundant test.
1614 * output.cc (Output_reloc::Output_reloc): Add is_relative.
1615 param to handle relative relocs.
1616 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
1617 (Output_data_reloc::add_absolute): Adjust.
1618 (Output_data_reloc::add_relative): New function.
1619 (Output_data::reset_data_size): New function.
1620 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
1621 (Output_section::set_addralign): New function.
1622 (Output_section::checkpoint_set_addralign): New function.
1623 (Output_section::clear_section_offsets_need_adjustment): New function.
1624 (Output_section::input_sections): Make public.
1625 * powerpc.cc (class Output_data_brlt_powerpc): New.
1626 (class Stub_table, class Stub_control): New.
1627 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
1628 stub_table_, set_stub_table, stub_table): New vectors and accessor
1629 functions.
1630 (Target_powerpc::do_may_relax, do_relax, push_branch,
1631 new_stub_table, stub_tables, brlt_section, group_sections,
1632 add_branch_lookup_table, find_branch_lookup_table,
1633 write_branch_lookup_table, make_brlt_section): New functions.
1634 (Target_powerpc::struct Sort_sections, class Branch_info): New.
1635 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
1636 branch_info_): New vars.
1637 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
1638 make call stubs here.
1639 (Output_data_glink): Remove all call stub handling from this class.
1640 (Target_powerpc::Scan::local, global): Save interesting branch
1641 relocs and relocs for ifunc. Adjust calls to plt entry functions.
1642 (Target_powerpc::do_finalize_sections): Only make reg save/restore
1643 functions on final link.
1644 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
1645 Handle long branch destinations too.
1646 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
1647 do_plt_address_for_local): Adjust lookup of plt call stubs.
1648
1649 2012-11-30 Alan Modra <amodra@gmail.com>
1650
1651 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
1652 relocs against protected symbols when building 32-bit shared libs.
1653
1654 2012-11-30 Alan Modra <amodra@gmail.com>
1655
1656 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
1657 param. Call got_section() to make .got. Update all callers
1658 and their callers and so on.
1659
1660 2012-11-30 Alan Modra <amodra@gmail.com>
1661
1662 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
1663 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
1664 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
1665 value if it already exists.
1666
1667 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
1668
1669 PR gold/14858
1670 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
1671
1672 2012-11-14 Roland McGrath <mcgrathr@google.com>
1673
1674 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
1675 than bfc instruction for data sandboxing.
1676
1677 2012-11-08 Alan Modra <amodra@gmail.com>
1678
1679 * po/POTFILES.in: Regenerate.
1680
1681 2012-11-05 Alan Modra <amodra@gmail.com>
1682
1683 * configure.ac: Apply 2012-09-10 change to config.in here.
1684 * configure: Regenerate.
1685
1686 2012-11-05 Alan Modra <amodra@gmail.com>
1687
1688 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
1689 (struct Opd_ent): Use "Address" rather than "Offset".
1690 (Output_data_got_powerpc::got_base_offset): Return Valtype.
1691 (Target_powerpc::got_section): Make public.
1692 (Target_powerpc::scan_relocs): Move code setting symbols..
1693 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
1694 Create _SDA_BASE_ only when referenced.
1695
1696 2012-11-02 Roland McGrath <mcgrathr@google.com>
1697
1698 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
1699 from last change.
1700
1701 2012-11-01 Roland McGrath <mcgrathr@google.com>
1702
1703 * target.h (Sized_target::relocate_relocs): Use Elf_Off
1704 for offset_in_output_section parameter.
1705 (Sized_target::relocate_special_relocatable): Likewise.
1706 * arm.cc (Target_arm::relocate_relocs): Likewise.
1707 (Target_arm::relocate_special_relocatable): Likewise.
1708 * i386.cc (Target_i386::relocate_relocs): Likewise.
1709 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
1710 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
1711 * target-reloc.h (relocate_relocs): Likewise.
1712 * testsuite/testfile.cc (Target_test): Likewise.
1713 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
1714 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
1715
1716 * system.h: Move inclusion of <clocale> to after <libintl.h> in
1717 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
1718
1719 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
1720 parameter, which is unused in the [!F_SETFD] case.
1721
1722 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
1723 SYMNDX to off_t before comparing it to this->data_size().
1724 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
1725 * incremental.cc (Output_section_incremental_inputs::do_write):
1726 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
1727
1728 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
1729
1730 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
1731
1732 * gold.cc (Target_arm::do_adjust_elf_header): Add the
1733 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
1734 in EABI_VER5.
1735
1736 2012-10-29 Cary Coutant <ccoutant@google.com>
1737
1738 * dwp.cc (usage): Add file and exit status parameters;
1739 add --help and --version options.
1740 (print_version): New function.
1741 (main): Add --help and --version options.
1742
1743 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1744
1745 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
1746 final_layout_sequence.txt.
1747 * testsuite/Makefile.in: Regenerated.
1748
1749 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1750
1751 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
1752 COMPILE generated by automake.
1753 (LINK1): Likewise.
1754 (CXXCOMPILE1): Likewise.
1755 (CXXLINK1): Likewise.
1756 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
1757 (LINK): Likewise.
1758 (CXXCOMPILE): Likewise.
1759 (CXXLINK): Likewise.
1760 * testsuite/Makefile.in: Regenerated.
1761
1762 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1763
1764 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
1765 on bad fwrite return.
1766
1767 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1768
1769 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
1770 on val.
1771
1772 2012-10-23 Cary Coutant <ccoutant@google.com>
1773
1774 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
1775 * testsuite/Makefile.in: Regenerate.
1776 * testsuite/dwp_test.h: New source file.
1777 * testsuite/dwp_test_1.cc: New source file.
1778 * testsuite/dwp_test_1.s: New source file.
1779 * testsuite/dwp_test_1.sh: New source file.
1780 * testsuite/dwp_test_1b.cc: New source file.
1781 * testsuite/dwp_test_1b.s: New source file.
1782 * testsuite/dwp_test_2.cc: New source file.
1783 * testsuite/dwp_test_2.s: New source file.
1784 * testsuite/dwp_test_2.sh: New source file.
1785 * testsuite/dwp_test_main.cc: New source file.
1786 * testsuite/dwp_test_main.s: New source file.
1787
1788 2012-10-23 Cary Coutant <ccoutant@google.com>
1789
1790 * dwp.h: New header file.
1791 * dwp.cc: New source file.
1792 * gold.h: Move shared declarations to system.h.
1793 * system.h: New header file.
1794 * Makefile.am: Add dwp.
1795 * Makefile.in: Regenerate.
1796
1797 2012-10-23 Cary Coutant <ccoutant@google.com>
1798
1799 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1800 Dwarf_info_reader::read_from_pointer.
1801 (Dwarf_pubnames_table::read_header): Likewise.
1802 (Dwarf_pubnames_table::next_name): Likewise.
1803 (Dwarf_die::read_attributes): Likewise.
1804 (Dwarf_die::skip_attributes): Likewise.
1805 (Dwarf_info_reader::read_from_pointer): New function template.
1806 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1807 (Dwarf_pubnames_table): Likewise.
1808 (Dwarf_info_reader::read_from_pointer): New function template.
1809 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1810 Dwarf_pubnames_table ctor.
1811
1812 2012-10-23 Cary Coutant <ccoutant@google.com>
1813
1814 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1815 abbrev_shndx.
1816 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1817 abbrev_shndx_.
1818 (Dwarf_info_reader::set_abbrev_shndx): New method.
1819 (Dwarf_info_reader::abbrev_shndx_): New data member.
1820
1821 2012-10-23 Cary Coutant <ccoutant@google.com>
1822
1823 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
1824 from object, not parameters.
1825 (Dwarf_info_reader::parse): Likewise.
1826 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
1827 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
1828 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
1829 methods.
1830
1831 2012-10-23 Cary Coutant <ccoutant@google.com>
1832
1833 * fileread.cc (Input_file::Input_file): New constructor.
1834 * fileread.h (class Input_file): Add new constructor.
1835
1836 2012-10-18 Alan Modra <amodra@gmail.com>
1837
1838 PR gold/14727
1839 * object.cc (Relobj::is_section_name_included): Also match
1840 .sdata personality section.
1841
1842 2012-10-18 Alan Modra <amodra@gmail.com>
1843
1844 * target-reloc.h (class Default_comdat_behavior): New, package up..
1845 (get_comdat_behaviour): ..this.
1846 (relocate_section): Add Relocate_comdat_behavior template arg,
1847 adjust code to suit.
1848 * arm.cc (Target_arm::relocate_section): Adjust to suit.
1849 (Target_arm::scan_reloc_section): Likewise.
1850 * i386.cc (Target_i386::relocate_section): Likewise.
1851 * sparc.cc (Target_sparc::relocate_section): Likewise.
1852 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
1853 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
1854 * powerpc.cc (class Relocate_comdat_behavior): New.
1855 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
1856 gold::relocate_section with new template arg.
1857
1858 2012-10-18 Alan Modra <amodra@gmail.com>
1859
1860 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
1861 dynamic relocs for GOT_TPREL got entries, without symbol if
1862 resolving locally.
1863 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
1864 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
1865 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
1866
1867 2012-10-17 Alan Modra <amodra@gmail.com>
1868
1869 PR gold/14726
1870 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
1871
1872 2012-10-16 Sriraman Tallam <tmsriram@google.com>
1873
1874 * layout.cc (Layout::include_section): Keep sections marked
1875 SHF_EXCLUDE when doing relocatable links.
1876
1877 2012-10-16 Alan Modra <amodra@gmail.com>
1878
1879 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
1880 (Target_powerpc::do_finalize_sections): Call it.
1881 (Output_data_save_res): New class and supporting functions.
1882 (Target_powerpc::symval_for_branch): Only look up .opd entry for
1883 normal symbols defined in object files.
1884
1885 2012-10-12 Alan Modra <amodra@gmail.com>
1886
1887 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
1888 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
1889 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
1890 section if scan_opd_relocs not yet called.
1891 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
1892
1893 2012-10-12 Alan Modra <amodra@gmail.com>
1894
1895 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1896 add_local_ifunc_entry): Revert last change.
1897 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
1898
1899 2012-10-05 Alan Modra <amodra@gmail.com>
1900
1901 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
1902 do_plt_address_for_global): New functions.
1903 (Output_data_got_powerpc::do_write): Don't segfault when linking
1904 statically.
1905 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1906 add_local_ifunc_entry): Return true on adding entry..
1907 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
1908 glink->add_entry call. Remove unused symtab param. Adjust calls.
1909 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
1910 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
1911 set up symbols here.
1912 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
1913 syms here. Do so even when no .iplt. Don't segfault when linking
1914 statically.
1915 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
1916 new variants without reloc param.
1917 (Glink_sym_ent::Glink_sym_ent): Likewise.
1918 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
1919 reloc when refs will resolve to plt call stub.
1920 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
1921 R_PPC_PLTREL24 to resolve locally.
1922 (Target_powerpc::Scan::global): Correct ifunc handling.
1923 (Target_powerpc::Relocate::relocate): Correct local sym glink
1924 lookup. Don't destroy "value" when we have a plt call stub,
1925 and when checking plt call validity.
1926 (Target_powerpc::do_dynsym_value): Simplify.
1927
1928 2012-10-05 Alan Modra <amodra@gmail.com>
1929
1930 * i386.cc (Output_data_plt_i386::address_for_global,
1931 address_for_local): Add plt offset to returned value. Adjust uses.
1932 * sparc.cc (Output_data_plt_sparc::address_for_global,
1933 address_for_local): Likewise.
1934 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
1935 address_for_local): Likewise.
1936 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
1937 address_for_local): Likewise.
1938 * target.h (Target::plt_address_for_global, plt_address_for_local):
1939 Update comment.
1940 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
1941 (Output_data_got::Got_entry::write): Nor here.
1942 * output.h: Comment fix.
1943
1944 2012-10-02 Jiong Wang <jiwang@tilera.com>
1945
1946 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
1947 global_offset_table_ value for larget got.
1948 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
1949
1950 2012-09-29 Alan Modra <amodra@gmail.com>
1951
1952 * powerpc.cc (Target_powerpc::iplt_): New output section.
1953 (Target_powerpc::iplt_section, make_iplt_section,
1954 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
1955 (Target_powerpc::make_plt_entry): Handle ifunc syms.
1956 Target_powerpc::plt_entry_count): Count iplt entries too.
1957 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
1958 reloc section in constructor. New params.
1959 (Target_powerpc::make_plt_section): Create reloc section here instead.
1960 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
1961 functions.
1962 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
1963 (Output_data_glink::add_entry, find_entry): New functions to
1964 deal with local syms.
1965 (Glink_sym_ent): Add support for local syms.
1966 (Output_data_glink::do_write): Handle ifunc plt entries.
1967 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1968 (Target_powerpc::Scan::local, global): Handle ifunc syms.
1969 (Target_powerpc::Relocate::relocate): Likewise.
1970 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
1971
1972 2012-09-25 Alan Modra <amodra@gmail.com>
1973
1974 * object.h (Sized_relobj_file::adjust_local_symbol,
1975 do_adjust_local_symbol): New functions.
1976 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
1977 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
1978 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
1979 and irregular opd entry spacing.
1980 (Powerpc_relobj::do_read_relocs): Add opd size checks.
1981 (Global_symbol_visitor_opd): New functor.
1982 (Target_powerpc::do_finalize_sections): Omit global symbols defined
1983 on deleted opd entries.
1984
1985 2012-09-15 Jiong Wang <jiwang@tilera.com>
1986
1987 * tilegx.cc: New file.
1988 * Makefile.am (TARGETSOURCES): Add tilegx.cc
1989 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
1990 * configure.tgt: Add entries for tilegx*.
1991 * configure.ac: Likewise.
1992 * Makefile.in: Rebuild.
1993 * configure: Likewise.
1994 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
1995 tilegx.
1996
1997 2012-09-13 Alan Modra <amodra@gmail.com>
1998
1999 * target-reloc.h (scan_relocs): Call scan.local for relocs
2000 against symbols in discarded sections. Pass is_discarded
2001 param.
2002 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2003 Add is_discarded param.
2004 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2005 is_discarded to flag opd entry as discarded. Don't emit dyn
2006 relocs on such entries.
2007 (Target_powerpc::Scan::global): Similarly detect and handle
2008 such opd entries.
2009 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2010 opd_ent_. Update all uses.
2011 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2012 (Target_powerpc::relocate_section): Zero out discarded opd
2013 entry relocs.
2014
2015 2012-09-12 Ian Lance Taylor <iant@google.com>
2016
2017 PR gold/14570
2018 * output.cc: Rename Output_data_got template parameter from size
2019 to got_size for all functions. Compile all variants of
2020 Output_data_got.
2021 (Output_data_got::Got_entry::write): Correct use of size for
2022 symbol value. Use local_is_tls rather than casting to
2023 Sized_relobj_file.
2024 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2025 (class Sized_relobj_file): Add do_local_is_tls.
2026 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2027
2028 2012-09-11 Alan Modra <amodra@gmail.com>
2029
2030 PR gold/14566
2031 * layout.cc (Layout::set_segment_offsets): When using
2032 common-page-size alignment, ensure we are on a new max-page-size
2033 page.
2034 * output.cc (Output_segment::set_section_addresses): Use
2035 abi_pagesize, not common_pagesize for relro boundary.
2036 (Output_segment::set_offset): Likewise.
2037
2038 2012-09-11 Alan Modra <amodra@gmail.com>
2039
2040 * output.h (Output_data_got::add_global_tls, add_local_tls,
2041 add_local_tls_pair): New functions.
2042 (Output_data_got::add_local_pair_with_rel): Remove second
2043 reloc param. Expand comment.
2044 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2045 use_plt_or_tls_offset_, similarly for constructor param.
2046 (Output_data_got::Got_entry::write): Add got_index param.
2047 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2048 add_local_tls_pair): New functions.
2049 (Output_data_got::Got_entry::write): Handle tls symbols
2050 with use_plt_or_tls_offset_ set specially.
2051 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2052 (Output_data_got::do_write): Replace iterator with index, pass
2053 index to entry write function.
2054 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2055 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2056 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2057 call.
2058 * i386.cc (Target_i386::Scan::local): Likewise.
2059 * sparc.cc (Target_sparc::Scan::local): Likewise.
2060 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2061 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2062 do_tls_offset_for_global): New functions.
2063 (Target_powerpc::Scan::local): Correct TLS relocations and got
2064 entry values.
2065 (Target_powerpc::Scan::global): Don't emit unnecessary
2066 dynamic relocations on TLS GOT entries.
2067
2068 2012-09-10 Matthias Klose <doko@ubuntu.com>
2069
2070 * config.in: Disable sanity check for kfreebsd.
2071
2072 2012-09-10 Sterling Augustine <saugustine@google.com>
2073
2074 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2075 (Gdb_index::pubtypes_read): New parameter.
2076 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2077 to calls.
2078 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2079 pubtypes_object_.
2080
2081 2012-09-09 Alan Modra <amodra@gmail.com>
2082
2083 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2084 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2085 * gc.h (gc_process_relocs): Call target gc_add_reference.
2086 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2087 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2088 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2089 unnecessary cast.
2090 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2091 to cater for when we don't need code offset. Update use.
2092 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2093 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2094 set_opd_valid): New functions.
2095 (Target_powerpc::do_gc_add_reference): New function.
2096 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2097 stashed refs.
2098 (Target_powerpc::do_gc_mark_symbol): New function.
2099
2100 2012-09-06 Cary Coutant <ccoutant@google.com>
2101
2102 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2103 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2104 (Dwarf_die::skip_attributes): Likewise.
2105 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2106 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2107 (main): Call it.
2108 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2109
2110 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2111
2112 * testsuite/script_test_3.t: Add .got.plt output section
2113 statement.
2114 * testsuite/script_test_4.t: Likewise.
2115
2116 2012-09-05 Alan Modra <amodra@gmail.com>
2117
2118 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2119 update all uses and lose "enum" when using type.
2120
2121 2012-09-05 Alan Modra <amodra@gmail.com>
2122
2123 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2124 * configure: Regenerate.
2125 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2126 (plugin_final_layout.stdout): Likewise.
2127 (memory_test): Set page sizes to 0x1000.
2128 * testsuite/Makefile.in: Regenerate.
2129 * testsuite/discard_locals_test.sh: Add FIXME comment.
2130 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2131 * testsuite/pr14265.t: Add .got output section statement.
2132 * testsuite/script_test_2.t: Likewise.
2133 * testsuite/script_test_3.t: Likewise.
2134 * testsuite/script_test_4.t: Likewise.
2135 * testsuite/script_test_5.t: Likewise.
2136 * testsuite/script_test_6.t: Likewise.
2137 * testsuite/script_test_7.t: Likewise.
2138 * testsuite/script_test_9.t: Likewise.
2139
2140 2012-09-05 Alan Modra <amodra@gmail.com>
2141
2142 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2143 (Powerpc_relocate_functions::Status): New typedef.
2144 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2145 (Target_powerpc::Scan::local): Handle REL64.
2146 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2147 for REL32 and REL64.
2148 (Target_powerpc::symval_for_branch): New function, extracted from..
2149 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2150 checks. Report overflow errors.
2151
2152 2012-09-05 Alan Modra <amodra@gmail.com>
2153
2154 * object.h (Sized_relobj_file::emit_relocs): Delete.
2155 (Sized_relobj_file::emit_relocs_reltype): Delete.
2156 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2157 relocate_relocs for --emit-relocs.
2158 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2159 * output.h: Update comment.
2160 (Output_segment::first_section): New function.
2161 (Output_segment::first_section_load_address): Use first_section.
2162 * output.cc (Output_segment::first_section): New function extracted..
2163 (Output_segment::first_section_load_address): ..from here. Delete.
2164 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2165 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2166 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2167 adjust call to target.h function.
2168 * i386.cc (Target_i386): Likewise.
2169 * sparc.cc (Target_sparc): Likewise.
2170 * x86_64.cc (Target_x86_64): Likewise.
2171 * powerpc.cc (Target_powerpc): Likewise.
2172 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2173 first tls section has section symbol for optimised local dynamic
2174 output relocs.
2175 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2176 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2177 optimised tls code.
2178 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2179 Rename to relocate_relocs. Update error message.
2180
2181 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2182
2183 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2184 --just-symbols.
2185
2186 2012-08-31 Alan Modra <amodra@gmail.com>
2187
2188 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2189 (Powerpc_relobj::toc_base_offset): New stub function.
2190 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2191 got_mod_index_offset to tlsld_got_offset. Update all refs.
2192 (Target_powerpc::Relocate::enum skip_tls): New.
2193 (Target_powerpc::call_tls_get_addr_): New var.
2194 (Target_powerpc::is_branch_reloc): Move to file scope.
2195 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2196 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2197 New functions.
2198 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2199 (powerpc_info): Correct common_pagesize for ppc64.
2200 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2201 (Powerpc_relocate_functions): Add overflow check enums and functions.
2202 Add non-shift version of rela, rela_ua. Delete all rel public
2203 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2204 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2205 addr16_ha3, addr14 functions.
2206 (Output_data_got_powerpc::add_constant_pair): New function.
2207 (Output_data_got_powerpc::got_base_offset): Likewise.
2208 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2209 (instruction constants): Sort, add some more.
2210 (Output_data_glink::do_write): Add and use Address typedef. Use
2211 object->toc_base_offset() stub for 64-bit.
2212 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2213 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2214 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2215 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2216 Always treat .opd relocs as against locally defined symbol.
2217 Correct condition for RELATIVE relocs.
2218 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2219 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2220 for 32-bit syms with a plt entry. Correct ppc64 toc base
2221 calculations. Handle TLS relocs, and more. Add overflow
2222 checking and adjust for Powerpc_relocate_functions changes.
2223 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2224 Reinstate --emit-relocs code with FIXME.
2225
2226 2012-08-30 Alan Modra <amodra@gmail.com>
2227
2228 * layout.cc (Layout::set_segment_offsets): Set p_align to
2229 abi_pagesize, not common_pagesize.
2230 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2231 to determine whether file header can go in segment.
2232
2233 2012-08-30 Alan Modra <amodra@gmail.com>
2234
2235 * output.h (Output_reloc::Output_reloc <output section>): Add
2236 is_relative param. Adjust calls.
2237 (Output_reloc::add_output_section_relative): New functions.
2238 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2239 is_relative.
2240 (Output_reloc::symbol_value): Handle SECTION_CODE.
2241
2242 2012-08-24 Sriraman Tallam <tmsriram@google.com>
2243
2244 * gold.cc (queue_middle_tasks): Call layout again when unique
2245 segments for sections is desired.
2246 * layout.cc (Layout::Layout): Initialize new members.
2247 (Layout::get_output_section_flags): New function.
2248 (Layout::choose_output_section): Call get_output_section_flags.
2249 (Layout::layout): Make output section for mapping to a unique segment.
2250 (Layout::insert_section_segment_map): New function.
2251 (Layout::attach_allocated_section_to_segment): Make unique segment for
2252 output sections marked so.
2253 (Layout::segment_precedes): Check for unique segments when sorting.
2254 * layout.h (Layout::Unique_segment_info): New struct.
2255 (Layout::Section_segment_map): New typedef.
2256 (Layout::insert_section_segment_map): New function.
2257 (Layout::get_output_section_flags): New function.
2258 (Layout::is_unique_segment_for_sections_specified): New function.
2259 (Layout::set_unique_segment_for_sections_specified): New function.
2260 (Layout::unique_segment_for_sections_specified_): New member.
2261 (Layout::section_segment_map_): New member.
2262 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2263 Rename is_gc_pass_one to is_pass_one.
2264 Rename is_gc_pass_two to is_pass_two.
2265 Rename is_gc_or_icf to is_two_pass.
2266 Check for which pass based on whether symbols data is present.
2267 Make it two pass when unique segments for sections is desired.
2268 * output.cc (Output_section::Output_section): Initialize new
2269 members.
2270 * output.h (Output_section::is_unique_segment): New function.
2271 (Output_section::set_is_unique_segment): New function.
2272 (Output_section::is_unique_segment_): New member.
2273 (Output_section::extra_segment_flags): New function.
2274 (Output_section::set_extra_segment_flags): New function.
2275 (Output_section::extra_segment_flags_): New member.
2276 (Output_section::segment_alignment): New function.
2277 (Output_section::set_segment_alignment): New function.
2278 (Output_section::segment_alignment_): New member.
2279 (Output_segment::Output_segment): Initialize is_unique_segment_.
2280 (Output_segment::is_unique_segment): New function.
2281 (Output_segment::set_is_unique_segment): New function.
2282 (Output_segment::is_unique_segment_): New member.
2283 * plugin.cc (allow_unique_segment_for_sections): New function.
2284 (unique_segment_for_sections): New function.
2285 (Plugin::load): Add new functions to transfer vector.
2286 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2287 * Makefile.in: Regenerate.
2288 * testsuite/plugin_final_layout.sh: Check if unique segment
2289 functionality works.
2290 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2291 are available.
2292 (allow_unique_segment_for_sections): New global.
2293 (unique_segment_for_sections): New global.
2294 (claim_file_hook): Call allow_unique_segment_for_sections.
2295 (all_symbols_read_hook): Call unique_segment_for_sections.
2296
2297 2012-08-22 Cary Coutant <ccoutant@google.com>
2298
2299 * layout.cc (Layout::include_section): Don't assert on GROUP
2300 sections with --emit-relocs.
2301
2302 2012-08-21 Cary Coutant <ccoutant@google.com>
2303
2304 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2305 if --export-dynamic-symbol names an undef symbol.
2306
2307 2012-08-18 Alan Modra <amodra@gmail.com>
2308
2309 * powerpc.cc: Formatting and white space.
2310 (Powerpc_relobj): Rename got2_section_ to special_.
2311 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2312 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2313 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2314 (Target_powerpc): Add Address typedef and invalid_address. Use
2315 throughout.
2316 (Target_powerpc::is_branch_reloc): New function.
2317 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2318 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2319 for dst_mask, value and addend.
2320 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2321 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2322 (Output_data_glink::do_write): Correct toc base. Don't try to use
2323 uint16_t for 24-bit offset. Use get_output_section_offset and
2324 check return.
2325 (Target_powerpc::Scan::local): Handle more relocs.
2326 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2327 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2328 Plug in toc restoring insn after plt calls. Translate branches
2329 to function descriptor symbols to corresponding entry point.
2330 (Target_powerpc::relocate_for_relocatable): Check return from
2331 get_output_section_offset.
2332 * symtab.h: Comment typo.
2333
2334 2012-08-14 Ian Lance Taylor <iant@google.com>
2335
2336 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2337 unsupported_relocal_local to call unsupported_reloc_global.
2338
2339 2012-08-14 Nick Clifton <nickc@redhat.com>
2340
2341 PR ld/14265
2342 * script-sections.cc (Sections_element::output_section_name): Add
2343 keep return parameter.
2344 (Output_section_element::match_name): Add keep return parameter.
2345 Return the value of the keep_ member.
2346 * script-sections.h (class Output_section): Update
2347 output_section_name prototype.
2348 * layout.cc (Layout::keep_input_section): New public member
2349 function.
2350 (Layout::choose_output_section): Pass keep parameter to
2351 output_section_name.
2352 * layout.h (class Layout): Add keep_input_section.
2353 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2354 sections.
2355 * testsuite/Makefile.am: Add a test.
2356 * testsuite/Makefile.in: Regenerate.
2357 * testsuite/pr14265.c: Source file for the test.
2358 * testsuite/pr14265.t: Linker script for the test.
2359 * testsuite/pr14265.sh: Shell script for the test.
2360
2361 2012-08-14 Alan Modra <amodra@gmail.com>
2362
2363 * target.h (Target::output_section_name): New function.
2364 (Target::do_output_section_name): New function.
2365 * layout.cc (Layout::choose_output_section): Call the above.
2366 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2367
2368 2012-08-14 Alan Modra <amodra@gmail.com>
2369
2370 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2371 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2372 for replace_constant call.
2373 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2374 (Output_data_glink::do_print_to_mapfile): New function.
2375 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2376 (Target_powerpc::Relocate::relocate): Likewise.
2377
2378 2012-08-14 Alan Modra <amodra@gmail.com>
2379
2380 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2381 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2382 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2383 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2384 all references to shndx_. Handle special case for R_PPC_PLTREL24
2385 here.
2386 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2387 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2388 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2389 here.
2390 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2391 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2392
2393 2012-08-12 Alan Modra <amodra@gmail.com>
2394
2395 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2396 (glink insn constants): Use uint32_t.
2397 (Output_data_glink::add_entry): Use insert, not [] operator.
2398
2399 2012-08-11 Alan Modra <amodra@gmail.com>
2400
2401 * object.h (Sized_relobj_file::find_shdr): New function.
2402 (Sized_relobj_file::find_special_sections): New function.
2403 * object.cc (Sized_relobj_file::find_shdr): New function.
2404 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2405 (Sized_relobj_file::find_special_sections): New function, split out..
2406 (Sized_relobj_file::do_read_symbols): ..from here.
2407 * output.h (Output_data_got::replace_constant): New function.
2408 (Output_data_got::num_entries): New function.
2409 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2410 (Output_data_got::got_offset): Protected rather than private.
2411 (Output_data_got::replace_got_entry): New function.
2412 * output.cc (Output_data_got::replace_got_entry): New function.
2413 * powerpc.cc (class Powerpc_relobj): New.
2414 (class Powerpc_relocate_functions): Delete all psymval variants or
2415 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2416 Implement _ha functions using corresponding _hi function.
2417 (Powerpc_relobj::find_special_sections): New function.
2418 (Target_powerpc::do_make_elf_object): New function.
2419 (class Output_data_got_powerpc): New.
2420 (class Output_data_glink): New.
2421 (class Powerpc_scan_relocatable_reloc): New.
2422 Many more changes througout file.
2423
2424 2012-08-09 Nick Clifton <nickc@redhat.com>
2425
2426 * po/vi.po: Updated Vietnamese translation.
2427
2428 2012-08-07 Ian Lance Taylor <iant@google.com>
2429
2430 * layout.cc (Layout::add_target_dynamic_tags): If
2431 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2432 plt_rel.
2433
2434 2012-07-30 Nick Clifton <nickc@redhat.com>
2435
2436 * po/gold.pot: Updated template.
2437 * po/es.po: Updated Spanish translation.
2438
2439 2012-07-18 Cary Coutant <ccoutant@google.com>
2440
2441 PR gold/14344
2442 * configure.ac: Add check for -gpubnames support.
2443 * configure: Regenerate.
2444 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2445 support; force -gno-pubnames.
2446 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2447 support.
2448 (gdb_index_test_4): New test.
2449 * testsuite/Makefile.in: Regenerate.
2450 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2451 * testsuite/gdb_index_test_2.sh: Likewise.
2452 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2453 * testsuite/gdb_index_test_4.sh: New script.
2454 * testsuite/gdb_index_test_comm.sh: New script with common code;
2455 don't look for space after colon.
2456
2457 2012-07-16 Sriraman Tallam <tmsriram@google.com>
2458
2459 * gold.cc (queue_middle_tasks): Update function order only after
2460 deferred objects due to plugins are processed.
2461
2462 2012-07-11 Ian Lance Taylor <iant@google.com>
2463
2464 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2465 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2466 (Target_arm::scan_reloc_for_stub): Likewise.
2467 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2468 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2469 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2470 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2471 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2472
2473 2012-07-10 Dodji Seketeli <dodji@redhat.com>
2474 Ian Lance Taylor <iant@google.com>
2475
2476 PR gold/14309
2477 * configure.ac: Test whether std::tr1::hash<off_t> works.
2478 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2479 needed.
2480 * output.h (class Output_fill): Add virtual destructor.
2481 * configure, config.in: Rebuild.
2482
2483 2012-06-22 Roland McGrath <mcgrathr@google.com>
2484
2485 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2486
2487 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2488
2489 * plugin.cc (Plugin::load): Handle position independent executables.
2490
2491 2012-06-06 Cary Coutant <ccoutant@google.com>
2492
2493 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2494 add .debug_macro.
2495 (lines_only_debug_sections): Likewise.
2496 (gdb_fast_lookup_sections): New static array.
2497 (is_gdb_debug_section): Rename formal parameter.
2498 (is_lines_only_debug_section): Likewise.
2499 (is_gdb_fast_lookup_section): New function.
2500 (Layout::include_section): Check for ".zdebug_" prefix; pass
2501 section name suffix to is_gdb_debug_section, et al.; check for
2502 fast-lookup sections when building .gdb_index.
2503 * options.h (--strip-debug-gdb): Update GDB version number.
2504
2505 2012-06-06 Cary Coutant <ccoutant@google.com>
2506
2507 * configure.ac: Add check for fallocate.
2508 * configure: Regenerate.
2509 * config.in: Regenerate.
2510
2511 * options.h (class General_options): Add --mmap-output-file and
2512 --posix-fallocate options.
2513 * output.cc: (posix_fallocate): Remove; replace with...
2514 (gold_fallocate): New function.
2515 (Output_file::map_no_anonymous): Call gold_fallocate.
2516 (Output_file::map): Check --mmap-output-file option.
2517
2518 2012-06-05 Jing Yu <jingyu@google.com>
2519
2520 * gold.h (textdomain): Add do {} to empty while(0).
2521 (bindtextdomain): Likewise.
2522
2523 2012-06-04 Cary Coutant <ccoutant@google.com>
2524
2525 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2526 has_dynsym_index.
2527
2528 2012-05-25 Sriraman Tallam <tmsriram@google.com>
2529
2530 * symtab.cc (Symbol_table::define_special_symbol):
2531 Initialize *poldsym to prevent uninitialized variable errors.
2532
2533 2012-05-23 Cary Coutant <ccoutant@google.com>
2534
2535 * layout.cc (Layout::section_name_mapping): Add rules to handle
2536 exact match on .data.rel.ro.local or .data.rel.ro.
2537 (Layout::output_section_name): Check for exact matches.
2538
2539 2012-05-23 Cary Coutant <ccoutant@google.com>
2540
2541 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2542 more carefully.
2543
2544 2012-05-22 Cary Coutant <ccoutant@google.com>
2545
2546 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2547 object before exporting symbol.
2548
2549 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2550
2551 * testsuite/tls_test.cc: Include "config.h" first.
2552 * testsuite/tls_test_c.c: Likewise.
2553
2554 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
2555 Nick Clifton <nickc@redhat.com>
2556
2557 PR 14072
2558 * configure.in: Add check that sysdep.h has been included before
2559 any system header files.
2560 * configure: Regenerate.
2561 * config.in: Regenerate.
2562
2563 2012-05-14 Cary Coutant <ccoutant@google.com>
2564
2565 * layout.cc (Layout::make_output_section): Mark .tdata section
2566 as RELRO.
2567 * testsuite/relro_test.cc: Add a TLS variable.
2568
2569 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2570
2571 PR gold/14091
2572 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2573 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2574 R_X86_64_64.
2575
2576 2012-05-08 Cary Coutant <ccoutant@google.com>
2577
2578 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2579 (lines_only_debug_sections): Likewise.
2580
2581 2012-05-02 Roland McGrath <mcgrathr@google.com>
2582
2583 * nacl.cc: New file.
2584 * nacl.h: New file.
2585 * Makefile.am (CCFILES, HFILES): Add them.
2586 * Makefile.in: Regenerate.
2587 * i386.cc (Output_data_plt_i386_nacl): New class.
2588 (Output_data_plt_i386_nacl_exec): New class.
2589 (Output_data_plt_i386_nacl_dyn): New class.
2590 (Target_i386_nacl): New class.
2591 (Target_selector_i386_nacl): New class.
2592 (target_selector_i386): Use it instead of Target_selector_i386.
2593 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
2594 (Target_x86_64_nacl): New class.
2595 (Target_selector_x86_64_nacl): New class.
2596 (target_selector_x86_64, target_selector_x32): Use it instead of
2597 Target_selector_x86_64.
2598 * arm.cc (Output_data_plt_arm_nacl): New class.
2599 (Target_arm_nacl): New class.
2600 (Target_selector_arm_nacl): New class.
2601 (target_selector_arm, target_selector_armbe): Use it instead of
2602 Target_selector_arm.
2603
2604 * target-select.cc (select_target): Take new Input_file* and off_t
2605 arguments, pass them on to recognize method of selector.
2606 * object.cc (make_elf_sized_object): Update caller.
2607 * parameters.cc (parameters_force_valid_target): Likewise.
2608 * incremental.cc (make_sized_incremental_binary): Likewise.
2609 * target-select.h: Update decl.
2610 (Target_selector::recognize): Take new Input_file* argument,
2611 pass it on to do_recognize.
2612 (Target_selector::do_recognize): Take new Input_file* argument.
2613 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
2614 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
2615 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
2616 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
2617
2618 * target.h (Target::Target_info): New members isolate_execinstr
2619 and rosegment_gap.
2620 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
2621 * arm.cc (Target_arm::arm_info): Update initializer.
2622 * i386.cc (Target_i386::i386_info): Likewise.
2623 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
2624 * sparc.cc (Target_sparc::sparc_info): Likewise.
2625 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2626 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2627 * layout.cc (Layout::attach_allocated_section_to_segment):
2628 Take new const Target* argument. If target->isolate_execinstr(), act
2629 like --rosegment.
2630 (Layout::find_first_load_seg): Take new const Target* argument;
2631 if target->isolate_execinstr(), reject PF_X segments.
2632 (Layout::relaxation_loop_body): Update caller.
2633 (Layout::set_segment_offsets): If target->isolate_execinstr(),
2634 reset file offset to zero when we hit LOAD_SEG, and then do a second
2635 loop over the segments before LOAD_SEG to reassign offsets after
2636 addresses have been determined. Handle target->rosegment_gap().
2637 (Layout::attach_section_to_segment): Take new const Target* argument;
2638 pass it to attach_allocated_section_to_segment.
2639 (Layout::make_output_section): Update caller.
2640 (Layout::attach_sections_to_segments): Take new const Target* argument;
2641 pass it to attach_section_to_segment.
2642 * gold.cc (queue_middle_tasks): Update caller.
2643 * layout.h (Layout): Update method decls with new arguments.
2644
2645 * arm.cc (Target_arm::Target_arm): Take optional argument for the
2646 Target_info pointer to use.
2647 (Target_arm::do_make_data_plt): New virtual method.
2648 (Target_arm::make_data_plt): New method that calls it.
2649 (Target_arm::make_plt_entry): Use it.
2650 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
2651 for the section alignment.
2652 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
2653 method.
2654 (Output_data_plt_arm::first_plt_entry_offset): Call it.
2655 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
2656 method.
2657 (Output_data_plt_arm::get_plt_entry_size): Call it.
2658 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
2659 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
2660 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
2661 method.
2662 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
2663 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
2664 method instead of sizeof(plt_entry).
2665 (Output_data_plt_arm::add_entry): Likewise.
2666 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
2667 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
2668 than static method.
2669 (Target_arm::plt_entry_size): Likewise.
2670 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
2671 Move to ...
2672 (Output_data_plt_arm_standard): ... here, new class.
2673 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
2674 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
2675 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
2676
2677 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2678 Take additional argument for the PLT entry size.
2679 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
2680 Use get_plt_entry_size method rather than plt_entry_size variable.
2681 (Output_data_plt_x86_64::reserve_slot): Likewise.
2682 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
2683 (Output_data_plt_x86_64::add_entry): Likewise.
2684 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
2685 (Output_data_plt_x86_64::address_for_global): Likewise.
2686 (Output_data_plt_x86_64::address_for_local): Likewise.
2687 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2688 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
2689 Make method non-static.
2690 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
2691 method.
2692 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
2693 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
2694 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
2695 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
2696 virtual method.
2697 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
2698 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
2699 virtual method.
2700 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
2701 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
2702 virtual method.
2703 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
2704 (Output_data_plt_x86_64::plt_entry_size)
2705 (Output_data_plt_x86_64::first_plt_entry)
2706 (Output_data_plt_x86_64::plt_entry)
2707 (Output_data_plt_x86_64::tlsdesc_plt_entry)
2708 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
2709 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
2710 (Output_data_plt_x86_64_standard): ... here, new class.
2711 (Target_x86_64::Target_x86_64): Take optional argument for the
2712 Target_info pointer to use.
2713 (Target_x86_64::do_make_data_plt): New virtual method.
2714 (Target_x86_64::make_data_plt): New method to call it.
2715 (Target_x86_64::init_got_plt_for_update): Use that.
2716 Call this->plt_->add_eh_frame method here.
2717 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
2718 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
2719 rather than static method.
2720 (Target_x86_64::plt_entry_size): Likewise.
2721 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
2722 rather than plt_entry_size variable. Move guts of PLT filling to...
2723 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
2724 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
2725 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
2726
2727 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
2728 additional argument for the section alignment.
2729 Don't do add_eh_frame_for_plt here.
2730 (Output_data_plt_i386::first_plt_entry_offset): Make the method
2731 non-static. Use get_plt_entry_size method rather than plt_entry_size
2732 variable.
2733 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
2734 method.
2735 (Output_data_plt_i386::get_plt_entry_size): Call it.
2736 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
2737 (Output_data_plt_i386::add_eh_frame): New method to call it.
2738 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
2739 method.
2740 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
2741 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
2742 method.
2743 (Output_data_plt_i386::fill_plt_entry): New method to call it.
2744 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
2745 method instead of plt_entry_size.
2746 (Output_data_plt_i386::plt_entry_size)
2747 (Output_data_plt_i386::plt_eh_frame_fde_size)
2748 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
2749 (Output_data_plt_i386_standard): ... here, new class.
2750 (Output_data_plt_i386_exec): New class.
2751 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
2752 (Output_data_plt_i386_exec::first_plt_entry): ... here.
2753 (Output_data_plt_i386::exec_plt_entry): Move to ...
2754 (Output_data_plt_i386_exec::plt_entry): ... here.
2755 (Output_data_plt_i386_dyn): New class.
2756 (Output_data_plt_i386::first_plt_entry): Move to ...
2757 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
2758 (Output_data_plt_i386::dyn_plt_entry): Move to ...
2759 (Output_data_plt_i386_dyn::plt_entry): ... here.
2760 (Target_i386::Target_i386): Take optional argument for the Target_info
2761 pointer to use.
2762 (Target_i386::do_make_data_plt): New virtual method.
2763 (Target_i386::make_data_plt): New method to call it.
2764 (Target_i386::make_plt_section): Use that.
2765 Call this->plt_->add_eh_frame method here.
2766 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
2767 rather than plt_entry_size variable.
2768 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
2769 (Output_data_plt_i386::address_for_local): Likewise.
2770 (Output_data_plt_i386::do_write): Likewise.
2771 Move guts of PLT filling to...
2772 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
2773 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
2774 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
2775 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
2776
2777 2012-05-01 Cary Coutant <ccoutant@google.com>
2778
2779 * dwarf_reader.cc (Dwarf_die::read_attributes)
2780 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
2781 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
2782 * reduced_debug_output.cc
2783 (Output_reduced_debug_info_section::get_die_end): Remove
2784 DW_FORM_GNU_ref_index. Add default case.
2785
2786 2012-04-26 Mark Wielaard <mjw@redhat.com>
2787
2788 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2789 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2790 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2791 DW_AT_high_pc as offset from DW_AT_low_pc.
2792
2793 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2794 * testsuite/Makefile.in: Regenerate.
2795 * testsuite/gdb_index_test_3.c: New test source file.
2796 * testsuite/gdb_index_test_3.sh: New test source file.
2797
2798 2012-04-25 Ian Lance Taylor <iant@google.com>
2799
2800 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2801 pointer.
2802 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2803 as a class, not a struct.
2804 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2805 (Target_arm::apply_cortex_a8_workaround): Likewise.
2806 * gc.h: Declare Reloc_types as a struct, not a class.
2807 * object.h: Declare Symbols_data as a struct.
2808 * reloc.h: Declare Read_relocs_data as a struct.
2809 * target.h: Declare Relocate_info as a struct.
2810
2811 2012-04-24 David S. Miller <davem@davemloft.net>
2812
2813 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2814 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2815 and R_SPARC_WPLT30.
2816
2817 2012-04-24 Cary Coutant <ccoutant@google.com>
2818
2819 * incremental-dump.cc (find_input_containing_global): Replace
2820 magic number with symbolic constant.
2821 (dump_incremental_inputs): Update version number.
2822 * incremental.cc (Output_section_incremental_inputs): Update version
2823 number; import symbolic constants from Incremental_inputs_reader.
2824 (Incremental_inputs::create_data_sections): Align relocations
2825 section correctly for 64-bit targets.
2826 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
2827 constants; add padding.
2828 (Output_section_incremental_inputs::write_header): Add assert for
2829 header_size.
2830 (Output_section_incremental_inputs::write_input_files): Add assert
2831 for input_entry_size.
2832 (Output_section_incremental_inputs::write_info_blocks): Add padding;
2833 add assert for object_info_size, input_section_entry_size,
2834 global_sym_entry_size.
2835 * incremental.h (Incremental_inputs_reader): Add symbolic constants
2836 for data structure sizes; use them.
2837 (Incremental_input_entry_reader): Import symbolic constants from
2838 Incremental_inputs_reader; use them.
2839
2840 2012-04-23 David S. Miller <davem@davemloft.net>
2841
2842 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
2843 and elf_flags_set_.
2844 (Target_sparc::Target_sparc): Initialize new fields.
2845 (Target_sparc::do_make_elf_object): New function.
2846 (Target_sparc::do_adjust_elf_header): New function.
2847
2848 2012-04-23 Cary Coutant <ccoutant@google.com>
2849
2850 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
2851 CU range table of gdb index.
2852
2853 2012-04-20 David S. Miller <davem@davemloft.net>
2854
2855 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
2856 instead of false.
2857
2858 2012-04-16 David S. Miller <davem@davemloft.net>
2859
2860 * sparc.cc (Target_sparc::got_address): New function.
2861 (Sparc_relocate_functions::gdop_hix22): New function.
2862 (Sparc_relocate_functions::gdop_lox10): New function.
2863 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
2864 relocs.
2865 (Target_sparc::Scan::local): Likewise if the global symbol is not
2866 preemptible and is not IFUNC.
2867 (Target_sparc::Relocate::relocate): Perform GOTDATA code
2868 transformations for local and non-preemptible non-IFUNC global
2869 symbols.
2870
2871 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
2872 writing out 64-bit part of ranges.
2873
2874 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
2875 -fpic and -fpie respectively.
2876 * Makefile.in: Regenerate.
2877
2878 * sparc.cc (class Target_sparc): Add rela_ifunc_.
2879 (Target_sparc::Target_sparc): Initialize new field.
2880 (Target_sparc::do_plt_section_for_global): New function.
2881 (Target_sparc::do_plt_section_for_local): New function.
2882 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
2883 (Target_sparc::make_plt_section): New function, broken out of
2884 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
2885 (Target_sparc::make_plt_entry): Call make_plt_section.
2886 (Target_sparc::make_local_ifunc_plt_entry): New function.
2887 (Target_sparc::rela_ifunc_section): New function.
2888 (Target_sparc::plt_section): Remove const.
2889 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
2890 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
2891 and ifunc_count_ fields.
2892 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
2893 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
2894 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
2895 (Output_data_plt_sparc::rela_ifunc): New function.
2896 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
2897 (Output_data_plt_sparc::has_ifunc_section): New function.
2898 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
2899 (Output_data_plt_sparc::address_for_global): New function.
2900 (Output_data_plt_sparc::address_for_local): New function.
2901 (Output_data_plt_sparc::plt_index_to_offset): New function.
2902 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
2903 and entry_count.
2904 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
2905 entry_count.
2906 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
2907 R_SPARC_JMP_IREL to switch.
2908 (Target_sparc::Scan::check_non_pic): Likewise.
2909 (Target_sparc::Scan::local): Handle IFUNC symbols.
2910 (Target_sparc::Scan::local): Likewise.
2911 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
2912 and plt_address_for_local.
2913 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
2914 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
2915
2916 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
2917 (class Output_data_reloc): Adjust calls to Output_reloc_type.
2918 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
2919 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
2920 global relocs too.
2921 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
2922 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
2923 calls.
2924 * sparc.cc (Target_sparc::Scan::global): Likewise.
2925 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2926
2927 2012-04-16 Cary Coutant <ccoutant@google.com>
2928
2929 * archive.cc (Library_base::should_include_member): Check for
2930 --export-dynamic-symbol.
2931 * options.h (class General_options): Add --export-dynamic-symbol.
2932 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
2933 --export-dynamic-symbol.
2934 (Symbol_table::gc_mark_undef_symbols): Likewise.
2935 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
2936
2937 2012-04-12 David S. Miller <davem@davemloft.net>
2938
2939 * sparc.cc (Reloc::wdisp10): New relocation method.
2940 (Reloc::h34): Likewise.
2941 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
2942 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
2943 R_SPARC_WDISP10.
2944 (Target_sparc::Scan::local): Likewise.
2945 (Target_sparc::Scan::global): Likewise.
2946 (Target_sparc::Relocate::relocate): Likewise.
2947
2948 2012-04-09 Cary Coutant <ccoutant@google.com>
2949
2950 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
2951 low_pc == 0.
2952
2953 2012-04-06 Ian Lance Taylor <iant@google.com>
2954
2955 * timer.cc: #include <unistd.h>.
2956
2957 2012-04-06 Roland McGrath <mcgrathr@google.com>
2958
2959 * configure.in (AC_CHECK_HEADERS): Add locale.h.
2960 * config.in: Regenerate.
2961 * configure: Regenerate.
2962
2963 2012-04-05 Nick Clifton <nickc@redhat.com>
2964
2965 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
2966 (AM_LC_MESSAGES): Add.
2967 * aclocal.m4: Regenerate.
2968 * config.in: Regenerate.
2969 * configure: Regenerate.
2970
2971 2012-03-21 Cary Coutant <ccoutant@google.com>
2972
2973 * Makefile.am: Add gdb-index.cc, gdb-index.h.
2974 * Makefile.in: Regenerate.
2975 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
2976 (Sized_elf_reloc_mapper::symbol_section): New function.
2977 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
2978 (make_elf_reloc_mapper): New function.
2979 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
2980 (Dwarf_abbrev_table::do_read_abbrevs): New function.
2981 (Dwarf_abbrev_table::do_get_abbrev): New function.
2982 (Dwarf_ranges_table::read_ranges_table): New function.
2983 (Dwarf_ranges_table::read_range_list): New function.
2984 (Dwarf_pubnames_table::read_section): New function.
2985 (Dwarf_pubnames_table::read_header): New function.
2986 (Dwarf_pubnames_table::next_name): New function.
2987 (Dwarf_die::Dwarf_die): New function.
2988 (Dwarf_die::read_attributes): New function.
2989 (Dwarf_die::skip_attributes): New function.
2990 (Dwarf_die::set_name): New function.
2991 (Dwarf_die::set_linkage_name): New function.
2992 (Dwarf_die::attribute): New function.
2993 (Dwarf_die::string_attribute): New function.
2994 (Dwarf_die::int_attribute): New function.
2995 (Dwarf_die::uint_attribute): New function.
2996 (Dwarf_die::ref_attribute): New function.
2997 (Dwarf_die::child_offset): New function.
2998 (Dwarf_die::sibling_offset): New function.
2999 (Dwarf_info_reader::check_buffer): New function.
3000 (Dwarf_info_reader::parse): New function.
3001 (Dwarf_info_reader::do_parse): New function.
3002 (Dwarf_info_reader::do_read_string_table): New function.
3003 (Dwarf_info_reader::lookup_reloc): New function.
3004 (Dwarf_info_reader::get_string): New function.
3005 (Dwarf_info_reader::visit_compilation_unit): New function.
3006 (Dwarf_info_reader::visit_type_unit): New function.
3007 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3008 Sized_elf_reloc_mapper.
3009 (Sized_dwarf_line_info::symbol_section): Remove function.
3010 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3011 (Sized_dwarf_line_info::read_line_mappings): Remove object
3012 parameter, adjust callers.
3013 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3014 * dwarf_reader.h: Include <sys/types.h>.
3015 (class Track_relocs): Remove forward declaration.
3016 (class Elf_reloc_mapper): New class.
3017 (class Sized_elf_reloc_mapper): New class.
3018 (class Dwarf_abbrev_table): New class.
3019 (class Dwarf_range_list): New class.
3020 (class Dwarf_ranges_table): New class.
3021 (class Dwarf_pubnames_table): New class.
3022 (class Dwarf_die): New class.
3023 (class Dwarf_info_reader): New class.
3024 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3025 (Sized_dwarf_line_info::symbol_section): Remove member function.
3026 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3027 base class.
3028 * gdb-index.cc: New source file.
3029 * gdb-index.h: New source file.
3030 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3031 and .debug_types sections, call Layout::add_to_gdb_index.
3032 (Sized_relobj_incr::do_section_name): Implement.
3033 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3034 return type; Implement.
3035 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3036 return type.
3037 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3038 parameter list and return type.
3039 (Sized_incr_dynobj::do_section_contents): Likewise.
3040 * layout.cc: Include gdb-index.h.
3041 (Layout::Layout): Initialize gdb_index_data_.
3042 (Layout::init_fixed_output_section): Check for .gdb_index section.
3043 (Layout::add_to_gdb_index): New function. Instantiate.
3044 * layout.h: Add forward declaration for class Gdb_index.
3045 (Layout::add_to_gdb_index): New member function.
3046 (Layout::gdb_index_data_): New data member.
3047 * main.cc: Include gdb-index.h.
3048 (main): Print statistics for gdb index.
3049 * object.cc (Object::section_contents): Move code into
3050 do_section_contents.
3051 (need_decompressed_section): Check for sections needed when building
3052 gdb index.
3053 (build_compressed_section_map): Likewise.
3054 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3055 gdb index.
3056 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3057 sections; call Layout::add_to_gdb_index.
3058 (Sized_relobj_file::do_decompressed_section_contents): Call
3059 do_section_contents directly.
3060 * object.h (Object::do_section_contents): Adjust parameter list and
3061 return type.
3062 (Object::do_decompressed_section_contents): Call do_section_contents
3063 directly.
3064 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3065 return type.
3066 * options.h (class General_options): Add --gdb-index option.
3067 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3068 list and return type.
3069 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3070 * reloc.h (Track_relocs::checkpoint): New function.
3071 (Track_relocs::reset): New function.
3072
3073 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3074 New test cases.
3075 * testsuite/Makefile.in: Regenerate.
3076 * testsuite/gdb_index_test.cc: New test source file.
3077 * testsuite/gdb_index_test_1.sh: New test source file.
3078 * testsuite/gdb_index_test_2.sh: New test source file.
3079
3080 2012-03-19 Doug Kwan <dougkwan@google.com>
3081
3082 * arm.cc (Target_arm::do_define_standard_symbols): New method.
3083 (Target_arm::do_finalize_sections): Remove code which defines
3084 __exidx_start and __exidx_end. Make symbol table parameter
3085 anonymous as it is not used.
3086 * gold.cc (queue_middle_tasks): Call target hook to define any
3087 target-specific symbols.
3088 * target.h (Target::define_standard_symbols): New method.
3089 (Target::do_define_standard_symbols): Same.
3090 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3091 * testsuite/Makefile.in: Regenerate.
3092 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3093 and __exidx_end.
3094 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3095 relocations are generated for __exidx_start and __exidx_end.
3096
3097 2012-03-16 Doug Kwan <dougkwan@google.com>
3098
3099 * testsuite/Makefile.am: Disable test initpri3b.
3100 * testsuite/Makefile.in: Regenerate.
3101
3102 2012-03-15 Doug Kwan <dougkwan@google.com>
3103
3104 * arm.cc (Target_arm::got_section): Make .got section read-only
3105 if -z now is given.
3106
3107 2012-03-15 Ian Lance Taylor <iant@google.com>
3108
3109 PR gold/13850
3110 * layout.cc (Layout::make_output_section): Correctly mark
3111 SHT_INIT_ARRAY, et. al., as relro.
3112
3113 2012-03-14 Doug Kwan <dougkwan@google.com>
3114
3115 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3116 dynamic relocations for protected symbols in shared objects.
3117
3118 2012-03-13 Ian Lance Taylor <iant@google.com>
3119
3120 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3121 keep the larger alignment.
3122
3123 2012-03-12 Cary Coutant <ccoutant@google.com>
3124
3125 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3126 handling of DW_LNE_define_file.
3127
3128 2012-03-12 Cary Coutant <ccoutant@google.com>
3129
3130 * reduced_debug_output.cc
3131 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3132 codes to switch.
3133
3134 2012-02-29 Cary Coutant <ccoutant@google.com>
3135
3136 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3137
3138 2012-02-29 Cary Coutant <ccoutant@google.com>
3139
3140 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3141 Call Object::decompressed_section_contents.
3142 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3143 New dtor.
3144 (Sized_dwarf_line_info::buffer_start_): New data member.
3145 * merge.cc (Output_merge_data::do_add_input_section): Call
3146 Object::decompressed_section_contents.
3147 (Output_merge_string::do_add_input_section): Likewise.
3148 * object.cc (need_decompressed_section): New function.
3149 (build_compressed_section_map): Decompress sections needed later.
3150 (Sized_relobj_file::do_decompressed_section_contents): New function.
3151 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3152 * object.h (Object::decompressed_section_contents): New function.
3153 (Object::discard_decompressed_sections): New function.
3154 (Object::do_decompressed_section_contents): New function.
3155 (Object::do_discard_decompressed_sections): New function.
3156 (Compressed_section_info): New type.
3157 (Compressed_section_map): Include decompressed section contents.
3158 (Sized_relobj_file::do_decompressed_section_contents): New function.
3159 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3160
3161 2012-02-16 Cary Coutant <ccoutant@google.com>
3162
3163 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3164 * testsuite/Makefile.in: Regenerate.
3165
3166 2012-02-14 Cary Coutant <ccoutant@google.com>
3167
3168 * options.cc (General_options::finalize): Disallow -pie and -static.
3169
3170 2012-02-03 Doug Kwan <dougkwan@google.com>
3171
3172 * arm.cc (Arm_relocate_functions::abs8,
3173 Arm_relocate_functions::abs16): Use
3174 Bits::has_signed_unsigned_overflow32.
3175 (Arm_relocate_functions::thm_abs8): Correct range of
3176 overflow check.
3177 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3178 in assertions.
3179
3180 2012-02-02 Doug Kwan <dougkwan@google.com>
3181
3182 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3183 position independent outputs, not just shared objects.
3184
3185 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3186
3187 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3188 * configure: Regenerated.
3189
3190 2012-01-27 Ian Lance Taylor <iant@google.com>
3191
3192 * reloc.h (Bits): New class with static functions, copied from
3193 namespace utils in arm.cc.
3194 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3195 instead.
3196
3197 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3198
3199 * incremental.cc (write_info_blocks): Correct relocation offset.
3200
3201 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3202
3203 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3204 (Relocate::tls_gd_to_le): Likewise.
3205
3206 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3207
3208 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3209
3210 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3211
3212 * configure.ac: Check if -mcmodel=medium works.
3213 * configure: Regenerated.
3214
3215 2012-01-24 Cary Coutant <ccoutant@google.com>
3216
3217 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3218 definition and ...
3219 (read_unsigned_LEB_128_x): ... this new function.
3220 (read_signed_LEB_128): Replaced with inline definition and ...
3221 (read_signed_LEB_128_x): ... this new function.
3222 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3223 (read_unsigned_LEB_128): Add inline definition.
3224 (read_signed_LEB_128_x): New function.
3225 (read_signed_LEB_128): Add inline definition.
3226 * testsuite/Makefile.am (leb128_unittest): New unit test.
3227 * testsuite/Makefile.in: Regenerate.
3228 * testsuite/leb128_unittest.cc: New unit test.
3229
3230 2012-01-23 Ian Lance Taylor <iant@google.com>
3231
3232 PR gold/13617
3233 * i386.cc (Target_i386::do_code_fill): When using a jmp
3234 instruction, pad with nop instructions.
3235 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3236
3237 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3238
3239 * x86_64.cc (gc_process_relocs): Add typename on types used in
3240 template.
3241 (scan_relocs): Likewise.
3242 (relocate_section): Likewise.
3243 (apply_relocation): Likewise.
3244
3245 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3246
3247 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3248 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3249 under x32.
3250
3251 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3252
3253 * x86_64.cc: Initial support for x32.
3254
3255 2012-01-03 Cary Coutant <ccoutant@google.com>
3256
3257 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3258 Use abstract base class for GOT.
3259 * gold/output.h (class Output_data_got_base): New abstract base class.
3260 (class Output_data_got): Derive from new base class, adjust ctors.
3261 (Output_data_got::reserve_slot): Make virtual; rename to
3262 do_reserve_slot; Adjust callers.
3263 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3264 pointer to abstract base class.
3265 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3266
3267 2011-12-18 Ian Lance Taylor <iant@google.com>
3268
3269 * object.h (Relobj::local_symbol_value): New function.
3270 (Relobj::local_plt_offset): New function.
3271 (Relobj::local_has_got_offset): New function.
3272 (Relobj::local_got_offset): New function.
3273 (Relobj::set_local_got_offset): New function.
3274 (Relobj::do_local_symbol_value): New pure virtual function.
3275 (Relobj::do_local_plt_offset): Likewise.
3276 (Relobj::do_local_has_got_offset): Likewise.
3277 (Relobj::do_local_got_offset): Likewise.
3278 (Relobj::do_set_local_got_offset): Likewise.
3279 (Sized_relobj::do_local_has_got_offset): Rename from
3280 local_has_got_offset.
3281 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3282 (Sized_relobj::do_set_local_got_offset): Rename from
3283 set_local_got_offset.
3284 (Sized_relobj_file::do_local_plt_offset): Rename from
3285 local_plt_offset.
3286 (Sized_relobj_file::do_local_symbol_value): New function.
3287 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3288 local_plt_offset.
3289 * output.cc (Output_data_got::Got_entry::write): Change object to
3290 Relobj. Use local_symbol_value.
3291 (Output_data_got::add_global_with_rel): Change rel_dyn to
3292 Output_data_reloc_generic*. Use add_global_generic.
3293 (Output_data_got::add_global_with_rela): Remove. Change all
3294 callers to use add_global_with_rel.
3295 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3296 Output_data_reloc_generic*. Use add_global_generic.
3297 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3298 callers to use add_global_pair_with_rel.
3299 (Output_data_got::add_local): Change object to Relobj*.
3300 (Output_data_got::add_local_plt): Likewise.
3301 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3302 change rel_dyn to Output_data_reloc_generic*. Use
3303 add_local_generic.
3304 (Output_data_got::add_local_with_rela): Remove. Change all
3305 callers to use all_local_with_rel.
3306 (Output_data_got::add_local_pair_with_rel): Change object to
3307 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3308 add_output_section_generic.
3309 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3310 callers to use add_local_pair_with_rel.
3311 (Output_data_got::reserve_local): Change object to Relobj*.
3312 * output.h: (class Output_data_reloc_generic): Add pure virtual
3313 declarations for add_global_generic, add_local_generic,
3314 add_output_section_generic.
3315 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3316 functions for Output_data_reloc_generic. Update declarations for
3317 changes listed in output.cc.
3318 (class Output_data_got): Change template parameter to got_size.
3319 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3320 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3321 function.
3322 (Sized_relobj_incr::do_local_plt_offset): New function.
3323 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3324 add_global_generic.
3325
3326 2011-12-17 Cary Coutant <ccoutant@google.com>
3327
3328 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3329 * resolve.cc (Symbol_table::resolve): Likewise.
3330 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3331 arrays.
3332 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3333
3334 2011-12-16 Ian Lance Taylor <iant@google.com>
3335
3336 * output.h (Output_data_reloc_generic::add): Only call
3337 add_dynamic_reloc if this is a dynamic reloc section.
3338
3339 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3340
3341 PR gold/13505
3342 * target-reloc.h (apply_relocation): Replace <64, false> with
3343 <size, big_endian>.
3344
3345 2011-11-25 Nick Clifton <nickc@redhat.com>
3346
3347 * po/it.po: New Italian translation.
3348
3349 2011-11-17 Sterling Augustine <saugustine@google.com>
3350
3351 * script.cc (script_include_directive): Implement.
3352 (read_script_file): New local variables name and search_path. Update
3353 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3354 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3355 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3356
3357 2011-11-11 Sterling Augustine <saugustine@google.com>
3358
3359 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3360 (file_or_sections_cmd): Likewise.
3361
3362 2011-11-11 Doug Kwan <dougkwan@google.com>
3363
3364 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3365 if --just-symbols is given.
3366
3367 2011-11-10 Doug Kwan <dougkwan@google.com>
3368
3369 PR gold/13362
3370 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3371 when processing data relocs.
3372 * reloc.h (Relocate_functions::rel_unaligned): New method.
3373 (Relocate_functions::pcrel_unaligned): Ditto.
3374 (Relocate_functions::rel32_unaligned): Ditto.
3375 (Relocate_functions::pcrel32_unaligned): Ditto.
3376
3377 2011-11-09 Doug Kwan <dougkwan@google.com>
3378
3379 PR gold/13362
3380 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3381 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3382 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3383 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3384 (Relocate_functions::rel_unaligned): New.
3385 (Relocate_functions::rel32_unaligned): New.
3386 * target-reloc.h (relocate_for_relocatable): Add code to handle
3387 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3388 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3389 arm_unaligned_reloc_r): New targets.
3390 * testsuite/Makefile.in: Regenerate.
3391 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3392 linking.
3393
3394 2011-11-02 Ian Lance Taylor <iant@google.com>
3395
3396 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3397 NATIVE_LINKER.
3398 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3399 * options.cc (General_options::finalize): Use library search path
3400 from configure script if specified. If not native and no sysroot,
3401 only search TOOLLIBDIR.
3402 * options.h (Search_directory::Search_directory): Change name to
3403 const std::string&.
3404 (General_options::add_to_library_path_with_sysroot): Change arg to
3405 const std::string&.
3406 * configure, Makefile.in, config.in: Rebuild.
3407
3408 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3409
3410 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3411 we are working around the ARM1176 Erratum.
3412 * options.h (General_options::fix_arm1176): Add option.
3413 * testsuite/Makefile.am: Add testcases, and keep current ones
3414 working.
3415 * testsuite/Makefile.in: Regenerate.
3416 * testsuite/arm_fix_1176.s: New file.
3417 * testsuite/arm_fix_1176.sh: Likewise.
3418
3419 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3420
3421 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3422 may_use_blx_.
3423 (Target_arm::may_use_blx): Remove method.
3424 (Target_arm::set_may_use_blx): Likewise.
3425 (Target_arm::may_use_v4t_interworking): New method.
3426 (Target_arm::may_use_v5t_interworking): Likewise.
3427 (Target_arm::may_use_blx_): Remove member variable.
3428 (Arm_relocate_functions::arm_branch_common): Check for v5T
3429 interworking.
3430 (Arm_relocate_functions::thumb_branch_common): Likewise.
3431 (Reloc_stub::stub_type_for_reloc): Likewise.
3432 (Target_arm::do_finalize_sections): Correct interworking checks.
3433 * testsuite/Makefile.am: Add new tests.
3434 * testsuite/Makefile.in: Regenerate.
3435 * testsuite/arm_farcall_arm_arm.s: New test.
3436 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3437 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3438 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3439 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3440 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3441 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3442 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3443
3444 2011-10-31 Cary Coutant <ccoutant@google.com>
3445
3446 PR gold/13023
3447 * expression.cc (Expression::eval_with_dot): Add
3448 is_section_dot_assignment parameter.
3449 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3450 absolute and assigning to dot within a section.
3451 * script-sections.cc
3452 (Output_section_element_assignment::set_section_addresses): Pass
3453 dot_section to set_if_absolute.
3454 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3455 as is_section_dot_assignment flag to eval_with_dot.
3456 (Output_section_element_dot_assignment::set_section_addresses):
3457 Likewise.
3458 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3459 parameter. Also set value if relative to dot_section; set the
3460 symbol's output_section.
3461 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3462 parameter. Adjust all callers.
3463 (Expression::eval_maybe_dot): Likewise.
3464 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3465 Adjust all callers.
3466 * testsuite/script_test_2.t: Test assignment of an absolute value
3467 to dot within an output section element.
3468
3469 2011-10-31 Cary Coutant <ccoutant@google.com>
3470
3471 * options.h (class General_options): Add --[no-]gnu-unique options.
3472 * symtab.cc (Symbol_table::sized_write_globals): Convert
3473 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3474
3475 2011-10-31 Cary Coutant <ccoutant@google.com>
3476
3477 PR gold/13359
3478 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3479 unnecessary assertion.
3480 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3481
3482 2011-10-31 Sriraman Tallam <tmsriram@google.com>
3483
3484 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3485 gc_mark_symbol.
3486 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3487 gc_mark_symbol.
3488 Change to just keep the section associated with symbol.
3489 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3490 they are externally visible and --export-dynamic is turned on.
3491 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3492
3493 2011-10-19 Ian Lance Taylor <iant@google.com>
3494
3495 PR gold/13163
3496 * script-sections.cc
3497 (Output_section_element_dot_assignment::needs_output_section): New
3498 function.
3499
3500 2011-10-19 Ian Lance Taylor <iant@google.com>
3501
3502 PR gold/13204
3503 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3504 --section-start option was seen.
3505 * options.h (General_options::any_section_start): New function.
3506
3507 2011-10-18 David S. Miller <davem@davemloft.net>
3508
3509 PR binutils/13301
3510 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3511 member to track relocation locations that have moved during TLS
3512 reloc optimizations.
3513 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3514 (Target_sparc::Relocate::relocate): Adjust view down by 4
3515 bytes if it matches reloc_adjust_addr_.
3516 (Target_sparc::Relocate::relocate_tls): Always move the
3517 __tls_get_addr call delay slot instruction forward 4 bytes when
3518 performing relaxation.
3519
3520 2011-10-18 Cary Coutant <ccoutant@google.com>
3521
3522 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3523 (Output_file::map_no_anonymous): Check for non-zero
3524 return code from posix_fallocate.
3525
3526 2011-10-17 Cary Coutant <ccoutant@google.com>
3527
3528 PR gold/13245
3529 * plugin.cc (is_visible_from_outside): Check for symbols
3530 referenced from dynamic objects.
3531 * resolve.cc (Symbol_table::resolve): Don't count references
3532 from dynamic objects as references from real ELF files.
3533 * testsuite/plugin_test_2.sh: Adjust expected result.
3534
3535 2011-10-17 Cary Coutant <ccoutant@google.com>
3536
3537 * gold.cc: Include timer.h.
3538 (queue_middle_tasks): Stamp time.
3539 (queue_final_tasks): Likewise.
3540 * main.cc (main): Store timer in parameters. Print timers
3541 for each pass.
3542 * parameters.cc (Parameters::Parameters): Initialize timer_.
3543 (Parameters::set_timer): New function.
3544 (set_parameters_timer): New function.
3545 * parameters.h (Parameters::set_timer): New function.
3546 (Parameters::timer): New function.
3547 (Parameters::timer_): New data member.
3548 (set_parameters_timer): New function.
3549 * timer.cc (Timer::stamp): New function.
3550 (Timer::get_pass_time): New function.
3551 * timer.h (Timer::stamp): New function.
3552 (Timer::get_pass_time): New function.
3553 (Timer::pass_times_): New data member.
3554
3555 2011-10-17 Cary Coutant <ccoutant@google.com>
3556
3557 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3558 task for members of lib groups.
3559
3560 2011-10-17 Cary Coutant <ccoutant@google.com>
3561
3562 PR gold/13288
3563 * fileread.cc (File_read::find_view): Add assert.
3564 (File_read::make_view): Move bounds check (replace with assert)...
3565 (File_read::find_or_make_view): ... to here.
3566
3567 2011-10-12 Cary Coutant <ccoutant@google.com>
3568
3569 * output.cc (Output_file::open_base_file): Handle case where
3570 ::read returns less than requested size.
3571
3572 2011-10-10 Cary Coutant <ccoutant@google.com>
3573
3574 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
3575 Initialize defined_count_.
3576 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3577 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3578 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3579 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3580 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
3581 * incremental.h (Sized_relobj_incr::defined_count_): New data
3582 member.
3583 (Sized_incr_dynobj::defined_count_): New data member.
3584 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
3585 Return zeroes instead of internal error.
3586
3587 2011-10-10 Cary Coutant <ccoutant@google.com>
3588
3589 PR gold/13249
3590 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
3591 (Output_reloc::symbol_value): Return PLT offset if flag is set.
3592 * output.h (class Output_reloc): Add use_plt_offset flag.
3593 (Output_reloc::type_): Adjust size of bit field.
3594 (Output_reloc::use_plt_offset_): New bit field.
3595 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
3596 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
3597 flag. Adjust all callers.
3598 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
3599 creating RELATIVE relocations.
3600
3601 2011-10-10 Nick Clifton <nickc@redhat.com>
3602
3603 * po/es.po: Updated Spanish translation.
3604 * po/fi.po: Updated Finnish translation.
3605
3606 2011-10-03 Diego Novillo <dnovillo@google.com>
3607
3608 * options.cc (parse_uint): Fix dereference of RETVAL.
3609
3610 2011-09-29 Sriraman Tallam <tmsriram@google.com>
3611
3612 * layout.h (section_order_map_): New member.
3613 (get_section_order_map): New member function.
3614 * output.cc (Output_section::add_input_section): Check for patterns
3615 only when --section-ordering-file is specified.
3616 * gold.cc (queue_middle_tasks): Delay updating order of sections till
3617 output_sections have been formed.
3618 * layout.cc (Layout_Layout): Initialize section_order_map_.
3619 * plugin.cc (update_section_order): Store order in order_map. Do not
3620 update the order.
3621 * testsuite/Makefile.am: Add test case for plugin_final_layout.
3622 * testsuite/Makefile.in: Regenerate.
3623 * testsuite/plugin_section_order.c: New file.
3624 * testsuite/plugin_final_layout.cc: New file.
3625 * testsuite/plugin_final_layout.sh: New file.
3626
3627 2011-09-29 Cary Coutant <ccoutant@google.com>
3628
3629 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3630 Check for NULL.
3631 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
3632 symbols during incremental update.
3633 (Symbol_table::add_from_dynobj): Likewise.
3634
3635 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3636 Ian Lance Taylor <iant@google.com>
3637
3638 * symtab.cc (Symbol_table::define_special_symbol): Always
3639 canonicalize version string.
3640
3641 2011-09-26 Cary Coutant <ccoutant@google.com>
3642
3643 * gold.cc (queue_initial_tasks): Move option checks ...
3644 * options.cc (General_options::finalize): ... to here. Disable
3645 some options; make others fatal.
3646
3647 2011-09-26 Cary Coutant <ccoutant@google.com>
3648
3649 gcc PR lto/47247
3650 * plugin.cc (get_symbols_v2): New function.
3651 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
3652 (is_referenced_from_outside): New function.
3653 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
3654 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
3655 (get_symbols): Pass version parameter.
3656 (get_symbols_v2): New function.
3657 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
3658 parameter.
3659 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
3660 (onload): Add LDPT_GET_SYMBOLS_V2.
3661 (all_symbols_read_hook): Use get_symbols_v2; check for
3662 LDPR_PREVAILING_DEF_IRONLY_EXP.
3663 * testsuite/plugin_test_3.sh: Update expected results.
3664
3665 2011-09-23 Simon Baldwin <simonb@google.com>
3666
3667 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
3668 configuration options.
3669 * configure: Regenerate.
3670 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
3671 * Makefile.in: Regenerate.
3672 * testsuite/Makefile.in: Regenerate.
3673
3674 2011-09-19 Sriraman Tallam <tmsriram@google.com>
3675
3676 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
3677
3678 2011-09-19 Cary Coutant <ccoutant@google.com>
3679
3680 * incremental.cc (can_incremental_update): Fix typo in comment.
3681 * incremental.h (can_incremental_update): Likewise.
3682
3683 2011-09-18 Cary Coutant <ccoutant@google.com>
3684
3685 * incremental.cc (can_incremental_update): New function.
3686 * incremental.h (can_incremental_update): New function.
3687 * layout.cc (Layout::init_fixed_output_section): Call it.
3688 (Layout::make_output_section): Don't allow patch space in .eh_frame.
3689 * object.cc (Sized_relobj_file::do_layout): Call
3690 can_incremental_update.
3691
3692 2011-09-13 Cary Coutant <ccoutant@google.com>
3693
3694 * configure.ac: Check for glibc support for gnu_indirect_function
3695 support with static linking, setting automake conditional
3696 IFUNC_STATIC.
3697 * Makefile.in: Regenerate.
3698 * configure: Regenerate.
3699
3700 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
3701 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
3702 for IFUNC_STATIC.
3703 * testsuite/Makefile.in: Regenerate.
3704
3705 2011-09-13 Cary Coutant <ccoutant@google.com>
3706
3707 * incremental.cc (Sized_relobj_incr::do_layout): Call
3708 report_comdat_group for kept comdat sections.
3709 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
3710 * testsuite/Makefile.in: Regenerate.
3711 * testsuite/incr_comdat_test_1.cc: New source file.
3712 * testsuite/incr_comdat_test_2_v1.cc: New source file.
3713 * testsuite/incr_comdat_test_2_v2.cc: New source file.
3714 * testsuite/incr_comdat_test_2_v3.cc: New source file.
3715
3716 2011-09-13 Ian Lance Taylor <iant@google.com>
3717
3718 * object.cc (Sized_relobj_file::do_layout): Remove unused local
3719 variable external_symbols_offset.
3720
3721 2011-09-12 Ian Lance Taylor <iant@google.com>
3722
3723 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
3724 triggered if object has no symbols.
3725
3726 2011-09-09 David S. Miller <davem@davemloft.net>
3727
3728 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
3729 (Output_fill_debug_line::do_write): Likewise.
3730
3731 2011-08-29 Cary Coutant <ccoutant@google.com>
3732
3733 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
3734 casts to match formatting specs.
3735 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
3736
3737 2011-08-26 Cary Coutant <ccoutant@google.com>
3738
3739 * layout.cc (Free_list::allocate): Provide guarantee of minimum
3740 remaining hole size when allocating.
3741 (Layout::make_output_section): Set fill methods for debug sections.
3742 * layout.h (Free_list::Free_list_node): Move from private to
3743 public.
3744 (Free_list::set_min_hole_size): New function.
3745 (Free_list::begin, Free_list::end): New functions.
3746 (Free_list::min_hole_): New data member.
3747 * output.cc: Include dwarf.h.
3748 (Output_fill_debug_info::do_minimum_hole_size): New function.
3749 (Output_fill_debug_info::do_write): New function.
3750 (Output_fill_debug_line::do_minimum_hole_size): New function.
3751 (Output_fill_debug_line::do_write): New function.
3752 (Output_section::Output_section): Initialize new data member.
3753 (Output_section::set_final_data_size): Ensure patch space is larger
3754 than minimum hole size.
3755 (Output_section::do_write): Fill holes in debug sections.
3756 * output.h (Output_fill): New class.
3757 (Output_fill_debug_info): New class.
3758 (Output_fill_debug_line): New class.
3759 (Output_section::set_free_space_fill): New function.
3760 (Output_section::free_space_fill_): New data member.
3761 * testsuite/Makefile.am (incremental_test_3): Add
3762 --incremental-patch option.
3763 (incremental_test_4): Likewise.
3764 (incremental_test_5): Likewise.
3765 (incremental_test_6): Likewise.
3766 (incremental_copy_test): Likewise.
3767 (incremental_common_test_1): Likewise.
3768 * testsuite/Makefile.in: Regenerate.
3769
3770 2011-08-26 Nick Clifton <nickc@redhat.com>
3771
3772 * po/es.po: Updated Spanish translation.
3773
3774 2011-08-01 Cary Coutant <ccoutant@google.com>
3775
3776 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
3777 * gold/testsuite/Makefile.in: Regenerate.
3778 * gold/testsuite/justsyms_exec.c: New source file.
3779 * gold/testsuite/justsyms_lib.c: New source file.
3780
3781 2011-08-01 Cary Coutant <ccoutant@google.com>
3782
3783 * layout.cc (Layout::set_segment_offsets): Don't realign text
3784 segment if -Ttext was specified.
3785 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
3786 file type.
3787 * object.h (Sized_relobj_file::e_type): New function.
3788 (Sized_relobj_file::e_type_): New data member.
3789 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3790 base address for ET_EXEC files.
3791 * target.cc (Target::do_make_elf_object_implementation): Allow
3792 ET_EXEC files with --just-symbols option.
3793
3794 2011-07-28 Cary Coutant <ccoutant@google.com>
3795
3796 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3797 Add thread_number parameter.
3798 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3799 * workqueue-threads.cc
3800 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3801 current thread if its thread number is greater than desired thread
3802 count.
3803 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3804 Add thread_number parameter.
3805 (Workqueue::should_cancel_thread): Likewise.
3806 (Workqueue::find_runnable_or_wait): Pass thread_number to
3807 should_cancel_thread.
3808 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3809 parameter.
3810
3811 2011-07-22 Sriraman Tallam <tmsriram@google.com>
3812
3813 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3814 only after checking if it cannot be forced local.
3815 * symtab.h (is_externally_visible): Check if the symbol is not forced
3816 local.
3817
3818 2011-07-15 Ian Lance Taylor <iant@google.com>
3819
3820 * options.h (class General_options): Add --print-output-format.
3821 Move -EL next to -EB, for better --help output.
3822 * target-select.cc: Include <cstdio>, "options.h", and
3823 "parameters.h".
3824 (Target_selector::do_target_bfd_name): New function.
3825 (print_output_format): New function.
3826 * target-select.h (class Target_selector): Update declarations.
3827 (Target_selector::target_bfd_name): New function.
3828 (print_output_format): Declare.
3829 * main.cc: Include "target-select.h".
3830 (main): Handle --print-output-format.
3831 * gold.cc: Include "target-select.h".
3832 (queue_initial_tasks): Handle --print-output-format when there are
3833 no input files.
3834 * parameters.cc (parameters_force_valid_target): Give a better
3835 error message if -EB/-EL does not match target.
3836 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
3837 function.
3838
3839 2011-07-15 Ian Lance Taylor <iant@google.com>
3840
3841 * i386.cc (class Output_data_plt_i386): Add layout_ field.
3842 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
3843 (Output_data_plt_i386::do_write): Write address of .dynamic
3844 section to first entry in .got.plt section.
3845 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
3846 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3847 Initialize layout_.
3848 (Output_data_plt_x86_64::do_write): Write address of .dynamic
3849 section to first entry in .got.plt section.
3850 * layout.h (Layout::dynamic_section): New function.
3851
3852 2011-07-13 Sriraman Tallam <tmsriram@google.com>
3853
3854 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
3855 to claim_file call.
3856 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
3857 input_section_position_, and input_section_glob_.
3858 (read_layout_from_file): Call function section_ordering_specified.
3859 * layout.h (is_section_ordering_specified): New function.
3860 (section_ordering_specified): New function.
3861 (section_ordering_specified_): New boolean member.
3862 * main.cc(main): Call load_plugins after layout object is defined.
3863 * output.cc (Output_section::add_input_section): Use
3864 function section_ordering_specified to check if section ordering is
3865 needed.
3866 * output.cc (Output_section::add_relaxed_input_section): Use
3867 function section_ordering_specified to check if section ordering is
3868 needed.
3869 (Output_section::update_section_layout): New function.
3870 (Output_section::sort_attached_input_sections): Check if input section
3871 must be reordered.
3872 * output.h (Output_section::update_section_layout): New function.
3873 * plugin.cc (get_section_count): New function.
3874 (get_section_type): New function.
3875 (get_section_name): New function.
3876 (get_section_contents): New function.
3877 (update_section_order): New function.
3878 (allow_section_ordering): New function.
3879 (Plugin::load): Add the new interfaces to the transfer vector.
3880 (Plugin_manager::load_plugins): New parameter.
3881 (Plugin_manager::all_symbols_read): New parameter.
3882 (Plugin_manager::claim_file): New parameter. Save the elf object for
3883 unclaimed objects.
3884 (Plugin_manager::get_elf_object): New function.
3885 (Plugin_manager::get_view): Change to directly use the bool to check
3886 if get_view is called from claim_file_hook.
3887 * plugin.h (input_objects): New function
3888 (Plugin__manager::load_plugins): New parameter.
3889 (Plugin_manager::claim_file): New parameter.
3890 (Plugin_manager::get_elf_object): New function.
3891 (Plugin_manager::in_claim_file_handler): New function.
3892 (Plugin_manager::in_claim_file_handler_): New member.
3893 (layout): New function.
3894 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
3895 handler with an extra parameter. Make the elf object before calling
3896 claim_file handler.
3897 * testsuite/plugin_test.c (get_section_count): New function pointer.
3898 (get_section_type): New function pointer.
3899 (get_section_name): New function pointer.
3900 (get_section_contents): New function pointer.
3901 (update_section_order): New function pointer.
3902 (allow_section_ordering): New function pointer.
3903 (onload): Check if the new interfaces exist.
3904
3905 2011-07-13 Ian Lance Taylor <iant@google.com>
3906
3907 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
3908 relro section.
3909 * x86_64.cc (Target_x86_64::got_section): Likewise.
3910 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
3911 (relro_now_test_SOURCES): New variable.
3912 (relro_now_test_DEPENDENCIES): New variable.
3913 (relro_now_test_LDFLAGS): New variable.
3914 (relro_now_test_LDADD): New variable.
3915 (relro_now_test.so): New target.
3916 * testsuite/Makefile.in: Rebuild.
3917
3918 2011-07-12 Ian Lance Taylor <iant@google.com>
3919
3920 PR gold/12980
3921 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
3922 GLOB_DAT relocation rather than a RELATIVE relocation for a
3923 protected symbol when creating a shared library.
3924 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3925 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
3926 * testsuite/protected_main_1.cc (main): Test that protected
3927 function has same address.
3928
3929 2011-07-11 Ian Lance Taylor <iant@google.com>
3930
3931 PR gold/12979
3932 * options.h (class General_options): Add -Bgroup.
3933 * options.cc (General_options::finalize): If -Bgroup is set,
3934 default to --unresolved-symbols=report-all.
3935 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
3936 * target-reloc.h (issue_undefined_symbol_error): Handle
3937 --unresolved-symbols=report-all.
3938
3939 2011-07-08 Ian Lance Taylor <iant@google.com>
3940
3941 PR gold/11985
3942 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
3943 if linker script discards key sections.
3944 (Layout::create_dynamic_symtab): Likewise.
3945 (Layout::assign_local_dynsym_offsets): Likewise.
3946 (Layout::sized_create_version_sections): Likewise.
3947 (Layout::create_interp): Likewise.
3948 (Layout::finish_dynamic_section): Likewise.
3949 (Layout::set_dynamic_symbol_size): Likewise.
3950
3951 2011-07-08 Ian Lance Taylor <iant@google.com>
3952
3953 PR gold/12386
3954 * options.h (class General_options): Add --unresolved-symbols.
3955 * target-reloc.h (issue_undefined_symbol_error): Check
3956 --unresolved-symbols. Add comments.
3957
3958 2011-07-08 Ian Lance Taylor <iant@google.com>
3959
3960 * testsuite/odr_violation2.cc (Ordering::operator()): Make
3961 expression more complex.
3962
3963 2011-07-08 Ian Lance Taylor <iant@google.com>
3964
3965 PR gold/11317
3966 * target-reloc.h (issue_undefined_symbol_error): New inline
3967 function, broken out of relocate_section.
3968 (relocate_section): Call issue_undefined_symbol_error.
3969 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3970 there is no TLS segment if we are about to issue an undefined
3971 symbol error.
3972 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3973
3974 2011-07-08 Ian Lance Taylor <iant@google.com>
3975
3976 PR gold/12279
3977 * resolve.cc (Symbol_table::should_override): Add fromtype
3978 parameter. Change all callers. Give error when linking together
3979 TLS and non-TLS symbol.
3980 (Symbol_table::should_override_with_special): Add fromtype
3981 parameter. Change all callers.
3982 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3983 there is no TLS segment if we have reported some errors.
3984 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3985
3986 2011-07-08 Ian Lance Taylor <iant@google.com>
3987
3988 PR gold/12372
3989 * target.h (Target::plt_address_for_global): New function.
3990 (Target::plt_address_for_local): New function.
3991 (Target::plt_section_for_global): Remove.
3992 (Target::plt_section_for_local): Remove.
3993 (Target::do_plt_address_for_global): New virtual function.
3994 (Target::do_plt_address_for_local): New virtual function.
3995 (Target::do_plt_section_for_global): Remove.
3996 (Target::do_plt_section_for_local): Remove.
3997 (Target::register_global_plt_entry): Add Symbol_table and Layout
3998 parameters.
3999 * output.cc (Output_data_got::Got_entry::write): Use
4000 plt_address_for_global and plt_address_for_local.
4001 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4002 address of output section.
4003 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4004 got_irelative_, and irelative_count_ fields. Update
4005 declarations.
4006 (Output_data_plt_i386::has_irelative_section): New function.
4007 (Output_data_plt_i386::entry_count): Add irelative_count_.
4008 (Output_data_plt_i386::set_final_data_size): Likewise.
4009 (class Target_i386): Add got_irelative_ and rel_irelative_
4010 fields. Update declarations.
4011 (Target_i386::Target_i386): Initialize new fields.
4012 (Target_i386::do_plt_address_for_global): New function replacing
4013 do_plt_section_for_global.
4014 (Target_i386::do_plt_address_for_local): New function replacing
4015 do_plt_section_for_local.
4016 (Target_i386::got_section): Create got_irelative_.
4017 (Target_i386::rel_irelative_section): New function.
4018 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4019 fields. Don't define __rel_iplt_{start,end}.
4020 (Output_data_plt_i386::add_entry): Add symtab and layout
4021 parameters. Change all callers. Use different PLT and GOT for
4022 IFUNC symbols.
4023 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4024 layout parameters. Change all callers. Use different PLT and
4025 GOT.
4026 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4027 (Output_data_plt_i386::rel_irelative): New function.
4028 (Output_data_plt_i386::address_for_global): New function.
4029 (Output_data_plt_i386::address_for_local): New function.
4030 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4031 IRELATIVE GOT when changing IFUNC GOT entries.
4032 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4033 reloc.
4034 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4035 if we didn't create an IRELATIVE GOT.
4036 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4037 plt_address_for_local.
4038 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4039 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4040 got_irelative_, and irelative_count_ fields. Update
4041 declarations.
4042 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4043 Initialize new fields. Remove symtab parameter. Change all
4044 callers.
4045 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4046 irelative_count_.
4047 (Output_data_plt_x86_64::has_irelative_section): New function.
4048 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4049 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4050 fields. Update declarations.
4051 (Target_x86_64::Target_x86_64): Initialize new fields.
4052 (Target_x86_64::do_plt_address_for_global): New function replacing
4053 do_plt_section_for_global.
4054 (Target_x86_64::do_plt_address_for_local): New function replacing
4055 do_plt_section_for_local.
4056 (Target_x86_64::got_section): Create got_irelative_.
4057 (Target_x86_64::rela_irelative_section): New function.
4058 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4059 all callers. Don't create __rel_iplt_{start,end}.
4060 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4061 parameters. Change all callers. Use different PLT and GOT for
4062 IFUNC symbols.
4063 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4064 layout parameters. Change all callers. Use different PLT and
4065 GOT.
4066 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4067 parameters. Change all callers. Use different PLT and GOT for
4068 IFUNC symbols.
4069 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4070 (Output_data_plt_x86_64::rela_irelative): New function.
4071 (Output_data_plt_x86_64::address_for_global): New function.
4072 (Output_data_plt_x86_64::address_for_local): New function.
4073 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4074 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4075 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4076 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4077 parameters.
4078 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4079 reloc.
4080 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4081 symbols if we didn't create an IRELATIVE GOT.
4082 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4083 plt_address_for_local.
4084 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4085 * testsuite/ifuncvar1.c: New test file.
4086 * testsuite/ifuncvar2.c: New test file.
4087 * testsuite/ifuncvar3.c: New test file.
4088 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4089 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4090 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4091 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4092 * testsuite/Makefile.in: Rebuild.
4093
4094 2011-07-07 Cary Coutant <ccoutant@google.com>
4095
4096 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4097 (two_file_test_1_ndebug.o): Likewise.
4098 (two_file_test_1b_ndebug.o): Likewise.
4099 (two_file_test_2_ndebug.o): Likewise.
4100 (two_file_test_main_ndebug.o): Likewise.
4101 (incremental_test_2): Link with no-debug versions.
4102
4103 2011-07-06 Cary Coutant <ccoutant@google.com>
4104
4105 * gold/incremental.cc
4106 (Output_section_incremental_inputs::write_info_blocks): Check for
4107 hidden and internal symbols.
4108
4109 2011-07-06 Cary Coutant <ccoutant@google.com>
4110
4111 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4112 Check disposition for startup file.
4113 (Incremental_inputs::report_command_line): Ignore
4114 --incremental-startup-unchanged option.
4115 * options.cc (General_options::parse_incremental_startup_unchanged):
4116 New function.
4117 (General_options::General_options): Initialize new data member.
4118 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4119 (General_options): Add --incremental-startup-unchanged option.
4120 (General_options::incremental_startup_disposition): New function.
4121 (General_options::incremental_startup_disposition_): New data member.
4122
4123 2011-07-06 Cary Coutant <ccoutant@google.com>
4124
4125 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4126 input file index to Script_info ctor.
4127 (Sized_incremental_binary::do_file_has_changed): Find the
4128 command-line argument for files named in scripts.
4129 * incremental.h (Script_info::Script_info): New ctor
4130 with input file index.
4131 (Script_info::input_file_index): New function.
4132 (Script_info::input_file_index_): New data member.
4133 (Incremental_binary::get_library): Add const.
4134 (Incremental_binary::get_script_info): Add const.
4135 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4136 * testsuite/Makefile.am (incremental_test_5): New test case.
4137 (incremental_test_6): New test case.
4138 * testsuite/Makefile.in: Regenerate.
4139
4140 2011-07-06 Cary Coutant <ccoutant@google.com>
4141
4142 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4143 debug output when command lines differ.
4144
4145 2011-07-06 Cary Coutant <ccoutant@google.com>
4146
4147 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4148 --incremental-patch option.
4149 * layout.cc (Free_list::allocate): Extend allocation beyond original
4150 end if enabled.
4151 (Layout::make_output_section): Mark sections that should get
4152 patch space.
4153 * options.cc (parse_percent): New function.
4154 * options.h (parse_percent): New function.
4155 (DEFINE_percent): New macro.
4156 (General_options): Add --incremental-patch option.
4157 * output.cc (Output_section::Output_section): Initialize new data
4158 members.
4159 (Output_section::add_input_section): Print section name when out
4160 of patch space.
4161 (Output_section::add_output_section_data): Likewise.
4162 (Output_section::set_final_data_size): Add patch space when
4163 doing --incremental-full.
4164 (Output_section::do_reset_address_and_file_offset): Remove patch
4165 space.
4166 (Output_segment::set_section_list_addresses): Print debug output
4167 only if --incremental-update.
4168 * output.h (Output_section::set_is_patch_space_allowed): New function.
4169 (Output_section::is_patch_space_allowed_): New data member.
4170 (Output_section::patch_space_): New data member.
4171 * parameters.cc (Parameters::incremental_full): New function.
4172 * parameters.h (Parameters::incremental_full): New function
4173 * testsuite/Makefile.am (incremental_test_2): Add test for
4174 --incremental-patch option.
4175 * testsuite/Makefile.in: Regenerate.
4176 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4177 (t18): Remove function body.
4178
4179 2011-07-05 Doug Kwan <dougkwan@google.com>
4180
4181 PR gold/12771
4182 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4183 Arm_Address type for relocation result.
4184 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4185 overflow check.
4186 (Arm_relocate_functions::abs32): Use unaligned access.
4187 (Arm_relocate_functions::rel32): Ditto.
4188 (Arm_relocate_functions::prel31): Ditto.
4189 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4190 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4191 static data relocations.
4192 * testsuite/Makefile.in: Regnerate.
4193 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4194
4195 2011-07-05 Ian Lance Taylor <iant@google.com>
4196
4197 PR gold/12392
4198 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4199 symbols if necessary.
4200 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4201
4202 2011-07-05 Ian Lance Taylor <iant@google.com>
4203
4204 PR gold/12952
4205 * resolve.cc (Symbol::override_base_with_special): Simply override
4206 version with special symbol version, ignoring previous version.
4207
4208 2011-07-05 Ian Lance Taylor <iant@google.com>
4209
4210 * object.cc (Sized_relobj_file::include_section_group): Add
4211 information to comment about signature location.
4212
4213 2011-07-02 Ian Lance Taylor <iant@google.com>
4214
4215 PR gold/12957
4216 * options.h (class General_options): Add -f and -F.
4217 * options.cc (General_options::finalize): Fatal error if -f/-F
4218 are used without -shared.
4219 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4220
4221 2011-07-02 Ian Lance Taylor <iant@google.com>
4222
4223 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4224
4225 2011-07-01 Ian Lance Taylor <iant@google.com>
4226
4227 PR gold/12525
4228 PR gold/12952
4229 * resolve.cc (Symbol::override_base_with_special): Don't override
4230 the version if the overriding symbol has a different name.
4231 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4232 all callers. If we give an error about an undefined version,
4233 define the base version if necessary.
4234 * dynobj.h (class Versions): Update declaration.
4235 * testsuite/weak_alias_test_5.cc: New file.
4236 * testsuite/weak_alias_test.script: New file.
4237 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4238 and versioned_alias have the right value, and call t2.
4239 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4240 weak_alias_test_5.so.
4241 (weak_alias_test_LDADD): Likewise.
4242 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4243 * testsuite/Makefile.in: Rebuild.
4244
4245 2011-07-01 Ian Lance Taylor <iant@google.com>
4246
4247 PR gold/12525
4248 * options.h (class General_options): Support -z notext.
4249 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4250 -Wl,-z,notext.
4251 (two_file_shared_nonpic.so): Likewise.
4252 (two_file_shared_mixed.so): Likewise.
4253 (two_file_shared_mixed_1.so): Likewise.
4254 (weak_undef_lib_nonpic.so): Likewise.
4255 (alt/weak_undef_lib_nonpic.so): Likewise.
4256 (tls_test_shared_nonpic.so): Likewise.
4257 * testsuite/Makefile.in: Rebuild.
4258
4259 2011-07-01 Ian Lance Taylor <iant@google.com>
4260
4261 PR gold/12525
4262 * configure.ac: Test whether static linking works, setting
4263 the automake conditional HAVE_STATIC.
4264 * testsuite/Makefile.am: Disable tests using -static if
4265 HAVE_STATIC is not true.
4266 * configure, testsuite/Makefile.in: Rebuild.
4267
4268 2011-07-01 Ian Lance Taylor <iant@google.com>
4269
4270 PR gold/12525
4271 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4272 Assert if we see DW_EH_PE_indirect.
4273 * target.h (Target::ehframe_datarel_base): New function.
4274 (Target::do_ehframe_datarel_base): New target function.
4275 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4276 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4277 function.
4278
4279 2011-07-01 Ian Lance Taylor <iant@google.com>
4280
4281 PR gold/12571
4282 * options.h (class General_options): Add
4283 --ld-generated-unwind-info.
4284 * ehframe.cc (Fde::write): Add address parameter. Change all
4285 callers. If associated with PLT, fill in address and size.
4286 (Cie::set_output_offset): Only add merge mapping if there is an
4287 object.
4288 (Cie::write): Add address parameter. Change all callers.
4289 (Eh_frame::add_ehframe_for_plt): New function.
4290 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4291 input_offset_ fields into union u_, with new plt field.
4292 (Fde::Fde): Adjust for new union field.
4293 (Fde::Fde) [Output_data version]: New constructor.
4294 (Fde::add_mapping): Only add merge mapping if there is an object.
4295 (class Cie): Update declarations.
4296 (class Eh_frame): Declare add_ehframe_for_plt.
4297 * layout.cc (Layout::layout_eh_frame): Break out code into
4298 make_eh_frame_section, and call it.
4299 (Layout::make_eh_frame_section): New function.
4300 (Layout::add_eh_frame_for_plt): New function.
4301 * layout.h (class Layout): Update declarations.
4302 * merge.cc (Merge_map::add_mapping): Add assertion.
4303 * i386.cc: Include "dwarf.h".
4304 (class Output_data_plt_i386): Make first_plt_entry,
4305 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4306 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4307 and plt_eh_frame_fde.
4308 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4309 boundary. Call add_eh_frame_for_plt if appropriate.
4310 * x86_64.cc: Include "dwarf.h".
4311 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4312 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4313 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4314 and plt_eh_frame_fde.
4315 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4316 appropriate.
4317
4318 2011-06-29 Ian Lance Taylor <iant@google.com>
4319
4320 PR gold/12629
4321 * object.cc (Sized_relobj_file::layout_section): Change shdr
4322 parameter to be const.
4323 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4324 out of do_layout.
4325 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4326 appropriate. Call layout_eh_frame_section.
4327 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4328 sections.
4329 * object.h (class Sized_relobj_file): Update declarations.
4330
4331 2011-06-29 Ian Lance Taylor <iant@google.com>
4332
4333 PR gold/12652
4334 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4335 modifier.
4336 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4337
4338 2011-06-29 Ian Lance Taylor <iant@google.com>
4339
4340 PR gold/12675
4341 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4342 SHT_X86_64_UNWIND.
4343 * layout.cc (Layout::layout_eh_frame): Likewise.
4344
4345 2011-06-29 Ian Lance Taylor <iant@google.com>
4346
4347 PR gold/12695
4348 * layout.cc (Layout::symtab_section_shndx): New function.
4349 * layout.h (class Layout): Declare symtab_section_shndx.
4350 * output.cc (Output_section::write_header): Call it.
4351
4352 2011-06-29 Ian Lance Taylor <iant@google.com>
4353
4354 PR gold/12818
4355 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4356 symbols which are not used in a relocation.
4357
4358 2011-06-28 Ian Lance Taylor <iant@google.com>
4359
4360 PR gold/12898
4361 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4362 script create indistinguishable segments.
4363 (Layout::set_segment_offsets): Use stable_sort when sorting
4364 segments. Pass this to Compare_segments constructor.
4365 * layout.h (class Layout): Make segment_precedes non-static.
4366 (class Compare_segments): Change from struct to class. Add
4367 layout_ field. Add constructor.
4368 * script-sections.cc
4369 (Script_sections::attach_sections_using_phdrs_clause): Rename
4370 local orphan to is_orphan. Don't report failure to put empty
4371 section in segment. On attachment failure, report name of
4372 section, and attach to first PT_LOAD segment.
4373
4374 2011-06-28 Ian Lance Taylor <iant@google.com>
4375
4376 PR gold/12934
4377 * target-select.cc (Target_selector::Target_selector): Add
4378 emulation parameter. Change all callers.
4379 (select_target_by_bfd_name): Rename from select_target_by_name.
4380 Change all callers.
4381 (select_target_by_emulation): New function.
4382 (supported_emulation_names): New function.
4383 * target-select.h (class Target_selector): Add emulation_ field.
4384 Update declarations.
4385 (Target_selector::recognize_by_bfd_name): Rename from
4386 recognize_by_name. Change all callers.
4387 (Target_selector::supported_bfd_names): Rename from
4388 supported_names. Change all callers.
4389 (Target_selector::recognize_by_emulation): New function.
4390 (Target_selector::supported_emulations): New function.
4391 (Target_selector::emulation): New function.
4392 (Target_selector::do_recognize_by_bfd_name): Rename from
4393 do_recognize_by_name. Change all callers.
4394 (Target_selector::do_supported_bfd_names): Rename from
4395 do_supported_names. Change all callers.
4396 (Target_selector::do_recognize_by_emulation): New function.
4397 (Target_selector::do_supported_emulations): New function.
4398 (select_target_by_bfd_name): Change name in declaration.
4399 (select_target_by_emulation): Declare.
4400 (supported_emulation_names): Declare.
4401 * parameters.cc (parameters_force_valid_target): Try to find
4402 target based on emulation from -m option.
4403 * options.h (class General_options): Change doc string for -m.
4404 * options.cc (help): Print emulations.
4405 (General_options::parse_V): Likewise.
4406 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4407 Add emulation parameter. Change all callers.
4408
4409 2011-06-28 Ian Lance Taylor <iant@google.com>
4410
4411 * target.h (class Target): Add osabi_ field.
4412 (Target::osabi): New function.
4413 (Target::set_osabi): New function.
4414 (Target::Target): Initialize osabi_.
4415 (Target::do_adjust_elf_header): Make pure virtual.
4416 (Sized_target::do_adjust_elf_header): Declare.
4417 * target.cc (Sized_target::do_adjust_elf_header): New function.
4418 (class Sized_target): Instantiate all versions.
4419 * freebsd.h (class Target_freebsd): Remove.
4420 (Target_selector_freebsd::do_recognize): Call set_osabi on
4421 Target.
4422 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4423 (Target_selector_freebsd::set_osabi): Remove.
4424 * i386.cc (class Target_i386): Inherit from Sized_target rather
4425 than Target_freebsd.
4426 * x86_64.cc (class Target_x86_64): Likewise.
4427
4428 2011-06-28 Ian Lance Taylor <iant@google.com>
4429
4430 * target.h (Target::can_check_for_function_pointers): Rewrite.
4431 Make non-virtual.
4432 (Target::can_icf_inline_merge_sections): Likewise.
4433 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4434 (Target::Target_info): Add can_icf_inline_merge_sections field.
4435 (Target::do_can_check_for_function_pointers): New virtual
4436 function.
4437 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4438 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4439 from can_check_for_function_pointers, move in file.
4440 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4441 section_may_have_icf_unsafe_poineters, move in file.
4442 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4443 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4444 Rename from can_check_for_function_pointers, move in file.
4445 (Target_i386::can_icf_inline_merge_sections): Remove.
4446 (Target_i386::i386_info): Initialize
4447 can_icf_inline_merge_sections.
4448 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4449 Initialize can_icf_inline_merge_sections.
4450 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4451 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4452 Rename from can_check_for_function_pointers, move in file.
4453 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4454 (Target_x86_64::x86_64_info): Initialize
4455 can_icf_inline_merge_sections.
4456 * testsuite/testfile.cc (Target_test::test_target_info):
4457 Likewise.
4458 * icf.cc (get_section_contents): Correct formatting.
4459
4460 2011-06-27 Ian Lance Taylor <iant@google.com>
4461
4462 * symtab.cc (Symbol::versioned_name): New function.
4463 (Symbol_table::add_to_final_symtab): Use versioned_name when
4464 appropriate.
4465 (Symbol_table::sized_write_symbol): Likewise.
4466 * symtab.h (class Symbol): Declare versioned_name.
4467 * stringpool.h (class Stringpool_template): Add variant of add
4468 which takes a std::basic_string.
4469 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4470 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4471 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4472 (ver_test_12.o): New target.
4473 * testsuite/Makefile.in: Rebuild.
4474
4475 2011-06-27 Doug Kwan <dougkwan@google.com>
4476
4477 * arm.cc (Arm_relocate_functions::thm_jump8,
4478 Arm_relocate_functions::thm_jump11): Use a wider signed
4479 type to compute offset.
4480 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4481 arm_thm_jump8.
4482 * testsuite/Makefile.in: Regenerate.
4483 * testsuite/arm_branch_in_range.sh: Check test results of
4484 arm_thm_jump11 and arm_thm_jump8.
4485 * testsuite/arm_thm_jump11.s: New test source file.
4486 * testsuite/arm_thm_jump11.t: New linker script.
4487 * testsuite/arm_thm_jump8.s: New test source file.
4488 * testsuite/arm_thm_jump8.t: New linker script.
4489
4490 2011-06-24 Ian Lance Taylor <iant@google.com>
4491
4492 * layout.cc: Include "object.h".
4493 (ctors_sections_in_init_array): New static variable.
4494 (Layout::is_ctors_in_init_array): New function.
4495 (Layout::layout): Add entry to ctors_sections_in_init_array if
4496 appropriate.
4497 * layout.h (class Layout): Declare is_ctors_in_init_array.
4498 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4499 is_ctors_reverse_view is set.
4500 (Sized_relobj_file::write_sections): Add layout parameter. Change
4501 all callers. Set is_ctors_reverse_view field of View_size.
4502 (Sized_relobj_file::reverse_words): New function.
4503 * object.h (Sized_relobj_file::View_size): Add
4504 is_ctors_reverse_view field.
4505 (class Sized_relobj_file): Update declarations.
4506 * testsuite/initpri3.c: New test.
4507 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4508 initpri3b.
4509 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4510 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4511 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4512 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4513 * testsuite/Makefile.in: Rebuild.
4514
4515 2011-06-24 Cary Coutant <ccoutant@google.com>
4516
4517 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4518 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4519 (debug_msg_cdebug.err): New targets.
4520 * testsuite/Makefile.in: Regenerate.
4521 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4522 Fix checks for link with shared library.
4523
4524 2011-06-24 Doug Kwan <dougkwan@google.com>
4525
4526 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4527 skip empty text sections.
4528 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4529
4530 2011-06-22 Ian Lance Taylor <iant@google.com>
4531
4532 PR gold/12910
4533 * options.h (class General_options): Add --ctors-in-init-array.
4534 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4535 friends as SHT_PROGBITS for merging sections.
4536 (Layout::layout): Remove special handling of .init_array and
4537 friends. Don't sort if doing relocatable link. Sort for .ctors
4538 and .dtors if ctors_in_init_array.
4539 (Layout::make_output_section): Force correct section types for
4540 .init_array and friends. Don't sort if doing relocatable link,
4541 Don't sort .ctors and .dtors if ctors_in_init_array.
4542 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4543 (Layout::output_section_name): Add relobj parameter. Change all
4544 callers. Handle .ctors. and .dtors. in code rather than table.
4545 Handle .ctors and .dtors if ctors_in_init_array.
4546 (Layout::match_file_name): New function, moved from output.cc.
4547 * layout.h (class Layout): Update declarations.
4548 * output.cc: Include "layout.h".
4549 (Input_section_sort_entry::get_priority): New function.
4550 (Input_section_sort_entry::match_file_name): Just call
4551 Layout::match_file_name.
4552 (Output_section::Input_section_sort_init_fini_compare::operator()):
4553 Handle .ctors and .dtors. Sort by explicit priority rather than
4554 by name.
4555 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4556 * testsuite/initpri2.c: New test.
4557 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4558 (check_PROGRAMS): Add initpri2.
4559 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4560 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4561 * configure, testsuite/Makefile.in: Rebuild.
4562
4563 2011-06-19 Ian Lance Taylor <iant@google.com>
4564
4565 PR gold/12880
4566 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4567 .interp section to a PT_INTERP segment even if we have seen a
4568 --dynamic-linker option. Don't do it if we have seen a PHDRS
4569 clause in a linker script.
4570 (Layout::finalize): Don't create a .interp section if we've
4571 already create a PT_INTERP segment.
4572 (Layout::create_interp): Always call choose_output_section (revert
4573 patch of 2011-06-17). Don't create PT_INTERP segment.
4574 * script-sections.cc
4575 (Script_sections::create_note_and_tls_segments): Add a .interp
4576 section to a PT_INTERP segment even if we have seen a
4577 --dynamic-linker option.
4578
4579 2011-06-18 Ian Lance Taylor <iant@google.com>
4580
4581 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
4582 merely because a non-PT_LOAD segment has a dynamic reloc.
4583
4584 2011-06-18 Ian Lance Taylor <iant@google.com>
4585
4586 * layout.cc (Layout::finish_dynamic_section): Don't create
4587 DT_FLAGS entry if not needed.
4588
4589 2011-06-18 Ian Lance Taylor <iant@google.com>
4590
4591 PR gold/12745
4592 * layout.cc (Layout::layout_eh_frame): Correct handling of
4593 writable .eh_frame section.
4594
4595 2011-06-17 Ian Lance Taylor <iant@google.com>
4596
4597 PR gold/12893
4598 * resolve.cc (Symbol_table::resolve): Don't give an error if a
4599 symbol is redefined with the exact same object and value.
4600
4601 2011-06-17 Ian Lance Taylor <iant@google.com>
4602
4603 PR gold/12880
4604 * layout.h (class Layout): Add interp_segment_ field.
4605 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
4606 (Layout::attach_allocated_section_to_segment): If making shared
4607 library, put .interp section in PT_INTERP segment.
4608 (Layout::finalize): Also call create_interp if -dynamic-linker
4609 option was used.
4610 (Layout::create_interp): Assert that there is no PT_INTERP
4611 segment. If not using a SECTIONS clause, use make_output_section.
4612 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
4613 * script-sections.cc
4614 (Script_sections::create_note_and_tls_segments): If making shared
4615 library, put .interp section in PT_INTERP segment.
4616
4617 2011-06-17 Ian Lance Taylor <iant@google.com>
4618
4619 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
4620 when making a shared library.
4621
4622 2011-06-17 Ian Lance Taylor <iant@google.com>
4623
4624 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
4625 parameter. Change all callers. Don't issue warning about PC32
4626 against locally defined symbol.
4627
4628 2011-06-16 Ian Lance Taylor <iant@google.com>
4629
4630 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
4631 occurs in same object.
4632
4633 2011-06-14 Alan Modra <amodra@gmail.com>
4634
4635 * po/POTFILES.in: Regenerate.
4636
4637 2011-06-09 Ian Lance Taylor <iant@google.com>
4638
4639 * script-sections.cc
4640 (Orphan_output_section::set_section_addresses): For a relocatable
4641 link set address to 0.
4642
4643 2011-06-09 Cary Coutant <ccoutant@google.com>
4644
4645 PR gold/12804
4646 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
4647 used with --compress-debug-sections.
4648 * gold/object.cc (Sized_relobj_file::do_layout): Report
4649 uncompressed size of compressed input sections.
4650
4651 2011-06-08 Cary Coutant <ccoutant@google.com>
4652
4653 PR gold/12804
4654 * testsuite/two_file_test_2_v1.cc: Change initialization of
4655 v2 to keep it in .data.
4656
4657 2011-06-07 Cary Coutant <ccoutant@google.com>
4658
4659 * common.cc (Symbol_table::do_allocate_commons_list): Call
4660 gold_fallback.
4661 * errors.cc (Errors::fatal): Adjust call to gold_exit.
4662 (Errors::fallback): New function.
4663 (gold_fallback): New function.
4664 * errors.h (Errors::fallback): New function.
4665 * gold.cc (gold_exit): Change status parameter to enum; adjust
4666 all callers.
4667 (queue_initial_tasks): Call gold_fallback.
4668 * gold.h: Include cstdlib.
4669 (Exit_status): New enum type.
4670 (gold_exit): Change status parameter to enum.
4671 (gold_fallback): New function.
4672 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
4673 (Layout::create_symtab_sections): Likewise.
4674 (Layout::create_shdrs): Likewise.
4675 * main.cc (main): Adjust call to gold_exit.
4676 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
4677 (Output_data_got::add_got_entry_pair): Likewise.
4678 (Output_section::add_input_section): Likewise.
4679 (Output_section::add_output_section_data): Likewise.
4680 (Output_segment::set_section_list_addresses): Likewise.
4681 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
4682
4683 2011-06-07 Cary Coutant <ccoutant@google.com>
4684
4685 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
4686 for incremental links.
4687 * output.cc (Output_segment::set_section_list_addresses): Remove
4688 FIXME and test for TLS or BSS.
4689
4690 2011-06-07 Cary Coutant <ccoutant@google.com>
4691
4692 * testsuite/Makefile.am: Add incremental_copy_test,
4693 incremental_common_test_1.
4694 * testsuite/Makefile.in: Regenerate.
4695 * testsuite/common_test_1_v1.c: New source file.
4696 * testsuite/common_test_1_v2.c: New source file.
4697 * testsuite/copy_test_v1.cc: New source file.
4698
4699 2011-06-07 Cary Coutant <ccoutant@google.com>
4700
4701 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
4702 update, allocate common from bss section's free list.
4703 * incremental-dump.cc (dump_incremental_inputs): Print flag for
4704 linker-defined symbols.
4705 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4706 Skip GOT and PLT entries that are no longer referenced.
4707 (Output_section_incremental_inputs::write_info_blocks): Mark
4708 linker-defined symbols.
4709 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
4710 * output.cc (Output_section::allocate): New function.
4711 * output.h (Output_section::allocate): New function.
4712 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
4713 linker-defined symbols.
4714 (Symbol::override_base_with_special): Copy is_predefined_ flag.
4715 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
4716 (Symbol::init_base_output_data): Likewise.
4717 (Symbol::init_base_output_segment): Likewise.
4718 (Symbol::init_base_constant): Likewise.
4719 (Sized_symbol::init_output_data): Likewise.
4720 (Sized_symbol::init_output_segment): Likewise.
4721 (Sized_symbol::init_constant): Likewise.
4722 (Symbol_table::do_define_in_output_data): Likewise.
4723 (Symbol_table::do_define_in_output_segment): Likewise.
4724 (Symbol_table::do_define_as_constant): Likewise.
4725 * symtab.h (Symbol::is_predefined): New function.
4726 (Symbol::init_base_output_data): Add is_predefined parameter.
4727 (Symbol::init_base_output_segment): Likewise.
4728 (Symbol::init_base_constant): Likewise.
4729 (Symbol::is_predefined_): New data member.
4730 (Sized_symbol::init_output_data): Add is_predefined parameter.
4731 (Sized_symbol::init_output_segment): Likewise.
4732 (Sized_symbol::init_constant): Likewise.
4733 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
4734
4735 2011-06-07 Cary Coutant <ccoutant@google.com>
4736
4737 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
4738 instead of emit_copy_reloc.
4739 (Copy_relocs::emit_copy_reloc): Refactor.
4740 (Copy_relocs::make_copy_reloc): New function.
4741 (Copy_relocs::add_copy_reloc): Remove.
4742 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
4743 section.
4744 (Copy_relocs::make_copy_reloc): New function.
4745 (Copy_relocs::add_copy_reloc): Remove.
4746 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
4747 unchanged input files.
4748 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
4749 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
4750 Reserve BSS space for COPY relocations.
4751 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4752 (Output_section_incremental_inputs::write_info_blocks): Record
4753 whether a symbol is copied from a shared object.
4754 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
4755 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
4756 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
4757 (Incremental_input_entry_reader::get_output_symbol_index): Add
4758 is_copy parameter.
4759 (Incremental_binary::emit_copy_relocs): New function.
4760 (Incremental_binary::do_emit_copy_relocs): New function.
4761 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4762 new data member.
4763 (Sized_incremental_binary::add_copy_reloc): New function.
4764 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4765 (Sized_incremental_binary::Copy_reloc): New struct.
4766 (Sized_incremental_binary::Copy_relocs): New typedef.
4767 (Sized_incremental_binary::copy_relocs_): New data member.
4768 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
4769 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
4770 * target.h (Sized_target::emit_copy_reloc): New function.
4771 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
4772
4773 2011-06-02 Cary Coutant <ccoutant@google.com>
4774
4775 PR gold/12163
4776 * gold/archive.cc (Archive::Archive): Initialize new data member.
4777 (Archive::include_all_members): Return if archive has already been
4778 included.
4779 * gold/archive.h (Archive::include_all_members_): New data member.
4780
4781 2011-06-02 Nick Clifton <nickc@redhat.com>
4782
4783 * dynobj.h: Fix spelling mistake in comment.
4784 * output.cc: Likewise.
4785
4786 2011-05-31 Doug Kwan <dougkwan@google.com>
4787 Asier Llano
4788
4789 PR gold/12826
4790 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
4791 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4792 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4793 redundant arm_exidx_test.so.
4794 * testsuite/Makefile.in: Regenerate.
4795 (check_SCRIPTS): Add pr12826.sh
4796 (check_DATA): Add pr12826.stdout
4797 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4798 * testsuite/pr12826.sh: New file.
4799 * testsuite/pr12826_1.s: Ditto.
4800 * testsuite/pr12826_1.s: Ditto.
4801
4802 2011-05-30 Ian Lance Taylor <iant@google.com>
4803
4804 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4805 sections.
4806
4807 2011-05-29 Ian Lance Taylor <iant@google.com>
4808
4809 PR gold/12804
4810 * testsuite/Makefile.am: Use different file name for two_file_test
4811 temporary file for each incremental test.
4812 * testsuite/Makefile.in: Rebuild.
4813
4814 2011-05-29 Ian Lance Taylor <iant@google.com>
4815
4816 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4817 binary input file is empty.
4818
4819 2011-05-27 Ian Lance Taylor <iant@google.com>
4820
4821 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4822 (ver_test_9.so): Likewise.
4823 * testsuite/Makefile.in: Rebuild.
4824
4825 2011-05-26 Cary Coutant <ccoutant@google.com>
4826
4827 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4828 * incremental.cc (Incremental_inputs::report_input_section): Fix
4829 comment, indentation.
4830 (Incremental_inputs::report_comdat_group): New function.
4831 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4832 of data for incremental input file entry.
4833 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
4834 group count, COMDAT group signatures.
4835 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
4836 an unchanged input file.
4837 * incremental.h (Incremental_object_entry::Incremental_object_entry):
4838 Initialize new data member.
4839 (Incremental_object_entry::add_comdat_group): New function.
4840 (Incremental_object_entry::get_comdat_group_count): New function.
4841 (Incremental_object_entry::get_comdat_signature_key): New function.
4842 (Incremental_object_entry::groups_): New data member.
4843 (Incremental_inputs::report_comdat_group): New function.
4844 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
4845 data for incremental input file entry.
4846 (Incremental_input_entry_reader::get_comdat_group_count): New function.
4847 (Incremental_input_entry_reader::get_input_section): Adjust size of
4848 data for incremental input file entry.
4849 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
4850 (Incremental_input_entry_reader::get_comdat_group_signature): New
4851 function.
4852 * object.cc (Sized_relobj::include_section_group): Report kept
4853 COMDAT groups for incremental links.
4854
4855 2011-05-24 David Meyer <pdox@google.com>
4856
4857 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
4858 with name parameter. Add found_name parameter.
4859 * fileread.cc (Input_file::find_file): Adjust code accordingly.
4860 * dirsearch.h (class Dirsearch): Update declaration.
4861
4862 2011-05-24 Ian Lance Taylor <iant@google.com>
4863
4864 * archive.cc (Library_base::should_include_member): Pull in object
4865 from archive if it defines the entry symbol.
4866 * parameters.cc (Parameters::entry): New function.
4867 * parameters.h (class Parameters): Declare entry.
4868 * output.h (class Output_file_header): Remove entry_ field.
4869 * output.cc (Output_file_header::Output_file_header): Remove entry
4870 parameter. Change all callers.
4871 (Output_file_header::entry): Use parameters->entry.
4872 * gold.cc (queue_middle_tasks): Likewise.
4873 * plugin.cc (Plugin_hook::run): Likewise.
4874
4875 2011-05-24 Cary Coutant <ccoutant@google.com>
4876
4877 * gold.cc (queue_initial_tasks): Pass incremental base filename
4878 to Output_file::open_base_file; don't print error message.
4879 * incremental-dump.cc (main): Adjust call to
4880 Output_file::open_for_modification.
4881 * incremental-dump.cc (main): Likewise.
4882 * incremental.cc (Incremental_inputs::report_command_line):
4883 Ignore --incremental-base option when comparing command lines.
4884 Ignore parameter when given as separate argument.
4885 * options.h (class General_options): Add --incremental-base.
4886 * output.cc (Output_file::Output_file):
4887 (Output_file::open_base_file): Add base_name and writable parameters;
4888 read base file into new file; print error message here.
4889 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4890 callers.
4891 * output.h (Output_file::open_for_modification): Rename to...
4892 (Output_file::open_base_file): ...this; add base_name and
4893 writable parameters; adjust all callers.
4894 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4895 callers.
4896 * testsuite/Makefile.am (incremental_test_4): Test
4897 --incremental-base.
4898 * testsuite/Makefile.in: Regenerate.
4899
4900 2011-05-24 Cary Coutant <ccoutant@google.com>
4901
4902 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
4903 incremental_test_4.
4904 * testsuite/Makefile.in: Regenerate.
4905 * testsuite/two_file_test_1_v1.cc: New test source file.
4906 * testsuite/two_file_test_1b_v1.cc: New test source file.
4907 * testsuite/two_file_test_2_v1.cc: New test source file.
4908
4909 2011-05-24 Cary Coutant <ccoutant@google.com>
4910
4911 * dynobj.h (Dynobj::do_dynobj): New function.
4912 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
4913 flag and soname for shared objects.
4914 * incremental.cc (Incremental_inputs::report_object): Make
4915 either Incremental_object_entry or Incremental_dynobj_entry; add
4916 soname to string table.
4917 (Incremental_inputs::report_input_section): Add assertion.
4918 (Output_section_incremental_inputs::set_final_data_size): Adjust
4919 type of input file entry for shared libraries; adjust size of
4920 shared library info entry.
4921 (Output_section_incremental_inputs::write_input_files): Write
4922 as_needed flag for shared libraries.
4923 (Output_section_incremental_inputs::write_info_blocks): Adjust type
4924 of input file entry for shared libraries; write soname.
4925 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
4926 soname from incremental info.
4927 * incremental.h (enum Incremental_input_flags): Add
4928 INCREMENTAL_INPUT_AS_NEEDED.
4929 (Incremental_input_entry::Incremental_input_entry): Initialize new
4930 data member.
4931 (Incremental_input_entry::set_as_needed): New function.
4932 (Incremental_input_entry::as_needed): New function.
4933 (Incremental_input_entry::do_dynobj_entry): New function.
4934 (Incremental_input_entry::as_needed_): New data member.
4935 (Incremental_object_entry::Incremental_object_entry): Don't check
4936 for shared library.
4937 (Incremental_object_entry::do_type): Likewise.
4938 (class Incremental_dynobj_entry): New class.
4939 (Incremental_input_entry_reader::as_needed): New function.
4940 (Incremental_input_entry_reader::get_soname): New function.
4941 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
4942 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
4943 size of shared library info entry.
4944 * layout.cc (Layout::finish_dynamic_section): Don't test for
4945 incremental link when adding DT_NEEDED entries.
4946 * object.h (Object::Object): Initialize new data member.
4947 (Object::dynobj): New function.
4948 (Object::set_as_needed): New function.
4949 (Object::as_needed): New function.
4950 (Object::do_dynobj): New function.
4951 (Object::as_needed_): New data member.
4952
4953 2011-05-24 Cary Coutant <ccoutant@google.com>
4954
4955 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
4956 info; adjust display of GOT entries.
4957 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4958 vector of input objects; remove file_status_.
4959 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
4960 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
4961 got_plt reader; call target hooks to reserve GOT entries.
4962 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4963 of input file info header and GOT info entry.
4964 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
4965 relocation info.
4966 (Got_plt_view_info::got_descriptor): Remove.
4967 (Got_plt_view_info::sym_index): New data member.
4968 (Got_plt_view_info::input_index): New data member.
4969 (Local_got_offset_visitor::visit): Write input file index.
4970 (Global_got_offset_visitor::visit): Write 0 for input file index.
4971 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
4972 with sym_index and input_index.
4973 (Output_section_incremental_inputs::write_got_plt): Adjust size of
4974 incremental info GOT entry; replace got_descriptor with input_index.
4975 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
4976 map from input file index to object.
4977 (Sized_relobj_incr::do_layout): Replace direct data member reference
4978 with accessor function.
4979 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
4980 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
4981 Adjust size of input file info header.
4982 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
4983 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
4984 (Incremental_input_entry_reader::get_input_section): Adjust size of
4985 input file info header.
4986 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
4987 of incremental info GOT entry.
4988 (Incremental_got_plt_reader::get_got_desc): Remove.
4989 (Incremental_got_plt_reader::get_got_symndx): New function.
4990 (Incremental_got_plt_reader::get_got_input_index): New function.
4991 (Sized_incremental_binary::Sized_incremental_binary): Remove
4992 file_status_; add input_objects_.
4993 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
4994 (Sized_incremental_binary::set_file_is_unchanged): Remove.
4995 (Sized_incremental_binary::file_is_unchanged): Remove.
4996 (Sized_incremental_binary::set_input_object): New function.
4997 (Sized_incremental_binary::input_object): New function.
4998 (Sized_incremental_binary::file_status_): Remove.
4999 (Sized_incremental_binary::input_objects_): New data member.
5000 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5001 references.
5002 (Sized_relobj_incr::invalid_address): Move to base class.
5003 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5004 class.
5005 (Sized_relobj_incr::do_output_section_offset): Likewise.
5006 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5007 (Sized_relobj_incr::section_offsets_): Likewise.
5008 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5009 function.
5010 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5011 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5012 with accessor function.
5013 (Sized_relobj_file::do_layout): Likewise.
5014 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5015 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5016 (Sized_relobj_file::compute_final_local_value): Replace refs to
5017 section_offsets_ with accessor function.
5018 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5019 * object.h (Relobj::Relobj): Initialize new data members.
5020 (Relobj::add_dyn_reloc): New function.
5021 (Relobj::first_dyn_reloc): New function.
5022 (Relobj::dyn_reloc_count): New function.
5023 (Relobj::first_dyn_reloc_): New data member.
5024 (Relobj::dyn_reloc_count_): New data member.
5025 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5026 references.
5027 (Sized_relobj::Address): New typedef.
5028 (Sized_relobj::invalid_address): Move here from child class.
5029 (Sized_relobj::Sized_relobj): Initialize new data members.
5030 (Sized_relobj::sized_relobj): New function.
5031 (Sized_relobj::is_output_section_offset_invalid): Move here from
5032 child class.
5033 (Sized_relobj::get_output_section_offset): Likewise.
5034 (Sized_relobj::local_has_got_offset): Likewise.
5035 (Sized_relobj::local_got_offset): Likewise.
5036 (Sized_relobj::set_local_got_offset): Likewise.
5037 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5038 (Sized_relobj::clear_got_offsets): New function.
5039 (Sized_relobj::section_offsets): Move here from child class.
5040 (Sized_relobj::do_output_section_offset): Likewise.
5041 (Sized_relobj::do_set_section_offset): Likewise.
5042 (Sized_relobj::Local_got_offsets): Likewise.
5043 (Sized_relobj::local_got_offsets_): Likewise.
5044 (Sized_relobj::section_offsets_): Likewise.
5045 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5046 references.
5047 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5048 class.
5049 (Sized_relobj_file::sized_relobj): New function
5050 (Sized_relobj_file::local_has_got_offset): Move to base class.
5051 (Sized_relobj_file::local_got_offset): Likewise.
5052 (Sized_relobj_file::set_local_got_offset): Likewise.
5053 (Sized_relobj_file::get_output_section_offset): Likewise.
5054 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5055 (Sized_relobj_file::do_output_section_offset): Likewise.
5056 (Sized_relobj_file::do_set_section_offset): Likewise.
5057 (Sized_relobj_file::Local_got_offsets): Likewise.
5058 (Sized_relobj_file::local_got_offsets_): Likewise.
5059 (Sized_relobj_file::section_offsets_): Likewise.
5060 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5061 (all constructors).
5062 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5063 (Output_reloc::get_symbol_index): Likewise.
5064 (Output_reloc::local_section_offset): Likewise.
5065 (Output_reloc::get_address): Likewise.
5066 (Output_reloc::symbol_value): Likewise.
5067 (Output_data_got::reserve_slot): Move to class definition.
5068 (Output_data_got::reserve_local): New function.
5069 (Output_data_got::reserve_slot_for_global): Remove.
5070 (Output_data_got::reserve_global): New function.
5071 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5072 (all constructors, two instantiations).
5073 (Output_reloc::get_relobj): New function (two instantiations).
5074 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5075 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5076 (Output_data_reloc::add_global): Adjust type of relobj.
5077 (Output_data_reloc::add_global_relative): Likewise.
5078 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5079 (Output_data_reloc::add_local): Likewise.
5080 (Output_data_reloc::add_local_relative): Likewise.
5081 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5082 (Output_data_reloc::add_local_section): Likewise.
5083 (Output_data_reloc::add_output_section): Likewise.
5084 (Output_data_reloc::add_absolute): Likewise.
5085 (Output_data_reloc::add_target_specific): Likewise.
5086 (Output_data_got::reserve_slot): Move definition here.
5087 (Output_data_got::reserve_local): New function.
5088 (Output_data_got::reserve_global): New function.
5089 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5090 section_offsets_ with accessor function.
5091 (Sized_relobj_file::write_sections): Likewise.
5092 (Sized_relobj_file::do_relocate_sections): Likewise.
5093 * target.h (Sized_target::reserve_local_got_entry): New function.
5094 (Sized_target::reserve_global_got_entry): New function.
5095 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5096 (Target_x86_64::reserve_global_got_entry): New function.
5097 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5098
5099 2011-05-23 Cary Coutant <ccoutant@google.com>
5100
5101 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5102 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5103 bit when checking got_type.
5104 * incremental.cc (Sized_incremental_binary::setup_readers):
5105 Store symbol table and string table locations; initialize bit vector
5106 of file status flags.
5107 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5108 unchanged files.
5109 (Sized_incremental_binary::do_process_got_plt): New function.
5110 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5111 (Output_section_incremental_inputs::set_final_data_size): Record
5112 file index for each input file.
5113 (Output_section_incremental_inputs::write_got_plt): Store file index
5114 instead of input entry offset for each GOT entry.
5115 * incremental.h
5116 (Incremental_input_entry::Incremental_input_entry): Initialize new
5117 data member.
5118 (Incremental_input_entry::set_offset): Store file index.
5119 (Incremental_input_entry::get_file_index): New function.
5120 (Incremental_input_entry::file_index_): New data member.
5121 (Incremental_binary::process_got_plt): New function.
5122 (Incremental_binary::do_process_got_plt): New function.
5123 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5124 data members.
5125 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5126 (Sized_incremental_binary::set_file_is_unchanged): New function.
5127 (Sized_incremental_binary::file_is_unchanged): New function.
5128 (Sized_incremental_binary::do_process_got_plt): New function.
5129 (Sized_incremental_binary::file_status_): New data member.
5130 (Sized_incremental_binary::main_symtab_loc_): New data member.
5131 (Sized_incremental_binary::main_strtab_loc_): New data member.
5132 * output.cc (Output_data_got::Got_entry::write): Add case
5133 RESERVED_CODE.
5134 (Output_data_got::add_global): Call add_got_entry.
5135 (Output_data_got::add_global_plt): Likewise.
5136 (Output_data_got::add_global_with_rel): Likewise.
5137 (Output_data_got::add_global_with_rela): Likewise.
5138 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5139 (Output_data_got::add_global_pair_with_rela): Likewise.
5140 (Output_data_got::add_local): Call add_got_entry.
5141 (Output_data_got::add_local_plt): Likewise.
5142 (Output_data_got::add_local_with_rel): Likewise.
5143 (Output_data_got::add_local_with_rela): Likewise.
5144 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5145 (Output_data_got::add_local_pair_with_rela): Likewise.
5146 (Output_data_got::reserve_slot): New function.
5147 (Output_data_got::reserve_slot_for_global): New function.
5148 (Output_data_got::add_got_entry): New function.
5149 (Output_data_got::add_got_entry_pair): New function.
5150 (Output_section::add_output_section_data): Edit FIXME.
5151 * output.h
5152 (Output_section_data_build::Output_section_data_build): New
5153 constructor with size parameter.
5154 (Output_data_space::Output_data_space): Likewise.
5155 (Output_data_got::Output_data_got): Initialize new data member; new
5156 constructor with size parameter.
5157 (Output_data_got::add_constant): Call add_got_entry.
5158 (Output_data_got::reserve_slot): New function.
5159 (Output_data_got::reserve_slot_for_global): New function.
5160 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5161 (Output_data_got::add_got_entry): New function.
5162 (Output_data_got::add_got_entry_pair): New function.
5163 (Output_data_got::free_list_): New data member.
5164 * target.h (Sized_target::init_got_plt_for_update): New function.
5165 (Sized_target::register_global_plt_entry): New function.
5166 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5167 Initialize new data member; call init; add constructor with PLT count.
5168 (Output_data_plt_x86_64::init): New function.
5169 (Output_data_plt_x86_64::add_relocation): New function.
5170 (Output_data_plt_x86_64::reserve_slot): New function.
5171 (Output_data_plt_x86_64::free_list_): New data member.
5172 (Target_x86_64::init_got_plt_for_update): New function.
5173 (Target_x86_64::register_global_plt_entry): New function.
5174 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5175 incremental updates.
5176 (Output_data_plt_x86_64::add_relocation): New function.
5177 * testsuite/object_unittest.cc (Object_test): Set default options.
5178
5179 2011-05-16 Ian Lance Taylor <iant@google.com>
5180
5181 * options.h (class General_options): Make -i a synonym for -r.
5182
5183 2011-05-16 Ian Lance Taylor <iant@google.com>
5184
5185 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5186
5187 2011-05-10 Cary Coutant <ccoutant@google.com>
5188
5189 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5190 strip_all (-s).
5191
5192 2011-05-06 Ian Lance Taylor <iant@google.com>
5193
5194 * layout.cc (Layout::layout): If the output section flags change,
5195 update the ordering.
5196
5197 2011-04-25 Cary Coutant <ccoutant@google.com>
5198
5199 * incremental-dump.cc (dump_incremental_inputs): Print local
5200 symbol info for each input file.
5201 * incremental.cc
5202 (Output_section_incremental_inputs::set_final_data_size): Add local
5203 symbol info to input file entries in incremental info.
5204 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5205 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5206 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5207 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5208 implementation.
5209 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5210 (Sized_incr_relobj::do_relocate): Write the local symbols.
5211 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5212 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5213 Adjust size of input file header.
5214 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5215 (Incremental_inputs_reader::get_local_symbol_count): New function.
5216 (Incremental_inputs_reader::get_input_section): Adjust size of input
5217 file header.
5218 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5219 (Sized_incr_relobj::This): New typedef.
5220 (Sized_incr_relobj::sym_size): New const data member.
5221 (Sized_incr_relobj::Local_symbol): New struct.
5222 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5223 (Sized_incr_relobj::do_local_symbol_offset): New function.
5224 (Sized_incr_relobj::local_symbol_count_): New data member.
5225 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5226 (Sized_incr_relobj::local_symbol_index_): New data member.
5227 (Sized_incr_relobj::local_symbol_offset_): New data member.
5228 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5229 (Sized_incr_relobj::local_symbols_): New data member.
5230 * object.h (Relobj::output_local_symbol_count): New function.
5231 (Relobj::local_symbol_offset): New function.
5232 (Relobj::do_output_local_symbol_count): New function.
5233 (Relobj::do_local_symbol_offset): New function.
5234 (Sized_relobj::do_output_local_symbol_count): New function.
5235 (Sized_relobj::do_local_symbol_offset): New function.
5236
5237 2011-04-22 Vladimir Simonov <sv@sw.ru>
5238
5239 * descriptors.cc (set_close_on_exec): New function.
5240 (Descriptors::open): Use set_close_on_exec.
5241 * output.cc (S_ISLNK): Define if not defined.
5242
5243 2011-04-22 Cary Coutant <ccoutant@google.com>
5244
5245 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5246 global symbol map.
5247 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5248 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5249 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5250 relocations.
5251 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5252 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5253 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5254 * incremental.h
5255 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5256 function.
5257 (Incremental_binary::apply_incremental_relocs): New function.
5258 (Incremental_binary::do_apply_incremental_relocs): New function.
5259 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5260 data member.
5261 (Sized_incremental_binary::add_global_symbol): New function.
5262 (Sized_incremental_binary::global_symbol): New function.
5263 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5264 (Sized_incremental_binary::symbol_map_): New data member.
5265 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5266 * target.h (Sized_target::apply_relocation): New function.
5267 * target-reloc.h (apply_relocation): New function.
5268 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5269
5270 2011-04-22 Doug Kwan <dougkwan@google.com>
5271
5272 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5273 flag of a SHT_ARM_EXIDX section.
5274 * testsuite/Makefile.am (arm_exidx_test): New test rules.
5275 * testsuite/Makefile.in: Regenerate.
5276 * testsuite/arm_exidx_test.s: New file.
5277 * testsuite/arm_exidx_test.sh: Same.
5278
5279 2011-04-20 Cary Coutant <ccoutant@google.com>
5280
5281 PR gold/12689
5282 * archive.h (Incremental_archive_entry::Archive_member):
5283 Initialize arg_serial_ (second constructor).
5284
5285 2011-04-17 Ian Lance Taylor <iant@google.com>
5286
5287 * object.cc (Relocate_info::location): Simplify location string.
5288 * errors.cc (Errors::error_at_location): Don't print program
5289 name.
5290 (Errors::warning_at_location): Likewise.
5291 (Errors::undefined_symbol): Likewise.
5292 * testsuite/debug_msg.sh: Update accordingly.
5293
5294 2011-04-14 Cary Coutant <ccoutant@google.com>
5295
5296 * gold/layout.cc (Layout::symtab_section_offset): New function.
5297 * gold/layout.h (Layout::symtab_section_offset): New function.
5298 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5299
5300 2011-04-12 Ian Lance Taylor <iant@google.com>
5301
5302 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5303 with MREMAP_MAYMOVE.
5304 * output.h (class Output_file): Add map_is_allocated_ field.
5305 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5306 not available, provide stubs. If mremap is not available, #define
5307 it to gold_mremap.
5308 (MREMAP_MAYMOVE): Define if not defined.
5309 (Output_file::Output_file): Initialize map_is_allocated_.
5310 (Output_file::resize): Check map_is_allocated_.
5311 (Output_file::map_anonymous): If mmap fails, use malloc.
5312 (Output_file::unmap): Don't do anything for an anonymous map.
5313 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5314 is not available, provide stubs.
5315 (File_read::View::~View): Use free rather than delete[].
5316 (File_read::make_view): Use malloc rather than new[]. If mmap
5317 fails, use malloc.
5318 (File_read::find_or_make_view): Use malloc rather than new[].
5319 * gold.h: Remove HAVE_REMAP code.
5320 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5321 exists. Rename mremap to gold_mremap. If mmap is not available
5322 don't do anything.
5323 * configure, config.in: Rebuild.
5324
5325 2011-04-11 Ian Lance Taylor <iant@google.com>
5326
5327 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5328 initialize local variable v.
5329
5330 2011-04-11 Cary Coutant <ccoutant@google.com>
5331
5332 * archive.cc (Archive::include_member): Adjust call to
5333 report_object.
5334 (Add_archive_symbols::run): Track argument serial numbers.
5335 (Lib_group::include_member): Likewise.
5336 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5337 * archive.h (Incremental_archive_entry::Archive_member):
5338 Initialize arg_serial_.
5339 (Archive_member::arg_serial_): New data member.
5340 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5341 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5342 incremental link.
5343 (Sized_dynobj::do_for_all_local_got_entries): New function.
5344 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5345 function.
5346 * fileread.cc (get_mtime): New function.
5347 * fileread.h (get_mtime): New function.
5348 * gold.cc (queue_initial_tasks): Check for incremental update.
5349 (process_incremental_input): New function.
5350 (queue_middle_tasks): Don't force valid target for incremental
5351 update.
5352 * incremental-dump.cc (find_input_containing_global): Adjust
5353 size of symbol info entry.
5354 (dump_incremental_inputs): Dump argument serial number and
5355 in_system_directory flag; bias shndx by 1; print symbol names
5356 when dumping per-file symbol lists; use new symbol info readers.
5357 * incremental.cc
5358 (Output_section_incremental_inputs:update_data_size): New function.
5359 (Sized_incremental_binary::setup_readers): Setup input readers
5360 for each input file; build maps for files added from libraries
5361 and scripts.
5362 (Sized_incremental_binary::check_input_args): New function.
5363 (Sized_incremental_binary::do_check_inputs): Build map of argument
5364 serial numbers to input arguments.
5365 (Sized_incremental_binary::do_file_has_changed): Rename
5366 do_file_is_unchanged to this; compare file modification times.
5367 (Sized_incremental_binary::do_init_layout): New function.
5368 (Sized_incremental_binary::do_reserve_layout): New function.
5369 (Sized_incremental_binary::do_get_input_reader): Remove.
5370 (Sized_incremental_binary::get_symtab_view): New function.
5371 (Incremental_checker::can_incrementally_link_output_file): Remove.
5372 (Incremental_inputs::report_command_line): Exclude --debug options.
5373 (Incremental_inputs::report_archive_begin): Add parameter; track
5374 argument serial numbers; don't put input file entry for archive
5375 before archive members.
5376 (Incremental_inputs::report_archive_end): Put input file entry
5377 for archive after archive members.
5378 (Incremental_inputs::report_object): Add parameter; track argument
5379 serial numbers and in_system_directory flag.
5380 (Incremental_inputs::report_script): Add parameter; track argument
5381 serial numbers.
5382 (Output_section_incremental_inputs::set_final_data_size): Adjust
5383 size of symbol info entry; check for forwarding symbols.
5384 (Output_section_incremental_inputs::write_input_files): Write
5385 in_system_directory flag and argument serial number.
5386 (Output_section_incremental_inputs::write_info_blocks): Map section
5387 indices between incremental info and original input file; store
5388 input section index for each symbol.
5389 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5390 change operator() to visit().
5391 (class Global_got_offset_visitor): Likewise.
5392 (class Global_symbol_visitor_got_plt):
5393 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5394 classes.
5395 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5396 (Sized_incr_relobj::do_read_symbols): New function.
5397 (Sized_incr_relobj::do_layout): New function.
5398 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5399 (Sized_incr_relobj::do_add_symbols): New function.
5400 (Sized_incr_relobj::do_should_include_member): New function.
5401 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5402 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5403 (Sized_incr_relobj::do_section_size): New function.
5404 (Sized_incr_relobj::do_section_name): New function.
5405 (Sized_incr_relobj::do_section_contents): New function.
5406 (Sized_incr_relobj::do_section_flags): New function.
5407 (Sized_incr_relobj::do_section_entsize): New function.
5408 (Sized_incr_relobj::do_section_address): New function.
5409 (Sized_incr_relobj::do_section_type): New function.
5410 (Sized_incr_relobj::do_section_link): New function.
5411 (Sized_incr_relobj::do_section_info): New function.
5412 (Sized_incr_relobj::do_section_addralign): New function.
5413 (Sized_incr_relobj::do_initialize_xindex): New function.
5414 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5415 (Sized_incr_relobj::do_read_relocs): New function.
5416 (Sized_incr_relobj::do_gc_process_relocs): New function.
5417 (Sized_incr_relobj::do_scan_relocs): New function.
5418 (Sized_incr_relobj::do_count_local_symbols): New function.
5419 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5420 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5421 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5422 (Sized_incr_relobj::do_relocate): New function.
5423 (Sized_incr_relobj::do_set_section_offset): New function.
5424 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5425 (Sized_incr_dynobj::do_read_symbols): New function.
5426 (Sized_incr_dynobj::do_layout): New function.
5427 (Sized_incr_dynobj::do_add_symbols): New function.
5428 (Sized_incr_dynobj::do_should_include_member): New function.
5429 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5430 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5431 (Sized_incr_dynobj::do_section_size): New function.
5432 (Sized_incr_dynobj::do_section_name): New function.
5433 (Sized_incr_dynobj::do_section_contents): New function.
5434 (Sized_incr_dynobj::do_section_flags): New function.
5435 (Sized_incr_dynobj::do_section_entsize): New function.
5436 (Sized_incr_dynobj::do_section_address): New function.
5437 (Sized_incr_dynobj::do_section_type): New function.
5438 (Sized_incr_dynobj::do_section_link): New function.
5439 (Sized_incr_dynobj::do_section_info): New function.
5440 (Sized_incr_dynobj::do_section_addralign): New function.
5441 (Sized_incr_dynobj::do_initialize_xindex): New function.
5442 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5443 (make_sized_incremental_object): New function.
5444 (Incremental_library::copy_unused_symbols): New function.
5445 (Incremental_library::do_for_all_unused_symbols): New function.
5446 * incremental.h (enum Incremental_input_flags): New type.
5447 (class Incremental_checker): Remove.
5448 (Incremental_input_entry::Incremental_input_entry): Add argument
5449 serial number.
5450 (Incremental_input_entry::arg_serial): New function.
5451 (Incremental_input_entry::set_is_in_system_directory): New function.
5452 (Incremental_input_entry::is_in_system_directory): New function.
5453 (Incremental_input_entry::arg_serial_): New data member.
5454 (Incremental_input_entry::is_in_system_directory_): New data member.
5455 (class Script_info): Move here from script.h.
5456 (Script_info::Script_info): Add filename parameter.
5457 (Script_info::filename): New function.
5458 (Script_info::filename_): New data member.
5459 (Incremental_script_entry::Incremental_script_entry): Add argument
5460 serial number.
5461 (Incremental_object_entry::Incremental_object_entry): Likewise.
5462 (Incremental_object_entry::add_input_section): Build list of input
5463 sections with map to original shndx.
5464 (Incremental_object_entry::get_input_section_index): New function.
5465 (Incremental_object_entry::shndx_): New data member.
5466 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5467 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5468 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5469 serial number.
5470 (Incremental_inputs::report_archive_begin): Likewise.
5471 (Incremental_inputs::report_object): Likewise.
5472 (Incremental_inputs::report_script): Likewise.
5473 (class Incremental_global_symbol_reader): New class.
5474 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5475 and store flags and input file type.
5476 (Incremental_input_entry_reader::arg_serial): New function.
5477 (Incremental_input_entry_reader::type): Extract type from flags.
5478 (Incremental_input_entry_reader::is_in_system_directory): New function.
5479 (Incremental_input_entry_reader::get_input_section_count): Call
5480 accessor function for type.
5481 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5482 function for type; adjust size of global symbol entry.
5483 (Incremental_input_entry_reader::get_global_symbol_count): Call
5484 accessor function for type.
5485 (Incremental_input_entry_reader::get_object_count): Likewise.
5486 (Incremental_input_entry_reader::get_object_offset): Likewise.
5487 (Incremental_input_entry_reader::get_member_count): Likewise.
5488 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5489 (Incremental_input_entry_reader::get_member_offset): Likewise.
5490 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5491 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5492 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5493 (Incremental_input_entry_reader::get_global_symbol_reader): New
5494 function.
5495 (Incremental_input_entry_reader::get_output_symbol_index): New
5496 function.
5497 (Incremental_input_entry_reader::type_): Remove.
5498 (Incremental_input_entry_reader::flags_): New data member.
5499 (Incremental_inputs_reader::input_file_offset): New function.
5500 (Incremental_inputs_reader::input_file_index): New function.
5501 (Incremental_inputs_reader::input_file): Call input_file_offset.
5502 (Incremental_inputs_reader::input_file_at_offset): New function.
5503 (Incremental_relocs_reader::get_r_type): Reformat.
5504 (Incremental_relocs_reader::get_r_shndx): Reformat.
5505 (Incremental_relocs_reader::get_r_offset): Reformat.
5506 (Incremental_relocs_reader::data): New function.
5507 (Incremental_binary::Incremental_binary): Initialize new data members.
5508 (Incremental_binary::check_inputs): Add cmdline parameter.
5509 (Incremental_binary::file_is_unchanged): Remove.
5510 (Input_reader::arg_serial): New function.
5511 (Input_reader::get_unused_symbol_count): New function.
5512 (Input_reader::get_unused_symbol): New function.
5513 (Input_reader::do_arg_serial): New function.
5514 (Input_reader::do_get_unused_symbol_count): New function.
5515 (Input_reader::do_get_unused_symbol): New function.
5516 (Incremental_binary::input_file_count): New function.
5517 (Incremental_binary::get_input_reader): Change signature to use
5518 index instead of filename.
5519 (Incremental_binary::file_has_changed): New function.
5520 (Incremental_binary::get_input_argument): New function.
5521 (Incremental_binary::get_library): New function.
5522 (Incremental_binary::get_script_info): New function.
5523 (Incremental_binary::init_layout): New function.
5524 (Incremental_binary::reserve_layout): New function.
5525 (Incremental_binary::output_file): New function.
5526 (Incremental_binary::do_check_inputs): New function.
5527 (Incremental_binary::do_file_is_unchanged): Remove.
5528 (Incremental_binary::do_file_has_changed): New function.
5529 (Incremental_binary::do_init_layout): New function.
5530 (Incremental_binary::do_reserve_layout): New function.
5531 (Incremental_binary::do_input_file_count): New function.
5532 (Incremental_binary::do_get_input_reader): Change signature.
5533 (Incremental_binary::input_args_map_): New data member.
5534 (Incremental_binary::library_map_): New data member.
5535 (Incremental_binary::script_map_): New data member.
5536 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5537 new data members.
5538 (Sized_incremental_binary::output_section): New function.
5539 (Sized_incremental_binary::inputs_reader): Add const.
5540 (Sized_incremental_binary::symtab_reader): Add const.
5541 (Sized_incremental_binary::relocs_reader): Add const.
5542 (Sized_incremental_binary::got_plt_reader): Add const.
5543 (Sized_incremental_binary::get_symtab_view): New function.
5544 (Sized_incremental_binary::Inputs_reader): New typedef.
5545 (Sized_incremental_binary::Input_entry_reader): New typedef.
5546 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5547 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5548 (Sized_incremental_binary::do_file_has_changed): New function.
5549 (Sized_incremental_binary::do_init_layout): New function.
5550 (Sized_incremental_binary::do_reserve_layout): New function.
5551 (Sized_input_reader::Inputs_reader): Remove.
5552 (Sized_input_reader::Input_entry_reader): Remove.
5553 (Sized_input_reader::do_arg_serial): New function.
5554 (Sized_input_reader::do_get_unused_symbol_count): New function.
5555 (Sized_input_reader::do_get_unused_symbol): New function.
5556 (Sized_incremental_binary::do_input_file_count): New function.
5557 (Sized_incremental_binary::do_get_input_reader): Change signature;
5558 use index instead of filename.
5559 (Sized_incremental_binary::section_map_): New data member.
5560 (Sized_incremental_binary::input_entry_readers_): New data member.
5561 (class Sized_incr_relobj): New class.
5562 (class Sized_incr_dynobj): New class.
5563 (make_sized_incremental_object): New function.
5564 (class Incremental_library): New class.
5565 * layout.cc (Free_list::num_lists): New static data member.
5566 (Free_list::num_nodes): New static data member.
5567 (Free_list::num_removes): New static data member.
5568 (Free_list::num_remove_visits): New static data member.
5569 (Free_list::num_allocates): New static data member.
5570 (Free_list::num_allocate_visits): New static data member.
5571 (Free_list::init): New function.
5572 (Free_list::remove): New function.
5573 (Free_list::allocate): New function.
5574 (Free_list::dump): New function.
5575 (Free_list::print_stats): New function.
5576 (Layout_task_runner::run): Resize output file for incremental updates.
5577 (Layout::Layout): Initialize new data members.
5578 (Layout::set_incremental_base): New function.
5579 (Layout::init_fixed_output_section): New function.
5580 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
5581 incremental updates.
5582 (Layout::create_gold_note): Do not create gold note section for
5583 incremental updates.
5584 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
5585 for incremental updates.
5586 (Layout::set_section_offsets): For incremental updates, allocate space
5587 from free list.
5588 (Layout::create_symtab_sections): Layout with offsets relative to
5589 start of section; for incremental updates, allocate space from free
5590 list.
5591 (Layout::create_shdrs): For incremental updates, allocate space from
5592 free list.
5593 (Layout::finish_dynamic_section): For incremental updates, do not
5594 check --as-needed (fixed in subsequent patch).
5595 * layout.h (class Free_list): New class.
5596 (Layout::set_incremental_base): New function.
5597 (Layout::incremental_base): New function.
5598 (Layout::init_fixed_output_section): New function.
5599 (Layout::allocate): New function.
5600 (Layout::incremental_base_): New data member.
5601 (Layout::free_list_): New data member.
5602 * main.cc (main): Print Free_list statistics.
5603 * object.cc (Relobj::finalize_incremental_relocs): Add
5604 clear_counts parameter; clear counts only when clear_counts is set.
5605 (Sized_relobj::Sized_relobj): Initialize new base class.
5606 (Sized_relobj::do_layout): Don't report special sections.
5607 (Sized_relobj::do_for_all_local_got_entries): New function.
5608 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
5609 symtab_off to all symbol table offsets.
5610 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
5611 * object.h (class Got_offset_list): Move to top of file.
5612 (Object::Object): Allow case where input_file == NULL.
5613 (Object::~Object): Likewise.
5614 (Object::input_file): Assert that input_file != NULL.
5615 (Object::lock): Allow case where input_file == NULL.
5616 (Object::unlock): Likewise.
5617 (Object::is_locked): Likewise.
5618 (Object::token): Likewise.
5619 (Object::release): Likewise.
5620 (Object::is_incremental): New function.
5621 (Object::get_mtime): New function.
5622 (Object::for_all_local_got_entries): New function.
5623 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
5624 (Object::set_is_in_system_directory): New function.
5625 (Object::is_in_system_directory): New function.
5626 (Object::do_is_incremental): New function.
5627 (Object::do_get_mtime): New function.
5628 (Object::do_for_all_local_got_entries): New function.
5629 (Object::is_in_system_directory_): New data member.
5630 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
5631 (class Sized_relobj_base): New class.
5632 (class Sized_relobj): Derive from Sized_relobj_base.
5633 (class Sized_relobj::Symbols): Redeclare from base class.
5634 (class Sized_relobj::local_got_offset_list): Remove.
5635 (class Sized_relobj::Output_sections): Redeclare from base class.
5636 (class Sized_relobj::do_for_all_local_got_entries): New function.
5637 (class Sized_relobj::write_local_symbols): Add offset parameter.
5638 (class Sized_relobj::local_symbol_offset_): Update comment.
5639 (class Sized_relobj::local_dynsym_offset_): Update comment.
5640 * options.cc (Input_arguments::add_file): Remove const.
5641 * options.h (Input_file_argument::Input_file_argument):
5642 Initialize arg_serial_ (all constructors).
5643 (Input_file_argument::set_arg_serial): New function.
5644 (Input_file_argument::arg_serial): New function.
5645 (Input_file_argument::arg_serial_): New data member.
5646 (Input_arguments::Input_arguments): Initialize file_count_.
5647 (Input_arguments::add_file): Remove const.
5648 (Input_arguments::number_of_input_files): New function.
5649 (Input_arguments::file_count_): New data member.
5650 (Command_line::number_of_input_files): Call
5651 Input_arguments::number_of_input_files.
5652 * output.cc (Output_segment_headers::Output_segment_headers):
5653 Set current size.
5654 (Output_section::Input_section::current_data_size): New function.
5655 (Output_section::Output_section): Initialize new data members.
5656 (Output_section::add_input_section): Don't do merge sections for
5657 an incremental link; allocate space from free list for an
5658 incremental update.
5659 (Output_section::add_output_section_data): Allocate space from
5660 free list for an incremental update.
5661 (Output_section::update_data_size): New function.
5662 (Output_section::set_fixed_layout): New function.
5663 (Output_section::reserve): New function.
5664 (Output_segment::set_section_addresses): Remove const.
5665 (Output_segment::set_section_list_addresses): Remove const; allocate
5666 space from free list for an incremental update.
5667 (Output_segment::set_offset): Adjust size of RELRO segment for an
5668 incremental update.
5669 * output.h (Output_data::current_data_size): Move here from
5670 child classes.
5671 (Output_data::pre_finalize_data_size): New function.
5672 (Output_data::update_data_size): New function.
5673 (Output_section_headers::update_data_size): new function.
5674 (Output_section_data_build::current_data_size): Move to Output_data.
5675 (Output_data_strtab::update_data_size): New function.
5676 (Output_section::current_data_size): Move to Output_data.
5677 (Output_section::set_fixed_layout): New function.
5678 (Output_section::has_fixed_layout): New function.
5679 (Output_section::reserve): New function.
5680 (Output_section::update_data_size): New function.
5681 (Output_section::has_fixed_layout_): New data member.
5682 (Output_section::free_list_): New data member.
5683 (Output_segment::set_section_addresses): Remove const.
5684 (Output_segment::set_section_list_addresses): Remove const.
5685 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
5686 New function.
5687 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
5688 New function.
5689 * readsyms.cc (Read_symbols::do_read_symbols): Add library
5690 parameter when calling Add_symbols constructor; store argument
5691 serial number for members of a lib group.
5692 (Add_symbols::locks): Allow case where token == NULL.
5693 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
5694 (Read_member::~Read_member): New function.
5695 (Read_member::is_runnable): New function.
5696 (Read_member::locks): New function.
5697 (Read_member::run): New function.
5698 (Check_script::~Check_script): New function.
5699 (Check_script::is_runnable): New function.
5700 (Check_script::locks): New function.
5701 (Check_script::run): New function.
5702 (Check_library::~Check_library): New function.
5703 (Check_library::is_runnable): New function.
5704 (Check_library::locks): New function.
5705 (Check_library::run): New function.
5706 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
5707 (Add_symbols::library_): New data member.
5708 (class Read_member): New class.
5709 (class Check_script): New class.
5710 (class Check_library): New class.
5711 * reloc.cc (Read_relocs::is_runnable): Allow case where
5712 token == NULL.
5713 (Read_relocs::locks): Likewise.
5714 (Scan_relocs::locks): Likewise.
5715 (Relocate_task::locks): Likewise.
5716 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
5717 to clear counters.
5718 (Sized_relobj::incremental_relocs_scan): Fix comment.
5719 (Sized_relobj::do_relocate): Pass output file offset to
5720 write_local_symbols.
5721 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
5722 from class declaration.
5723 * script.cc (read_input_script): Allocate Script_info; pass
5724 argument serial number to report_script.
5725 * script.h (class Script_info): Move to incremental.h.
5726 * symtab.cc (Symbol_table::add_from_incrobj): New function.
5727 * symtab.h (Symbol_table::add_from_incrobj): New function.
5728 (Symbol_table::set_file_offset): New function.
5729
5730 2011-04-05 Cary Coutant <ccoutant@google.com>
5731
5732 * incremental-dump.cc (dump_incremental_inputs): Change signature
5733 to take a Sized_incremental_binary; change caller. Use readers
5734 in Sized_incremental_binary.
5735 * incremental.cc
5736 (Sized_incremental_binary::find_incremental_inputs_sections):
5737 Rename do_find_incremental_inputs_sections to this.
5738 (Sized_incremental_binary::setup_readers): New function.
5739 (Sized_incremental_binary::do_check_inputs): Check
5740 has_incremental_info_ flag; move setup code to setup_readers;
5741 use input readers.
5742 (Sized_incremental_binary::do_file_is_unchanged): New function.
5743 (Sized_incremental_binary::do_get_input_reader): New function.
5744 * incremental.h (class Incremental_binary): Move to end of file.
5745 (Incremental_binary::file_is_unchanged): New function.
5746 (Incremental_binary::do_file_is_unchanged): New function.
5747 (Incremental_binary::Input_reader): New class.
5748 (Incremental_binary::get_input_reader): New function.
5749 (class Sized_incremental_binary): Move to end of file.
5750 (Sized_incremental_binary::Sized_incremental_binary): Setup the
5751 input section reader classes.
5752 (Sized_incremental_binary::has_incremental_info): New function.
5753 (Sized_incremental_binary::inputs_reader): New function.
5754 (Sized_incremental_binary::symtab_reader): New function.
5755 (Sized_incremental_binary::relocs_reader): New function.
5756 (Sized_incremental_binary::got_plt_reader): New function.
5757 (Sized_incremental_binary::do_file_is_unchanged): New function.
5758 (Sized_incremental_binary::Sized_input_reader): New class.
5759 (Sized_incremental_binary::get_input_reader): New function.
5760 (Sized_incremental_binary::find_incremental_inputs_sections):
5761 Rename do_find_incremental_inputs_sections to this.
5762 (Sized_incremental_binary::setup_readers): New function.
5763 (Sized_incremental_binary::has_incremental_info_): New data member.
5764 (Sized_incremental_binary::inputs_reader_): New data member.
5765 (Sized_incremental_binary::symtab_reader_): New data member.
5766 (Sized_incremental_binary::relocs_reader_): New data member.
5767 (Sized_incremental_binary::got_plt_reader_): New data member.
5768 (Sized_incremental_binary::current_input_file_): New data member.
5769
5770 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
5771
5772 PR gold/12640
5773 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5774 violation.
5775
5776 2011-03-30 Cary Coutant <ccoutant@google.com>
5777
5778 * archive.cc (Archive::include_member): Adjust call to report_object.
5779 (Add_archive_symbols::run): Add script_info to call to
5780 report_archive_begin.
5781 (Lib_group::include_member): Adjust call to report_object.
5782 (Add_lib_group_symbols::run): Adjust call to report_object.
5783 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
5784 blocks. Add object count for script input files.
5785 * incremental.cc (Incremental_inputs::report_archive_begin): Add
5786 script_info parameter; change all callers.
5787 (Incremental_inputs::report_object): Add script_info parameter;
5788 change all callers.
5789 (Incremental_inputs::report_script): Store backpointer to
5790 incremental info entry.
5791 (Output_section_incremental_inputs::set_final_data_size): Record
5792 additional information for scripts.
5793 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5794 * incremental.h (Incremental_script_entry::add_object): New function.
5795 (Incremental_script_entry::get_object_count): New function.
5796 (Incremental_script_entry::get_object): New function.
5797 (Incremental_script_entry::objects_): New data member; adjust
5798 constructor.
5799 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5800 (Incremental_inputs::report_object): Add script_info parameter.
5801 (Incremental_inputs_reader::get_object_count): New function.
5802 (Incremental_inputs_reader::get_object_offset): New function.
5803 * options.cc (Input_arguments::add_file): Return reference to
5804 new input argument.
5805 * options.h (Input_argument::set_script_info): New function.
5806 (Input_argument::script_info): New function.
5807 (Input_argument::script_info_): New data member; adjust all
5808 constructors.
5809 (Input_file_group::add_file): Return reference to new input argument.
5810 (Input_file_lib::add_file): Likewise.
5811 (Input_arguments::add_file): Likewise.
5812 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5813 * script.cc (Parser_closure::Parser_closure): Add script_info
5814 parameter; adjust all callers.
5815 (Parser_closure::script_info): New function.
5816 (Parser_closure::script_info_): New data member.
5817 (read_input_script): Report scripts earlier to incremental info.
5818 (script_add_file): Set script_info in Input_argument.
5819 (script_add_library): Likewise.
5820 * script.h (Script_options::Script_info): Rewrite class.
5821
5822 2011-03-29 Cary Coutant <ccoutant@google.com>
5823
5824 * archive.cc (Library_base::should_include_member): Move
5825 method here from class Archive.
5826 (Archive::Archive): Initialize base class.
5827 (Archive::should_include_member): Move to base class.
5828 (Archive::do_for_all_unused_symbols): New function.
5829 (Add_archive_symbols::run): Remove redundant access to
5830 incremental_inputs.
5831 (Lib_group::Lib_group): Initialize base class.
5832 (Lib_group::do_filename): New function.
5833 (Lib_group::include_member): Pass pointer to Lib_group to
5834 report_object.
5835 (Lib_group::do_for_all_unused_symbols): New function.
5836 (Add_lib_group_symbols::run): Report archive information for
5837 incremental links.
5838 * archive.h (class Library_base): New base class.
5839 (class Archive): Derive from Library_base.
5840 (Archive::filename): Move to base class.
5841 (Archive::set_incremental_info): Likewise.
5842 (Archive::incremental_info): Likewise.
5843 (Archive::Should_include): Likewise.
5844 (Archive::should_include_member): Likewise.
5845 (Archive::Armap_entry): Remove.
5846 (Archive::Unused_symbol_iterator): Remove.
5847 (Archive::unused_symbols_begin): Remove.
5848 (Archive::unused_symbols_end): Remove.
5849 (Archive::do_filename): New function.
5850 (Archive::do_get_mtime): New function.
5851 (Archive::do_for_all_unused_symbols): New function.
5852 (Archive::task_): Move to base class.
5853 (Archive::incremental_info_): Likewise.
5854 (class Lib_group): Derive from Library_base.
5855 (Lib_group::do_filename): New function.
5856 (Lib_group::do_get_mtime): New function.
5857 (Lib_group::do_for_all_unused_symbols): New function.
5858 (Lib_group::task_): Move to base class.
5859 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
5860 function.
5861 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
5862 function.
5863 * incremental.cc (Incremental_inputs::report_archive_begin):
5864 Use Library_base; call library's get_mtime; add incremental inputs
5865 entry before members.
5866 (class Unused_symbol_visitor): New class.
5867 (Incremental_inputs::report_archive_end): Use Library_base; use
5868 visitor class to record unused symbols; don't add incremental inputs
5869 entry after members.
5870 (Incremental_inputs::report_object): Use Library_base.
5871 * incremental.h
5872 (Incremental_archive_entry::Incremental_archive_entry): Remove
5873 unused Archive parameter.
5874 (Incremental_inputs::report_archive_begin): Use Library_base.
5875 (Incremental_inputs::report_archive_end): Likewise.
5876 (Incremental_inputs::report_object): Likewise.
5877 * object.cc (Sized_relobj::do_for_all_global_symbols): New
5878 function.
5879 * object.h (Object::for_all_global_symbols): New function.
5880 (Object::do_for_all_global_symbols): New function.
5881 (Sized_relobj::do_for_all_global_symbols): New function.
5882 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
5883 function.
5884 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
5885 function.
5886
5887 2011-03-27 Ian Lance Taylor <iant@google.com>
5888
5889 * archive.cc (Archive::interpret_header): Return -1 if something
5890 goes wrong. Change callers accordingly.
5891
5892 2011-03-25 Cary Coutant <ccoutant@google.com>
5893
5894 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
5895 * testsuite/Makefile.in: Regenerate.
5896
5897 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
5898
5899 * plugin.cc (get_view): New.
5900 (Plugin::load): Pass get_view to the plugin.
5901 (Plugin_manager::get_view): New.
5902
5903 2011-03-21 Ian Lance Taylor <iant@google.com>
5904
5905 * testsuite/final_layout.sh: Rewrite to not use dc.
5906 * testsuite/relro_test.sh: Fail if dc is not present.
5907
5908 2011-03-21 Sriraman Tallam <tmsriram@google.com>
5909
5910 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
5911 Change == to -eq.
5912 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
5913 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
5914 Change == to -eq.
5915 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
5916 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
5917
5918 2011-03-14 Ian Lance Taylor <iant@google.com>
5919
5920 * script-sections.cc (Sort_output_sections::script_compare):
5921 Rename from is_before, change return type.
5922 (Sort_output_sections::operator()): Adjust accordingly.
5923
5924 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
5925
5926 PR gold/12572
5927 * testsuite/odr_violation2.cc: Add comment to make all error line
5928 numbers double digits.
5929 * testsuite/debug_msg.sh: Adjust expected errors.
5930
5931 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
5932
5933 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
5934 but mark earlier ones as non-canonical
5935 (offset_to_iterator): Update search target and example
5936 (do_addr2line): Return extra lines in a vector*
5937 (format_file_lineno): Extract from do_addr2line
5938 (one_addr2line): Add vector* out-param
5939 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
5940 when a lineno entry appeared last for its instruction
5941 (Dwarf_line_info): Add vector* out-param
5942 * object.cc (Relocate_info): Pass NULL for the vector* out-param
5943 * symtab.cc (Odr_violation_compare): Include the lineno in the
5944 comparison again.
5945 (linenos_from_loc): New. Combine the canonical line for an
5946 address with its other lines.
5947 (True_if_intersect): New. Helper functor to make
5948 std::set_intersection a query.
5949 (detect_odr_violations): Compare sets of lines instead of just
5950 one line for each function. This became less deterministic, but
5951 has fewer false positives.
5952 * symtab.h: Declarations.
5953 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
5954 mix an optimized and non-optimized object in the same binary
5955 (odr_violation2.so): Same.
5956 * testsuite/Makefile.in: Regenerate from Makefile.am.
5957 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
5958 * testsuite/debug_msg.sh: Update line numbers and add
5959 assertions.
5960 * testsuite/odr_violation1.cc: Use OdrDerived, in a
5961 non-optimized context.
5962 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
5963 isn't inlined, and use OdrDerived in an optimized context.
5964 * testsuite/odr_header1.h: Defines OdrDerived, where
5965 optimization will change the
5966 first-instruction-in-the-destructor's file and line number.
5967 * testsuite/odr_header2.h: Defines OdrBase.
5968
5969 2011-03-09 Ian Lance Taylor <iant@google.com>
5970
5971 * fileread.cc (File_read::clear_views): Don't delete the whole
5972 file view.
5973
5974 2011-03-08 Ian Lance Taylor <iant@google.com>
5975
5976 PR gold/12525
5977 * fileread.cc: #include <climits>.
5978 (GOLD_IOV_MAX): Define.
5979 (File_read::read_multiple): Limit number of entries by iov_max.
5980 * fileread.h (class File_read): Always set max_readv_entries to
5981 128.
5982
5983 2011-03-07 Ian Lance Taylor <iant@google.com>
5984
5985 PR gold/12525
5986 * options.h (class General_options): Add -dy and -dn.
5987
5988 2011-03-02 Cary Coutant <ccoutant@google.com>
5989
5990 * testsuite/script_test_9.t: Add TLS segment.
5991
5992 2011-03-02 Simon Baldwin <simonb@google.com>
5993
5994 * configure.ac: Add check for gnu_indirect_function support in
5995 the toolchain building binutils.
5996 * configure: Rebuild.
5997
5998 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
5999
6000 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6001 plugin only symbols.
6002 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6003 in plugin files as not needed in the symbol table.
6004
6005 2011-02-11 Sriraman Tallam <tmsriram@google.com>
6006
6007 * output.cc (Output_section::add_input_section): Delay fill
6008 generation for section ordering.
6009
6010 2011-02-09 Ian Lance Taylor <iant@google.com>
6011
6012 PR gold/12316
6013 * object.h (class Sized_relobj): Remove clear_local_symbols.
6014 * reloc.cc (Sized_relobj::do_relocate): Don't call
6015 clear_local_symbols.
6016
6017 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
6018
6019 * plugin.cc (is_visible_from_outside): Return true for symbols
6020 in the -u option.
6021
6022 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6023
6024 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6025 filename.
6026
6027 2011-02-02 Sriraman Tallam <tmsriram@google.com>
6028
6029 * icf.h (is_section_foldable_candidate): Change type of parameter
6030 to std::string.
6031 * icf.cc (Icf::find_identical_sections): Change type of local variable
6032 section_name to be std::string.
6033 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6034
6035 2011-01-25 Ian Lance Taylor <iant@google.com>
6036
6037 * script.cc (script_add_extern): Rewrite to use
6038 add_symbol_reference.
6039
6040 2011-01-25 Doug Kwan <dougkwan@google.com>
6041
6042 * icf.cc (get_section_contents): Always lock section's object.
6043
6044 2011-01-24 Ian Lance Taylor <iant@google.com>
6045
6046 * options.h (class General_options): Accept
6047 --no-detect-odr-violations.
6048
6049 2011-01-24 Ian Lance Taylor <iant@google.com>
6050
6051 * version.cc (version_string): Bump to 1.11.
6052
6053 2011-01-24 Ian Lance Taylor <iant@google.com>
6054
6055 * plugin.cc (class Plugin_rescan): Define new class.
6056 (Plugin_manager::claim_file): Set any_claimed_.
6057 (Plugin_manager::save_archive): New function.
6058 (Plugin_manager::save_input_group): New function.
6059 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6060 necessary.
6061 (Plugin_manager::new_undefined_symbol): New function.
6062 (Plugin_manager::rescan): New function.
6063 (Plugin_manager::rescannable_defines): New function.
6064 (Plugin_manager::add_input_file): Set any_added_.
6065 * plugin.h (class Plugin_manager): define new fields rescannable_,
6066 undefined_symbols_, any_claimed_, and any_added_. Declare
6067 Plugin_rescan as friend. Declare new functions.
6068 (Plugin_manager::Rescannable): Define type.
6069 (Plugin_manager::Rescannable_list): Define type.
6070 (Plugin_manager::Undefined_symbol_list): Define type.
6071 (Plugin_manager::Plugin_manager): Initialize new fields.
6072 * archive.cc (Archive::defines_symbol): New function.
6073 (Add_archive_symbols::run): Pass archive to plugins if any.
6074 * archive.h (class Archive): Declare defines_symbol.
6075 * readsyms.cc (Input_group::~Input_group): New function.
6076 (Finish_group::run): Pass input_group to plugins if any.
6077 * readsyms.h (class Input_group): Declare destructor.
6078 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6079 any.
6080
6081 2011-01-10 Ian Lance Taylor <iant@google.com>
6082
6083 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6084 section as relro.
6085 (Layout::set_segment_offsets): Reset increase_relro before calling
6086 set_section_addresses a second time.
6087
6088 2011-01-04 Cary Coutant <ccoutant@google.com>
6089
6090 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6091 sections before NOBITS sections.
6092
6093 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6094
6095 * version.cc (print_version): Update copyright to 2011.
6096
6097 2010-12-23 Cary Coutant <ccoutant@google.com>
6098
6099 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6100 of OS to this->add. Add OD parameter to second form of the function.
6101
6102 2010-12-20 Ian Lance Taylor <iant@google.com>
6103
6104 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6105 second of two consecutive entries with same offset.
6106
6107 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6108
6109 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6110 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6111 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6112 to avoid unneeded links against $(LDADD).
6113 * testsuite/Makefile.in: Regenerate.
6114
6115 2010-12-15 Ian Lance Taylor <iant@google.com>
6116
6117 PR gold/12324
6118 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6119 for R_X86_64_32 and R_X86_64_PC32.
6120 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6121 ver_matching_def_pic.o.
6122 (ver_matching_def_pic.o): New target.
6123
6124 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6125
6126 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6127 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6128 Move definition before File_read::View member definitions.
6129 (File_read::View::~View): Initialize and hold lock before
6130 updating current_mapped_bytes.
6131
6132 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6133
6134 * dwarf_reader.cc: Remove outdated comment.
6135 * gold-threads.cc: Fix typo in error message.
6136 * archive.cc: Fix typos in comments.
6137 * archive.h: Likewise.
6138 * arm-reloc-property.cc: Likewise.
6139 * arm-reloc-property.h: Likewise.
6140 * arm-reloc.def: Likewise.
6141 * arm.cc: Likewise.
6142 * attributes.h: Likewise.
6143 * cref.cc: Likewise.
6144 * ehframe.cc: Likewise.
6145 * fileread.h: Likewise.
6146 * gold.h: Likewise.
6147 * i386.cc: Likewise.
6148 * icf.cc: Likewise.
6149 * incremental.h: Likewise.
6150 * int_encoding.cc: Likewise.
6151 * layout.h: Likewise.
6152 * main.cc: Likewise.
6153 * merge.h: Likewise.
6154 * object.cc: Likewise.
6155 * object.h: Likewise.
6156 * options.cc: Likewise.
6157 * readsyms.cc: Likewise.
6158 * reduced_debug_output.cc: Likewise.
6159 * reloc.cc: Likewise.
6160 * script-sections.cc: Likewise.
6161 * sparc.cc: Likewise.
6162 * symtab.h: Likewise.
6163 * target-reloc.h: Likewise.
6164 * target.cc: Likewise.
6165 * target.h: Likewise.
6166 * timer.cc: Likewise.
6167 * timer.h: Likewise.
6168 * x86_64.cc: Likewise.
6169
6170 2010-12-09 Cary Coutant <ccoutant@google.com>
6171
6172 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6173 stack.
6174 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6175 parameter; change all callers.
6176 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6177 * options.h (warn_execstack): New option.
6178
6179 2010-12-07 Doug Kwan <dougkwan@google.com>
6180
6181 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6182 like function call relocations.
6183
6184 2010-12-07 Ian Lance Taylor <iant@google.com>
6185
6186 * archive.cc (Archive::get_elf_object_for_member): Permit
6187 punconfigured to be NULL.
6188 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6189 (Archive::include_member): Pass NULL to get_elf_object_for_member
6190 if we searched for the archive and this is the first included
6191 object.
6192
6193 2010-12-01 Ian Lance Taylor <iant@google.com>
6194
6195 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6196 track_relocs_type_ field.
6197 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6198 Set track_relocs_type_.
6199 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6200 contents when using RELA relocs.
6201 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6202 reloc_map_.
6203 * reloc.cc (Track_relocs::next_addend): New function.
6204 * reloc.h (class Track_relocs): Declare next_addend.
6205
6206 2010-12-01 Ian Lance Taylor <iant@google.com>
6207
6208 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6209 virtual destructor.
6210
6211 2010-12-01 Ian Lance Taylor <iant@google.com>
6212
6213 * README: Update compilers known to work and fail.
6214
6215 2010-11-23 Matthias Klose <doko@ubuntu.com>
6216
6217 * configure.in: For --enable-gold, handle value `default' instead of
6218 `both*'. Always install ld as ld.bfd, install as ld if gold is
6219 not the default.
6220 * configure: Regenerate.
6221
6222 2010-11-18 Doug Kwan <dougkwan@google.com>
6223
6224 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6225 and right_alignment to be zero. Store result alignment only if it is
6226 greater than existing alignment.
6227
6228 2010-11-16 Cary Coutant <ccoutant@google.com>
6229
6230 PR gold/12220
6231 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6232 Check for ".zdebug_line".
6233
6234 2010-11-16 Doug Kwan <dougkwan@google.com>
6235 Cary Coutant <ccoutant@google.com>
6236
6237 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6238 by reference; adjust all callers.
6239 * output.cc (Output_segment::set_section_addresses): Adjust references
6240 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6241 list is empty.
6242 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6243 end at page boundary.
6244
6245 2010-11-16 Cary Coutant <ccoutant@google.com>
6246
6247 PR gold/12220
6248 * layout.cc (Layout::choose_output_section): Transform names of
6249 compressed sections even when using a script with a SECTIONS clause.
6250 (Layout::output_section_name): Remove code to transform
6251 compressed debug section names.
6252 * output.cc (Output_section::add_input_section): Use uncompressed
6253 section size when tracking input sections.
6254
6255 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6256
6257 * symtab.h (Symbol::NON_PIC_REF): Remove.
6258 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6259 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6260 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6261 (Symbol::use_plt_offset): Take a flags argument and pass it
6262 directly to needs_dynamic_reloc. Restrict check for undefined
6263 weak symbols to function calls.
6264 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6265 (Target_arm::Scan::global): Use it.
6266 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6267 (Target_arm::Relocate::relocate): Likewise.
6268 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6269 parameter with an r_type parameter. Use get_reference_flags
6270 to get the flags.
6271 (Target_arm::Relocate::relocate): Update accordingly.
6272 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6273 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6274 (Target_i386::Scan::global): Likewise.
6275 (Target_i386::Relocate::relocate): Likewise.
6276 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6277 parameter with an r_type parameter. Use get_reference_flags
6278 to get the flags.
6279 (Target_i386::Relocate::relocate): Update accordingly.
6280 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6281 (Target_powerpc::Scan::global): Use it.
6282 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6283 (Target_powerpc::Relocate::relocate): Likewise.
6284 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6285 (Target_sparc::Scan::global): Use it.
6286 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6287 (Target_sparc::Relocate::relocate): Likewise.
6288 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6289 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6290 (Target_x86_64::Scan::global): Likewise.
6291 (Target_x86_64::Relocate::relocate): Likewise.
6292
6293 2010-11-08 Doug Kwan <dougkwan@google.com>
6294 Cary Coutant <ccoutant@google.com>
6295
6296 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6297 (Arm_exidx_merge_section::section_contents_): New data member.
6298 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6299 (Arm_input_section::~Arm_input_section): De-allocate memory.
6300 (Arm_input_section::original_contents_): New data member.
6301 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6302 in parameters instead of calling Object::section_contents without
6303 locking.
6304 (Arm_output_section::group_section): New parameter TASK. Pass it
6305 to callees that need locking objects.
6306 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6307 to lock EXIDX input sections. Fix a formatting issue. Call
6308 Arm_exidx_merged_section::build_contents to create merged section
6309 contents.
6310 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6311 to lock object of stub table owner.
6312 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6313 TEXT_SIZE to initialize data member TEXT_SIZE_.
6314 (Arm_exidx_input_section::addralign): Fix typo in comment.
6315 (Arm_exidx_input_section::text_size): New method.
6316 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6317 that require locking objects. Lock objects before scanning for stubs
6318 and updating local symbols.
6319 (Arm_input_section<big_endian>::init): Copy contents of original
6320 input section.
6321 (Arm_input_section<big_endian>::do_write): Use saved contents of
6322 original input section instead of calling Object::section_contents
6323 without locking.
6324 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6325 size without calling Object::section_size().
6326 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6327 for size. Allocate a buffer for merged EXIDX entries.
6328 (Arm_exidx_merged_section::build_contents): New method.
6329 (Arm_exidx_merged_section::do_write): Move merge section contents
6330 building code to Arm_exidx_merged_section::build_contetns. Write
6331 out contetns in buffer instead of building it on the fly.
6332 (Arm_relobj::make_exidx_input_section): Also pass text section size
6333 to Arm_exidx_input_section constructor.
6334 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6335 (Arm_dynobj::do_read_symbols): Fix memory leak.
6336 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6337 * target.h: (class Task): Add forward declaration.
6338 (Target::relax): Add new parameter TASK and pass it to
6339 Target::do_relax().
6340 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6341
6342 2010-11-05 Cary Coutant <ccoutant@google.com>
6343
6344 PR gold/10708
6345 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6346 object when reading from the file.
6347 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6348 second layout pass.
6349 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6350 when reading section contents.
6351 (get_section_contents): Likewise.
6352 (icf::find_identical_sections): Likewise.
6353 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6354 object when reading from the file.
6355 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6356 the object when doing deferred section layout.
6357
6358 2010-11-03 Nick Clifton <nickc@redhat.com>
6359
6360 PR gold/12001
6361 * script.h (class Symbol_assignment: name): New member. Returns
6362 the name of the symbol.
6363 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6364 Returns true if the given symbol name is on the list of
6365 assignments wating to be processed.
6366 * archive.cc (should_incldue_member): If the symbol is undefined,
6367 check to see if it is on the list of symbols pending assignment.
6368
6369 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6370
6371 * script-sections.cc (Script_sections::find_memory_region): Check
6372 for a NULL output section pointer.
6373
6374 2010-10-29 Doug Kwan <dougkwan@google.com>
6375
6376 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6377 Output_section::add_relaxed_input_section.
6378 * output.cc (Output_section::add_relaxed_input_section): Add new
6379 arguments LAYOUT and NAME. Set section order index.
6380 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6381 Copy section order index.
6382 * output.h (Output_section::add_relaxed_input_section): Add new
6383 arguments LAYOUT and NAME.
6384
6385 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6386
6387 * testsuite/Makefile.am: Move gcctestdir/ld rule to
6388 NATIVE_OR_CROSS_LINKER.
6389 * testsuite/Makefile.in: Regenerate.
6390
6391 2010-10-20 Doug Kwan <dougkwan@google.com>
6392
6393 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6394 without SHF_LINK_ORDER flags.
6395 * layout.cc (Layout::choose_output_section): Do not filter
6396 SHF_LINK_ORDER flag in a relocatable link.
6397
6398 2010-10-17 Cary Coutant <ccoutant@google.com>
6399
6400 * output.h (Output_segment::set_section_addresses): Change function
6401 signature. Update all callers.
6402 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6403 sections.
6404 (Output_segment::set_section_addresses): Align after last TLS
6405 section. Add padding before last relro section instead of after.
6406
6407 2010-10-17 Doug Kwan <dougkwan@google.com>
6408
6409 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6410 GOT output section to be writable.
6411
6412 2010-10-14 Cary Coutant <ccoutant@google.com>
6413
6414 * debug.h (DEBUG_INCREMENTAL): New flag.
6415 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6416 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6417 mode.
6418 * incremental.cc (report_command_line): Ignore all forms of
6419 --incremental.
6420 * layout.cc (Layout::Layout): Check parameters for incremental link
6421 mode.
6422 * options.cc (General_options::parse_incremental): New function.
6423 (General_options::parse_no_incremental): New function.
6424 (General_options::parse_incremental_full): New function.
6425 (General_options::parse_incremental_update): New function.
6426 (General_options::incremental_mode_): New data member.
6427 (General_options::finalize): Check incremental_mode_.
6428 * options.h (General_options): Update help text for --incremental.
6429 Add --no-incremental, --incremental-full, --incremental-update.
6430 (General_options::Incremental_mode): New enum type.
6431 (General_options::incremental_mode): New function.
6432 (General_options::incremental_mode_): New data member.
6433 * parameters.cc (Parameters::incremental_mode_): New data member.
6434 (Parameters::set_options): Set incremental_mode_.
6435 (Parameters::set_incremental_full): New function.
6436 (Parameters::incremental): New function.
6437 (Parameters::incremental_update): New function.
6438 (set_parameters_incremental_full): New function.
6439 * parameters.h (Parameters::set_incremental_full): New function.
6440 (Parameters::incremental): New function.
6441 (Parameters::incremental_update): New function.
6442 (Parameters::incremental_mode_): New data member.
6443 (set_parameters_incremental_full): New function.
6444 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6445 incremental link mode.
6446 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6447 (Sized_relobj::do_relocate_sections): Likewise.
6448 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6449 option.
6450 * testsuite/Makefile.in: Regenerate.
6451 * testsuite/incremental_test.sh: Filter all forms of --incremental.
6452
6453 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6454
6455 * script-sections.h (class Script_sections): Make
6456 Sections_elements typedef public.
6457 * script-sections.cc (class Sort_output_sections): Add elements_
6458 field. Add constructor which sets it; change all callers.
6459 (Sort_output_sections::is_before): New function.
6460 (Sort_output_sections::operator()): Call is_before.
6461 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6462 conditional.
6463 * testsuite/script_test_10.sh: New test. Test script section
6464 order.
6465 * testsuite/script_test_10.t: Likewise.
6466 * testsuite/script_test_10.s: Likewise.
6467 * testsuite/Makefile.am: Wrap the cross linker tests and the
6468 common tests into NATIVE_OR_CROSS_LINKER.
6469 (check_SCRIPTS): Add script_test_10.sh.
6470 (check_DATA): Add script_test_10.stdout.
6471 (script_test_10.o, script_test_10): New targets.
6472 (script_test_10.stdout): New target.
6473 * configure, testsuite/Makefile.in: Regenerate.
6474
6475 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6476
6477 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6478 error for the deprecated relocations.
6479 (Target_arm::Scan::global): Likewise.
6480 (Target_arm::Relocate::relocate): Likewise.
6481
6482 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6483
6484 * fileread.cc (Input_file::find_file): Initialize *found_name
6485 and *namep when using the fallback search for case 4.
6486
6487 2010-10-11 Cary Coutant <ccoutant@google.com>
6488
6489 * options.h (class General_options): Redefine -z lazy as an alias for
6490 the negation of -z now.
6491
6492 2010-10-11 Ian Lance Taylor <iant@google.com>
6493
6494 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6495 binding.
6496
6497 2010-10-06 Nick Clifton <nickc@redhat.com>
6498
6499 * script-sections.cc(class Memory_region): Remove
6500 current_lma_offset_ field. Rename current_vma_offset_ to
6501 current_offset_. Add last_section_ field.
6502 (Memory_region::get_current_vma_address): Rename to
6503 get_current_address.
6504 (Memory_region::get_current_lma_address): Delete.
6505 (Memory_region::increment_vma_offset): Rename to
6506 increment_offset.
6507 (Memory_region::increment_lma_offset): Delete.
6508 (Memory_region::attributes_compatible): New method. Returns
6509 true if the provided section is compatible with the region.
6510 (Memory_region::get_last_section): New method. Returns the last
6511 section to use the region.
6512 (Memory_region::set_last_section): New method. Stores the last
6513 section to use the region.
6514 (Script_sections::block_in_region): New method. Returns true if
6515 a block of memory is contained within a region.
6516 (Script_sections::find_memory_region): New method. Locates a
6517 memory region to be used to set a VMA or LMA address.
6518 (Output_section_definition::set_section_addresses): Add code to
6519 check for addresses set by memory regions.
6520 (Output_segment::set_section_addresses): Remove memory region
6521 walking code.
6522 (Script_sections::create_segment): Add a warning if a header
6523 segment is created outside of any region.
6524 * script-sections.h (class Script_sections): Add prototypes for
6525 find_memory_region and block_in_region methods.
6526 * testsuite/memory_test.s: Use .long instead of .word.
6527 * testsuite/memory_test.t: Add some more output sections.
6528 * testsuite/memory_test.sh: Update expected output.
6529
6530 2010-10-02 Doug Kwan <dougkwan@google.com>
6531
6532 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6533 defintion to symtab.h
6534 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6535 declaration to defintion.
6536
6537 2010-10-01 Nick Clifton <nickc@redhat.com>
6538
6539 * expression.cc (eval): Replace dummy argument with NULL.
6540 (eval_maybe_dot): Check for a NULL result section pointer.
6541 (Symbol_expression::value): Likewise.
6542 (Dot_expression::value): Likewise.
6543 (BINARY_EXPRESSION): Likewise.
6544 (Max_expression::value): Likewise.
6545 (Min_expression::value): Likewise.
6546 (Absolute_expression::value): Likewise.
6547 (Addr_expression::value_from_output_section): Likewise.
6548 (Loaddddr_expression::value_from_output_section): Likewise.
6549 (Segment_start_expression::value): Likewise.
6550 * script-sections.cc
6551 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6552 argument with NULL.
6553 (Sections_elememt_dot_assignment::set_section_addresses):
6554 Likewise.
6555 (Output_data_expression::do_write_to_buffer): Likewise.
6556 (Output_section_definition::finalize_symbols): Likewise.
6557 (Output_section_definition::set_section_addresses): Likewise.
6558
6559 2010-09-30 Doug Kwan <dougkwan@google.com>
6560
6561 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6562
6563 2010-09-28 Sriraman Tallam <tmsriram@google.com>
6564
6565 * target.h (Target::can_icf_inline_merge_sections): New virtual
6566 function.
6567 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6568 virtual function.
6569 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6570 virtual function.
6571 * icf.cc (get_section_contents): Inline merge sections only when
6572 target allows it.
6573
6574 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6575
6576 * configure: Regenerate.
6577
6578 2010-09-17 Ian Lance Taylor <iant@google.com>
6579
6580 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
6581 * testsuite/Makefile.am (memory_test.o): New target.
6582 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
6583 memory_test.t.
6584 * testsuite/Makefile.in: Rebuild.
6585
6586 2010-09-17 Doug Kwan <dougkwan@google.com>
6587
6588 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
6589 defintion if relocation uses GOT entries of the symbol.
6590 * testsuite/icf_safe_test.sh: Fix test.
6591 * testsuite/icf_safe_so_test.sh: Fix test.
6592
6593 2010-09-16 Cary Coutant <ccoutant@google.com>
6594
6595 * script_sections.cc (class Memory_region): Remove "NULL" from
6596 vector initializations.
6597
6598 2010-09-15 Cary Coutant <ccoutant@google.com>
6599
6600 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
6601 Resolve forwarding symbols.
6602
6603 2010-09-15 Doug Kwan <dougkwan@google.com>
6604
6605 * gold/testsuite/script_test_3.t: Add ARM special sections.
6606 * gold/testsuite/script_test_4.t: Same.
6607 * gold/testsuite/script_test_5.t: Same.
6608 * gold/testsuite/script_test_6.t: Same.
6609 * gold/testsuite/script_test_7.t: Same.
6610 * gold/testsuite/script_test_7.t: Same.
6611 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
6612
6613 2010-09-14 Cary Coutant <ccoutant@google.com>
6614
6615 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
6616 (Target_x86_64::Relocate::relocate_tls): Replace check for
6617 saw_tls_block_reloc_ with test for executable section.
6618
6619 2010-09-12 Cary Coutant <ccoutant@google.com>
6620
6621 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
6622 position-independent executables to shared libraries need dynamic
6623 relocations.
6624 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
6625 position-independent executables.
6626 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
6627 * testsuite/Makefile.in: Regenerate.
6628
6629 2010-09-10 Nick Clifton <nickc@redhat.com>
6630
6631 PR gold/11997
6632 * testsuite/memory_test.t: Discard any sections that are not
6633 needed.
6634
6635 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
6636
6637 PR gold/11996
6638 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
6639 "This::" to work around a bug in gcc 4.2.
6640
6641 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
6642
6643 2010-09-09 Rafael Espindola <espindola@google.com>
6644
6645 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
6646 sections with different PF_X flags in the same segment.
6647 (Layout::find_first_load_seg): Search all segments to find the first
6648 one.
6649 * options.h (rosegment): New.
6650
6651 2010-09-08 Rafael Espindola <espindola@google.com>
6652
6653 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
6654
6655 2010-09-08 Doug Kwan <dougkwan@google.com>
6656
6657 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
6658 (Arm_relobj::do_relocate_sections): Add new parameter for output
6659 file to match the parent.
6660 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
6661 of local symbols instead of input values. Update code to track
6662 changes in gold::relocate_section.
6663 * object.cc (Sized_relobj::compute_final_local_value): New methods.
6664 (Sized_relobj::compute_final_local_value_internal): New methods.
6665 (Sized_relobj::do_finalize_local_symbols): Move code from loop
6666 body into private version of Sized_relobj::compute_final_local_value.
6667 Call the inline method.
6668 * object.h (Symbol_value::Symbol_value): Define destructor. Free
6669 merged symbol value if there is one.
6670 (Symbol_value::has_output_value): New method defintiion.
6671 (Sized_relobj::Compute_final_local_value_status): New enum type.
6672 (Sized_relobj::compute_final_local_value): New methods.
6673 (Sized_relobj::compute_final_local_value_internal): New methods.
6674 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
6675 and arm_cortex_a8.sh.
6676 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
6677 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
6678 New tests.
6679 * Makefile.in: Regenerate.
6680 * testsuite/arm_bl_out_of_range.s: Update test.
6681 * testsuite/thumb_bl_out_of_range.s: Ditto.
6682 * testsuite/thumb_blx_out_of_range.s: Ditto.
6683 * testsuite/arm_branch_out_of_range.sh: New file.
6684 * testsuite/arm_cortex_a8.sh: Ditto.
6685 * testsuite/arm_cortex_a8_b.s: Ditto.
6686 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
6687 * testsuite/arm_cortex_a8_b_local.s: Ditto.
6688 * testsuite/arm_cortex_a8_bl.s: Ditto.
6689 * testsuite/arm_cortex_a8_blx.s: Ditto.
6690 * testsuite/arm_cortex_a8_local.s: Ditto.
6691 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
6692 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
6693
6694 2010-09-08 Rafael Espindola <espindola@google.com>
6695
6696 * Makefile.am (memory_test.stdout): Run readelf with -W.
6697 * Makefile.in: Regenerate.
6698 * testsuite/memory_test.sh: Make the regexps accept both 32 and
6699 64 bit output.
6700
6701 2010-09-08 Rafael Espindola <espindola@google.com>
6702
6703 * script-sections.cc (Script_sections::add_memory_region): Convert
6704 field precision to int.
6705 * script.cc (script_set_section_region, script_set_section_region):
6706 Convert field precision to int.
6707
6708 2010-09-08 Rafael Espindola <espindola@google.com>
6709
6710 * arm.cc (do_finalize_sections): Create the __exidx_start and
6711 __exdix_end symbols even when the section is missing.
6712
6713 2010-09-08 Nick Clifton <nickc@redhat.com>
6714
6715 * README: Remove claim that MEMORY is not supported.
6716 * expression.cc (script_exp_function_origin)
6717 (script_exp_function_length): Move from here to ...
6718 * script.cc: ... here.
6719 (script_set_section_region, script_add_memory)
6720 (script_parse_memory_attr, script_include_directive): New
6721 functions.
6722 * script-sections.cc
6723 (class Memory_region): New class.
6724 (class Output_section_definition): Add set_memory_region,
6725 set_section_vma, set_section_lma and get_section_name methods.
6726 (class Script_Sections): Add add_memory_region,
6727 find_memory_region, find_memory_region_origin,
6728 find_memory_region_length and set_memory_region methods.
6729 Have set_section_addresses method walk the list of set memory
6730 regions.
6731 Extend the print methos to display memory regions.
6732 * script-sections.h: Add prototypes for new methods.
6733 Add enum for MEMORY region attributes.
6734 * yyscript.y: Add support for parsing MEMORY regions.
6735 * script-c.h: Add prototypes for new functions.
6736 * testsuite/Makefile.am: Add test of MEMORY region functionality.
6737 * testsuite/Makefile.in: Regenerate.
6738 * testsuite/memory_test.sh: New script.
6739 * testsuite/memory_test.s: New assembler source file.
6740 * testsuite/memory_test.t: New linker script.
6741
6742 2010-08-27 Doug Kwan <dougkwan@google.com>
6743
6744 * gold/resolve.cc (Symbol_table::should_override): Let a weak
6745 reference override an existing dynamic weak reference.
6746 * testsuite/Makefile.am: Add new test dyn_weak_ref.
6747 * testsuite/Makefile.in: Regenerate.
6748 * testsuite/dyn_weak_ref.sh: New file.
6749 * testsuite/dyn_weak_ref_1.c: Ditto.
6750 * testsuite/dyn_weak_ref_2.c: Ditto.
6751
6752 2010-08-27 Ian Lance Taylor <iant@google.com>
6753
6754 * incremental.h (class Incremental_input_entry): Add virtual
6755 destructor.
6756
6757 2010-08-27 Ian Lance Taylor <iant@google.com>
6758
6759 * testsuite/start_lib_test_3.c: Mark t3 as used.
6760
6761 2010-08-27 Nick Clifton <nickc@redhat.com>
6762
6763 * options.cc (version_script): Fix small typo in previous
6764 whitespace tidyup.
6765
6766 2010-08-25 Nick Clifton <nickc@redhat.com>
6767
6768 * archive.cc: Formatting fixes: Remove whitespace between
6769 typename and following asterisk. Remove whitespace between
6770 function name and opening parenthesis.
6771 * archive.h: Likewise.
6772 * arm.cc: Likewise.
6773 * attributes.cc: Likewise.
6774 * attributes.h: Likewise.
6775 * common.cc: Likewise.
6776 * copy-relocs.cc: Likewise.
6777 * dirsearch.h: Likewise.
6778 * dynobj.cc: Likewise.
6779 * ehframe.cc: Likewise.
6780 * ehframe.h: Likewise.
6781 * expression.cc: Likewise.
6782 * fileread.cc: Likewise.
6783 * fileread.h: Likewise.
6784 * gc.h: Likewise.
6785 * gold-threads.cc: Likewise.
6786 * gold.cc: Likewise.
6787 * i386.cc: Likewise.
6788 * icf.h: Likewise.
6789 * incremental-dump.cc: Likewise.
6790 * incremental.cc: Likewise.
6791 * layout.cc: Likewise.
6792 * layout.h: Likewise.
6793 * main.cc: Likewise.
6794 * merge.cc: Likewise.
6795 * merge.h: Likewise.
6796 * object.cc: Likewise.
6797 * object.h: Likewise.
6798 * options.cc: Likewise.
6799 * options.h: Likewise.
6800 * output.cc: Likewise.
6801 * output.h: Likewise.
6802 * plugin.cc: Likewise.
6803 * plugin.h: Likewise.
6804 * powerpc.cc: Likewise.
6805 * reloc.cc: Likewise.
6806 * script-c.h: Likewise.
6807 * script-sections.cc: Likewise.
6808 * script.cc: Likewise.
6809 * stringpool.cc: Likewise.
6810 * symtab.cc: Likewise.
6811 * symtab.h: Likewise.
6812 * target.cc: Likewise.
6813 * timer.cc: Likewise.
6814 * timer.h: Likewise.
6815 * version.cc: Likewise.
6816 * x86_64.cc: Likewise.
6817
6818 2010-08-24 Nick Clifton <nickc@redhat.com>
6819
6820 PR 11899
6821 * layout.cc (segment_precedes): Sort segments by their physical
6822 addresses, if they have been set.
6823
6824 2010-08-23 Cary Coutant <ccoutant@google.com>
6825
6826 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
6827 symbols data.
6828 (Lib_group::include_member): Unlock object after deleting its
6829 symbols data.
6830 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
6831 the bug fixed here.
6832
6833 2010-08-19 Neil Vachharajani <nvachhar@google.com>
6834 Cary Coutant <ccoutant@google.com>
6835
6836 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
6837 constructor, and set_blocker.
6838 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
6839 readsyms_blocker_.
6840 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
6841 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
6842 * testsuite/Makefile.am (start_lib_test): New test case.
6843 * testsuite/Makefile.in: Regenerate.
6844 * testsuite/start_lib_test_main.c: New file.
6845 * testsuite/start_lib_test_1.c: New file.
6846 * testsuite/start_lib_test_2.c: New file.
6847 * testsuite/start_lib_test_3.c: New file.
6848
6849 2010-08-19 Ian Lance Taylor <iant@google.com>
6850
6851 * Makefile.in: Rebuild with automake 1.11.1.
6852 * aclocal.m4: Likewise.
6853 * testsuite/Makefile.in: Likewise.
6854
6855 2010-08-19 Ian Lance Taylor <iant@google.com>
6856
6857 PR 10893
6858 * i386.cc (class Output_data_plt_i386): Update declarations.
6859 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
6860 local_ifuncs_ fields.
6861 (Target_i386::do_plt_section_for_global): New function.
6862 (Target_i386::do_plt_section_for_local): New function.
6863 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
6864 parameter; change all callers. Initialize global_ifuncs_ and
6865 local_ifuncs_. If doing a static link define __rel_iplt_start and
6866 __rel_iplt_end.
6867 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
6868 (Output_data_plt_i386::add_local_ifunc_entry): New function.
6869 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
6870 symbols.
6871 (Target_i386::make_plt_section): New function, broken out of
6872 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
6873 (Target_i386::make_plt_entry): Call make_plt_section.
6874 (Target_i386::make_local_ifunc_plt_entry): New function.
6875 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
6876 (Target_i386::Scan::local): Handle IFUNC symbols. Add
6877 R_386_IRELATIVE to switch.
6878 (Target_i386::Scan::global): Likewise.
6879 (Target_i386::Relocate::relocate): Likewise.
6880 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
6881 switch.
6882 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
6883 (Target_x86_64::do_plt_section_for_global): New function.
6884 (Target_x86_64::do_plt_section_for_local): New function.
6885 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
6886 parameter; change all callers. If doing a static link define
6887 __rela_iplt_start and __rela_iplt_end.
6888 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
6889 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
6890 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
6891 to point to .plt.
6892 (Target_x86_64::make_local_ifunc_plt_entry): New function.
6893 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
6894 switch.
6895 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
6896 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
6897 R_X86_64_IRELATIVE to switch.
6898 (Target_x86_64::Scan::global): Likewise.
6899 (Target_x86_64::Relocate::relocate): Likewise.
6900 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
6901 switch.
6902 * target.h (class Target): Add plt_section_for_global and
6903 plt_section_for_local functions. Add do_plt_section_for_global
6904 and do_plt_section_for_local virtual functions.
6905 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
6906 clarifying comments.
6907 (Symbol::use_plt_offset): Handle IFUNC symbol.
6908 * object.cc (Sized_relobj::Sized_relobj): Initialize
6909 local_plt_offsets_.
6910 (Sized_relobj::local_has_plt_offset): New function.
6911 (Sized_relobj::local_plt_offset): New function.
6912 (Sized_relobj::set_local_plt_offset): New function.
6913 (Sized_relobj::do_count): Handle IFUNC symbol.
6914 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
6915 a bit away from input_shndx_ field. Add set_is_func_symbol and
6916 is_ifunc_symbol functions.
6917 (class Sized_relobj): Update declarations. Remove Tls_got_entry
6918 and Local_tls_got_offsets. Define Local_plt_offsets. Add
6919 local_plt_offsets_ field.
6920 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
6921 * output.h (class Output_section_data): Add non-const
6922 output_section function.
6923 (class Output_data_got): Update declarations.
6924 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
6925 Add use_plt_offset parameter to global and local constructors.
6926 Change all callers. Change local_sym_index_ field to 31 bits.
6927 Change GSYM_CODE and CONSTANT_CODE accordingly.
6928 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
6929 doing a static link don't set sh_link field.
6930 (Output_data_got::Got_entry::write): Use PLT offset if
6931 appropriate.
6932 (Output_data_got::add_global_plt): New function.
6933 (Output_data_got::add_local_plt): New function.
6934 * target-reloc.h (relocate_section): Handle IFUNC symbol.
6935 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
6936 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
6937 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
6938 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
6939 IFUNC conditional.
6940 * testsuite/ifunc-sel.h: New file.
6941 * testsuite/ifuncmain1.c: New file.
6942 * testsuite/ifuncmain1vis.c: New file.
6943 * testsuite/ifuncmod1.c: New file.
6944 * testsuite/ifuncdep2.c: New file.
6945 * testsuite/ifuncmain2.c: New file.
6946 * testsuite/ifuncmain3.c: New file.
6947 * testsuite/ifuncmod3.c: New file.
6948 * testsuite/ifuncmain4.c: New file.
6949 * testsuite/ifuncmain5.c: New file.
6950 * testsuite/ifuncmod5.c: New file.
6951 * testsuite/ifuncmain6pie.c: New file.
6952 * testsuite/ifuncmod6.c: New file.
6953 * testsuite/ifuncmain7.c: New file.
6954 * configure, testsuite/Makefile.in: Rebuild.
6955
6956 2010-08-18 Ian Lance Taylor <iant@google.com>
6957
6958 * incremental.cc
6959 (Output_section_incremental_inputs::write_input_files): Add cast
6960 to avoid signed/unsigned comparison warning.
6961 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6962
6963 2010-08-12 Cary Coutant <ccoutant@google.com>
6964
6965 * common.cc (Sort_commons::operator()): Remove unnecessary code.
6966
6967 2010-08-13 Ian Lance Taylor <iant@google.com>
6968
6969 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
6970
6971 2010-08-12 Cary Coutant <ccoutant@google.com>
6972 Doug Kwan <dougkwan@google.com>
6973
6974 * resolve.cc (Symbol_table::should_override): When a weak dynamic
6975 defintion overrides non-weak undef, remember that the original undef
6976 is not weak.
6977 * symtab.cc (Symbol_table::sized_write_global): For undef without
6978 an original weak binding, set binding to global in output.
6979 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
6980 * testsuite/Makefile.in: Regenerate.
6981 * testsuite/strong_ref_weak_def.sh: New file.
6982 * testsuite/strong_ref_weak_def_1.c: Ditto.
6983 * testsuite/strong_ref_weak_def_2.c: Ditto.
6984
6985 2010-08-12 Cary Coutant <ccoutant@google.com>
6986
6987 * testsuite/incremental_test.sh: Rewrite.
6988 * testsuite/incremental_test_1.c: Rewrite.
6989 * testsuite/incremental_test_2.c: Rewrite.
6990
6991 2010-08-12 Cary Coutant <ccoutant@google.com>
6992
6993 * arm.cc (Target_arm::got_size): Add const.
6994 (Target_arm::got_entry_count): New function.
6995 (Target_arm::plt_entry_count): New function.
6996 (Target_arm::first_plt_entry_offset): New function.
6997 (Target_arm::plt_entry_size): New function.
6998 (Output_data_plt_arm::entry_count): New function.
6999 (Output_data_plt_arm::first_plt_entry_offset): New function.
7000 (Output_data_plt_arm::get_plt_entry_size): New function.
7001 * i386.cc (Target_i386::got_size): Add const.
7002 (Target_i386::got_entry_count): New function.
7003 (Target_i386::plt_entry_count): New function.
7004 (Target_i386::first_plt_entry_offset): New function.
7005 (Target_i386::plt_entry_size): New function.
7006 (Output_data_plt_i386::entry_count): New function.
7007 (Output_data_plt_i386::first_plt_entry_offset): New function.
7008 (Output_data_plt_i386::get_plt_entry_size): New function.
7009 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7010 find_incremental_inputs_sections. Dump incremental_got_plt section.
7011 * incremental.cc: Include target.h.
7012 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7013 parameter. Adjust all callers. Find incremental_got_plt section.
7014 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7015 section.
7016 (Output_section_incremental_inputs::set_final_data_size): Calculate
7017 size of incremental_got_plt section.
7018 (Output_section_incremental_inputs::do_write): Write the
7019 incremental_got_plt section.
7020 (Got_plt_view_info): New struct.
7021 (Local_got_offset_visitor): New class.
7022 (Global_got_offset_visitor): New class.
7023 (Global_symbol_visitor_got_plt): New class.
7024 (Output_section_incremental_inputs::write_got_plt): New function.
7025 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7026 Add parameter. Adjust all callers.
7027 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7028 (Incremental_inputs::got_plt_section): New function.
7029 (Incremental_inputs::got_plt_section_): New data member.
7030 (Incremental_got_plt_reader): New class.
7031 * layout.cc (Layout::create_incremental_info_sections): Add the
7032 incremental_got_plt section.
7033 * object.h (Got_offset_list::get_list): New function.
7034 (Got offset_list::for_all_got_offsets): New function.
7035 (Sized_relobj::local_got_offset_list): New function.
7036 * powerpc.cc (Target_powerpc::got_size): Add const.
7037 (Target_powerpc::got_entry_count): New function.
7038 (Target_powerpc::plt_entry_count): New function.
7039 (Target_powerpc::first_plt_entry_offset): New function.
7040 (Target_powerpc::plt_entry_size): New function.
7041 (Output_data_plt_powerpc::entry_count): New function.
7042 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7043 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7044 * sparc.cc (Target_sparc::got_size): Add const.
7045 (Target_sparc::got_entry_count): New function.
7046 (Target_sparc::plt_entry_count): New function.
7047 (Target_sparc::first_plt_entry_offset): New function.
7048 (Target_sparc::plt_entry_size): New function.
7049 (Output_data_plt_sparc::entry_count): New function.
7050 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7051 (Output_data_plt_sparc::get_plt_entry_size): New function.
7052 * symtab.h (Symbol::got_offset_list): New function.
7053 (Symbol_table::for_all_symbols): New function.
7054 * target.h (Sized_target::got_entry_count): New function.
7055 (Sized_target::plt_entry_count): New function.
7056 (Sized_target::plt_entry_size): New function.
7057 * x86_64.cc (Target_x86_64::got_size): Add const.
7058 (Target_x86_64::got_entry_count): New function.
7059 (Target_x86_64::plt_entry_count): New function.
7060 (Target_x86_64::first_plt_entry_offset): New function.
7061 (Target_x86_64::plt_entry_size): New function.
7062 (Output_data_plt_x86_64::entry_count): New function.
7063 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7064 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7065
7066 2010-08-12 Cary Coutant <ccoutant@google.com>
7067
7068 * archive.cc: Include incremental.h.
7069 (Archive::Archive): Initialize incremental_info_.
7070 (Archive::include_member): Record archive members in incremental info.
7071 (Add_archive_symbols::run): Record begin and end of an archive in
7072 incremental info.
7073 (Lib_group::include_member): Record objects in incremental info.
7074 * archive.h (Incremental_archive_entry): Forward declaration.
7075 (Archive::set_incremental_info): New member function.
7076 (Archive::incremental_info): New member function.
7077 (Archive::Unused_symbol_iterator): New class.
7078 (Archive::unused_symbols_begin): New member function.
7079 (Archive::unused_symbols_end): New member function.
7080 (Archive::incremental_info_): New data member.
7081 * incremental-dump.cc (find_input_containing_global): New function.
7082 (dump_incremental_inputs): Dump new incremental info sections.
7083 * incremental.cc: Include symtab.h.
7084 (Output_section_incremental_inputs): New class.
7085 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7086 new incremental info sections.
7087 (Sized_incremental_binary::do_check_inputs): Likewise.
7088 (Incremental_inputs::report_archive): Remove.
7089 (Incremental_inputs::report_archive_begin): New function.
7090 (Incremental_inputs::report_archive_end): New function.
7091 (Incremental_inputs::report_object): New function.
7092 (Incremental_inputs::finalize_inputs): Remove.
7093 (Incremental_inputs::report_input_section): New function.
7094 (Incremental_inputs::report_script): Rewrite.
7095 (Incremental_inputs::finalize): Do nothing but finalize string table.
7096 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7097 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7098 (Incremental_inputs::create_data_sections): New function.
7099 (Incremental_inputs::relocs_entsize): New function.
7100 (Output_section_incremental_inputs::set_final_data_size): New function.
7101 (Output_section_incremental_inputs::do_write): New function.
7102 (Output_section_incremental_inputs::write_header): New function.
7103 (Output_section_incremental_inputs::write_input_files): New function.
7104 (Output_section_incremental_inputs::write_info_blocks): New function.
7105 (Output_section_incremental_inputs::write_symtab): New function.
7106 * incremental.h (Incremental_script_entry): Forward declaration.
7107 (Incremental_object_entry): Forward declaration.
7108 (Incremental_archive_entry): Forward declaration.
7109 (Incremental_inputs): Forward declaration.
7110 (Incremental_inputs_header_data): Remove.
7111 (Incremental_inputs_header): Remove.
7112 (Incremental_inputs_header_write): Remove.
7113 (Incremental_inputs_entry_data): Remove.
7114 (Incremental_inputs_entry): Remove.
7115 (Incremental_inputs_entry_write): Remove.
7116 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7117 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7118 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7119 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7120 Likewise.
7121 (Incremental_input_entry): New class.
7122 (Incremental_script_entry): New class.
7123 (Incremental_object_entry): New class.
7124 (Incremental_archive_entry): New class.
7125 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7126 (Incremental_inputs::report_inputs): Remove.
7127 (Incremental_inputs::report_archive): Remove.
7128 (Incremental_inputs::report_archive_begin): New function.
7129 (Incremental_inputs::report_archive_end): New function.
7130 (Incremental_inputs::report_object): Change prototype.
7131 (Incremental_inputs::report_input_section): New function.
7132 (Incremental_inputs::report_script): Change prototype.
7133 (Incremental_inputs::get_reloc_count): New function.
7134 (Incremental_inputs::set_reloc_count): New function.
7135 (Incremental_inputs::create_data_sections): New function.
7136 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7137 (Incremental_inputs::inputs_section): New function.
7138 (Incremental_inputs::symtab_section): New function.
7139 (Incremental_inputs::relocs_section): New function.
7140 (Incremental_inputs::get_stringpool): Add const.
7141 (Incremental_inputs::command_line): Add const.
7142 (Incremental_inputs::inputs): Remove.
7143 (Incremental_inputs::command_line_key): New function.
7144 (Incremental_inputs::input_file_count): New function.
7145 (Incremental_inputs::input_files): New function.
7146 (Incremental_inputs::relocs_entsize): New function.
7147 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7148 (Incremental_inputs::finalize_inputs): Remove.
7149 (Incremental_inputs::Input_info): Remove.
7150 (Incremental_inputs::lock_): Remove.
7151 (Incremental_inputs::inputs_): Change type.
7152 (Incremental_inputs::inputs_map_): Remove.
7153 (Incremental_inputs::current_object_entry_): New data member.
7154 (Incremental_inputs::inputs_section_): New data member.
7155 (Incremental_inputs::symtab_section_): New data member.
7156 (Incremental_inputs::relocs_section_): New data member.
7157 (Incremental_inputs::reloc_count_): New data member.
7158 (Incremental_inputs_reader): New class.
7159 (Incremental_symtab_reader): New class.
7160 (Incremental_relocs_reader): New class.
7161 * layout.cc (Layout::finalize): Move finalization of incremental info
7162 and creation of incremental info sections to follow finalization of
7163 symbol table. Set offsets for postprocessing sections.
7164 (Layout::create_incremental_info_sections): Call
7165 Incremental_inputs::create_data_sections. Add incremental symtab
7166 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7167 sections to layout after input sections.
7168 * layout.h (struct Timespec): Forward declaration.
7169 (Layout::incremental_inputs): Add const.
7170 (Layout::create_incremental_info_sections): Add parameter.
7171 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7172 * object.cc: Include incremental.h.
7173 (Relobj::finalize_incremental_relocs): New function.
7174 (Sized_relobj::do_layout): Record input sections in incremental info.
7175 * object.h (Object::output_section): New function.
7176 (Object::output_section_offset): Moved from Relobj.
7177 (Object::get_incremental_reloc_base): New function.
7178 (Object::get_incremental_reloc_count): New function.
7179 (Object::do_output_section): New function.
7180 (Object::do_output_section_offset): Moved from Relobj.
7181 (Object::do_get_incremental_reloc_base): New function.
7182 (Object::do_get_incremental_reloc_count): New function.
7183 (Object::Object): Initialize new data members.
7184 (Relobj::output_section): Renamed do_output_section and moved to
7185 protected.
7186 (Relobj::output_section_offset): Moved to Object.
7187 (Relobj::do_get_incremental_reloc_base): New function.
7188 (Relobj::do_get_incremental_reloc_count): New function.
7189 (Relobj::allocate_incremental_reloc_counts): New function.
7190 (Relobj::count_incremental_reloc): New function.
7191 (Relobj::finalize_incremental_relocs): New function.
7192 (Relobj::next_incremental_reloc_index): New function.
7193 (Relobj::reloc_counts_): New data member.
7194 (Relobj::reloc_bases_): New data member.
7195 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7196 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7197 (Sized_relobj::incremental_relocs_scan): New function.
7198 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7199 (Sized_relobj::incremental_relocs_write): New function.
7200 (Sized_relobj::incremental_relocs_write_reltype): New function.
7201 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7202 incremental link.
7203 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7204 archives and object files elsewhere.
7205 (Add_symbols::run): Report object files here.
7206 (Finish_group::run): Report end of archive at end of group.
7207 * reloc.cc: Include layout.h, incremental.h.
7208 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7209 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7210 (Sized_relobj::incremental_relocs_scan): New function.
7211 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7212 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7213 (Sized_relobj::incremental_relocs_write): New function.
7214 (Sized_relobj::incremental_relocs_write_reltype): New function.
7215 * script.cc (read_input_script): Rewrite test for incremental link.
7216 Change call to Incremental_inputs::report_script.
7217 * symtab.h (Symbol_table::first_global_index): New function.
7218 (Symbol_table::output_count): New function.
7219
7220 2010-08-12 Doug Kwan <dougkwan@google.com>
7221
7222 * arm.cc (Target_arm::merge_object_attributes): Check command line
7223 options --no-wchar-size-warning and --no-enum-size-warning.
7224 * options.h (General_options): Add ld-compatible options
7225 --no-enum-size-warning and --no-wchar-size-warning.
7226
7227 2010-08-04 Ian Lance Taylor <iant@google.com>
7228
7229 * x86_64.cc (Target_x86_64::Scan::local): Use
7230 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7231 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7232 (Target_x86_64::Scan::global): Likewise.
7233 (Target_x86_64::Relocate::relocate): Likewise.
7234 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7235 Likewise.
7236
7237 2010-08-03 Cary Coutant <ccoutant@google.com>
7238
7239 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7240 to reserve space in merged_strings vector. Keep total input size
7241 for stats.
7242 (Output_merge_string::do_print_merge_stats): Print total input size.
7243 * merge.h (Output_merge_string): Add input_size_ field.
7244 * stringpool.cc (Stringpool_template::string_length): Move
7245 implementations out of Stringpool_template class and place in
7246 stringpool.h.
7247 * stringpool.h (string_length): Move out of Stringpool_template.
7248
7249 2010-08-03 Ian Lance Taylor <iant@google.com>
7250
7251 PR 11712
7252 * layout.cc (relaxation_loop_body): If address of load segment is
7253 set, adjust address to include headers if possible.
7254
7255 2010-08-03 Ian Lance Taylor <iant@google.com>
7256
7257 * version.cc (version_string): Bump to 1.10.
7258
7259 2010-08-03 Ian Lance Taylor <iant@google.com>
7260
7261 PR 11805
7262 * layout.h (enum Output_section_order): Define.
7263 (class Layout): Update declarations.
7264 * layout.cc (Layout::get_output_section): Add order parameter.
7265 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7266 is_first_non_relro parameters. Change all callers.
7267 (Layout::choose_output_section): Likewise.
7268 (Layout::add_output_section_data): Likewise.
7269 (Layout::make_output_section): Likewise. Set order.
7270 (Layout::default_section_order): New function.
7271 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7272 * output.cc (Output_section::Output_section): Initialize order_.
7273 Don't initialize deleted fields.
7274 (Output_segment::Output_segment): Don't initialize deleted
7275 fields.
7276 (Output_segment::add_output_section_to_load): New function
7277 replacing add_output_section. Change all callers to call this or
7278 add_output_section_to_nonload.
7279 (Output_segment::add_output_section_to_nonload): New function.
7280 (Output_segment::remove_output_section): Rewrite.
7281 (Output_segment::add_initial_output_data): Likewise.
7282 (Output_segment::has_any_data_sections): Likewise.
7283 (Output_segment::is_first_section_relro): Likewise.
7284 (Output_segment::maximum_alignment): Likewise.
7285 (Output_segment::has_dynamic_reloc): New function replacing
7286 dynamic_reloc_count. Change all callers.
7287 (Output_segment::has_dynamic_reloc_list): New function replacing
7288 dynamic_reloc_count_list. Change all callers.
7289 (Output_segment::set_section_addresses): Rewrite.
7290 (Output_segment::set_offset): Rewrite.
7291 (Output_segment::find_first_and_last_list): Remove.
7292 (Output_segment::set_tls_offsets): Rewrite.
7293 (Output_segment::first_section_load_address): Likewise.
7294 (Output_segment::output_section_count): Likewise.
7295 (Output_segment::section_with_lowest_load_address): Likewise.
7296 (Output_segment::write_section_headers): Likewise.
7297 (Output_segment::print_sections_to_map): Likewise.
7298 * output.h (class Output_data): Remove dynamic_reloc_count_
7299 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7300 (Output_data::add_dynamic_reloc): Rewrite.
7301 (Output_data::has_dynamic_reloc): New function.
7302 (Output_data::dynamic_reloc_count): Remove.
7303 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7304 is_last_relro_, is_first_non_relro_, is_interp_,
7305 is_dynamic_linker_section_ fields. Add order and set_order
7306 functions. Remove is_relro_local, set_is_relro_local,
7307 is_last_relro, set_is_last_relro, is_first_non_relro,
7308 set_is_first_non_relro functions, is_interp, set_is_interp,
7309 is_dynamic_linker_section, and set_is_dynamic_linker_section
7310 functions.
7311 (class Output_segment): Change Output_data_list from std::list to
7312 std:;vector. Add output_lists_ field. Remove output_data_ and
7313 output_bss_ fields. Update declarations.
7314
7315 2010-08-02 Ian Lance Taylor <iant@google.com>
7316
7317 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7318 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7319 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7320
7321 2010-08-02 Ian Lance Taylor <iant@google.com>
7322
7323 PR 11855
7324 * script.cc (Script_options::Script_options): Initialize
7325 symbol_definitions_ and symbol_references_.
7326 (Script_options::add_symbol_assignment): Update
7327 symbol_definitions_ and symbol_references_.
7328 (Script_options::add_symbol_reference): New function.
7329 (script_symbol): New function.
7330 * script.h (class Script_options): Add symbol_definitions_ and
7331 symbol_references_ fields.
7332 (Script_options::referenced_const_iterator): New type.
7333 (Script_options::referenced_begin): New function.
7334 (Script_options::referenced_end): New function.
7335 (Script_options::is_referenced): New function.
7336 (Script_options::any_unreferenced): New function.
7337 * script-c.h (script_symbol): Declare.
7338 * yyscript.y (exp): Call script_symbol.
7339 * symtab.cc: Include "script.h".
7340 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7341 Change all callers. Check symbols referenced by scripts.
7342 (Symbol_table::add_undefined_symbols_from_command_line): Add
7343 layout parameter. Change all callers.
7344 (Symbol_table::do_add_undefined_symbols_from_command_line):
7345 Likewise. Break out loop body. Check symbols referenced by
7346 scripts.
7347 (Symbol_table::add_undefined_symbol_from_command_line): New
7348 function broken out of
7349 do_add_undefined_symbols_from_command_line.
7350 * symtab.h (class Symbol_table): Update declarations.
7351 * archive.cc: Include "layout.h".
7352 (Archive::should_include_member): Add layout parameter. Change
7353 all callers. Check for symbol mentioned in expression.
7354 * archive.h (class Archive): Update declaration.
7355 * object.cc (Sized_relobj::do_should_include_member): Add layout
7356 parameter.
7357 * object.h (Object::should_include_member): Add layout parameter.
7358 Change all callers.
7359 (Object::do_should_include_member): Add layout parameter.
7360 (class Sized_relobj): Update declaration.
7361 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7362 parameter.
7363 * dynobj.h (class Sized_dynobj): Update declaration.
7364 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7365 layout parameter.
7366 * plugin.h (class Sized_pluginobj): Update declaration.
7367
7368 2010-08-02 Ian Lance Taylor <iant@google.com>
7369
7370 PR 11866
7371 * output.cc (Output_segment::set_offset): Search for the first and
7372 last sections rather than assuming that the list is in order.
7373 (Output_segment::find_first_and_last_list): New function.
7374 * output.h (class Output_segment): Update declarations.
7375 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7376 (relro_strip_test_SOURCES): New variable.
7377 (relro_strip_test_DEPENDENCIES): New variable.
7378 (relro_strip_test_LDFLAGS): New variable.
7379 (relro_strip_test_LDADD): New variable.
7380 (relro_strip_test.so): New target.
7381
7382 2010-08-02 Ian Lance Taylor <iant@google.com>
7383
7384 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7385 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7386 (Target_i386::got_tlsdesc_section): New function.
7387 (Target_i386::got_section): Create space for GOT entries for
7388 TLSDESC relocations.
7389 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7390 R_386_TLS_GOTDESC.
7391 (Target_i386::Scan::global): Likewise.
7392 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7393 using TLSDESC GOT.
7394 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7395 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7396 (Target_x86_64::got_tlsdesc_section): New function.
7397 (Target_x86_64::got_section): Create space for GOT entries for
7398 TLSDESC relocations.
7399 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7400 R_386_TLS_GOTDESC.
7401 (Target_x86_64::Scan::global): Likewise.
7402 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7403 using TLSDESC GOT.
7404
7405 2010-08-02 Ian Lance Taylor <iant@google.com>
7406
7407 * testsuite/final_layout.sh: Use dc to convert from hex to
7408 decimal.
7409
7410 2010-07-29 Sriraman Tallam <tmsriram@google.com>
7411
7412 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7413 paramter to the call to gold::gc_process_relocs.
7414 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7415 paramter to the call to gold::gc_process_relocs.
7416 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7417 parameter to the call to gold::gc_process_relocs.
7418 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7419 template parameter to the call to gold::gc_process_relocs.
7420 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7421 paramter to the call to gold::gc_process_relocs.
7422 * gc.h (get_embedded_addend_size): New function.
7423 (gc_process_relocs): Save the size of the reloc for use by ICF.
7424 * icf.cc (get_section_contents): Get the addend from the text section
7425 for SHT_REL relocation sections.
7426 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7427 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7428 * int_encoding.h (read_from_pointer): New overloaded function.
7429 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7430 * testsuite/icf_sht_rel_addend_test.sh: New file.
7431 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7432 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7433
7434 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7435
7436 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7437 * Makefile.in: Regenerate.
7438 * testsuite/Makefile.in: Regenerate.
7439
7440 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7441
7442 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7443 * gold/testsuite/debug_msg.cc: Likewise.
7444 * gold/testsuite/odr_violation1.cc
7445 * gold/testsuite/odr_violation2.cc
7446
7447 2010-07-21 Cary Coutant <ccoutant@google.com>
7448
7449 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7450 string, and length fields.
7451 (Output_merge_string::Merged_strings_list): New type.
7452 (Output_merge_string::Merged_strings_lists): New typedef.
7453 (Output_merge_string): Replace merged_strings_ with
7454 merged_strings_lists_.
7455 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7456 Merged_strings_list per input object and section. Don't store pointer
7457 to the string. Don't store length with each merged string entry.
7458 (Output_merge_string::finalize_merged_data): Loop over list of merged
7459 strings lists. Recompute length of each merged string.
7460
7461 2010-07-15 Cary Coutant <ccoutant@google.com>
7462
7463 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7464 here.
7465
7466 2010-07-14 Ian Lance Taylor <iant@google.com>
7467
7468 * descriptors.cc (Descriptors::open): Report correct name in error
7469 message.
7470
7471 2010-07-13 Doug Kwan <dougkwan@google.com>
7472
7473 * arm.cc (Arm_input_section::Arm_input_section): For a
7474 SHT_ARM_EXIDX section, always keeps the input sections.
7475 (Arm_input_section::set_exidx_section_link): New method.
7476 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7477 has_errors_ to false.
7478 (Arm_exidx_input_section::has_errors,
7479 Arm_exidx_input_section::set_has_errors): New methods.
7480 (Arm_exidx_input_section::has_errors_): New data member.
7481 (Arm_relobj::get_exidx_shndx_list): New method.
7482 (Arm_output_section::append_text_sections_to_list): Do not skip
7483 section without SHF_EXECINSTR.
7484 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7485 errors.
7486 (Arm_relobj::make_exidx_input_section): Add new parameter for text
7487 section header. Make error messages more verbose. Check for
7488 a non-executable section linked to an EXIDX section.
7489 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7490 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7491 check that there is no deferred EXIDX section if we exit early.
7492 Instead of not making an EXIDX section in case of an error, make one
7493 and set the has_errors flag of it.
7494 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7495 in a relocatable link.
7496 (Target_arm::do_relax): Look for the EXIDX output section instead of
7497 assuming that it is called .ARM.exidx.
7498 (Target_arm::fix_exidx_coverage): Add a new parameter for input
7499 section list. Do not check for SHF_EXECINSTR section flags but
7500 skip any input section with errors.
7501 * output.cc (Output_section::Output_section): Initialize
7502 always_keeps_input_sections_ to false.
7503 (Output_section::add_input_section): Check for
7504 always_keeps_input_sections_.
7505 * output.h (Output_section::always_keeps_input_sections,
7506 Output_section::set_always_keeps_input_sections): New methods.
7507 (Output_section::always_keeps_input_sections): New data member.
7508
7509 2010-07-13 Rafael Espindola <espindola@google.com>
7510
7511 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7512 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7513
7514 2010-07-13 Philip Herron <herron.philip@googlemail.com>
7515 Ian Lance Taylor <iant@google.com>
7516
7517 * output.h (Output_section_lookup_maps::add_merge_section):
7518 Correct check of whether value was inserted.
7519 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7520 (Output_section_lookup_maps::add_relaxed_input_section):
7521 Likewise.
7522 * arm.cc (Target_arm::got_section): Remove used local os.
7523 * i386.cc (Target_i386::got_section): Likewise.
7524 * x86_64.cc (Target_x86_64::got_section): Likewise.
7525 * sparc.cc (Target_sparc::got_section): Likewise.
7526 (Target_sparc::relocate): Remove unused local have_got_offset.
7527 * powerpc.cc (Target_powerpc::relocate): Likewise.
7528
7529 2010-07-13 Ian Lance Taylor <iant@google.com>
7530
7531 * compressed_output.cc (zlib_decompress): Fix signature in
7532 !HAVE_ZLIB_H case.
7533
7534 * archive.cc (Archive::include_member): Unlock an external member
7535 of a thin archive. Don't bother to delete an object we know is
7536 NULL.
7537
7538 2010-07-12 Cary Coutant <ccoutant@google.com>
7539
7540 * compressed_output.cc (zlib_decompress): New function.
7541 (get_uncompressed_size): New function.
7542 (decompress_input_section): New function.
7543 * compressed_output.h (get_uncompressed_size): New function.
7544 (decompress_input_section): New function.
7545 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7546 Handle compressed debug sections.
7547 * layout.cc (is_compressed_debug_section): New function.
7548 (Layout::output_section_name): Map compressed section names to
7549 canonical names.
7550 * layout.h (is_compressed_debug_section): New function.
7551 (is_debug_info_section): Recognize compressed debug sections.
7552 * merge.cc: Include compressed_output.h.
7553 (Output_merge_data::do_add_input_section): Handle compressed
7554 debug sections.
7555 (Output_merge_string::do_add_input_section): Handle compressed
7556 debug sections.
7557 * object.cc: Include compressed_output.h.
7558 (Sized_relobj::Sized_relobj): Initialize new data members.
7559 (build_compressed_section_map): New function.
7560 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7561 * object.h (Object::section_is_compressed): New method.
7562 (Object::do_section_is_compressed): New method.
7563 (Sized_relobj::Compressed_section_map): New type.
7564 (Sized_relobj::do_section_is_compressed): New method.
7565 (Sized_relobj::compressed_sections_): New data member.
7566 * output.cc (Output_section::add_input_section): Handle compressed
7567 debug sections.
7568 * reloc.cc: Include compressed_output.h.
7569 (Sized_relobj::write_sections): Handle compressed debug sections.
7570
7571 2010-07-08 Cary Coutant <ccoutant@google.com>
7572
7573 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7574 weak when resolving to a dynamic def.
7575 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7576 for weak undef/dynamic def cases. Adjust callers.
7577 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7578 undef_binding_weak_.
7579 (Symbol_table::sized_write_globals): Adjust symbol binding.
7580 (Symbol_table::sized_write_symbol): Add binding parameter.
7581 * symtab.h (Symbol::set_undef_binding): New method.
7582 (Symbol::is_undef_binding_weak): New method.
7583 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
7584 (Symbol_table::should_override): Add new parameter.
7585 (Symbol_table::sized_write_symbol): Add new parameter.
7586
7587 * testsuite/weak_undef_file1.cc: Add new test case.
7588 * testsuite/weak_undef_file2.cc: Fix header comment.
7589 * testsuite/weak_undef_test.cc: Add new test case.
7590
7591 2010-06-29 Doug Kwan <dougkwan@google.com>
7592
7593 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
7594 Initialize USE_SYMBOL_.
7595 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
7596 definition.
7597 (Arm_reloc_property::uses_symbol_): New data member declaration.
7598 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
7599 uses symbol value and symbol is undefined but not weakly undefined.
7600
7601 2010-06-28 Rafael Espindola <espindola@google.com>
7602
7603 * plugin.cc (Plugin::load): Use dlerror.
7604
7605 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
7606
7607 * symtab.cc (detect_odr_violations): When reporting an ODR
7608 violation, report an object where the symbol is defined.
7609
7610 2010-06-25 Doug Kwan <dougkwan@google.com>
7611
7612 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
7613 (Target_arm::section_may_have_icf_unsafe_pointers): New method
7614 definition.
7615 (Target_arm::Scan::local_reloc_may_be_function_pointer,
7616 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
7617 target hook to detect function points.
7618 (Target_arm::Scan::possible_function_pointer_reloc): New method.
7619 * icf.h (Icf::check_section_for_function_pointers): Change type of
7620 parameter SECTION_NAME to const reference to std::string. Use
7621 target hook to determine if section may have unsafe pointers.
7622 * target.h (Target::section_may_have_icf_unsafe_pointers): New
7623 method definition.
7624
7625 2010-06-21 Rafael Espindola <espindola@google.com>
7626
7627 * fileread.cc (Input_file::find_fie): New
7628 (Input_file::open): Use Input_file::find_fie.
7629 * fileread.h (Input_file::find_fie): New
7630 * plugin.cc (set_extra_library_path): New.
7631 (Plugin::load): Add set_extra_library_path to the transfer vector.
7632 (Plugin_manager::set_extra_library_path): New.
7633 (Plugin_manager::add_input_file): Use the extra search path if set.
7634 (set_extra_library_path(): New.
7635 * plugin.h (Plugin_manager): Add set_extra_library_path and
7636 extra_search_path_.
7637
7638 2010-06-19 Cary Coutant <ccoutant@google.com>
7639
7640 * layout.cc (gdb_sections): Add .debug_types.
7641 (lines_only_debug_sections): Likewise.
7642
7643 2010-06-18 Rafael Espindola <espindola@google.com>
7644
7645 * plugin.cc (add_input_file,add_input_library)
7646 (Plugin_manager::add_input_file): Make filename arguments const.
7647 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
7648 const.
7649
7650 2010-06-16 Doug Kwan <dougkwan@google.com>
7651
7652 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
7653 .ARM.attributes section if we have not merged any input
7654 attributes sections.
7655
7656 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7657
7658 * arm.cc: Allow combining objects with no EABI version
7659 information.
7660
7661 2010-06-15 Rafael Espindola <espindola@google.com>
7662
7663 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
7664
7665 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7666
7667 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
7668 (struct iovec): Correct !HAVE_READV definition.
7669
7670 2010-06-10 Cary Coutant <ccoutant@google.com>
7671
7672 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
7673 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
7674 reloc sections.
7675 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
7676
7677 PR 11683
7678 * symtab.h (Symbol::is_placeholder): New member function.
7679 * target-reloc.h (relocate_section): Check for placeholder symbols.
7680
7681 * testsuite/Makefile.am (plugin_test_8): New test.
7682 (plugin_test_9): New test.
7683 * testsuite/Makefile.in: Regenerate.
7684
7685 2010-06-09 Nick Clifton <nickc@redhat.com>
7686
7687 * yyscript.y (input_list_element): Allow strings prefixed with
7688 the '-' character. Treat these as libraries.
7689 * script.cc (script_add_library): New function. Adds a library
7690 specified by "-l<name>" found in an input script.
7691 * script-c.h: Add prototype for script_add_library.
7692
7693 2010-06-07 Doug Kwan <dougkwan@google.com>
7694
7695 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
7696 Restrict stub-group size to be within long conditional branch
7697 range when working around cortex-A8 erratum.
7698
7699 2010-06-07 Damien Diederen <dd@crosstwine.com>
7700
7701 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
7702 #ifdef typo.
7703
7704 2010-06-03 Sriraman Tallam <tmsriram@google.com>
7705
7706 PR gold/11658
7707 * output.cc
7708 (Output_section::Input_section_sort_entry::compare_section_ordering):
7709 Change to return non-zero correctly.
7710 (Output_section::Input_section_sort_section_order_index_compare
7711 ::operator()): Change to fix ambiguity in comparisons.
7712
7713 2010-06-01 Sriraman Tallam <tmsriram@google.com>
7714
7715 * gold.h (is_wildcard_string): New function.
7716 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
7717 (Layout::layout_eh_frame): Ditto.
7718 (Layout::find_section_order_index): New method.
7719 (Layout::read_layout_from_file): New method.
7720 * layout.h (Layout::find_section_order_index): New method.
7721 (Layout::read_layout_from_file): New method.
7722 (Layout::input_section_position_): New private member.
7723 (Layout::input_section_glob_): New private member.
7724 * main.cc (main): Call read_layout_from_file here.
7725 * options.h (--section-ordering-file): New option.
7726 * output.cc (Output_section::input_section_order_specified_): New
7727 member.
7728 (Output_section::Output_section): Initialize new member.
7729 (Output_section::add_input_section): Add new parameter.
7730 Keep input sections when --section-ordering-file is used.
7731 (Output_section::set_final_data_size): Sort input sections when
7732 section ordering file is specified.
7733 (Output_section::Input_section_sort_entry): Add new parameter.
7734 Check sorting type.
7735 (Output_section::Input_section_sort_entry::compare_section_ordering):
7736 New method.
7737 (Output_section::Input_section_sort_compare::operator()): Change to
7738 consider section_order_index.
7739 (Output_section::Input_section_sort_init_fini_compare::operator()):
7740 Change to consider section_order_index.
7741 (Output_section::Input_section_sort_section_order_index_compare
7742 ::operator()): New method.
7743 (Output_section::sort_attached_input_sections): Change to sort
7744 according to section order when specified.
7745 (Output_section::add_input_section<32, true>): Add new parameter.
7746 (Output_section::add_input_section<64, true>): Add new parameter.
7747 (Output_section::add_input_section<32, false>): Add new parameter.
7748 (Output_section::add_input_section<64, false>): Add new parameter.
7749 * output.h (Output_section::add_input_section): Add new parameter.
7750 (Output_section::input_section_order_specified): New
7751 method.
7752 (Output_section::set_input_section_order_specified): New method.
7753 (Input_section::Input_section): Initialize section_order_index_.
7754 (Input_section::section_order_index): New method.
7755 (Input_section::set_section_order_index): New method.
7756 (Input_section::section_order_index_): New member.
7757 (Input_section::Input_section_sort_section_order_index_compare): New
7758 struct.
7759 (Output_section::input_section_order_specified_): New member.
7760 * script-sections.cc (is_wildcard_string): Delete and move modified
7761 method to gold.h.
7762 (Output_section_element_input::Output_section_element_input): Modify
7763 call to is_wildcard_string.
7764 (Output_section_element_input::Input_section_pattern
7765 ::Input_section_pattern): Ditto.
7766 (Output_section_element_input::Output_section_element_input): Ditto.
7767 * testsuite/Makefile.am (final_layout): New test case.
7768 * testsuite/Makefile.in: Regenerate.
7769 * testsuite/final_layout.cc: New file.
7770 * testsuite/final_layout.sh: New file.
7771
7772 2010-06-01 Rafael Espindola <espindola@google.com>
7773
7774 * plugin.cc (Plugin::load): Pass the output name to the plugin.
7775
7776 2010-06-01 Rafael Espindola <espindola@google.com>
7777
7778 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
7779 visibility of symbols.
7780
7781 2010-05-27 Doug Kwan <dougkwan@google.com>
7782
7783 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
7784 from start of output section instead of address for a local symbol
7785 in a merged or relaxed section when doing a relocatable link.
7786
7787 2010-05-26 Rafael Espindola <espindola@google.com>
7788
7789 PR 11604
7790 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7791 adding sections the garbage collector removed.
7792 * gold/testsuite/Makefile.am: Add test.
7793 * gold/testsuite/Makefile.in: Regenerate.
7794 * gold/testsuite/plugin_test_7.sh: New.
7795 * gold/testsuite/plugin_test_7_1.c: New.
7796 * gold/testsuite/plugin_test_7_2.c: New.
7797
7798 2010-05-26 Rafael Espindola <espindola@google.com>
7799
7800 * script-sections.cc (Output_section_definition::set_section_addresses):
7801 Check for --section-start.
7802
7803 2010-05-26 Doug Kwan <dougkwan@google.com>
7804
7805 * arm.cc (Arm_scan_relocatable_relocs): New class.
7806 (Target_arm::relocate_special_relocatable): New method.
7807 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7808 (Arm_relocate_functions::thumb_branch_common): Same.
7809 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7810 instead of Default_scan_relocatable_relocs.
7811 * target-reloc.h (relocate_for_relocatable): Let target handle
7812 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7813 * target.h (Sized_target::relocate_special_relocatable): New method.
7814
7815 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7816
7817 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7818
7819 2010-05-23 Doug Kwan <dougkwan@google.com>
7820
7821 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
7822 instead of a cast.
7823 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
7824 with a direct branch, not a conditional branch, to a stub.
7825 * merge.cc (Output_merge_base::record_input_section): New method
7826 defintion.
7827 (Output_merge_data::do_add_input_section): Record input section if
7828 keeps-input-sections flag is set.
7829 (Output_merge_string::do_add_input_section): Ditto.
7830 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
7831 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
7832 INPUT_SECTIONS_.
7833 (Output_merge_base::keeps_input_sections,
7834 Output_merge_base::set_keeps_input_sections,
7835 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
7836 method definitions.
7837 (Output_merge_base::Input_sections): New type declaration.
7838 (Output_merge_base::input_sections_begin,
7839 Output_merge_base::input_sections_end,
7840 Output_merge_base::do_set_keeps_input_sections): New method definitions.
7841 (Output_merge_base::bool keeps_input_sections_,
7842 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
7843 Output_merge_base::input_sections_): New data members.
7844 (Output_merge_data::do_set_keeps_input_sections): New method
7845 defintion.
7846 (Output_merge_string::do_set_keeps_input_sections): Ditto.
7847 * output.cc (Output_section::Input_section::relobj): Move method
7848 defintion from class declaration to here and handle merge sections.
7849 (Output_section::Input_section::shndx): Ditto.
7850 (Output_section::Output_section): Remove initializations of removed
7851 data members and initialize new data member LOOKUP_MAPS_.
7852 (Output_section::add_input_section): Set keeps-input-sections flag
7853 for a newly created merge output section as appropriate. Adjust code
7854 to use Output_section_lookup_maps class.
7855 (Output_section::add_relaxed_input_section): Adjst code for lookup
7856 maps code refactoring.
7857 (Output_section::add_merge_input_section): Add a new parameter
7858 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
7859 class. If adding input section to a newly created merge output
7860 section fails, remove the new merge section.
7861 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
7862 Adjust code for use of the Output_section_lookup_maps class.
7863 (Output_section::find_merge_section): Ditto.
7864 (Output_section::build_lookup_maps): New method defintion.
7865 (Output_section::find_relaxed_input_section): Adjust code to use
7866 Output_section_lookup_maps class.
7867 (Output_section::get_input_sections): Export merge sections. Adjust
7868 code to use Output_section_lookup_maps class.
7869 (Output_section:::add_script_input_section): Adjust code to use
7870 Output_section_lookup_maps class. Update lookup maps for merge
7871 sections also.
7872 (Output_section::discard_states): Use Output_section_lookup_maps.
7873 (Output_section::restore_states): Same.
7874 * output.h (Merge_section_properties): Move class defintion out of
7875 Output_section.
7876 (Output_section_lookup_maps): New class.
7877 (Output_section::Input_section::is_merge_section): New method
7878 defintion.
7879 (Output_section::Input_section::relobj): Move defintion out of class
7880 defintion. Declare method only.
7881 (Output_section::Input_section::shndx): Ditto.
7882 (Output_section::Input_section::output_merge_base): New method defintion.
7883 (Output_section::Input_section::u2_.pomb): New union field.
7884 (Output_section::Merge_section_by_properties_map,
7885 Output_section::Output_section_data_by_input_section_map,
7886 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
7887 Remove types.
7888 (Output_section::add_merge_input_section): Add new parameter
7889 KEEPS_INPUT_SECTIONS.
7890 (Output_section::build_lookup_maps): New method declaration.
7891 (Output_section::merge_section_map_,
7892 Output_section::merge_section_by_properties_map_,
7893 Output_section::relaxed_input_section_map_,
7894 Output_section::is_relaxed_input_section_map_valid_): Remove data
7895 members.
7896 (Output_section::lookup_maps_): New data member.
7897
7898 2010-05-21 Doug Kwan <dougkwan@google.com>
7899
7900 PR gold/11619
7901 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
7902 avoid a compilation error.
7903
7904 2010-05-19 Rafael Espindola <espindola@google.com>
7905
7906 * script-sections.cc (Output_section_definition::allocate_to_segment):
7907 Update the phdrs_list even when the output section is NULL.
7908 * testsuite/Makefile.am: Add test.
7909 * testsuite/Makefile.in: Regenerate.
7910 * testsuite/script_test_9.cc: New.
7911 * testsuite/script_test_9.sh: New.
7912 * testsuite/script_test_9.t: New.
7913
7914 2010-05-19 Doug Kwan <dougkwan@google.com>
7915
7916 * arm.cc (Arm_input_section::original_size): New method.
7917 (Arm_input_section::do_addralign): Add a cast.
7918 (Arm_input_section::do_output_offset): Remove static cast.
7919 (Arm_input_section::original_addralign,
7920 Arm_input_section::original_size_): Change type to uint32_t.
7921 (Arm_input_section::init): Add safe casts for section alignment
7922 and size.
7923 (Arm_input_section::set_final_data_size): Do not set address and
7924 offset of stub table.
7925 (Arm_output_section::fix_exidx_coverage): Change use of of
7926 Output_section::Simple_input_section to that of
7927 Output_section::Input_section.
7928 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
7929 except for the first pass.
7930 * output.cc (Output_section::get_input_sections): Change type of
7931 input_sections to std::list<Input_section>.
7932 (Output_section::add_script_input_section): Rename from
7933 Output_section::add_simple_input_section. Change type of SIS
7934 parameter from Simple_input_section to Input_section.
7935 * output.h (Output_section::Simple_input_section): Remove class.
7936 (Output_section::Input_section): Change class visibility to public.
7937 (Output_section::Input_section::addralign): Use stored alignments
7938 for special input sections if set.
7939 (Output_section::Input_section::set_addralign): New method.
7940 (Output_section::get_input_sections): Change parameter type from
7941 list of Simple_input_section to list of Input_section.
7942 (Output_section::add_script_input_section): Rename from
7943 Output_section::add_simple_input_section. Change first parameter's
7944 type from Simple_input_section to Input_section and remove the
7945 second and third parameters.
7946 * script-sections.cc (Input_section::Input_section_list): Change
7947 type to list of Output_section::Input_section/
7948 (Input_section_info::Input_section_info): Change parameter type of
7949 INPUT_SECTION to Output_section::Input_section.
7950 (Input_section_info::input_section): Change return type.
7951 (Input_section_info::input_section_): Change type to
7952 Output_section::Input_section.
7953 (Output_section_element_input::set_section_addresses): Adjust code
7954 to use Output_section::Input_section instead of
7955 Output_section::Simple_input_section. Adjust code for renaming
7956 of Output_section::add_simple_input_section.
7957 (Orphan_output_section::set_section_addresses): Ditto.
7958
7959 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7960
7961 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
7962 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
7963
7964 2010-05-18 Rafael Espindola <espindola@google.com>
7965
7966 * options.cc (General_options::finalize): Handle -nostdlib.
7967 * options.h (nostdlib): New option.
7968 * script.cc (script_add_search_dir): Handle -nostdlib.
7969
7970 2010-05-12 Doug Kwan <dougkwan@google.com>
7971
7972 * arm.cc (Target_arm::do_finalize_sections): Create an empty
7973 attributes section only if there no attributes section after merging.
7974 (Target_arm::merge_object_attributes): Move value of
7975 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
7976 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
7977 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
7978 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
7979 and arm_attr_merge_7.stdout.
7980 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
7981 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
7982 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
7983 arm_attr_merge_7b.o): New rules.
7984 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
7985 arm_attr_merge_7
7986 * testsuite/Makefile.in: Regenerate.
7987 * testsuite/arm_attr_merge.sh: New file.
7988 * testsuite/arm_attr_merge_[67][ab].s: Same.
7989
7990 2010-05-05 Nick Clifton <nickc@redhat.com>
7991
7992 * po/es.po: Updated Spanish translation.
7993
7994 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7995
7996 * Makefile.am (install-exec-local): Properly install gold as
7997 default cross linker.
7998 * Makefile.in: Regenerated.
7999
8000 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8001 Nick Clifton <nickc@redhat.com>
8002
8003 * configure.ac (install_as_default): Define and set to false
8004 unless --enable-gold or --enable-gold=both/gold has been
8005 specified.
8006 * configure: Regenerate.
8007
8008 * Makefile.am (install-exec-local): Install the executable as
8009 'ld.gold'. If install_as_default is true then also install it as
8010 'ld'.
8011 * Makefile.in: Regenerated.
8012
8013 2010-04-24 Ian Lance Taylor <iant@google.com>
8014
8015 * layout.cc (Layout::layout_reloc): In relocatable link don't
8016 combine reloc sections for grouped sections.
8017
8018 2010-04-23 Sriraman Tallam <tmsriram@google.com>
8019
8020 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8021 sections that are not ordinary to icf.
8022 * icf.cc (get_section_contents): Handle relocation pointing to section
8023 with no object or shndx information.
8024 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8025 * testsuite/Makefile.in: Regenerate.
8026 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8027 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8028
8029 2010-04-22 Ian Lance Taylor <iant@google.com>
8030
8031 * expression.cc (Expression::Expression_eval_info): Add
8032 result_alignment_pointer field.
8033 (Expression::eval_with_dot): Add result_alignment_pointer
8034 parameter. Change all callers.
8035 (Expression::eval_maybe_dot): Likewise.
8036 (class Binary_expression): Add alignment_pointer parameter to
8037 left_value and right_value. Change all callers.
8038 (BINARY_EXPRESSION): Set result alignment.
8039 (class Trinary_expression): Add alignment_pointer parameter to
8040 arg2_value and arg3_value. Change all callers.
8041 (Trinary_cond::value): Set result alignment.
8042 (Max_expression::value, Min_expression::value): Likewise.
8043 (Align_expression::value): Likewise.
8044 * script-sections.cc (class Sections_element): Add dot_alignment
8045 parameter to set_section_addresses virtual function. Update
8046 instantiations.
8047 (class Output_section_element): Likewise.
8048 (Script_sections::create_segments): Add dot_alignment parameter.
8049 Change all callers.
8050 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8051 (Script_sections::set_phdrs_clause_addresses): Likewise.
8052 * script-sections.h: Update declarations.
8053 * script.h: Update declarations.
8054 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8055 min_p_align.
8056 * testsuite/script_test_3.t: Set large alignment.
8057 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8058 segment has expected alignment.
8059
8060 2010-04-22 Nick Clifton <nickc@redhat.com>
8061
8062 * po/gold.pot: Updated by the Translation project.
8063 * po/vi.po: Updated Vietnamese translation.
8064
8065 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8066
8067 * testsuite/Makefile.am (check_PROGRAMS): Add
8068 icf_virtual_function_folding_test.
8069 * testsuite/Makefile.in: Regenerated.
8070
8071 2010-04-15 Andrew Haley <aph@redhat.com>
8072
8073 * options.h (merge_exidx_entries): New option.
8074 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8075 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8076 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8077 (Target_arm::merge_exidx_entries): New function.
8078 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8079 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8080 to Arm_exidx_fixup constructor.
8081 Add new arg, merge_exidx_entries.
8082 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8083 Arm_output_section::fix_exidx_coverage.
8084
8085 2010-04-18 Sriraman Tallam <tmsriram@google.com>
8086
8087 * icf.cc (get_section_contents): Check for preemptible functions.
8088 Ignore addend when appropriate.
8089 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8090 section folded.
8091 (add_from_relobj): Check for section folded.
8092 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8093 * symtab.h (should_add_dynsym_entry): Add new parameter.
8094 * target-reloc.h (scan_relocs): Check for section folded.
8095 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8096 Check reloc types for function pointers in shared objects.
8097 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8098 case.
8099 (icf_preemptible_functions_test): New test case.
8100 (icf_string_merge_test): New test case.
8101 * testsuite.Makefile.in: Regenerate.
8102 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8103 bar_glob. Refactor code.
8104 * testsuite/icf_preemptible_functions_test.cc: New file.
8105 * testsuite/icf_preemptible_functions_test.sh: New file.
8106 * testsuite/icf_string_merge_test.cc: New file.
8107 * testsuite/icf_string_merge_test.sh: New file.
8108 * testsuite/icf_virtual_function_folding_test.cc: New file.
8109 * testsuite/icf_virtual_function_folding_test.sh: New file.
8110
8111 2010-04-14 Doug Kwan <dougkwan@google.com>
8112
8113 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8114 for local symbol recounting if we remove a section due to ICF.
8115 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8116 there are no regular objects in input.
8117
8118 2010-04-13 Doug Kwan <dougkwan@google.com>
8119
8120 * arm.cc (Arm_input_section::set_final_data_size): Compute
8121 accurate final data size instead of using current data size.
8122
8123 2010-04-09 Doug Kwan <dougkwan@google.com>
8124
8125 * layout.cc (Layout::choose_output_section): Handle script section
8126 types.
8127 (Layout::make_output_section_for_script): Add section type parameter.
8128 Handle script section types.
8129 * layout.h (Layout::make_output_section_for_script): Add section
8130 type parameter.
8131 * output.cc (Output_section::Output_section): Initialize data member
8132 is_noload_.
8133 (Output_section::do_reset_address_and_file_offset): Do not set address
8134 to 0 if section is a NOLOAD section.
8135 * output.h (Output_section::is_noload): New method.
8136 (Output_section::set_is_noload): Ditto.
8137 (Output_section::is_noload_): New data member.
8138 * script-c.h (Script_section_type): New enum type.
8139 (struct Parser_output_section_header): Add new file section_type.
8140 * script-sections.cc (Sections_element::output_section_name): Add
8141 parameter for returning script section type.
8142 (Output_section_definition::output_section_name): Ditto.
8143 (Output_section_definition::section_type)P; New method.
8144 (Output_section_definiton::script_section_type_name): Ditto.
8145 (Output_section_definition::script_section_type_): New data member.
8146 (Output_section_definition::Output_section_definition): Initialize
8147 data member Output_section_definition::script_section_type_.
8148 (Output_section_definition::create_sections): Pass script section type
8149 to Layout::make_output_section_for_script.
8150 (Output_section_definition::output_section_name): Return script
8151 section type to caller.
8152 (Output_section_definition::set_section_address): Do not advance
8153 dot value and load address if section type is NOLOAD. Set address
8154 of NOLOAD sections regardless of section flags.
8155 (Output_section_definition::print): Print section type if it is
8156 not SCRIPT_SECTION_TYPE_NONE.
8157 (Output_section_definition::section_type): New method.
8158 (Output_section_definition::script_section_type_name): Ditto.
8159 (Script_sections::output_section_name): Add new parameter
8160 PSECTION_TYPE for returning script section type. Pass it to
8161 section elements. Handle discard sections.
8162 (Sort_output_sections::operator()): Handle NOLOAD sections.
8163 * script-sections.h (Script_sections::Section_type): New enum type.
8164 (Script_sections::output_section_name): Add a new parameter for
8165 returning script section type.
8166 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8167 INFO and NOLOAD.
8168 * yyscript.y (union): Add new field SECTION_TYPE.
8169 (COPY, DSECT, INFO, NOLOAD): New tokens.
8170 (opt_address_and_section_type): Change type to output_section_header.
8171 (section_type): New non-terminal
8172 (section_header): Handle section type.
8173 (opt_address_and_section_type): Return section type value.
8174
8175 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8176
8177 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8178 * testsuite/plugin_common_test_2.c (foo): Likewise.
8179
8180 2010-04-08 Doug Kwan <dougkwan@google.com>
8181
8182 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8183 Output_merge_data.
8184 * output.cc (Output_section::add_merge_input_section): Simplify
8185 code and return status of Output_merge_base::add_input_section.
8186 Update merge section map only if Output_merge_base::add_input_section
8187 returns true.
8188
8189 2010-04-07 Doug Kwan <dougkwan@google.com>
8190
8191 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8192 if section is marked as containing instructions but has no mapping
8193 symbols.
8194 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8195 correct section index.
8196 (Arm_relobj::find_linked_text_section): Ditto.
8197
8198 2010-04-07 Cary Coutant <ccoutant@google.com>
8199
8200 * archive.cc (include_member): Destroy Read_symbols_data object before
8201 releasing file.
8202 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8203 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8204 (Read_symbols_data::~Read_symbols_data) New destructor.
8205 (Section_relocs::Section_relocs) New constructor.
8206 (Section_relocs::~Section_relocs) New destructor.
8207 (Read_relocs_data::Read_relocs_data) New constructor.
8208 (Read_relocs_data::~Read_relocs_data) New destructor.
8209 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8210 pointers to NULL after deleting.
8211
8212 2010-04-07 Doug Kwan <dougkwan@google.com>
8213
8214 * arm.cc: Replace "endianity" with "endianness" in comments.
8215 (Arm_exidx_cantunwind): Ditto.
8216 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8217 (Arm_relobj::merge_flags_and_attributes): New method.
8218 (Arm_relobj::merge_flags_and_attributes_): New data member.
8219 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8220 (Arm_relobj::scan_sections_for_stubs): Ditto.
8221 (Arm_relobj::do_read_symbols): Check to see if we really want to
8222 merge processor-specific flags and attributes. Exit early if
8223 an object is empty except for section names and the undefined symbol.
8224 (Target_arm::do_finalize_sections): Move check for ELF format to
8225 Arm_relobj::do_read_symbols. Merge processor specific flags and
8226 attributes from a regular object only when we have determined that
8227 it is aapropriate. Do not create an .ARM.attributes section in
8228 output if there is no regular input object.
8229 (Target_arm::merge_processor_specific_flags): Check
8230 --warn-mismatch before printing any error.
8231 (Target_arm::merge_object_attributes): Ditto.
8232 * gold.cc (queue_middle_tasks): Handle the case in which there is
8233 no regular object in input.
8234 * options.cc (General_options::parse_EB): New method.
8235 (General_options::parse_EL): Same.
8236 (General_options::General_options): Initialize endianness_.
8237 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8238 New options.
8239 (General_options::Endianness): New enum.
8240 (General_options::endianness): New method.
8241 (General_options::endianness_): New data member.
8242 * parameters.cc (Parameters::set_options): Check target endianness.
8243 (Parameters::set_target_once): Ditto.
8244 (Parameters::check_target_endianness): New method.
8245 (parameters_force_valid_target): If either -EL or -EB is specified,
8246 use it to define endianness of default target.
8247 * parameters.h (Parameters::check_target_endianness): New method
8248 declaration.
8249 * target.h (class Target): Change "endianity" to "endianness"
8250 in comments.
8251
8252 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8253
8254 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8255 * configure: Regenerate.
8256 * Makefile.in: Regenerate.
8257 * testsuite/Makefile.in: Regenerate.
8258
8259 2010-04-06 Cary Coutant <ccoutant@google.com>
8260
8261 gcc PR lto/42757
8262 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8263 prevailing definitions of common symbols.
8264 * testsuite/plugin_test_6.sh: New test case.
8265 * testsuite/plugin_common_test_1.c: New test case.
8266 * testsuite/plugin_common_test_2.c: New test case.
8267 * testsuite/Makefile.am (plugin_test_6): New test case.
8268 * testsuite/Makefile.in: Regenerate.
8269
8270 2010-04-06 Nick Clifton <nickc@redhat.com>
8271
8272 * po/vi.po: New Vietnamese translation.
8273
8274 2010-03-30 Doug Kwan <dougkwan@google.com>
8275
8276 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8277
8278 2010-03-25 Doug Kwan <dougkwan@google.com>
8279
8280 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8281 to avoid a conversion warning on a 32-bit host.
8282
8283 2010-03-24 Ian Lance Taylor <iant@google.com>
8284
8285 * testsuite/script_test_3.t: Add a TLS segment.
8286 * testsuite/Makefile.am (check_PROGRAMS): Add
8287 tls_phdrs_script_test.
8288 (tls_phdrs_script_test_SOURCES): Define.
8289 (tls_phdrs_script_test_DEPENDENCIES): Define.
8290 (tls_phdrs_script_test_LDFLAGS): Define.
8291 (tls_phdrs_script_test_LDADD): Define.
8292 * testsuite/Makefile.in: Rebuild.
8293
8294 2010-03-23 Cary Coutant <ccoutant@google.com>
8295
8296 * fileread.cc (find_or_make_view): Fix comment.
8297
8298 2010-03-23 Ian Lance Taylor <iant@google.com>
8299
8300 * script-sections.cc (class Orphan_section_placement): Define
8301 PLACE_TLS and PLACE_TLS_BSS.
8302 (Orphan_section_placement::Orphan_section_placement): Initialize
8303 new places.
8304 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8305 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8306 (tls_script_test_SOURCES): Define.
8307 (tls_script_test_DEPENDENCIES): Define.
8308 (tls_script_test_LDFLAGS): Define.
8309 (tls_script_test_LDADD): Define.
8310 * testsuite/Makefile.in: Rebuild.
8311
8312 2010-03-22 Doug Kwan <dougkwan@google.com>
8313
8314 * arm.cc (Arm_relocate_functions::abs8,
8315 Arm_relocate_functions::abs16): Use correct check for overflow
8316 specified in the ARM ELF specs.
8317 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8318 target of a BLX instruction specially.
8319 (Reloc_stub::stub_type_for_reloc): Ditto.
8320 (Relocate::relocate): Use symbolic names instead of numeric relocation
8321 codes to report error.
8322 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8323 workaround.
8324 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8325 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8326 thumb2_blx_out_of_range.stdout
8327 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8328 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8329 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8330 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8331 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8332 thumb2_blx_in_range, thumb2_blx_in_range.o,
8333 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8334 thumb2_blx_out_of_range.o): New rules.
8335 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
8336 thumb2_blx_in_range and thumb2_blx_out_of_range.
8337 * testsuite/Makefile.in: Regenerate.
8338 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8339 * testsuite/thumb_blx_in_range.s: New file.
8340 * testsuite/thumb_blx_out_of_range.s: New file.
8341
8342 2010-03-22 Rafael Espindola <espindola@google.com>
8343
8344 * archive.cc (Should_include): Move to archive.h.
8345 (should_include_member): Make it a member of Archive.
8346 (Lib_group): New.
8347 (Add_lib_group_symbols): New.
8348 * archive.h: Include options.h.
8349 (Archive_member): Moved from Archive.
8350 (Should_include): Moved from archive.cc.
8351 (Lib_group): New.
8352 (Add_lib_group_symbols): New.
8353 * dynobj.cc (do_should_include_member): New.
8354 * dynobj.h (do_should_include_member): New.
8355 * gold.cc (queue_initial_tasks): Update call to queue.
8356 * main.cc (main): Print lib group stats.
8357 * object.cc (do_should_include_member): New.
8358 * object.h: Include archive.h.
8359 (Object::should_include_member): New.
8360 (Object::do_should_include_member): New.
8361 (Sized_relobj::do_should_include_member): New.
8362 * options.cc (General_options::parse_start_lib): New.
8363 (General_options::parse_end_lib): New.
8364 (Input_arguments::add_file): Handle lib groups.
8365 (Input_arguments::start_group): Check we are not in a lib.
8366 (Input_arguments::start_lib): New.
8367 (Input_arguments::end_lib): New.
8368 * options.h (General_options): Add start_lib and end_lib.
8369 (Input_argument::lib_): New.
8370 (Input_argument::lib): New.
8371 (Input_argument::is_lib): New.
8372 (Input_file_lib): New.
8373 (Input_arguments::in_lib_): New.
8374 (Input_arguments::in_lib): New.
8375 (Input_arguments::start_lib): New.
8376 (Input_arguments::end_lib_): New.
8377 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8378 in unused members as preempted.
8379 (Sized_pluginobj::do_should_include_member): New.
8380 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8381 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8382 return the blocker.
8383 (Read_symbols::do_whole_lib_group): New.
8384 (Read_symbols::do_lib_group): New.
8385 (Read_symbols::do_read_symbols): Handle lib groups.
8386 (Read_symbols::get_name): Handle lib groups.
8387 * readsyms.h (Read_symbols): Add an archive member pointer.
8388 (Read_symbols::do_whole_lib_group): New.
8389 (Read_symbols::do_lib_group): New.
8390 (Read_symbols::member_): New.
8391 * script.cc (read_input_script): Update call to queue_soon.
8392
8393 2010-03-19 Doug Kwan <dougkwan@google.com>
8394
8395 * arm.cc (Stub_table::Stub_table): Initialize new data members
8396 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8397 (Stub_table::add_reloc_stub): Assign stub offset and update
8398 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8399 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8400 New data members.
8401 (Stub_table::update_data_size_and_addralign): Use
8402 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8403 instead of going over all reloc stubs.
8404 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
8405 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8406 Stringpool_template::offset_ to size of Stringpool_char.
8407 (Stringpool_template::new_key_offset): Remove code to initialize
8408 Stringpool_template::offset_.
8409 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8410 Stringpool_template::offset_ to zero.
8411
8412 2010-03-15 Doug Kwan <dougkwan@google.com>
8413
8414 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8415 offset_.
8416 (Stringpool_template::new_key_offset): New method.
8417 (Stringpool_template::add_string): Assign offsets when adding new
8418 strings.
8419 (Stringpool_template::set_string_offsets): Do not set string offsets
8420 when not optimizing.
8421 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8422 member size_.
8423 (Chunked_vector::clear): Clear size_.
8424 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8425 (Chunked_vector::size): Return size_.
8426 (Chunked_vector::push_back): Use size_ to find insert position.
8427 (Chunked_vector::size_): New data member.
8428 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8429 (Stringpool_template::new_key_offset): New method declaration.
8430 (Stringpool_template::offset_): New data member.
8431
8432 2010-03-15 Rafael Espindola <espindola@google.com>
8433
8434 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8435 Add_symbols' constructor.
8436 * readsyms.h (Add_symbols): Remove the input_group member.
8437
8438 2010-03-10 Ian Lance Taylor <iant@google.com>
8439
8440 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8441 target to ask whether a reference to a symbol requires a stack
8442 split.
8443 * target.h (Target::is_call_to_non_split): New function.
8444 (Target::do_is_call_to_non_split): Declare virtual function.
8445 * target.cc: Include "symtab.h".
8446 (Target::do_is_call_to_non_split): New function.
8447 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8448
8449 2010-03-10 Cary Coutant <ccoutant@google.com>
8450
8451 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8452 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8453 (File_read::open[2]): Add whole_file_view_ to list of views.
8454 (File_read::make_view): Remove test of whole_file_view_.
8455 (File_read::find_or_make_view): Create whole_file_view_ if
8456 necessary.
8457 (File_read::clear_views): Replace bool parameter with enum;
8458 adjust all callers. Don't delete views with permanent data;
8459 do delete cached views and views from archives if
8460 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8461 if clearing the corresponding view.
8462 * fileread.h (File_read::Clear_views_mode): New enum.
8463 (File_read::View::is_permanent_view): New method.
8464 (File_read::clear_views): Replace bool parameter
8465 with enum; adjust all callers.
8466 * options.h (General_options): Change keep_files_mapped option;
8467 add map_whole_files.
8468 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8469 releasing the file.
8470 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8471 the file.
8472
8473 2010-03-10 David S. Miller <davem@davemloft.net>
8474
8475 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8476
8477 2010-03-09 Sriraman Tallam <tmsriram@google.com>
8478
8479 * icf.cc (get_section_contents): Add '@' marker after processing the
8480 merge reloc.
8481
8482 2010-03-08 Doug Kwan <dougkwan@google.com>
8483
8484 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8485 due to a conversion warning.
8486 (Arm_relobj::update_output_local_symbol_count): Check for local
8487 symbol with unset output index.
8488
8489 2010-03-05 Ian Lance Taylor <iant@google.com>
8490
8491 * options.h (class General_options): Add --spare-dynamic-tags.
8492 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8493 --spare-dynamic-tags.
8494
8495 2010-03-05 Ian Lance Taylor <iant@google.com>
8496
8497 * incremental.cc: Include "libiberty.h".
8498
8499 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8500
8501 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8502 function, is_info_ member.
8503 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8504 (Versions::Versions): Update caller.
8505 (Versions::define_base_version): Likewise.
8506 (Versions::add_def): Likewise.
8507
8508 2010-03-03 Sriraman Tallam <tmsriram@google.com>
8509
8510 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8511 (Scan::possible_function_pointer_reloc): New function.
8512 (Scan::local_reloc_may_be_function_pointer): Change to call
8513 possible_function_pointer_reloc.
8514 (Scan::global_reloc_may_be_function_pointer): Ditto.
8515 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8516 relocations in ".data.rel.ro._ZTV" section.
8517 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8518 * testsuite/icf_safe_so_test.cc: Ditto.
8519 * testsuite/icf_safe_test.cc: Ditto.
8520 * testsuite/icf_safe_test.sh: Ditto.
8521
8522 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8523 Ian Lance Taylor <iant@google.com>
8524
8525 * target-reloc.h (relocate_section): Check the symbol table index
8526 for -1U before setting the local symbol index.
8527 (scan_relocatable_relocs): If copying the relocation, record that
8528 the local symbol is required.
8529 * object.h (Symbol_value::is_output_symtab_index_set): New
8530 function.
8531 (Symbol_value::may_be_discarded_from_output_symtab): New
8532 function.
8533 (Symbol_value::has_output_symtab_entry): New function.
8534 (Symbol_value::needs_output_symtab_entry): Remove.
8535 (Symbol_value::output_symtab_index): Make sure the symbol index is
8536 set.
8537 (Symbol_value::set_output_symtab_index): Make sure the symbol
8538 index is not set. Make sure the new index is valid.
8539 (Symbol_value::set_must_have_output_symtab_entry): New function.
8540 (Symbol_value::has_output_dynsym_entry): New function.
8541 (Symbol_value::set_output_dynsym_index): Make sure the new index
8542 is valid.
8543 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8544 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8545 local symbol if permitted.
8546 (Sized_relobj::do_finalize_local_symbols): Call
8547 is_output_symtab_index_set rather than needs_output_symtab_entry.
8548 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8549 rather than needs_output_symtab_entry. Call
8550 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8551 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8552 is_output_symtab_index_set rather than needs_output_symtab_entry.
8553 * testsuite/discard_locals_relocatable_test.c: New file.
8554 * testsuite/discard_locals_test.sh: Test -r.
8555 * testsuite/Makefile.am (check_DATA): Add
8556 discard_locals_relocatable_test1.syms,
8557 discard_local_relocatable_test2.syms.
8558 (MOSTLYCLEANFILES): Likewise. Also add
8559 discard_locals_relocatable_test1.lout and
8560 discard_locals_relocatable_test2.out.
8561 (discard_locals_relocatable_test1.syms): New target.
8562 (discard_locals_relocatable_test.o): New target.
8563 (discard_locals_relocatable_test1.out): New target.
8564 (discard_locals_relocatable_test2.syms): New target.
8565 (discard_locals_relocatable_test2.out): New target.
8566 (various): Add missing ../ld-new dependencies.
8567 * testsuite/Makefile.in: Rebuild.
8568
8569 2010-03-03 Nick Clifton <nickc@redhat.com>
8570
8571 * po/fi.po: New Finnish translation.
8572
8573 2010-03-01 Doug Kwan <dougkwan@google.com>
8574
8575 * layout.cc (Layout::Layout): Force section types of .init_array*,
8576 .preinit_array* and .fini_array* sections.
8577 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8578 Fix check of return value of std::string::find.().
8579 (Output_section::Input_section_sort_compare::operator()): Remove
8580 comment about .init_array.
8581 (Output_section::Input_section_sort_init_fini_compare::operator()):
8582 New method.
8583 (Output_section::sort_attached_input_sections): Handle .init_array
8584 and .fini_array specially.
8585 * output.h (Output_section::Inut_section_sort_compare): Update
8586 comment.
8587 (Output_section::Input_section_sort_init_fini_compare): New struct.
8588
8589 2010-02-26 Doug Kwan <dougkwan@google.com>
8590
8591 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
8592 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
8593 * testsuite/debug_msg.sh: Avoid matching source line number for
8594 use of global variable undef_int.
8595
8596 2010-02-26 Doug Kwan <dougkwan@google.com>
8597
8598 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
8599 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
8600 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
8601 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
8602 * options.cc (General_options::General_options): Initialize member
8603 fix_v4bx_.
8604 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
8605 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
8606 and rm_no_fix_v4bx.stdout
8607 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
8608 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
8609 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
8610 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
8611 and arm_no_fix_v4bx.
8612 * Makefile.in: Regenerate.
8613 * testsuite/arm_fix_v4bx.s: New file.
8614 * testsuite/arm_fix_v4bx.sh: Ditto.
8615
8616 2010-02-24 Doug Kwan <dougkwan@google.com>
8617
8618 * arm.cc (Target_arm::got_section): Make the .got section the first
8619 non RELRO section in the data segment.
8620 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
8621 suffixes of section names.
8622
8623 2010-02-24 Doug Kwan <dougkwan@google.com>
8624
8625 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
8626 flags and attributes merging if an input file is a binary file.
8627 * fileread.cc (Input_file::open): Record format of original file.
8628 * fileread.h (Input_file::Format): New enum type.
8629 (Input_file::Input_file): Initialize data member format_.
8630 (Input_file::format): New method definition.
8631 (Input_file::format_):: New data member.
8632
8633 2010-02-24 Doug Kwan <dougkwan@google.com>
8634
8635 * arm.cc (Arm_output_data_got): New class.
8636 (ARM_TCB_SIZE): New constant
8637 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
8638 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
8639 If user uses a script with a SECTIONS clause, issue only a warning
8640 for a misplaced EXIDX input section. Otherwise, issue an error.
8641 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
8642 garbage collection.
8643 (Target_arm::got_mode_index_entry): Handle static linking.
8644 (Target_arm::Scan::local): Ditto.
8645 (Target_arm::Scan::global): Ditto.
8646 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
8647 all incorrectly implemented relocations.
8648 (Target_arm::fix_exidx_coverage): Pass layout to
8649 Arm_output_section::fix_exidx_coverage.
8650 * layout.cc (Layout::section_name_mapping): Remove trailing dots
8651 from ".ARM.exidx." and ".ARM.extab.".
8652
8653 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8654
8655 * arm.cc (Target_arm::do_finalize_sections): Create attribute
8656 section if it does not already exist.
8657 * attributes.cc (Attributes_section_data::Attributes_section_data):
8658 Don't crash if size is zero.
8659
8660 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8661 Ian Lance Taylor <iant@google.com>
8662
8663 * gold.cc (queue_middle_tasks): If no input files were opened,
8664 exit.
8665 * workqueue.h (Task_function::Task_function): Assert that there is
8666 a blocker.
8667
8668 2010-02-22 Doug Kwan <dougkwan@google.com>
8669
8670 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
8671 * icf.cc (get_section_contents): Cast snprintf arguments to long long
8672 types to avoid warnings due to different uint64_t implementations
8673 on different hosts.
8674
8675 2010-02-21 Doug Kwan <dougkwan@google.com>
8676
8677 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
8678 handling of the maximum backward branch offset.
8679 (Arm_relocate_functions::thumb_branch_common): Ditto.
8680 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
8681 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
8682 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
8683 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
8684 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
8685 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
8686 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
8687 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
8688 thumb_bl_out_of_range thumb_bl_out_of_range.o,
8689 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
8690 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
8691 thumb2_bl_out_of_range.o): New rules.
8692 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
8693 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
8694 thumb2_bl_out_of_range
8695 * testsuite/Makefile.in: Regenerate.
8696 * testsuite/arm_bl_in_range.s: New file.
8697 * testsuite/arm_bl_out_of_range.s: Ditto.
8698 * testsuite/arm_branch_in_range.sh: Ditto.
8699 * testsuite/arm_branch_range.t: Ditto.
8700 * testsuite/thumb2_branch_range.t: Ditto.
8701 * testsuite/thumb_bl_in_range.s: Ditto.
8702 * testsuite/thumb_bl_out_of_range.s: Ditto.
8703 * testsuite/thumb_branch_range.t: Ditto.
8704
8705 2010-02-20 Sriraman Tallam <tmsriram@google.com>
8706
8707 * gc.h (gc_process_relocs): Change vectors to point to the new list.
8708 Add reloc offset information.
8709 * icf.cc (get_section_contents): Change iterators to point to the new
8710 vectors. Add reloc offset information to the contents.
8711 * icf.h (Icf::Sections_reachable_info): New typedef.
8712 (Icf::Sections_reachable_list): New typedef.
8713 (Icf::Offset_info): New typedef.
8714 (Icf::Reloc_info): New struct typedef.
8715 (Icf::Reloc_info_list): New typedef.
8716 (Icf::symbol_reloc_list): Delete method.
8717 (Icf::addend_reloc_list): Delete method.
8718 (Icf::section_reloc_list): Delete method.
8719 (Icf::reloc_info_list): New method.
8720 (Icf::reloc_info_list_): New member.
8721
8722 2010-02-19 Doug Kwan <dougkwan@google.com>
8723
8724 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
8725 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
8726 * arm.cc (Arm_relocation_functions): New forward declaration.
8727 (Target_arm::Target_arm): Initialize new data members
8728 got_mod_index_offset_ and tls_base_symbol_defined_.
8729 (Target_arm::Relocate::relocate_tls): New method.
8730 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
8731 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
8732 New methods.
8733 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
8734 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
8735 (Target_arm::got_mod_index_offset_,
8736 Target_arm::tls_base_symbol_defined_): New data members.
8737 (Target_arm::Scan::local, Target::Scan::global,
8738 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
8739 relocations.
8740
8741 2010-02-18 Doug Kwan <dougkwan@google.com>
8742
8743 * arm.cc (Arm_relobj::find_linked_text_section): New method.
8744 (Arm_relobj::make_exidx_input_section): Pass section index of linked
8745 text section as a parameter becuase some broken tools may not set
8746 the link in section header.
8747 (Target_arm::has_got_section): New method.
8748 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
8749 without any mapping symbol as data only. Remove warning.
8750 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
8751 link in its section header, try to discover the link by inspecting the
8752 REL31 relocation at the beginning of the section.
8753 (Target_arm::Scan::check_non_pic): Report name of offending relocation
8754 in error message.
8755 (Target_arm::Scan::global): Treat any reference to the symbol
8756 _GLOBAL_OFFSET_TABLE_ as a GOT access.
8757
8758 2010-02-12 Sriraman Tallam <tmsriram@google.com>
8759
8760 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
8761 (Scan::global_reloc_may_be_function_pointer): New function.
8762 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8763 (Scan::global_reloc_may_be_function_pointer): New function.
8764 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8765 (Scan::global_reloc_may_be_function_pointer): New function.
8766 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
8767 (Scan::global_reloc_may_be_function_pointer): New function.
8768 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
8769 (Scan::global_reloc_may_be_function_pointer): New function.
8770 (Scan::possible_function_pointer_reloc): New function.
8771 (Target_x86_64::can_check_for_function_pointers): New function.
8772 * gc.h (gc_process_relocs): Scan relocation types to determine if
8773 function pointers were taken for targets that support it.
8774 * icf.cc (Icf::find_identical_sections): Include functions for
8775 folding in safe ICF whose pointer is not taken.
8776 * icf.h (Secn_fptr_taken_set): New typedef.
8777 (fptr_section_id_): New member.
8778 (section_has_function_pointers): New function.
8779 (set_section_has_function_pointers): New function.
8780 (check_section_for_function_pointers): New function.
8781 * options.h: Fix comment for safe ICF option.
8782 * target.h (can_check_for_function_pointers): New function.
8783 * testsuite/Makefile.am: Add icf_safe_so_test test case.
8784 Modify icf_safe_test for X86-64.
8785 * testsuite/Makefile.in: Regenerate.
8786 * testsuite/icf_safe_so_test.cc: New file.
8787 * testsuite/icf_safe_so_test.sh: New file.
8788 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8789 (main): Change to take pointer to function kept_func_3.
8790 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8791 folding is done correctly for X86-64.
8792
8793 2010-02-12 David S. Miller <davem@davemloft.net>
8794
8795 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8796 is_symbolless parameter.
8797 (Output_reloc<SHT_REL>::is_symbolless): New.
8798 (Output_reloc<SHT_REL>::is_symbolless_): New.
8799 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8800 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8801 (Output_reloc<SHT_RELA>::is_symbolless): New.
8802 (Output_data_reloc::add_global): Handle is_symbolless.
8803 (Output_data_reloc::add_global_relative): Likewise.
8804 (Output_data_reloc::add_local): Likewise.
8805 (Output_data_reloc::add_local_relative): Likewise.
8806 (Output_data_reloc::add_symbolless_global_addend): New.
8807 (Output_data_reloc::add_symbolless_local_addend): New.
8808 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8809 is_symbolless.
8810 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8811 instead of ->is_relative_
8812 (Output_reloc::write): Likewise.
8813 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8814 (Output_reloc::write_rel): Simplify.
8815
8816 * sparc.cc (Target_sparc::Scan::local): Use
8817 ->add_symbolless_local_addend as needed.
8818 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8819 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8820 based upon relocation offset.
8821
8822 2010-02-11 Doug Kwan <dougkwan@google.com>
8823
8824 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
8825 (Target_arm::Scan::global): Ditto. Also remove a comment before the
8826 beginning of function.
8827 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
8828 and MOVT_ABS relocations. Those are non issued in scanning. Fix
8829 parameter is_32bit in calls to should_apply_static_reloc.
8830 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
8831 (check_DATA): Add arm_abs_global.stdout.
8832 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
8833 arm_abs_global.stdout): New rules.
8834 (MOSTLLYCLEANFILES): Add arm_abs_global
8835 * Makefile.in: Regenerate.
8836 * testsuite/arm_abs_global.s: New file.
8837 * testsuite/arm_abs_global.sh: Ditto.
8838 * testsuite/arm_abs_lib.s: Ditto.
8839
8840 2010-02-11 Ian Lance Taylor <iant@google.com>
8841
8842 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
8843 Read_relocs task.
8844 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
8845 Allocate_commons_task first.
8846 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
8847 task, rather than symtab_lock_.
8848 (Gc_process_relocs::~Gc_process_relocs): New function.
8849 (Gc_process_relocs::is_runnable): Check this_blocker_.
8850 (Gc_process_relocs::locks): Use next_blocker_ rather than
8851 blocker_.
8852 (Scan_relocs::~Scan_relocs): New function.
8853 (Scan_relocs::is_runnable): Check this_blocker_ rather than
8854 symtab_lock_.
8855 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
8856 next_blocker_.
8857 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
8858 fields. Add this_blocker_ and next_blocker_ fields. Adjust
8859 constructor accordingly.
8860 (class Gc_process_relocs): Likewise.
8861 (class Scan_relocs): Likewise.
8862 * common.h (class Allocate_commons_task): Remove symtab_lock_
8863 field, and corresponding constructor parameter.
8864 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
8865 symtab_lock_.
8866 (Allocate_commons_task::locks): Likewise.
8867
8868 2010-02-11 Ian Lance Taylor <iant@google.com>
8869
8870 * gold-threads.h (class Once): Define.
8871 (class Initialize_lock): Rewrite as child of Once.
8872 * gold-threads.cc (class Once_initialize): Define.
8873 (once_pointer_control): New static variable.
8874 (once_pointer, once_arg): New static variables.
8875 (c_run_once): New static function.
8876 (Once::Once, Once::run_once, Once::internal_run): New functions.
8877 (class Initialize_lock_once): Remove.
8878 (initialize_lock_control): Remove.
8879 (initialize_lock_pointer): Remove.
8880 (initialize_lock_once): Remove.
8881 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
8882 (Initialize_lock::initialize): Rewrite.
8883 (Initialize_lock::do_run_once): New function.
8884 * archive.cc (Archive::interpret_header): Only clear name if it is
8885 not already empty.
8886 * fileread.cc: Include "gold-threads.h"
8887 (file_counts_lock): New static variable.
8888 (file_counts_initialize_lock): Likewise.
8889 (File_read::release): Only increment counts when using --stats.
8890 Use a lock around the increment.
8891 * parameters.cc (class Set_parameters_target_once): Define.
8892 (set_parameters_target_once): New static variable.
8893 (Parameters::Parameters): Move here from parameters.h.
8894 (Parameters::set_target): Rewrite.
8895 (Parameters::set_target_once): New function.
8896 (Parameters::clear_target): Move here and rewrite.
8897 * parameters.h (class Parameters): Update declarations. Add
8898 set_parameters_target_once_ field.
8899 (Parameters::Parameters): Move to parameters.cc.
8900 (Parameters::clear_target): Likewise.
8901 * readsyms.cc (Read_symbols::do_group): Create a Start_group
8902 task.
8903 (Start_group::~Start_group): New function.
8904 (Start_group::is_runnable): New function.
8905 (Start_group::locks, Start_group::run): New functions.
8906 (Finish_group::run): Change saw_undefined to size_t.
8907 * readsyms.h (class Start_group): Define.
8908 (class Finish_group): Change saw_undefined_ field to size_t.
8909 (Finish_group::Finish_group): Remove saw_undefined and
8910 this_blocker parameters. Change all callers.
8911 (Finish_group::set_saw_undefined): New function.
8912 (Finish_group::set_blocker): New function.
8913 * symtab.h (class Symbol_table): Change saw_undefined to return
8914 size_t. Change saw_undefined_ field to size_t.
8915 * target-select.cc (Set_target_once::do_run_once): New function.
8916 (Target_selector::Target_selector): Initialize set_target_once_
8917 field. Don't initialize lock_ and initialize_lock_ fields.
8918 (Target_selector::instantiate_target): Rewrite.
8919 (Target_selector::set_target): New function.
8920 * target-select.h (class Set_target_once): Define.
8921 (class Target_selector): Update declarations. Make
8922 Set_target_once a friend. Remove lock_ and initialize_lock_
8923 fields. Add set_target_once_ field.
8924
8925 2010-02-10 Ian Lance Taylor <iant@google.com>
8926
8927 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
8928 queueing any tasks.
8929 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
8930 (queue_middle_tasks): Add all blockers before queueing any tasks.
8931 (queue_final_tasks): Likewise.
8932 * token.h (Task_token::add_blockers): New function.
8933 * object.h (Input_objects::number_of_relobjs): New function.
8934
8935 2010-02-10 Ian Lance Taylor <iant@google.com>
8936
8937 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
8938 shared, not if not position independent.
8939 * x86_64.cc (Relocate::relocate_tls): Likewise.
8940 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
8941 (tls_pie_pic_test): New target.
8942 * testsuite/Makefile.in: Rebuild.
8943
8944 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
8945 (tls_test_main_pie.o, tls_test_pie.o): New targets.
8946 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
8947 * testsuite/Makefile.in: Rebuild.
8948
8949 2010-02-09 David S. Miller <davem@davemloft.net>
8950
8951 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
8952 R_SPARC_RELATIVE using ->add_local_relative().
8953 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
8954
8955 * output.h (Output_data_dynamic::add_section_size): New method
8956 that takes two Output_data objects.
8957 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
8958 entry param. Handle it in initializers.
8959 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
8960 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
8961 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
8962 arg.
8963 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
8964 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
8965 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
8966 for dynrel_includes_plt.
8967 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8968 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8969 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
8970 before .rela.plt
8971 (Target_sparc::do_finalize_sections): Update to pass true for
8972 dynrel_includes_plt.
8973 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
8974 output before .rela.plt
8975 (Target_powerpc::do_finalize_sections): Update to pass true for
8976 dynrel_includes_plt when 32-bit.
8977
8978 2010-02-08 Doug Kwan <dougkwan@google.com>
8979
8980 * arm.cc (Arm_relobj::simple_input_section_output_address): New
8981 method.
8982 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
8983 Arm_relobj::scan_section_for_cortex_a8_stubs,
8984 Arm_relobj::do_relocation_section): Instead of calling
8985 Output_section::output_address, use faster
8986 Arm_relobj::simple_input_section_output_address.
8987
8988 2010-02-08 David S. Miller <davem@davemloft.net>
8989
8990 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
8991 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
8992 relocation helper function.
8993
8994 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
8995 just like R_SPARC_GOT{10,13,22}.
8996 (Target_sparc::Scan::local): Likewise.
8997 (Target_sparc::Relocate:relocate): Likewise.
8998
8999 2010-02-06 Ian Lance Taylor <iant@google.com>
9000
9001 * configure.ac: Rewrite targetobjs duplicate removal code to use
9002 only shell constructs.
9003 * configure: Rebuild.
9004
9005 2010-02-05 Doug Kwan <dougkwan@google.com>
9006
9007 PR 11247
9008 * arm.cc (Arm_relobj::section_is_scannable): New method.
9009 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9010 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9011
9012 2010-02-04 Doug Kwan <dougkwan@google.com>
9013
9014 PR 11247
9015 * arm-reloc-property.cc (cstdio): Include.
9016 * configure.ac (targetobjs): Remove duplicates.
9017 * configure: Regenerate.
9018 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9019 big and little endian version for a given address size.
9020
9021 2010-02-03 Doug Kwan <dougkwan@google.com>
9022
9023 * arm-reloc-property.cc
9024 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9025 definition.
9026 * arm-reloc-property.h
9027 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9028 New method definition.
9029 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9030 declaration.
9031 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9032 overflow to N.
9033 (GOT_PREL): Change implemented to Y.
9034 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9035 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9036 (Arm_relocate_functions::movw_abs_nc): Remove method.
9037 (Arm_relocate_functions::movt_abs): Ditto.
9038 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9039 (Arm_relocate_functions::thm_movt_abs): Ditto.
9040 (Arm_relocate_functions::movw_rel_nc): Ditto.
9041 (Arm_relocate_functions::movw_rel): Ditto.
9042 (Arm_relocate_functions::movt_rel): Ditto.
9043 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9044 (Arm_relocate_functions:thm_movw_rel): Ditto.
9045 (Arm_relocate_functions:thm_movt_rel): Ditto.
9046 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9047 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9048 New method definitions.
9049 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9050 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9051 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9052 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9053 (Target_arm::Relocate::relocate): Check for non-static or
9054 unimplemented relocation code and exit early. Change calls to
9055 Target_arm::reloc_uses_thumb_bit and
9056 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9057 instead. Refactor code to handle similar relocations to increase
9058 code sharing. Remove check for unsupported relocation code in switch
9059 statement.
9060 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9061 relocation property table to find out size. Change error message to
9062 print out the name of a relocation code instead of the numeric value.
9063 (Target_arm::scan_reloc_for_stub): Use relocation property table
9064 instead of calling Target_arm::reloc_uses_thumb_bit().
9065
9066 2010-02-02 Doug Kwan <dougkwan@google.com>
9067
9068 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9069 types of relaxed input section.
9070
9071 2010-02-02 Doug Kwan <dougkwan@google.com>
9072
9073 * Makefile.am (HFILES): Add arm-reloc-property.h.
9074 (DEFFILES): New.
9075 (TARGETSOURCES): Add arm-reloc-property.cc
9076 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
9077 (libgold_a_SOURCES): $(DEFFILES)
9078 * Makefile.in: Regenerate.
9079 * arm-reloc-property.cc: New file.
9080 * arm-reloc-property.h: New file.
9081 * arm-reloc.def: New file.
9082 * arm.cc: Update comments.
9083 (arm-reloc-property.h): New included header.
9084 (arm_reloc_property_table): New global variable.
9085 (Target_arm::do_select_as_default_target): New method definition.
9086 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9087 arm-reloc-property to targ_extra_obj.
9088 * parameters.cc (set_parameters_target): Call
9089 Target::select_as_default_target().
9090 * target.h (Target::select_as_default_target): New method definition.
9091 (Target::do_select_as_default_target): Same.
9092
9093 2010-02-01 Doug Kwan <dougkwan@google.com>
9094
9095 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9096 first_output_text_section_.
9097 (Arm_exidx_fixup::first_output_text_section): New method definition.
9098 (Arm_exidx_fixup::first_output_text_section_): New data member.
9099 (Arm_exidx_fixup::process_exidx_section): Record the first text
9100 output section seen.
9101 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9102 and entsize in output section header.
9103
9104 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9105
9106 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9107 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9108 (Arm_relocate_functions::thm_alu11): New Method.
9109 (Arm_relocate_functions::thm_pc8): New Method.
9110 (Arm_relocate_functions::thm_pc12): New Method.
9111 (Target_arm::Scan::local): Handle the relocations.
9112 (Target_arm::Scan::global): Likewise.
9113 (Target_arm::Relocate::relocate): Likewise.
9114 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9115
9116 2010-01-29 Doug Kwan <dougkwan@google.com>
9117
9118 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9119 of relocation types as ld.
9120
9121 2010-01-29 Doug Kwan <dougkwan@google.com>
9122
9123 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9124 to public.
9125 (Arm_relocate_functions::thumb_branch_common): Ditto.
9126 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9127 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9128 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9129 Arm_relocate_functions::jump24): Remove.
9130 (Target_arm::Relocate::relocate): Adjust code to call
9131 Arm_relocation_functions::arm_branch_common and
9132 Arm_relocation_functions::thumb_branch_common instead of their removed
9133 wrappers. Merge switch-cases together to reduce source code size.
9134
9135 2010-01-29 Doug Kwan <dougkwan@google.com>
9136
9137 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9138 output_local_symbol_count_needs_update_.
9139 (Arm_relobj::output_local_symbol_count_needs_update,
9140 Arm_relobj::set_output_local_symbol_count_needs_update,
9141 Arm_relobj::update_output_local_symbol_count): New methods.
9142 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9143 member.
9144 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9145 of pointed function as in a R_ARM_PREL31 relocation.
9146 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9147 for output local symbol count updating.
9148 (Target_arm::do_relax): Update output local symbol counts in objects
9149 if necessary.
9150 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9151
9152 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9153
9154 * arm.cc: Added support for the ARM relocations:
9155 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9156 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9157 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9158 movw_prel_nc).
9159 (Arm_relocate_functions::movw_rel): New method.
9160 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9161 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9162 thm_movw_prel_nc).
9163 (Arm_relocate_functions::thm_movw_rel): New method.
9164 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9165 thm_movt_prel).
9166 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9167 relocations.
9168 (Target_arm::Scan::global): Likewise.
9169 (Target_arm::Relocate::relocate): Likewise.
9170 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9171 Likewise.
9172
9173 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9174
9175 * arm.cc: Added support for ARM group relocations.
9176 (Target_arm::reloc_needs_sym_origin): New method.
9177 (Arm_relocate_functions::calc_grp_kn): New method.
9178 (Arm_relocate_functions::calc_grp_residual): New method.
9179 (Arm_relocate_functions::calc_grp_gn): New method.
9180 (Arm_relocate_functions::arm_grp_alu): New Method.
9181 (Arm_relocate_functions::arm_grp_ldr): New Method.
9182 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9183 (Arm_relocate_functions::arm_grp_ldc): New Method.
9184 (Target_arm::Scan::local): Handle the ARM group relocations.
9185 (Target_arm::Scan::global): Likewise.
9186 (Target_arm::Relocate::relocate): Likewise.
9187 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9188 Likewise.
9189
9190 2010-01-26 Doug Kwan <dougkwan@google.com>
9191
9192 * arm.cc (set): Include.
9193 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9194 pointer type.
9195 (Arm_output_section::Text_section_list): New type.
9196 (Arm_output_section::append_text_sections_to_list): New method.
9197 (Arm_output_section::fix_exidx_coverage): Ditto.
9198 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
9199 (Arm_relobj::convert_input_section_to_relaxed_section): Use
9200 Relobj::set_section_offset() instead of
9201 Sized_relobj::invalidate_section_offset().
9202 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
9203 parameter for section headers. Ignore relocation sections for
9204 unallocated sections and EXIDX sections.
9205 (Target_arm::fix_exidx_coverage): New method.
9206 (Target_arm::output_section_address_less_than): New type.
9207 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9208 linked text section instead of the EXIDX section.
9209 (Arm_output_section::create_stub_group): Add an assertion to check
9210 that this is not an EXIDX output section.
9211 (Arm_output_section::append_text_sections_to_list): New method.
9212 (Arm_output_section::fix_exidx_coverage): Ditto.
9213 (Arm_relobj::scan_sections_for_stubs): Adjust call to
9214 Arm_relobj::section_needs_reloc_stub_scanning.
9215 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9216 first pass.
9217 (Target_arm::fix_exidx_coverage): New method.
9218 * object.h (Relobj::set_output_section): New method.
9219 (Sized_relobj::invalidate_section_offset): Remove method.
9220 (Sized_relobj::do_invalidate_section_offset): Remove method.
9221 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9222
9223 2010-01-25 Doug Kwan <dougkwan@google.com>
9224
9225 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9226 Fix warning due to signed and unsigned comparison on a 32-bit host.
9227
9228 2010-01-22 Doug Kwan <dougkwan@google.com>
9229
9230 * arm.cc (Target_arm::do_relax): Record an output section for section
9231 offset adjustment it contains any stub table that has changed.
9232 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9233 offsets in an output section if necessary.
9234 * output.cc (Output_section::Output_section): Initialize
9235 section_offsets_need_adjustments_.
9236 (Output_section::add_input_section_for_script): Renamed to
9237 Output_section::add_simple_input_section.
9238 (Output_section::save_states): Add a comment.
9239 (Output_section::discard_states): New method defintion.
9240 (Output_section::adjust_section_offsets): Same.
9241 * output.h (Output_section::add_input_section_for_script): Renamed to
9242 Output_section::add_simple_input_section.
9243 (Output_section::discard_states): New method declaration.
9244 (Output_section::adjust_section_offsets): Same.
9245 (Output_section::section_offsets_need_adjustment,
9246 Output_section::set_section_offsets_need_adjustment): New method
9247 definitions.
9248 (Output_section::section_offsets_need_adjustment_): New data member.
9249 * script-sections.cc
9250 (Output_section_element_input::set_section_address): Adjust code for
9251 renaming of Output_section::add_input_section_for_script.
9252 (Orphan_output_section::set_section_address): Same.
9253
9254 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9255
9256 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9257 Fix_v4bx enum values .
9258 * gold/options.h (General_options): New option definitions.
9259 (General_options::fix_v4bx): New method.
9260 (General_options::Fix_v4bx): New enum.
9261 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9262 (General_options::parse_fix_v4bx_interworking): New method.
9263
9264 2010-01-22 Doug Kwan <dougkwan@google.com>
9265
9266 * arm.cc (Arm_exidx_fixup): New class.
9267
9268 2010-01-21 Doug Kwan <dougkwan@google.com>
9269
9270 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9271 classes.
9272 (Arm_exidx_section_offset_map): New type.
9273
9274 2010-01-21 Doug Kwan <dougkwan@google.com>
9275
9276 * arm.cc (Arm_exidx_input_section): New class.
9277 (Arm_relobj::exidx_input_section_by_link,
9278 Arm_relobj::exidx_input_section_by_shndx,
9279 Arm_relobj::make_exidx_input_section): New methods.
9280 (read_arm_attributes_section): Remove.
9281 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9282 information about them.
9283 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9284 to here.
9285
9286 2010-01-20 Doug Kwan <dougkwan@google.com>
9287
9288 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9289 Input_section_specifier to Section_id.
9290 (Target_arm::new_arm_input_section: Adjust code for change of key
9291 type.
9292 (Target_arm::find_arm_input_section): Ditto.
9293 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9294 (Section_id): Remove.
9295 (Garbage_collection::Section_id_hash): Remove.
9296 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9297 (Section_id): Remove.
9298 (Icf::Section_id_hash): Remove.
9299 * object.h (Section_id, Const_section_id, Section_id_hash,
9300 Const_section_id_hash): New type definitions.
9301 * output.cc (Output_section::add_relaxed_input_section): Change to
9302 use Const_section_id instead of Input_section_specifier as key type.
9303 (Output_section::add_merge_input_section): Ditto.
9304 (Output_section::build_relaxation_map): Change to use Section_id
9305 instead of Input_section_specifier as key type.
9306 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9307 Ditto.
9308 (Output_section::convert_input_sections_to_relaxed_sections): Change
9309 to use Const_section_id instead of Input_section_specifier as key type.
9310 (Output_section::find_merge_section): Ditto.
9311 (Output_section::find_relaxed_input_section): Ditto.
9312 * output.h (Input_section_specifier): Remove class.
9313 (Output_section::Output_section_data_by_input_section_map): Change
9314 key type to Const_section_id.
9315 (Output_section::Output_relaxed_input_section_by_input_section_map):
9316 Ditto.
9317 (Output_section::Relaxation_map): Change key type to Section_id.
9318
9319 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9320
9321 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9322 (class Arm_v4bx_stub): New class.
9323 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9324 (Stub_factory::make_arm_v4bx_stub): New method.
9325 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9326 (Stub_table::empty): Handle v4bx stubs.
9327 (Stub_table::add_arm_v4bx_stub): New method.
9328 (Stub_table::find_arm_v4bx_stub): New method.
9329 (Arm_relocate_functions::v4bx): New method.
9330 (Target_arm::fix_v4bx): New method.
9331 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9332 (Stub_table::relocate_stubs): Likewise.
9333 (Stub_table::do_write): Likewise.
9334 (Stub_table::update_data_size_and_addralign): Likewise.
9335 (Stub_table::finalize_stubs): Likewise.
9336 (Target_arm::Scan::local): Likewise.
9337 (Target_arm::Scan::global): Likewise.
9338 (Target_arm::do_finalize_sections): Likewise.
9339 (Target_arm::Relocate::relocate): Likewise.
9340 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9341 Likewise.
9342 (Target_arm::scan_reloc_for_stub): Likewise.
9343 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9344
9345 2010-01-19 Ian Lance Taylor <iant@google.com>
9346
9347 * output.cc (Output_section_headers::do_sized_write): Write large
9348 segment count to sh_info field.
9349 (Output_file_header::do_sized_write): For large segment count,
9350 write PN_XNUM to e_phnum field.
9351
9352 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9353
9354 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9355 (Arm_relocate_functions::thm_jump8): New function.
9356 (Arm_relocate_functions::thm_jump11): New function.
9357 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9358 R_ARM_THM_JUMP11.
9359 (Target_arm::Scan::global): Likewise.
9360 (Target_arm::Relocate::relocate): Likewise.
9361 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9362 Likewise.
9363
9364 2010-01-14 Doug Kwan <dougkwan@google.com>
9365
9366 * arm.cc (map, utility): Include headers.
9367 (Target_arm::apply_cortex_a8_workaround): New method.
9368 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9369 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9370 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9371 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9372 the --[no-]fix-cortex-a8 command line options.
9373 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9374 (Target_arm::relocate_stub): Use addend in instruction template.
9375 * options.h (DEFINE_bool): Set the user-set flag.
9376 (General_options): Add --[no-]-fix-cortex options.
9377 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
9378 : Update fast look-up map after conversion.
9379
9380 2010-01-14 Sriraman Tallam <tmsriram@google.com>
9381
9382 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9383 in the first pass of do_layout.
9384
9385 2010-01-13 Doug Kwan <dougkwan@google.com>
9386
9387 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9388 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9389 apparent compiler problem of not folding static constant integral
9390 data members of elfcpp::Elf_sizes<32>.
9391
9392 2010-01-13 Doug Kwan <dougkwan@google.com>
9393
9394 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9395 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9396 Arm_relobj::scan_section_for_cortex_a8_erratum,
9397 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9398 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9399 sections to scan for relocation stubs into a new method
9400 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9401 relocation and Cortex-A8 stub scanning.
9402 (Target_arm::do_relax): Force stubs to be after stubbed sections
9403 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
9404 the beginning of a new relaxation pass. Update a comment.
9405 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9406
9407 2010-01-12 Ian Lance Taylor <iant@google.com>
9408
9409 * target-reloc.h (visibility_error): New inline function.
9410 (relocate_section): Call visibility_error.
9411 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9412 (MOSTLYCLEANFILES): Likewise.
9413 (protected_4_pic.o, protected_3.err): New targets.
9414 * testsuite/protected_4.cc: New file.
9415
9416 2010-01-12 Doug Kwan <dougkwan@google.com>
9417
9418 * arm.cc (Cortex_a8_reloc): New class.
9419 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9420 and cortex_a8_relocs_info_.
9421 (Target_arm::fix_cortex_a8): New method definition.
9422 (Target_arm::Cortex_a8_relocs_info): New type.
9423 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9424 New data member declarations.
9425 (Target_arm::scan_reloc_for_stub): Record information about
9426 relocations for THUMB branches that might be exempted from the
9427 Cortex-A8 workaround.
9428 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9429 at the beginning of a relaxation pass.
9430
9431 2010-01-12 Doug Kwan <dougkwan@google.com>
9432
9433 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9434 (Arm_relobj::Mapping_symbol_position,
9435 Arm_reloj::Mapping_symbol_position_less,
9436 Arm_relobj::Mapping_symbols_info): New types.
9437 (Target_arm::is_mapping_symbol_name): New method definition.
9438 (Arm_relobj::do_count_local_symbols): Save information about mapping
9439 symbols.
9440
9441 2010-01-11 Doug Kwan <dougkwan@google.com>
9442
9443 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9444 Arm_relocate_functions::thumb32_branch_upper,
9445 Arm_relocate_functions::thumb32_branch_lower,
9446 Arm_relocate_functions::thumb32_cond_branch_offset,
9447 Arm_relocate_functions::thumb32_cond_branch_upper,
9448 Arm_relocate_functions::thumb32_cond_branch_lower,
9449 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9450 branch offset encoding.
9451 (Arm_relocate_functions::thumb_branch_common): Use new branch
9452 offset encoding methods to avoid code duplication.
9453 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9454 (Stub_addend_reader::operator()): Use new branch encoding method
9455 to avoid code duplication.
9456
9457 2010-01-11 Doug Kwan <dougkwan@google.com>
9458
9459 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9460 (Target_arm::do_finalize_sections): Define special EXIDX section
9461 symbols only if referenced.
9462 * gc.h (Garbage_collection::add_reference): New method.
9463 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9464 code duplication.
9465
9466 2010-01-11 Ian Lance Taylor <iant@google.com>
9467
9468 * script.cc (Version_script_info::build_expression_list_lookup):
9469 Change complaing about duplicate wildcard match from error to
9470 warning.
9471
9472 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9473 of 2009-12-30.
9474 (Version_script_info::Version_script_info): Initialize globs_,
9475 default_version_, default_is_global_, and exact_. Don't
9476 initialize globals_ or locals_.
9477 (Version_script_info::build_lookup_tables): Build local symbols
9478 first.
9479 (Version_script_info::unquote): New function.
9480 (Version_script_info::add_exact_match): New function.
9481 (Version_script_info::build_expression_list_lookup): Remove lookup
9482 parameter. Add is_global parameter. Change all callers. Handle
9483 wildcard pattern specially. Unquote pattern. Call
9484 add_exact_match.
9485 (Version_script_info::get_name_to_match): New function.
9486 (Version_script_info::get_symbol_version): New function.
9487 (Version_script_info::get_symbol_version_helper): Remove.
9488 (Version_script_info::check_unmatched_names): Call unquote.
9489 * script.h (class Version_script_info): Change get_symbol_version
9490 to be non-inline and add is_global parameter; change all callers.
9491 Rewrite symbol_is_local. Update declarations. Define struct
9492 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9493 Remove globals_ and locals_ members. Add exact_, globs_,
9494 default_version_, is_global_.
9495 (Version_script_info::Glob): Remove pattern, add expression and
9496 is_global. Update constructor. Change all callers.
9497 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9498 default version.
9499 (Versions::symbol_section_contents): If a symbol is undefined, or
9500 defined in a dynamic object, set the version index to
9501 VER_NDX_LOCAL.
9502 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9503 symbol_is_local.
9504 (Symbol_table::add_from_pluginobj): Likewise.
9505 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9506
9507 2010-01-11 Doug Kwan <dougkwan@google.com>
9508
9509 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9510 (incremental_dump_LDADD): Add linking option for libintl.
9511 * Makefile.in: Regenerate.
9512
9513 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9514
9515 PR gold/11144
9516 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9517 instead of -Ds.
9518 * testsuite/Makefile.in: Regenerated.
9519
9520 2010-01-10 Doug Kwan <dougkwan@google.com>
9521
9522 * options.h (DEFINE_var): Use parentheses around argument varname__
9523 in macro body to avoid any unintended subsequent substitutions.
9524
9525 2010-01-10 Ian Lance Taylor <iant@google.com>
9526
9527 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9528 candidates before doing symbol resolution.
9529
9530 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9531 ODR candidates if only one is weak.
9532
9533 2010-01-08 Ian Lance Taylor <iant@google.com>
9534
9535 * script.cc (Version_script_info::build_expression_list_lookup):
9536 Don't warn about ambiguous version, just record the ambiguity.
9537 (Version_script_info::get_symbol_version_helper): Give error if
9538 version is ambiguous.
9539
9540 2010-01-08 Doug Kwan <dougkwan@google.com>
9541
9542 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
9543 prev_data_size_ and prev_addralign_. Remove initializer for
9544 deleted data member has_been_changed_.
9545 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9546 to determine if the table is empty.
9547 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9548 Remove.
9549 (Stub_table::add_reloc_stub): Define method in class definition
9550 instead of just declaring it there.
9551 (Stub_table::add_cortex_a8_stub): New method definition.
9552 (Stub_table::update_data_size_and_addralign): Ditto.
9553 (Stub_table::finalize_stubs): Ditto.
9554 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9555 (Stub_table::do_addralign_): Return address alignment in the
9556 (Stub_table::do_reset_address_and_file_offset): Define method in
9557 class definition instead of declaring it there. Set current data
9558 size to be the data size of the previous pass.
9559 (Stub_table::set_final_data_size): Use current data size as the
9560 final data size.
9561 (Stub_table::relocate_stub): Change parameter type of stub from
9562 Reloc_stub pointer to Stub pointer.
9563 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9564 (Stub_table::Cortex_a8_stub_list): New typedef.
9565 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9566 Stub_table::prev_addralign_): New data member.
9567 (Arm_relobj::Arm_relobj): Initialize data member
9568 section_has_cortex_a8_workaround_.
9569 (Arm_relobj::section_has_cortex_a8_workaround,
9570 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9571 definitions.
9572 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9573 declarations.
9574 (Target_arm::relocate_stub): Change parameter type of stub from
9575 Reloc_stub pointer to Stub pointer.
9576 (Insn_template::size, Insn_template::alignment): Handle
9577 THUMB16_SPECIAL_TYPE.
9578 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9579 Stub_table::update_data_size_and_addralign,
9580 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
9581 definitions.
9582 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
9583 (Stub_table::do_write): Ditto.
9584 (Target_arm::do_relax): Adjust code for changes in Stub_table.
9585
9586 2010-01-08 Ian Lance Taylor <iant@google.com>
9587
9588 PR 11108
9589 * symtab.h (class Symbol): Remove fields is_target_special_ and
9590 has_plt_offset_. Add field is_defined_in_discarded_section_.
9591 (Symbol::is_defined_in_discarded_section): New function.
9592 (Symbol::set_is_defined_in_discarded_section): New function.
9593 (Symbol::has_plt_offset): Rewrite.
9594 (Symbol::set_plt_offset): Verify that new offset is not -1U.
9595 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
9596 Don't initialize is_target_special_ or has_plt_offset_.
9597 Initialize is_defined_in_discarded_section_.
9598 (Symbol_table::add_from_relobj): If appropriate, set
9599 is_defined_in_discarded_section.
9600 * resolve.cc (Symbol::override_base_with_special): Don't test
9601 is_target_special_. Change has_plt_offset_ to has_plt_offset().
9602 * target-reloc.h (relocate_section): Do special handling for
9603 symbols defined in discarded sections for global symbols as well
9604 as local symbols.
9605
9606 2010-01-08 Ian Lance Taylor <iant@google.com>
9607
9608 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
9609 the SHT_SYMTAB case.
9610
9611 2010-01-08 Ian Lance Taylor <iant@google.com>
9612
9613 * object.cc (Sized_relobj::do_layout): Don't get confused if
9614 layout_eh_frame returns NULL.
9615
9616 2010-01-08 Ian Lance Taylor <iant@google.com>
9617
9618 PR 11084
9619 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
9620 dynamic symbol table, use the normal symbol table.
9621 (Sized_dynobj::do_read_symbols): Remove assertion about type of
9622 symbol table.
9623
9624 2010-01-08 Ian Lance Taylor <iant@google.com>
9625
9626 PR 11072
9627 * layout.cc (Layout::include_section): Remove .gnu_debuglink
9628 sections.
9629
9630 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
9631
9632 * version.cc (print_version): Change to "Copyright 2010".
9633
9634 2010-01-08 Ian Lance Taylor <iant@google.com>
9635
9636 PR 10287
9637 PR 11063
9638 * i386.cc (class Target_i386): Change return type of plt_section
9639 to be non-const.
9640 (class Output_data_plt_i386): Add tls_desc_rel_ field.
9641 (Output_data_plt_i386::Output_data_plt_i386): Initialize
9642 tls_desc_rel_ field.
9643 (Output_data_plt_i386::rel_tls_desc): New function.
9644 (Target_i386::rel_tls_desc_section): New function.
9645 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
9646 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
9647 R_386_TLS_DESC reloc in rel_tls_desc_section.
9648 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
9649 Define struct Tlsdesc_info.
9650 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
9651 (Target_x86_64::do_reloc_symbol_index): New function.
9652 (Target_x86_64::add_tlsdesc_info): New function.
9653 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
9654 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
9655 tlsdesc_rel_ field.
9656 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
9657 all callers.
9658 (Output_data_plt_x86_64::rela_tlsdesc): New function.
9659 (Target_x86_64::rela_tlsdesc_section): New function.
9660 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
9661 handling.
9662 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
9663 (Target_x86_64::do_reloc_addend): New function.
9664 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
9665 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
9666 declarations. Define TARGET_CODE. Add arg field to u1_ union.
9667 (Output_reloc::type): New function.
9668 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
9669 (Output_reloc::is_target_specific): New function.
9670 (Output_reloc::target_arg): New function.
9671 (class Output_reloc) [SHT_RELA]: Add four new constructors for
9672 absolute relocs and target specific relocs.
9673 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
9674 add_target_specific.
9675 (class Output_data_reloc) [SHT_RELA]: Likewise.
9676 * output.cc (Output_reloc::Output_reloc): Add four new versions
9677 for absolute relocs and target specific relocs.
9678 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
9679 (Output_reloc::get_symbol_index): Likewise.
9680 (Output_reloc::local_section_offset): Check that local_sym_index_
9681 is not TARGET_CODE or 0.
9682 (Output_reloc::symbol_value): Likewise.
9683 (Output_reloc::write) [SHT_RELA]: Call target for target specific
9684 reloc.
9685 * target.h (class Target): Add reloc_symbol_index and reloc_addend
9686 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
9687 functions.
9688 * layout.cc (add_target_dynamic_tags): Use output section for
9689 DT_PLTRELSZ and DT_JMPREL.
9690
9691 2010-01-07 Ian Lance Taylor <iant@google.com>
9692
9693 PR 11061
9694 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
9695 function.
9696 (class Output_data_reloc_generic): Define.
9697 (class Output_data_reloc_base): Change base class to
9698 Output_data_reloc_generic. Change add() method to call
9699 bump_relative_reloc_count for a relative reloc. Remove
9700 sort_relocs_ field.
9701 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
9702 to sort_relocs().
9703 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
9704 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
9705 appropriate.
9706 * layout.h (class Layout): Update declaration.
9707
9708 2010-01-07 Ian Lance Taylor <iant@google.com>
9709
9710 * output.h (class Output_data): Add const version of
9711 output_section and do_output_section.
9712 (class Output_section_data): Add const version of
9713 do_output_section.
9714 (class Output_section): Likewise.
9715 * layout.cc (Layout::add_target_dynamic_tags): New function.
9716 * layout.h (class Layout): Update declarations.
9717 * arm.cc (Target_arm::do_finalize_sections): Use
9718 add_target_dynamic_tags.
9719 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9720 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9721 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9722 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9723
9724 2010-01-07 Ian Lance Taylor <iant@google.com>
9725
9726 PR 11042
9727 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
9728 object as needed.
9729
9730 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
9731 Ian Lance Taylor <iant@google.com>
9732
9733 PR 11019
9734 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
9735 Xindex::read_symtab_xindex.
9736
9737 2010-01-07 Doug Kwan <dougkwan@google.com>
9738
9739 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
9740 (Insn_template::thumb16_bcond_insn): New method declaration.
9741 (Insn_template): Fix spelling.
9742 (Stub::thumb16_special): New method declaration.
9743 (Stub::do_write): Define virtual method which was previously pure
9744 virtual.
9745 (Stub::do_thumb16_special): New method declaration.
9746 (Stub::do_fixed_endian_write): New template member.
9747 (Reloc_stub::do_write): Remove.
9748 (Reloc_stub::do_fixed_endian_write): Remove.
9749 (Cortex_a8_stub): New class definition.
9750 (Stub_factory::make_cortex_a8_stub): New method definition.
9751 (Stub_factory::Stub_factory): Add missing static storage class
9752 qualifier for elf32_arm_stub_a8_veneer_blx.
9753
9754 2010-01-07 Ian Lance Taylor <iant@google.com>
9755
9756 PR 10980
9757 * options.h (class General_options): Add --warn-unresolved-symbols
9758 and --error-unresolved-symbols.
9759 * errors.cc (Errors::undefined_symbol): Implement
9760 --warn-unresolved-symbols.
9761
9762 * options.h (class General_options): Add -z text and -z textoff.
9763 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
9764
9765 2010-01-06 Sriraman Tallam <tmsriram@google.com>
9766
9767 * gc.h (Garbage_collection::Cident_section_map): New typedef.
9768 (Garbage_collection::cident_sections): New function.
9769 (Garbage_collection::add_cident_section): New function.
9770 (Garbage_collection::cident_sections_): New member.
9771 (gc_process_relocs): Add references to sections whose names are C
9772 identifiers.
9773 * gold.h (cident_section_start_prefix): New constant.
9774 (cident_section_stop_prefix): New constant.
9775 (is_cident): New function.
9776 * layout.cc (Layout::define_section_symbols): Replace string constants
9777 with the newly defined constants.
9778 * object.cc (Sized_relobj::do_layout): Track sections whose names are
9779 C identifiers.
9780 * testsuite/Makefile.am: Add gc_orphan_section_test.
9781 * testsuite/Makefile.in: Regenerate.
9782 * testsuite/gc_orphan_section_test.cc: New file.
9783 * testsuite/gc_orphan_section_test.sh: New file.
9784
9785 2010-01-06 Ian Lance Taylor <iant@google.com>
9786
9787 PR 10980
9788 * options.h (class General_options): Add --warn-shared-textrel.
9789 * layout.cc (Layout::finish_dynamic_section): Implement
9790 --warn-shared-textrel.
9791
9792 PR 10980
9793 * options.h (class General_options): Add --warn-multiple-gp.
9794
9795 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9796
9797 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9798 $(THREADSLIB) and $(LIBDL).
9799 * Makefile.in: Rebuild.
9800
9801 2010-01-06 Ian Lance Taylor <iant@google.com>
9802
9803 PR 10980
9804 * options.cc (General_options::parse_section_start): New function.
9805 (General_options::section_start): New function.
9806 (General_options::General_options): Initialize all members.
9807 * options.h: Include <map>
9808 (class General_options): Add --section-start. Add section_starts_
9809 member.
9810 * layout.cc (Layout::attach_allocated_section_to_segment): If
9811 --section-start was used, set the address of the segment. Remove
9812 local sort_sections.
9813 (Layout::relaxation_loop_body): If the address of the load segment
9814 has been set by --section-start, don't use it.
9815 * output.h (Output_segment::update_flags_for_output_section): New
9816 function.
9817 * output.cc (Output_segment::add_output_section): Call
9818 update_flags_for_output_section.
9819
9820 2010-01-05 Ian Lance Taylor <iant@google.com>
9821
9822 PR 10980
9823 * options.h (class General_options): Add --undefined-version.
9824 * script.cc (struct Version_expression): Add was_matched_by_symbol
9825 field.
9826 (Version_script_info::matched_symbol): New function.
9827 (Version_script_info::get_symbol_version_helper): Call
9828 matched_symbol.
9829 (Version_script_info::check_unmatched_names): New function.
9830 * script.h (class Version_script_info): Update declarations.
9831 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
9832
9833 * options.h (class General_options): Use DEFINE_bool_alias for
9834 allow_multiple_definition.
9835 * resolve.cc (Symbol_table::should_override): Don't test
9836 allow_multiple_definition.
9837
9838 PR 10980
9839 * options.h (class General_options): Add --cref.
9840 * main.cc (main): Print cref table if --cref. Don't close mapfile
9841 until after printing cref table.
9842 * cref.cc: Include "symtab.h".
9843 (class Cref_inputs): Define Cref_table_compare and Cref_table.
9844 (Cref_table_compare::operator()): New function.
9845 (Cref_inputs::gather_cref): New function.
9846 (filecol): New static const.
9847 (Cref_inputs::print_cref): New function.
9848 (Cref::print_cref): New function.
9849 * cref.h: Include <cstdio>.
9850 (class Cref): Update declarations.
9851 * mapfile.h (Mapfile::file): New function.
9852 * object.h (class Object): Define Symbols. Declare virtual
9853 do_get_global_symbols.
9854 (Object::get_global_symbols): New function.
9855 * object.cc (Input_objects::add_object): Pass object to cref_ if
9856 --cref.
9857 (Input_objects::archive_start): Likewise.
9858 (Input_objects::archive_stop): Likewise.
9859 (Input_objects::print_cref): New function.
9860 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
9861 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
9862 --cref.
9863 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
9864 function.
9865 * plugin.h (class Sized_pluginobj): Update declarations.
9866
9867 2010-01-05 Ian Lance Taylor <iant@google.com>
9868
9869 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
9870 to is_default_version. Rename insdef to insdefault.
9871 (Symbol_table::add_from_relobj): Rename def to is_default_version
9872 and local to is_forced_local.
9873 (Symbol_table::add_from_pluginobj): Likewise.
9874 (Symbol_table::add_from_dynobj): Likewise.
9875 (Symbol_table::define_special_symbol): Rename insdef to
9876 insdefault.
9877
9878 2010-01-04 Ian Lance Taylor <iant@google.com>
9879
9880 PR 10980
9881 * options.h (class General_options): Add
9882 --allow-multiple-definition and -z muldefs.
9883 * resolve.cc (Symbol_table::should_override): Don't warn about a
9884 multiple symbol definition if --allow-multiple-definition or -z
9885 muldefs.
9886
9887 PR 10980
9888 * options.h (class General_options): Add --add-needed and
9889 --copy-dt-needed-entries. Tweak --as-needed help entry.
9890 * object.cc (Input_objects::check_dynamic_dependencies): Give an
9891 error if --copy-dt-needed-entries aka --add-needed is used and
9892 would cause a change in behaviour.
9893
9894 PR 10980
9895 * options.h (class General_options): Add -G as a short version of
9896 --shared. Add no-op options -assert, -g, and -i.
9897
9898 2010-01-04 Sriraman Tallam <tmsriram@google.com>
9899
9900 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
9901 check for .text or .gnu.linkonce.t sections.
9902 * icf.cc (Icf::find_identical_sections): Ditto.
9903 Change the detection for mangled function name within the section
9904 name.
9905 * icf.h (is_section_foldable_candidate): New function.
9906
9907 2009-12-30 Ian Lance Taylor <iant@google.com>
9908
9909 PR 10980
9910 * options.h (class General_options): Permit two dashes with
9911 --retain-symbols-file.
9912
9913 2009-12-30 Ian Lance Taylor <iant@google.com>
9914
9915 PR 10979
9916 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
9917 don't put the file header and segment headers in the text
9918 segment.
9919
9920 PR 10979
9921 * common.cc (Sort_commons::operator()): Stabilize sort when both
9922 entries are NULL.
9923 (Symbol_table::do_allocate_commons_list): When allocating common
9924 symbols, skip a symbol which is no longer common.
9925 * symtab.h (Symbol::is_common): Test whether the symbol comes from
9926 an object before checking its type.
9927 * testsuite/common_test_2.c: New file.
9928 * testsuite/common_test_3.c: New file.
9929 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
9930 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
9931 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
9932 (common_test_2_pic.o, common_test_2.so): New targets.
9933 (common_test_3_pic.o, common_test_3.so): New targets.
9934 * testsuite/Makefile.in: Rebuild.
9935
9936 PR 10979
9937 * script.cc (read_input_script): If we see a new SECTIONS clause,
9938 and we have added an input section, give an error.
9939 * layout.h (class Layout): Add have_added_input_section function.
9940 Add have_added_input_section_ field.
9941 * layout.cc (Layout::Layout): Initialize
9942 have_added_input_section_.
9943 (Layout::layout): Set have_added_input_section_.
9944 (Layout::layout_eh_frame): Likewise.
9945
9946 2009-12-30 Ian Lance Taylor <iant@google.com>
9947
9948 PR 10931
9949 * options.h (class General_options): Add --sort-common option.
9950 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
9951 * common.cc (Sort_common): Add sort_order parameter to
9952 constructor. Add sort_order_ field.
9953 (Sort_commons::operator): Check sort_order_.
9954 (Symbol_table::allocate_commons): Determine the sort order.
9955 (Symbol_table::do_allocate_commons): Add sort_order parameter.
9956 Change all callers.
9957 (Symbol_table::do_allocate_commons_list): Likewise.
9958
9959 2009-12-30 Ian Lance Taylor <iant@google.com>
9960
9961 PR 10916
9962 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
9963 symbols from this object, don't change the visibility of an
9964 undefined symbol.
9965 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
9966
9967 2009-12-30 Ian Lance Taylor <iant@google.com>
9968
9969 PR 10861
9970 * script.h (class Version_script_info): Define Language enum.
9971 Update declarations. Define Glob, Exact, and Lookup types. Add
9972 new fields globals_, locals_, and is_finalized_.
9973 * script.cc: Various formatting fixes.
9974 (class Parser_closure): Change language_stack_ from a vector of
9975 std::string to one of Version_script_info::Language. Adjust all
9976 uses accordingly.
9977 (class Lazy_demangler): Remove.
9978 (struct Version_expression): Change language from std::string to
9979 Version_script_info::Language.
9980 (Version_script_info::Version_script_info): New function.
9981 (Version_script_info::~Version_script_info): Don't call clear.
9982 (Version_script_info::finalize): New function.
9983 (Version_script_info::build_lookup_tables): New function.
9984 (Version_script_info::build_expression_list_lookup): New
9985 function.
9986 (Version_script_info::get_symbol_version_helper): Rewrite to use
9987 lookup tables.
9988 (Version_script_info::print_expression_list): Adjust to use
9989 Version_script_info::Language.
9990 (script_push_lex_into_version_mode): Check that the version script
9991 has not been finalized.
9992 (version_script_push_lang): Change language string to
9993 Version_script_info::Language.
9994 * options.cc (Command_line::version_script): New function.
9995 * options.h (class General_options): Add finalize_dynamic_list
9996 function. Change version_script from declaration to definition.
9997 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
9998 * testsuite/version_script.map: Remove duplicate def of foo.
9999 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10000 version_script.map.
10001 * testsuite/Makefile.in: Rebuild.
10002
10003 2009-12-30 Ian Lance Taylor <iant@google.com>
10004
10005 PR 10843
10006 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10007 if the input symbol index is 0, make the output symbol index 0.
10008
10009 2009-12-30 Ian Lance Taylor <iant@google.com>
10010
10011 PR 10670
10012 * options.h (class General_options): Add -x/--discard-all.
10013 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10014 --discard-all. If the local symbol needs a dynamic entry, check
10015 that before handling --discard-locals.
10016
10017 2009-12-30 Ian Lance Taylor <iant@google.com>
10018
10019 PR 10450
10020 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10021 flags to PF_R.
10022 (Output_segment::add_output_section): Don't change the flags if
10023 the type is PT_TLS.
10024
10025 PR 10450
10026 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10027 GNU hash table if they need a dynamic value. Otherwise, don't add
10028 them if they are defined in a dynamic object or are forced local.
10029
10030 2009-12-29 Ian Lance Taylor <iant@google.com>
10031
10032 PR 10450
10033 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10034 .gnu.hash table for a 32-bit target.
10035
10036 PR 10450
10037 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10038 regular and a dynamic object only needs a dynamic symbol table
10039 entry if it is externally visible.
10040
10041 PR 10450
10042 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10043 constructor. Add global_offset_table_ field.
10044 (Target_i386::got_section): Set global_offset_table_.
10045 (Target_i386::do_finalize_sections): Set global_offset_table_
10046 size.
10047 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10048 in constructor. Add global_offset_table_ field.
10049 (Target_x86_64::got_section): Set global_offset_table_.
10050 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10051 size.
10052
10053 * layout.cc (Layout::Layout): Initialize increase_relro_.
10054 (Layout::get_output_section): Add is_relro, is_last_relro, and
10055 is_first_non_relro parameters. Change all callers.
10056 (Layout::choose_output_section): Likewise.
10057 (Layout::add_output_section_data): Likewise.
10058 (Layout::make_output_section): Likewise.
10059 (Layout::set_segment_offsets): Clear increase_relro when using a
10060 linker script.
10061 * layout.h (class Layout): Add increase_relro method. Add
10062 increase_relro_ field. Update declarations.
10063 * output.cc (Output_section::Output_section): Initialize
10064 is_last_relro_ and is_first_non_relro_.
10065 (Output_segment::add_output_section): Group relro sections is
10066 do_sort is true. Handle is_last_relro and is_first_non_relro.
10067 (Output_segment::maximum_alignment): Remove relro handling.
10068 (Output_segment::set_section_addresses): Add increase_relro
10069 parameter. Change all callers. Add initial alignment to align
10070 relro sections on separate page. Remove old relro handling.
10071 (Output_segment::set_section_list_addresses): Remove in_relro
10072 parameter. Change all callers.
10073 (Output_segment::set_offset): Add increase parameter. Change all
10074 callers. Remove old relro handling.
10075 * output.h (class Output_section): Add new methods: is_last_relro,
10076 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10077 Add is_last_relro_ and is_first_non_relro_ fields.
10078 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10079 Create separate .got.plt section. Call increase_relro.
10080 * x86_64.cc (Target_x86_64::got_section): Likewise.
10081 * testsuite/relro_script_test.t: Add .got.plt.
10082
10083 PR 10450
10084 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10085 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10086 (Layout::finalize): Call set_dynamic_symbol_size.
10087 (Layout::set_dynamic_symbol_size): New function.
10088 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10089 set_dynamic_symbol_size.
10090
10091 PR 10450
10092 * output.h (class Output_section): Add is_entsize_zero_ field.
10093 * output.cc (Output_section::Output_section): Initialize
10094 is_entsize_zero_.
10095 (Output_section::set_entsize): If two different entsizes are
10096 requested, force it to zero.
10097 (Output_section::add_input_section): Set flags for .debug_str
10098 before updating section flags. Set entsize.
10099 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10100 and SHF_STRING if all input sections have those flags.
10101
10102 2009-12-29 Rafael Espindola <espindola@google.com>
10103
10104 * main.cc (main): Fix the sys time reporting.
10105 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10106 reporting.
10107
10108 2009-12-29 Sriraman Tallam <tmsriram@google.com>
10109
10110 * options.cc (General_options::parse_version): Allow -v to exit
10111 without an error if there is nothing to link.
10112
10113 2009-12-29 Ian Lance Taylor <iant@google.com>
10114
10115 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10116 using a version of gcc before 4.1.
10117 * configure: Rebuild.
10118
10119 2009-12-28 Chris Demetriou <cgd@google.com>
10120
10121 * attributes.cc (Output_attributes_section_data::do_write): Use
10122 std::vector::front rather than std::vector::data.
10123
10124 2009-12-28 Ian Lance Taylor <iant@google.com>
10125
10126 * symtab.h (class Symbol_table): Add enum Defined.
10127 * resolve.cc (Symbol_table::should_override): Add defined
10128 parameter. Change all callers. Test whether object is NULL
10129 before calling a method on it.
10130 (Symbol_table::report_resolve_problem): Add defined parameter.
10131 Change all callers.
10132 (Symbol_table::should_override_with_special): Likewise.
10133 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10134 parameter. Change all callers.
10135 (Symbol_table::do_define_in_output_data): Likewise.
10136 (Symbol_table::define_in_output_segment): Likewise.
10137 (Symbol_table::do_define_in_output_segment): Likewise.
10138 (Symbol_table::define_as_constant): Likewise.
10139 (Symbol_table::do_define_as_constant): Likewise.
10140 * script.h (class Symbol_assignment): Add is_defsym parameter to
10141 constructor; change all callers.
10142 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10143 parameter. Change all callers. Add is_defsym_ field.
10144 (class Parser_closure): Add parsing_defsym parameter to
10145 constructor; change all callers. Add parsing_defsym accessor
10146 function. Add parsing_defsym_ field.
10147
10148 2009-12-28 Ian Lance Taylor <iant@google.com>
10149
10150 * gold.cc (queue_middle_tasks): Fix formatting.
10151 * object.cc (Relobj::is_section_name_included): Likewise.
10152
10153 2009-12-23 Ian Lance Taylor <iant@google.com>
10154
10155 * i386.cc (Target_i386::do_calls_non_split): Recognize
10156 -fsplit-stack prologue for a function with a static chain.
10157 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10158 -fsplit-stack prologue when using %r11.
10159
10160 2009-12-21 Sriraman Tallam <tmsriram@google.com>
10161
10162 * options.cc (General_options::parse_version): Make -v continue and do
10163 the link like GNU ld does.
10164
10165 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
10166
10167 * Makefile.am (CCFILES): Add timer.cc.
10168 (HFILES): Add timer.h.
10169 * configure.ac: Check for sysconf and times.
10170 * main.cc: include timer.h.
10171 (main): Use Timer instead of get_run_time.
10172 * timer.cc: New.
10173 * timer.h: New.
10174 * workqueue.cc: include timer.h.
10175 (Workqueue::find_and_run_task):
10176 Report user, sys and wall time.
10177 * Makefile.in: Regenerate.
10178 * config.in: Regenerate.
10179 * configure: Regenerate.
10180
10181 2009-12-16 Doug Kwan <dougkwan@google.com>
10182
10183 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10184 sections.
10185 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10186 relaxed input sections.
10187 * output.cc (Output_section::find_relaxed_input_section): Change
10188 return type to Output_relaxed_input_section pointer. Adjust code
10189 for new type of relaxed_input_section_map_.
10190 * output.h (Output_section::find_relaxed_input_section): Change
10191 return type to Output_relaxed_input_section pointer.
10192 (Output_section::Output_relaxed_input_section_by_input_section_map):
10193 New type.
10194 (Output_section::relaxed_input_section_map_): Change type to
10195 Output_section::Output_relaxed_input_section_by_input_section_map.
10196 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10197 input section.
10198
10199 2009-12-15 Ian Lance Taylor <iant@google.com>
10200
10201 * layout.cc (Layout::create_shstrtab): Only write out after input
10202 sections if we are compressing debug sections.
10203
10204 2009-12-15 Ian Lance Taylor <iant@google.com>
10205
10206 * archive.cc (Archive::add_symbols): Only look up a symbol without
10207 a version if there is, in fact, a version.
10208
10209 2009-12-14 Ian Lance Taylor <iant@google.com>
10210
10211 Revert -Wshadow changes, all changes from:
10212 2009-12-11 Doug Kwan <dougkwan@google.com>
10213 2009-12-11 Nick Clifton <nickc@redhat.com>
10214 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10215
10216 2009-12-11 Doug Kwan <dougkwan@google.com>
10217
10218 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10219 due to -Wshadow.
10220 * attributes.cc (Object_attribute::size): Ditto.
10221 (Attributes_section_data::size): Ditto.
10222 (Attributes_section_data::Attributes_section_data): Ditto.
10223 (Output_attributes_section_data::do_write): Ditto.
10224 * attributes.h (Object_attribute::set_type): Ditto.
10225 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10226
10227 2009-12-11 Nick Clifton <nickc@redhat.com>
10228
10229 * archive.cc: Fix shadowed variable warnings.
10230 * arm.cc: Likewise.
10231 * compressed_output.cc: Likewise.
10232 * compressed_output.h: Likewise.
10233 * configure: Likewise.
10234 * dwarf_reader.cc: Likewise.
10235 * dynobj.cc: Likewise.
10236 * dynobj.h: Likewise.
10237 * ehframe.cc: Likewise.
10238 * ehframe.h: Likewise.
10239 * errors.cc: Likewise.
10240 * expression.cc: Likewise.
10241 * fileread.cc: Likewise.
10242 * fileread.h: Likewise.
10243 * freebsd.h: Likewise.
10244 * i386.cc: Likewise.
10245 * icf.cc: Likewise.
10246 * incremental.h: Likewise.
10247 * layout.cc: Likewise.
10248 * layout.h: Likewise.
10249 * mapfile.cc: Likewise.
10250 * merge.cc: Likewise.
10251 * merge.h: Likewise.
10252 * object.cc: Likewise.
10253 * object.h: Likewise.
10254 * options.h: Likewise.
10255 * output.cc: Likewise.
10256 * output.h: Likewise.
10257 * parameters.cc: Likewise.
10258 * plugin.cc: Likewise.
10259 * powerpc.cc: Likewise.
10260 * reduced_debug_output.cc: Likewise.
10261 * reduced_debug_output.h: Likewise.
10262 * reloc.cc: Likewise.
10263 * reloc.h: Likewise.
10264 * resolve.cc: Likewise.
10265 * script-sections.cc: Likewise.
10266 * script.cc: Likewise.
10267 * script.h: Likewise.
10268 * sparc.cc: Likewise.
10269 * symtab.cc: Likewise.
10270 * symtab.h: Likewise.
10271 * target-select.cc: Likewise.
10272 * target-select.h: Likewise.
10273 * token.h: Likewise.
10274 * workqueue.cc: Likewise.
10275 * workqueue.h: Likewise.
10276 * x86_64.cc: Likewise.
10277
10278 2009-12-10 Doug Kwan <dougkwan@google.com>
10279
10280 * arm.cc (attributes.h): New include.
10281 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10282 (Arm_relobj::~Arm_relobj): Delete object pointed by
10283 attributes_section_data_.
10284 (Arm_relobj::attributes_section_data): New method definition.
10285 (Arm_relobj::attributes_section_data_): New data member declaration.
10286 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10287 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10288 attributes_section_data_.
10289 (Arm_dynobj::attributes_section_data): New method definition.
10290 (Arm_dynobj::attributes_section_data_): New data member declaration.
10291 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10292 initialization value of may_use_blx_ to false.
10293 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
10294 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10295 object attributes to compute results instead of hard-coding.
10296 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10297 Target_arm::get_secondary_compatible_arch,
10298 Target_arm::set_secondary_compatible_arch
10299 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10300 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10301 New method declarations.
10302 (Target_arm::get_aeabi_object_attribute): New method definition.
10303 (Target_arm::attributes_section_data_): New data member declaration.
10304 (read_arm_attributes_section): New template definition.
10305 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10306 (Arm_dynobj::do_read_symbols): Ditto.
10307 (Target_arm::do_finalize_sections): Merge attributes sections from
10308 input. Check for BLX use after attributes section merging.
10309 Fix __exidx_start and __exidx_end visibility. Create an
10310 .ARM.attributes section if necessary.
10311 (Target_arm::get_secondary_compatible_arch,
10312 Target_arm::set_secondary_compatible_arch,
10313 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10314 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
10315 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
10316 New method definitions.
10317
10318 2009-12-09 Ian Lance Taylor <iant@google.com>
10319
10320 * plugin.cc (Plugin::load): Don't cast from void* to a function
10321 pointer.
10322
10323 2009-12-09 Ian Lance Taylor <iant@google.com>
10324
10325 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10326 information fields.
10327
10328 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10329
10330 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10331 Replace two_file_shared_1.so with two_file_shared_2.so.
10332 * testsuite/Makefile.in: Regenerated.
10333
10334 2009-12-08 Doug Kwan <dougkwan@google.com>
10335
10336 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10337 (HFILES): Add attributes.h and int_encoding.h.
10338 * Makefile.in: Regenerate.
10339 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10340 function definitions to int_encoding.cc
10341 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10342 prototypes to int_encoding.h
10343 * reduced_debug_output.cc (int_encoding.h): New include.
10344 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10345 function definitions to int_encoding.cc
10346 (insert_into_vector, read_from_pointer): Move template definitions to
10347 int_encoding.h
10348 * attributes.cc: New file.
10349 * attributes.h: New file.
10350 * int_encoding.cc: New file.
10351 * int_encoding.h: New file.
10352
10353 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
10354
10355 PR gold/11055
10356 * incremental-dump.cc (dump_incremental_inputs): New.
10357 (main): Use dump_incremental_inputs.
10358
10359 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10360
10361 PR gold/10893
10362 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10363 checking elfcpp::STT_FUNC.
10364 (Target_i386::Relocate::relocate): Likewise.
10365 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10366
10367 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10368 symbols from shared libraries into normal FUNC symbols.
10369
10370 * symtab.h (Symbol): Add is_func and use it.
10371
10372 2009-12-05 Doug Kwan <dougkwan@google.com>
10373
10374 * arm.cc (Target_arm::arm_info): Initialize new fields
10375 attributes_section and attributes_vendor.
10376 * i386.cc (Target_i386::i386_info): Same.
10377 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10378 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10379 fields attributes_section and attributes_vendor.
10380 * sparc.cc (Target_sparc::sparc_info): Same.
10381 * target.h (Target::attributes_section, Target::attributes_vendor,
10382 Target::is_attributes_section, Target::attribute_arg_type,
10383 Target::attributes_order): New method definitions.
10384 (Target::Target_info::attributes_section,
10385 Target::Target_info::attributes_vendor): New fields.
10386 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10387 virtual method definitions.
10388 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10389 attributes_section and attributes_vendor.
10390 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10391
10392 2009-12-05 Doug Kwan <dougkwan@google.com>
10393
10394 * arm.cc: Update comments about interworking and stub generation.
10395 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10396 considered as non-PIC.
10397 (Arm_relocate_functions::base_abs): Fix formatting.
10398 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10399 of function to use GOT entry address instead of offset.
10400 (Target_arm::Scan::global): Issue an error if a symbol would need a
10401 PLT does not get one because it is untyped. Remove code to create
10402 dynamic symbols for relative branches.
10403 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10404 takes unsigned integer instead of boolean.
10405
10406 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10407
10408 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10409 (two_file_test_LDADD): Likewise.
10410 (common_test_1_LDADD): Likewise.
10411 (exception_test_LDADD) Likewise.
10412 (weak_test_LDADD): Likewise.
10413 (many_sections_test_LDADD): Likewise.
10414 (initpri1_LDADD): Likewise.
10415 (script_test_1_LDADD): Likewise.
10416 (script_test_2_LDADD): Likewise.
10417 (justsyms_LDADD): Likewise.
10418 (binary_test_LDADD): Likewise.
10419 (large_LDADD): Likewise.
10420 * testsuite/Makefile.in: Regenerated.
10421
10422 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
10423
10424 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10425 (Symbol_table::override_with_special): Likewise.
10426 (Symbol_table::add_from_object): Likewise.
10427
10428 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10429
10430 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10431 Don't set the data_offset twice.
10432
10433 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10434
10435 * testsuite/Makefile.in: Regenerate.
10436
10437 2009-12-03 Doug Kwan <dougkwan@google.com>
10438
10439 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10440 (Target_arm::do_finalize_sections): Add parameter for symbol table
10441 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10442 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10443 parameter for symbol table pointer.
10444 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10445 an additional parameter for a pointer to symbol table.
10446 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10447 parameter for a symbol table pointer.
10448 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10449 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10450 Ditto.
10451 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10452 parameter for a symbol table pointer.
10453
10454 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
10455
10456 * incremental.cc (Incremental_inputs_header)
10457 (Incremental_inputs_header_write, Incremental_inputs_entry)
10458 (Incremental_inputs_entry_write): Move ...
10459 * incremental.h (Incremental_inputs_header)
10460 (Incremental_inputs_header_write, Incremental_inputs_entry)
10461 (Incremental_inputs_entry_write): here.
10462
10463 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10464
10465 * incremental.cc (make_sized_incremental_binary): Set the target.
10466 Error if it is incompatible.
10467 * output.h (Output_file): Add filename method.
10468
10469 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10470
10471 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10472 from the get_* methods.
10473
10474 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10475
10476 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10477 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10478 Write 0 for the data_offset of scripts.
10479
10480 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10481
10482 * testsuite/Makefile.am: Add the incremental_test.sh test.
10483 * testsuite/incremental_test.sh: New.
10484 * testsuite/incremental_test_1.c: New.
10485 * testsuite/incremental_test_2.c: New.
10486
10487 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
10488
10489 * incremental-dump.cc (main): Fix typos.
10490
10491 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
10492
10493 PR gold/11025
10494 * incremental-dump.cc (main): Use llu to print 64 bit values.
10495
10496 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10497 H.J. Lu <hongjiu.lu@intel.com>
10498
10499 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10500 $(LIBDL).
10501 (incremental_dump_LDADD): Likewise.
10502 * Makefile.in: Regenerated.
10503
10504 2009-11-25 Doug Kwan <dougkwan@google.com>
10505
10506 Revert:
10507
10508 2009-11-25 Doug Kwan <dougkwan@google.com>
10509
10510 * arm.cc (Target_arm::Target_arm): Move method definition
10511 outside of class definition. Add code to handle
10512 --target1-rel, --target1-abs and --target2= options.
10513 (Target_arm::get_reloc_reloc_type): Change method to be
10514 non-static and const.
10515 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10516 New data member declaration.
10517 (Target_arm::Scan::local, Target_arm::Scan::global,
10518 Target_arm::Relocate::relocate,
10519 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10520 Adjust call to Target_arm::get_real_reloc_type.
10521 (Target_arm::get_real_reloc_type): Use command line options
10522 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10523 * options.h (--target1-rel, --target1-abs, --target2): New
10524 ARM-only options.
10525
10526 2009-11-25 Doug Kwan <dougkwan@google.com>
10527
10528 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10529 class definition. Add code to handle --target1-rel, --target1-abs
10530 and --target2= options.
10531 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10532 and const.
10533 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10534 member declaration.
10535 (Target_arm::Scan::local, Target_arm::Scan::global,
10536 Target_arm::Relocate::relocate,
10537 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10538 call to Target_arm::get_real_reloc_type.
10539 (Target_arm::get_real_reloc_type): Use command line options to
10540 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10541 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10542 options.
10543
10544 2009-11-25 Doug Kwan <dougkwan@google.com>
10545
10546 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10547 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10548 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10549 formatting.
10550 (Arm_relocate_functions::thm_call): Replace body with a call to
10551 Arm_relocate_functions::thumb_branch_common.
10552 (Arm_relocate_functions::thm_jump24,
10553 Arm_relocate_functions::thm_xpc22): New method definitions.
10554 (Arm_relocate_functions::thumb_branch_common): New method definition.
10555 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10556 operator.
10557 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10558 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10559
10560 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10561
10562 * Makefile.am: Build incremental-dump
10563 * Makefile.in: Regenerate.
10564 * incremental-dump.cc: New.
10565 * incremental.cc (Incremental_inputs_header_data,
10566 Incremental_inputs_entry_data): Move to incremental.h
10567 * incremental.h: (Incremental_inputs_header_data,
10568 Incremental_inputs_entry_data): Move from incremental.cc
10569
10570 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10571
10572 * incremental.cc (Incremental_inputs_header,
10573 Incremental_inputs_header_write, Incremental_inputs_entry,
10574 Incremental_inputs_entry_write): Add a typedef with the data type.
10575
10576 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10577
10578 * incremental.cc (Incremental_inputs_header,
10579 Incremental_inputs_header_write, Incremental_inputs_entry,
10580 Incremental_inputs_entry_write): Update comment about which
10581 type has the filed descriptions.
10582
10583 2009-11-15 Doug Kwan <dougkwan@google.com>
10584
10585 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
10586 (Arm_relocate_functions::arm_branch_common): Change method defintion
10587 in class definition to a method declaration and update list of formal
10588 parameters.
10589 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
10590 Arm_relocation_functions::jump24): Adjust call to
10591 Arm_relocate_functions::arm_branch_common. Update list of formal
10592 parameters.
10593 (Arm_relocate_functions::xpc25): New method definition.
10594 (Arm_relocate_functions::arm_branch_common): Move method defintion
10595 out from class definition. Use stubs for mode-switching and extending
10596 branch ranges.
10597 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
10598 specially. Change code to enable use of stubs in ARM branches.
10599
10600 2009-11-10 Doug Kwan <dougkwan@google.com>
10601
10602 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
10603 in method declaration.
10604 (Target_arm::relocate_stub): New method declaration.
10605 (Target_arm::default_target): Change to return a pointer instead of
10606 a const reference.
10607 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
10608 Target_arm::default_target.
10609 (Arm_Relobj::do_relocate_sections): Remove options paramater in
10610 method definition.
10611 (Target_arm::relocate_section): Adjust view.
10612 (Target_arm::relocate_stub): New method definition.
10613
10614 2009-11-10 Doug Kwan <dougkwan@google.com>
10615
10616 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
10617 a format warning.
10618 * incremental.cc (open_incremental_binary): Initialized local
10619 variables to avoid warnings.
10620 * object.cc (make_elf_object): Ditto.
10621 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
10622 a format warning.
10623
10624 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
10625
10626 PR gold/10930
10627 * testsuite/plugin_test.c: Include "config.h".
10628
10629 2009-11-09 Doug Kwan <dougkwan@google.com>
10630
10631 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
10632 (arm_symbol_value): Remove.
10633 (Arm_relocate_functions::arm_branch_common,
10634 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
10635 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
10636 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
10637 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
10638 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
10639 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
10640 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
10641 Arm_relocate_functions::thm_mobw_abs_nc,
10642 Arm_relocate_functions::thm_mov_abs,
10643 Arm_relocate_functions::movw_prel_nc,
10644 Arm_relocate_functions::thm_movt_abs,
10645 Arm_relocate_functions::movt_prel,
10646 Arm_relocate_functions::thm_movw_prel_nc,
10647 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
10648 (Target_arm::Relocate::relocate): Only decompose address into two
10649 parts if relocation type uses the thumb-bit and pass the actual
10650 bit instead of a flag indicating that the thumb-bit is used. Adjust
10651 calls to methods in Arm_relocate_functions for this change.
10652
10653 2009-11-08 Ian Lance Taylor <iant@google.com>
10654
10655 PR 10925
10656 * reloc.cc: Instantiate
10657 Sized_relobj::initialize_input_to_output_maps and
10658 Sized_relobj:free_input_to_output_maps.
10659
10660 2009-11-06 Ian Lance Taylor <iant@google.com>
10661
10662 PR 10876
10663 * defstd.cc (in_segment): Set only_if_ref true for "end".
10664
10665 2009-11-06 Doug Kwan <dougkwan@google.com>
10666
10667 * arm.cc (class Reloc_stub): Correct a comment.
10668 (Target_arm::Target_arm): Initialize arm_input_section_map_.
10669 (Target_arm::scan_section_for_stubs): New method declaration.
10670 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
10671 Change methods from private to protected.
10672 (Target_arm::do_may_relax): New method definition.
10673 (Target_arm::do_relax, Target_arm::group_sections,
10674 Target_arm::scan_reloc_for_stub,
10675 Target_arm::scan_reloc_section_for_stubs): New method declarations.
10676 (Target_arm::arm_input_section_map_): New data member declaration.
10677 (Target_arm::scan_reloc_for_stub,
10678 Target_arm::scan_reloc_section_for_stubs,
10679 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
10680 Target_arm::do_relax): New method definitions.
10681
10682 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
10683
10684 * configure.ac: Check for (struct stat)::st_mtim
10685 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
10686 * config.in: Regenerate.
10687 * configure: Regenerate.
10688
10689 2009-11-05 Ian Lance Taylor <iant@google.com>
10690
10691 PR 10910
10692 * output.cc (Output_segment::add_output_section): Add missing
10693 return statement.
10694
10695 2009-11-04 Ian Lance Taylor <iant@google.com>
10696
10697 PR 10880
10698 * object.h (class Object): Add is_needed and set_is_needed
10699 methods. Add is_needed_ field. Make bool fields into bitfields.
10700 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
10701 defined in a dynamic object and referenced by a regular object,
10702 set is_needed for the dynamic object.
10703 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
10704 if the file is marked with as_needed and it is not needed.
10705
10706 2009-11-04 Ian Lance Taylor <iant@google.com>
10707
10708 PR 10887
10709 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
10710 tags if data is discarded by linker script.
10711 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10712 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10713 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10714 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10715
10716 2009-11-04 Ian Lance Taylor <iant@google.com>
10717
10718 * layout.cc (Layout::get_output_section): Add is_interp and
10719 is_dynamic_linker_section parameters. Change all callers.
10720 (Layout::choose_output_section): Likewise.
10721 (Layout::make_output_section): Likewise.
10722 (Layout::add_output_section_data): Add is_dynamic_linker_section
10723 parameter. Change all callers.
10724 * layout.h (class Layout): Update declarations.
10725 * output.h (class Output_section): Add is_interp, set_is_interp,
10726 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
10727 Add is_interp_, is_dynamic_linker_section_ fields. Change
10728 generate_code_fills_at_write_ to a bitfield.
10729 * output.cc (Output_section::Output_sections): Initialize new
10730 fields.
10731 (Output_segment::add_output_section): Add do_sort parameter.
10732 Change all callers.
10733
10734 2009-11-03 Ian Lance Taylor <iant@google.com>
10735
10736 PR 10860
10737 * options.h (class General_options): Add --warn-common.
10738 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
10739 merging two common symbols.
10740 (Symbol_table::should_override): Handle --warn-common when merging
10741 a common symbol with a defined symbol. Use report_resolve_problem
10742 for multiple definitions.
10743 (Symbol_table::report_resolve_problem): New function.
10744 * symtab.h (class Symbol_table): Declare report_resolve_problem.
10745
10746 2009-11-03 Doug Kwan <dougkwan@google.com>
10747
10748 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
10749 stub_factory_.
10750 (Target_arm::stub_factory): New method definition.
10751 (Target_arm::new_arm_input_section,
10752 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
10753 Target_arm::reloc_uses_thumb_bit): New method declarations.
10754 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
10755 New type definitions.
10756 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
10757 member declarations.
10758 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
10759 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
10760 New method definitions.
10761
10762 2009-11-03 Ian Lance Taylor <iant@google.com>
10763
10764 * options.h (class General_options): Add --warn_constructors.
10765
10766 2009-11-03 Ian Lance Taylor <iant@google.com>
10767
10768 PR 10893
10769 * defstd.cc (in_section): Add entries for __rel_iplt_start,
10770 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
10771
10772 2009-11-03 Ian Lance Taylor <iant@google.com>
10773
10774 PR 10895
10775 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
10776 --msgid-bugs-address.
10777 (install-pdf): New target.
10778 (install-data_yes): Look up one directory to find mkinstalldirs.
10779
10780 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
10781
10782 * po/Make-in (.po.gmo): Don't generate .gmo files in source
10783 tree.
10784
10785 2009-10-30 Doug Kwan <dougkwan@google.com>
10786
10787 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10788
10789 2009-10-30 Doug Kwan <dougkwan@google.com>
10790
10791 * arm.cc (Stub_addend_reader): New struct template definition
10792 and partial specializations.
10793 (Stub_addend_reader::operator()): New method definition for a
10794 partially specialized template.
10795
10796 2009-10-30 Doug Kwan <dougkwan@google.com>
10797
10798 * arm.cc (Arm_relobj::processor_specific_flags): New method
10799 definition.
10800 (Arm_relobj::do_read_symbols): New method declaration.
10801 (Arm_relobj::processor_specific_flags_): New data member declaration.
10802 (Arm_dynobj): New class definition.
10803 (Target_arm::do_finalize_sections): Add input_objects parameter.
10804 (Target_arm::do_adjust_elf_header): New method declaration.
10805 (Target_arm::are_eabi_versions_compatible,
10806 (Target_arm::merge_processor_specific_flags): New method declaration.
10807 (Target_arm::do_make_elf_object): New overloaded method definitions
10808 and declaration.
10809 (Arm_relobj::do_read_symbols): New method definition.
10810 (Arm_dynobj::do_read_symbols): Ditto.
10811 (Target_arm::do_finalize_sections): Add input_objects parameters.
10812 Merge processor-specific flags from all input objects.
10813 (Target_arm::are_eabi_versions_compatible,
10814 Target_arm::merge_processor_specific_flags,
10815 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10816 New method definitions.
10817 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10818 Input_objects pointer type parameter.
10819 * layout.cc (Layout::finalize): Pass input objects to target's.
10820 finalize_sections function.
10821 * output.cc (Output_file_header::do_sized_write): Set ELF file
10822 header's processor-specific flags.
10823 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
10824 Input_objects pointer type parameter.
10825 * sparc.cc (Target_sparc::do_finalize_sections): Same.
10826 * target.h (Input_objects): New forward class declaration.
10827 (Target::processor_specific_flags,
10828 Target::are_processor_specific_flags_sect): New method definitions.
10829 (Target::finalize_sections): Add input_objects parameter.
10830 (Target::Target): Initialize processor_specific_flags_ and
10831 are_processor_specific_flags_set_.
10832 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
10833 parameter.
10834 (Target::set_processor_specific_flags): New method definition.
10835 (Target::processor_specific_flags_,
10836 Target::are_processor_specific_flags_set_): New data member
10837 declarations.
10838 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
10839 Input_objects pointer type parameter.
10840
10841 2009-10-30 Doug Kwan <dougkwan@google.com>
10842
10843 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
10844
10845 2009-10-28 Ian Lance Taylor <iant@google.com>
10846
10847 * object.h (class Relobj): Drop options parameter from
10848 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
10849 do_scan_relocs, do_relocate. Change all callers.
10850 (class Sized_relobj): Drop options parameters from
10851 do_gc_process_relocs, do_scan_relocs, do_relocate,
10852 do_relocate_sections, relocate_sections, emit_relocs_scan,
10853 emit_relocs_scan_reltype. Change all callers.
10854 (struct Relocate_info): Remove options field and all references to
10855 it.
10856 * reloc.h (class Read_relocs): Remove options constructor
10857 parameter and options_ field. Change all callers.
10858 (class Gc_process_relocs, class Scan_relocs): Likewise.
10859 (class Relocate_task): Likewise.
10860 * target-reloc.h (scan_relocs): Remove options parameter. Change
10861 all callers.
10862 (scan_relocatable_relocs): Likewise.
10863 * target.h (class Sized_target): Remove options parameter from
10864 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
10865 all callers.
10866 * gc.h (gc_process_relocs): Remove options parameter. Change all
10867 callers.
10868 * arm.cc: Update functions to remove options parameters.
10869 * i386.cc: Likewise.
10870 * powerpc.cc: Likewise.
10871 * sparc.cc: Likewise.
10872 * x86_64.cc: Likewise.
10873 * testsuite/testfile.cc: Likewise.
10874
10875 2009-10-28 Doug Kwan <dougkwan@google.com>
10876
10877 * arm.cc (Arm_relobj): New class definition.
10878 (Arm_relobj::scan_sections_for_stubs,
10879 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
10880 New method definitions.
10881
10882 2009-10-28 Cary Coutant <ccoutant@google.com>
10883
10884 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
10885 (Plugin::cleanup_done_): New member.
10886 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
10887 (Plugin_manager::cleanup_done_): Remove.
10888 (Plugin_manager::add_input_file): Edit error message.
10889 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
10890 (Plugin_manager::cleanup): Remove use of cleanup_done_.
10891
10892 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
10893
10894 * fileread.cc: (File_read::View::~View): Use the new
10895 data_ownership_ filed.
10896 (File_read::~File_read): Dispose the new whole_file_view_.
10897 (File_read::open): Mmap the whole file if needed.
10898 (File_read::open): Use whole_file_view_ instead of contents_.
10899 (File_read::find_view): Use whole_file_view_ if applicable.
10900 (File_read::do_read): Use whole_file_view_ instead of contents_.
10901 (File_read::make_view): Use whole_file_view_ instead of contents_,
10902 update File_read::View::View call.
10903 (File_read::find_or_make_view): Update File_read::View::View
10904 call.
10905 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
10906 remove contents_
10907 (File_read::View::Data_ownership): New enum.
10908 (File_read::View::View): Replace bool mapped_ with Data_ownership
10909 argument.
10910 (File_read::View::mapped_): Remove (replaced by data_ownership_).
10911 (File_read::View::data_ownership_): New field.
10912 (File_read::contents_): Remove (replaced by whole_file_view_).
10913 (File_read::whole_file_view_): New field.
10914 * options.h (class General_options): Add --keep-files-mapped.
10915
10916 2009-10-27 Cary Coutant <ccoutant@google.com>
10917
10918 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
10919 * testsuite/Makefile.am (plugin_test_5): New test case.
10920 * testsuite/Makefile.in: Regenerate.
10921
10922 2009-10-25 Doug Kwan <dougkwan@google.com>
10923
10924 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
10925 from private to protected to allow access by child class.
10926 (Sized_relobj::do_relocate_sections): New method declaration.
10927 (Sized_relobj::relocate_sections): Virtualize.
10928 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
10929 Sized_relobj::relocate_sections. Instantiate template explicitly
10930 for different target sizes and endianity.
10931
10932 2009-10-24 Doug Kwan <dougkwan@google.com>
10933
10934 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
10935 (Arm_input_section::as_arm_input_section): New method.
10936 (Arm_output_section): New class definition.
10937 (Arm_output_section::create_stub_group,
10938 Arm_output_section::group_sections): New method definitions.
10939
10940 2009-10-22 Doug Kwan <dougkwan@google.com>
10941
10942 * arm.cc (Arm_input_section): New class definition.
10943 (Arm_input_section::init, Arm_input_section:do_write,
10944 Arm_input_section::set_final_data_size,
10945 Arm_input_section::do_reset_address_and_file_offset): New method
10946 definitions.
10947
10948 2009-10-21 Doug Kwan <dougkwan@google.com>
10949
10950 * arm.cc (Stub_table, Arm_input_section): New forward class
10951 declarations.
10952 (Stub_table): New class defintion.
10953 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
10954 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
10955 New method definition.
10956
10957 2009-10-21 Doug Kwan <dougkwan@google.com>
10958
10959 * arm.cc: Update copyright comments.
10960 (Target_arm): New forward class template declaration.
10961 (Arm_address): New type.
10962 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
10963 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
10964 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
10965 constants.
10966 (Insn_template): Same.
10967 (DEF_STUBS): New macro.
10968 (Stub_type): New enum type.
10969 (Stub_template): New class definition.
10970 (Stub): Same.
10971 (Reloc_stub): Same.
10972 (Stub_factory): Same.
10973 (Target_arm::Target_arm): Initialize may_use_blx_ and
10974 should_force_pic_veneer_.
10975 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
10976 Target_arm::should_force_pic_veneer,
10977 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
10978 Target_arm::using_thumb_only, Target_arm:;default_target): New
10979 method defintions.
10980 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
10981 New data member declarations.
10982 (Insn_template::size, Insn_template::alignment): New method defintions.
10983 (Stub_template::Stub_template): New method definition.
10984 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
10985 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
10986 (Stub_factory::Stub_factory): New method definition.
10987 * gold.h (string_hash): New template.
10988 * output.h (Input_section_specifier::hash_value): Use
10989 gold::string_hash.
10990 (Input_section_specifier::string_hash): Remove.
10991 * stringpool.cc (Stringpool_template::string_hash): Use
10992 gold::string_hash.
10993
10994 2009-10-20 Doug Kwan <dougkwan@google.com>
10995
10996 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
10997 symbols of relaxed input sections.
10998 * output.h (Output_section::find_relaxed_input_section): Make
10999 method public.
11000
11001 2009-10-16 Doug Kwan <dougkwan@google.com>
11002
11003 * dynobj.cc (Versions::Versions): Initialize version_script_.
11004 Only insert base version symbol definition for a shared object
11005 if version script defines any version versions.
11006 (Versions::define_base_version): New method definition.
11007 (Versions::add_def): Check that base version is not needed.
11008 (Versions::add_need): Define base version lazily.
11009 * dynobj.h (Versions::define_base_version): New method declaration.
11010 (Versions::needs_base_version_): New data member declaration.
11011 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11012 (check_DATA): Add no_version_test.stdout.
11013 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11014 New make rules.
11015 * testsuite/Makefile.in: Regenerate.
11016 * testsuite/no_version_test.c: New file.
11017 * testsuite/no_version_test.sh: Ditto.
11018
11019 2009-10-16 Doug Kwan <dougkwan@google.com>
11020
11021 * expression.cc (class Segment_start_expression): New class definition.
11022 (Segment_start_expression::value): New method definition.
11023 (script_exp_function_segment_start): Return a new
11024 Segment_start_expression.
11025 * gold/script-c.h (script_saw_segment_start_expression): New function
11026 prototype.
11027 * script-sections.cc (Script_sections::Script_sections): Initialize
11028 SAW_SEGMENT_START_EXPRESSION_ to false.
11029 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11030 and -Tbbs options to specify section addresses if given in
11031 command line and no SEGMENT_START expression is seen in a script.
11032 * script-sections.h (Script_sections::saw_segment_start_expression,
11033 Script_sections::set_saw_segment_start_expression): New method
11034 definition.
11035 (Script_sections::saw_segment_start_expression_): New data member
11036 declaration.
11037 * script.cc (script_saw_segment_start_expression): New function.
11038 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11039 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11040 script_test_7.sh and script_test_8.sh.
11041 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11042 script_test_8.stdout.
11043 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11044 (script_test_6, script_test_6.stdout, script_test_7,
11045 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11046 * Makefile.in: Regenerate.
11047 * testsuite/script_test_6.sh: New file.
11048 * testsuite/script_test_6.t: Same.
11049 * testsuite/script_test_7.sh: Same.
11050 * testsuite/script_test_7.t: Same.
11051 * testsuite/script_test_8.sh: Same.
11052
11053 2009-10-16 Doug Kwan <dougkwan@google.com>
11054
11055 * output.cc (Output_segment::set_section_list_address): Cast
11056 expressions to unsigned long long type to avoid format warnings.
11057
11058 2009-10-15 Ian Lance Taylor <iant@google.com>
11059
11060 * script.cc (Script_options::add_symbol_assignment): Always add a
11061 dot assignment to script_sections_.
11062 * script-sections.cc (Script_sections::add_dot_assignment):
11063 Initialize if necessary.
11064
11065 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11066 program headers with no load segment if there is a linker script.
11067
11068 * layout.cc (Layout::set_segment_offsets): Align the file offset
11069 to the segment aligment for -N or -n with no load segment.
11070 * output.cc (Output_segment::add_output_section): Don't crash if
11071 the first section is a TLS section.
11072 (Output_segment::set_section_list_addresses): Print an error
11073 message if the address moves backward in a linker script.
11074 * script-sections.cc
11075 (Output_section_element_input::set_section_addresses): Don't
11076 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11077 (Orphan_output_section::set_section_addresses): Likewise.
11078
11079 2009-10-15 Doug Kwan <dougkwan@google.com>
11080
11081 * layout.cc (Layout::finish_dynamic_section): Generate tags
11082 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11083 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11084 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11085
11086 2009-10-14 Ian Lance Taylor <iant@google.com>
11087
11088 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11089 fields.
11090 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11091 data_shdr fields of relinfo.
11092 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11093 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11094 R_386_TLS_LDO_32, adjust based on section flags.
11095 (Target_i386::Relocate::fix_up_ldo): Remove.
11096
11097 2009-10-13 Ian Lance Taylor <iant@google.com>
11098
11099 Add support for -pie.
11100 * options.h (class General_options): Add -pie and
11101 --pic-executable.
11102 (General_options::output_is_position_independent): Test -pie.
11103 (General_options::output_is_executable): Return true if not shared
11104 and not relocatable.
11105 (General_options::output_is_pie): Remove.
11106 * options.cc (General_options::finalize): Reject incompatible uses
11107 of -pie.
11108 * gold.cc (queue_middle_tasks): A -pie link is not static.
11109 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11110 * symtab.cc (Symbol::final_value_is_known): Return false if
11111 output_is_position_independent.
11112 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11113 output_is_position_independent.
11114 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11115 output_is_position_independent.
11116 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11117 output_is_position_independent.
11118 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11119 two_file_pie_test.
11120 (basic_pie_test.o, basic_pie_test): New targets.
11121 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11122 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11123 (two_file_pie_test): New target.
11124 * testsuite/Makefile.in: Rebuild.
11125 * README: Remove note saying that -pie is not supported.
11126
11127 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11128
11129 * options.h (class General_options): Add -init and -fini.
11130 * layout.cc (Layout::finish_dynamic_section): Emit
11131 given init and fini functions.
11132
11133 2009-10-13 Sriraman Tallam <tmsriram@google.com>
11134
11135 * gc.h (gc_process_relocs): Check if icf is enabled using new
11136 function.
11137 * gold.cc (queue_initial_tasks): Likewise.
11138 (queue_middle_tasks): Likewise.
11139 * object.cc (do_layout): Likewise.
11140 * symtab.cc (is_section_folded): Likewise.
11141 * main.cc (main): Likewise.
11142 * reloc.cc (Read_relocs::run): Likewise.
11143 (Sized_relobj::do_scan_relocs): Likewise.
11144 * icf.cc (is_function_ctor_or_dtor): New function.
11145 (Icf::find_identical_sections): Check if function is ctor or dtor when
11146 safe icf is chosen.
11147 * options.h (General_options::icf): Change option to be an enum.
11148 (Icf_status): New enum.
11149 (icf_enabled): New method.
11150 (icf_safe_folding): New method.
11151 (set_icf_status): New method.
11152 (icf_status_): New variable.
11153 * (options.cc) (General_options::finalize): Set icf_status_.
11154 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11155 icf_test and icf_keep_unique_test to use the --icf enum flag.
11156 * testsuite/icf_safe_test.sh: New file.
11157 * testsuite/icf_safe_test.cc: New file.
11158
11159 2009-10-12 Sriraman Tallam <tmsriram@google.com>
11160
11161 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11162 includes to gc.h and icf.h.
11163 * arm.cc: Include gc.h.
11164 * gold.cc: Likewise.
11165 * i386.cc: Likewise.
11166 * powerpc.cc: Likewise.
11167 * sparc.cc: Likewise.
11168 * x86_64.cc: Likewise.
11169 * gc.h: Include icf.h.
11170
11171 2009-10-11 Ian Lance Taylor <iant@google.com>
11172
11173 * plugin.cc: Include "gold.h" before other header files.
11174
11175 2009-10-10 Chris Demetriou <cgd@google.com>
11176
11177 * options.h (Input_file_argument::Input_file_type): New enum.
11178 (Input_file_argument::is_lib_): Replace with...
11179 (Input_file_argument::type_): New member.
11180 (Input_file_argument::Input_file_argument): Take Input_file_type
11181 'type' rather than boolean 'is_lib' as second argument.
11182 (Input_file_argument::is_lib): Use type_.
11183 (Input_file_argument::is_searched_file): New function.
11184 (Input_file_argument::may_need_search): Handle is_searched_file.
11185 * options.cc (General_options::parse_library): Support -l:filename.
11186 (General_options::parse_just_symbols): Update for Input_file_argument
11187 changes.
11188 (Command_line::process): Likewise.
11189 * archive.cc (Archive::get_file_and_offset): Likewise.
11190 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11191 * script.cc (read_script_file, script_add_file): Likewise.
11192 * fileread.cc (Input_file::Input_file): Likewise.
11193 (Input_file::will_search_for): Handle is_searched_file.
11194 (Input_file::open): Likewise.
11195 * readsyms.cc (Read_symbols::get_name): Likewise.
11196 * testsuite/Makefile.am (searched_file_test): New test.
11197 * testsuite/Makefile.in: Regenerate.
11198 * testsuite/searched_file_test.cc: New file.
11199 * testsuite/searched_file_test_lib.cc: New file.
11200
11201 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11202 Ian Lance Taylor <iant@google.com>
11203
11204 * descriptor.cc: Include <cstdio> and "binary-io.h".
11205 (Descriptors::open): Open the files in binary mode always.
11206 * script.cc (Lex::get_token): Treat \r as whitespace.
11207
11208 2009-10-09 Ian Lance Taylor <iant@google.com>
11209
11210 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11211
11212 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11213 Ian Lance Taylor <iant@google.com>
11214
11215 * configure.ac: Check for readv function also.
11216 * fileread.cc (readv): Define if not HAVE_READV.
11217 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11218 does not exist.
11219 * config.in: Regenerate.
11220 * configure: Regenerate.
11221
11222 2009-10-09 Doug Kwan <dougkwan@google.com>
11223
11224 * layout.cc (Layout::make_output_section): Call target hook to make
11225 ordinary output section.
11226 (Layout::finalize): Adjust parameter list of call the
11227 Target::may_relax().
11228 * layout.h (class Layout::section_list): New method.
11229 * merge.h (Output_merge_base::entsize): Change visibility to public.
11230 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11231 New methods.
11232 (Output_merge_string::do_is_string): New method.
11233 * object.cc (Sized_relobj::do_setup): renamed from
11234 Sized_relobj::set_up.
11235 * object.h (Sized_relobj::adjust_shndx,
11236 Sized_relobj::initializ_input_to_output_maps,
11237 Sized_relobj::free_input_to_output_maps): Change visibilities to
11238 protected.
11239 (Sized_relobj::setup): Virtualize.
11240 (Sized_relobj::do_setup): New method declaration.
11241 (Sized_relobj::invalidate_section_offset,
11242 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11243 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11244 * options.cc (parse_int): New function.
11245 * options.h (parse_int): New declaration.
11246 (DEFINE_int): New macro.
11247 (stub_group_size): New option.
11248 * output.cc (Output_section::Output_section): Initialize memebers
11249 merge_section_map_, merge_section_by_properties_map_,
11250 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11251 (Output_section::add_input_section): Handled deferred code-fill
11252 generation and remove an old comment.
11253 (Output_section::add_relaxed_input_section): New method definition.
11254 (Output_section::add_merge_input_section): Use merge section by
11255 properties map to speed to search. Update merge section maps
11256 as appropriate.
11257 (Output_section::build_relaxation_map): New method definition.
11258 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11259 Same.
11260 (Output_section::relax_input_section): Renamed to
11261 Output_section::convert_input_sections_to_relaxed_sections and change
11262 interface to take a vector of pointers to relaxed sections.
11263 (Output_section::find_merge_section,
11264 Output_section::find_relaxed_input_section): New method definitions.
11265 (Output_section::is_input_address_mapped,
11266 Output_section::output_offset, Output_section::output_address):
11267 Use output section data maps to speed up searching.
11268 (Output_section::find_starting_output_address): Add comments.
11269 (Output_section::do_write,
11270 Output_section::write_to_postprocessing_buffer): Do code-fill
11271 generation as appropriate.
11272 (Output_section::get_input_sections): Invalidate relaxed input section
11273 map.
11274 (Output_section::restore_states): Adjust type of checkpoint .
11275 Invalidate relaxed input section map.
11276 * output.h (Output_merge_base): New class declaration.
11277 (Input_section_specifier): New class defintion.
11278 (class Output_relaxed_input_section) Change base class to
11279 Output_section_data_build.
11280 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11281 base class initializer.
11282 (Output_section::add_relaxed_input_section): New method declaration.
11283 (Output_section::Input_section): Change visibility to protected.
11284 (Output_section::Input_section::relobj,
11285 Output_section::Input_section::shndx): Handle relaxed input sections.
11286 Output_section::input_sections) Change visibility to protected. Also
11287 define overload to return a non-const pointer.
11288 (Output_section::Merge_section_properties): New class defintion.
11289 (Output_section::Merge_section_by_properties_map,
11290 Output_section::Output_section_data_by_input_section_map,
11291 Output_section::Relaxation_map): New types.
11292 (Output_section::relax_input_section): Rename method to
11293 Output_section::convert_input_sections_to_relaxed_sections and change
11294 interface to take a vector of relaxed section pointers.
11295 (Output_section::find_merge_section,
11296 Output_section::find_relaxed_input_section,
11297 Output_section::build_relaxation_map,
11298 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11299 New method declarations.
11300 (Output_section::merge_section_map_
11301 Output_section::merge_section_by_properties_map_,
11302 Output_section::relaxed_input_section_map_,
11303 Output_section::is_relaxed_input_section_map_valid_,
11304 Output_section::generate_code_fills_at_write_): New data members.
11305 * script-sections.cc
11306 (Output_section_element_input::set_section_addresses): Call
11307 current_data_size and addralign methods of relaxed input sections.
11308 (Orphan_output_section::set_section_addresses): Call current_data_size
11309 and addralign methods of relaxed input sections.
11310 * symtab.cc (Symbol_table::compute_final_value): Extract template
11311 from the body of Symbol_table::sized_finalize_symbol.
11312 (Symbol_table::sized_finalized_symbol): Call
11313 Symbol_table::compute_final_value.
11314 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11315 (Symbol_table::compute_final_value): New templated method declaration.
11316 * target.cc (Target::do_make_output_section): New method defintion.
11317 * target.h (Target::make_output_section): New method declaration.
11318 (Target::relax): Add more parameters for input objects, symbol table
11319 and layout. Adjust call to do_relax.
11320 (Target::do_make_output_section): New method declaration.
11321 (Target::do_relax): Add parameters for input objects, symbol table
11322 and layout.
11323
11324 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11325
11326 * pread.c: Include stdio.h.
11327
11328 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11329
11330 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11331 defined.
11332
11333 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11334
11335 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11336 Change read_shndx type to unsigned int.
11337 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11338 int.
11339 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11340 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11341 Change read_shndx type to unsigned int.
11342 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11343 int.
11344 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11345 * layout.cc (Layout::create_symtab_sections): Cast the result of
11346 local_symcount * symsize to off_t in the gold_assert.
11347
11348 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11349
11350 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11351 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11352 R_ARM_BASE_ABS.
11353 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11354 (Arm_relocate_functions::thm_abs5): New function.
11355 (Arm_relocate_functions::abs12): New function.
11356 (Arm_relocate_functions::abs16): New function.
11357 (Arm_relocate_functions::base_abs): New function.
11358 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11359 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11360 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11361 R_ARM_BASE_ABS.
11362 (Scan::global): Likewise.
11363 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11364 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11365 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11366 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11367 R_ARM_BASE_ABS.
11368
11369 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11370
11371 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11372 (Arm_relocate_functions::movt_prel): New function.
11373 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11374 (Arm_relocate_functions::thm_movt_prel): New function.
11375 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11376 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11377 (Scan::global, Relocate::relocate): Likewise.
11378 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11379
11380 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11381
11382 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11383 Incremental_checker.
11384 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11385 unsigned int.
11386 (class Incremental_inputs_header): New class.
11387 (Incremental_inputs_header_writer): Edit comment.
11388 (Incremental_inputs_entry): New class.
11389 (Incremental_inputs_entry_writer): Edit comment.
11390 (Sized_incremental_binary::do_find_incremental_inputs_section):
11391 Add *strtab_shndx parameter, fill it.
11392 (Sized_incremental_binary::do_check_inputs): New method.
11393 (Incremental_checker::can_incrementally_link_output_file): Use
11394 Sized_incremental_binary::check_inputs.
11395 (Incremental_inputs::report_command_line): Save command line in
11396 command_line_.
11397 * incremental.h:
11398 (Incremental_binary::find_incremental_inputs_section): New
11399 method.
11400 (Incremental_binary::do_find_incremental_inputs_section): Add
11401 strtab_shndx parameter.
11402 (Incremental_binary::do_check_inputs): New pure virtual method.
11403 (Sized_incremental_binary::do_check_inputs): Declare.
11404 (Incremental_checker::Incremental_checker): Add incremental_inputs
11405 parameter, use it to initialize incremental_inputs_.
11406 (Incremental_checker::incremental_inputs_): New field.
11407 (Incremental_checker::command_line): New method.
11408 (Incremental_checker::inputs): New method.
11409 (Incremental_checker::command_line_): New field.
11410
11411 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11412
11413 * incremental.cc: Include <cstdarg> and "target-select.h".
11414 (vexplain_no_incremental): New function.
11415 (explain_no_incremental): New function.
11416 (Incremental_binary::error): New method.
11417 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11418 method.
11419 (make_sized_incremental_binary): New function.
11420 (open_incremental_binary): New function.
11421 (can_incrementally_link_file): Add checks if output is ELF and has
11422 inputs section.
11423 * incremental.h: Include "elfcpp_file.h" and "output.h".
11424 (Incremental_binary): New class.
11425 (Sized_incremental_binary): New class.
11426 (open_incremental_binary): Declare.
11427 * object.cc (is_elf_object): Use
11428 elfcpp::Elf_recognizer::is_elf_file.
11429 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11430 * output.h (Output_file::filesize): New method.
11431
11432 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11433
11434 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11435 New function.
11436 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11437 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11438 function.
11439 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11440 function.
11441 (Arm_relocate_functions::movw_abs_nc): New function.
11442 (Arm_relocate_functions::movt_abs): New function.
11443 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11444 (Arm_relocate_functions::thm_movt_abs): New function.
11445 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11446 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11447 (Scan::global): Likewise.
11448 (Relocate::relocate): Likewise.
11449 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11450
11451 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11452
11453 * arm.cc (Arm_relocate_functions::got_prel) New function.
11454 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11455 (Relocate::relocate): Likewise.
11456 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11457
11458 2009-10-06 Ian Lance Taylor <iant@google.com>
11459
11460 * options.h (class General_options): Define
11461 split_stack_adjust_size parameter.
11462 * object.h (class Object): Add uses_split_stack_ and
11463 has_no_split_stack_ fields. Add uses_split_stack and
11464 has_no_split_stack accessor functions. Declare
11465 handle_split_stack_section.
11466 (class Reloc_symbol_changes): Define.
11467 (class Sized_relobj): Define Function_offsets. Declare
11468 split_stack_adjust, split_stack_adjust_reltype, and
11469 find_functions.
11470 * object.cc (Object::handle_split_stack_section): New function.
11471 (Sized_relobj::do_layout): Call handle_split_stack_section.
11472 * dynobj.cc (Sized_dynobj::do_layout): Call
11473 handle_split_stack_section.
11474 * reloc.cc (Sized_relobj::relocate_sections): Call
11475 split_stack_adjust for executable sections in split_stack
11476 objects. Pass reloc_map to relocate_section.
11477 (Sized_relobj::split_stack_adjust): New function.
11478 (Sized_relobj::split_stack_adjust_reltype): New function.
11479 (Sized_relobj::find_functions): New function.
11480 * target-reloc.h: Include "object.h".
11481 (relocate_section): Add reloc_symbol_changes parameter. Change
11482 all callers.
11483 * target.h (class Target): Add calls_non_split method. Declare
11484 do_calls_non_split virtual method. Declare match_view and
11485 set_view_to_nop.
11486 * target.cc: Include "elfcpp.h".
11487 (Target::do_calls_non_split): New function.
11488 (Target::match_view): New function.
11489 (Target::set_view_to_nop): New function.
11490 * gold.cc (queue_middle_tasks): Give an error if mixing
11491 split-stack and non-split-stack objects with -r.
11492 * i386.cc (Target_i386::relocate_section): Add
11493 reloc_symbol_changes parameter.
11494 (Target_i386::do_calls_non_split): New function.
11495 * x86_64.cc (Target_x86_64::relocate_section): Add
11496 reloc_symbol_changes parameter.
11497 (Target_x86_64::do_calls_non_split): New function.
11498 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11499 parameter.
11500 * powerpc.cc (Target_powerpc::relocate_section): Add
11501 reloc_symbol_changes parameter.
11502 * sparc.cc (Target_sparc::relocate_section): Add
11503 reloc_symbol_changes parameter.
11504 * configure.ac: Call AM_CONDITIONAL for the default target.
11505 * configure: Rebuild.
11506 * testsuite/Makefile.am (TEST_AS): New variable.
11507 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11508 (check_DATA): Add split_i386 and split_x86_64 files.
11509 (SPLIT_DEFSYMS): Define.
11510 (split_i386_[1234n].o): New targets.
11511 (split_i386_[124]): New targets.
11512 (split_i386_[1234r].stdout): New targets.
11513 (split_x86_64_[1234n].o): New targets.
11514 (split_x86_64_[124]): New targets.
11515 (split_x86_64_[1234r].stdout): New targets.
11516 (MOSTLYCLEANFILES): Add new executables.
11517 * testsuite/split_i386.sh: New file.
11518 * testsuite/split_x86_64.sh: New file.
11519 * testsuite/split_i386_1.s: New file.
11520 * testsuite/split_i386_2.s: New file.
11521 * testsuite/split_i386_3.s: New file.
11522 * testsuite/split_i386_4.s: New file.
11523 * testsuite/split_i386_n.s: New file.
11524 * testsuite/split_x86_64_1.s: New file.
11525 * testsuite/split_x86_64_2.s: New file.
11526 * testsuite/split_x86_64_3.s: New file.
11527 * testsuite/split_x86_64_4.s: New file.
11528 * testsuite/split_x86_64_n.s: New file.
11529 * testsuite/testfile.cc (Target_test): Update relocation_section
11530 function.
11531 * testsuite/Makefile.in: Rebuild.
11532
11533 2009-10-06 Ian Lance Taylor <iant@google.com>
11534
11535 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11536 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11537 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11538 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11539 the address on ldo_addrs_.
11540 (Target_i386::Relocate::fix_up_ldo): New function.
11541
11542 2009-10-06 Rafael Espindola <espindola@google.com>
11543
11544 * plugin.cc (add_input_library): New.
11545 (Plugin::load): Add add_input_library to tv.
11546 (Plugin_manager::add_input_file): Add the is_lib argument.
11547 (add_input_file): Update call to Plugin_manager::add_input_file.
11548 (add_input_library): New.
11549 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11550
11551 2009-09-30 Doug Kwan <dougkwan@google.com>
11552
11553 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11554 symbol and call Symbol::may_need_copy_reloc to determine if
11555 a copy reloc is needed.
11556 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11557 nocopyreloc is given in command line.
11558 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11559 given in command line.
11560 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11561 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11562 of the removed Target_i386::may_need_copy_reloc.
11563 * options.h (copyreloc): New option with default value false.
11564 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11565 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11566 instead of the removed Target_powerpc::may_need_copy_reloc.
11567 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11568 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11569 instead of the removed Target_sparc::may_need_copy_reloc.
11570 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11571 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11572 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11573 instead of the removed Target_x86_64::may_need_copy_reloc.
11574
11575 2009-09-30 Ian Lance Taylor <iant@google.com>
11576
11577 * object.h (class Object): Remove target_ field, and target,
11578 sized_target, and set_target methods.
11579 (Object::sized_target): Remove.
11580 (class Sized_relobj): Update declarations. Remove sized_target.
11581 * object.cc (Sized_relobj::setup): Remove target parameter.
11582 Change all callers.
11583 (Input_objects::add_object): Don't do anything with the target.
11584 (make_elf_sized_object): Add punconfigured parameter. Change all
11585 callers. Set or test parameter target.
11586 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
11587 Change all callers.
11588 * parameters.cc (Parameters::set_target): Change parameter type to
11589 be non-const.
11590 (Parameters::default_target): Remove.
11591 (set_parameters_target): Change parameter type to be non-const.
11592 (parameters_force_valid_target): New function.
11593 (parameters_clear_target): New function.
11594 * parameters.h (class Parameters): Update declarations. Remove
11595 default_target method. Add sized_target and clear_target
11596 methods. Change target_ to be non-const.
11597 (set_parameters_target): Update declaration.
11598 (parameters_force_valid_target): Declare.
11599 (parameters_clear_target): Declare.
11600 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
11601 as NULL if we aren't searching.
11602 (Add_symbols::run): Don't check for compatible target.
11603 * fileread.cc (Input_file::open_binary): Call
11604 parameters_force_valid_target.
11605 * gold.cc (queue_middle_tasks): Likewise.
11606 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
11607 set_target on object.
11608 * dynobj.h (class Sized_dynobj): Update declarations.
11609 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
11610 make_elf_object returns NULL.
11611 (Archive::include_member): Don't check whether object target is
11612 compatible.
11613 * output.cc (Output_section::add_input_section): Get target from
11614 parameters.
11615 (Output_section::relax_input_section): Likewise.
11616 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
11617 parameters.
11618 (Sized_relobj::do_scan_relocs): Likewise.
11619 (Sized_relobj::relocate_sections): Likewise.
11620 * resolve.cc (Symbol_table::resolve): Likewise.
11621 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
11622 parameter. Change all callers.
11623 (Symbol_table::add_from_object): Get target from parameters.
11624 (Symbol_table::add_from_relobj): Don't check object target.
11625 (Symbol_table::add_from_dynobj): Likewise.
11626 (Symbol_table::define_special_symbol): Get target from
11627 parameters.
11628 * symtab.h (class Symbol_table): Update declaration.
11629 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
11630 parameter. Change all callers. Clear parameter target.
11631 (Binary_test): Test target here.
11632 * testsuite/object_unittest.cc (gold_testsuite): Remove
11633 target_test_pointer parameter. Change all callers.
11634 (Object_test): Test target here.
11635
11636 2009-09-26 Ian Lance Taylor <iant@google.com>
11637
11638 * testsuite/initpri1.c: Don't try to use constructor priorities if
11639 compiling with gcc before 4.3.
11640
11641 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
11642
11643 * testsuite/retain_symbols_file_test.sh (check_present): Change
11644 output file name to retain_symbols_file_test.stdout.
11645 (check_absent): Likewise.
11646
11647 2009-09-18 Craig Silverstein <csilvers@google.com>
11648
11649 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
11650 * options.cc: Include <cerrno> and <fstream>.
11651 (General_options::finalize): Parse -retain-symbols-file tag.
11652 * options.h: New flag.
11653 (General_options): New method should_retain_symbol, new
11654 variable symbols_to_retain.
11655 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
11656 should_retain_symbol map.
11657 * testsuite/Makefile.am (retain_symbols_file_test): New test.
11658 * testsuite/Makefile.in: Regenerate.
11659 * testsuite/retain_symbols_file_test.sh: New file.
11660
11661 2009-09-18 Nick Clifton <nickc@redhat.com>
11662
11663 * po/es.po: Updated Spanish translation.
11664
11665 2009-09-17 Doug Kwan <dougkwan@google.com>
11666
11667 * debug.h (DEBUG_RELAXATION): New constant.
11668 (DEBUG_ALL): Add DEBUG_RELAXATION.
11669 (debug_string_to_enum): Add relaxation debug option.
11670 * layout.cc
11671 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
11672 Layout::Relaxation_debug_check::read_sections,
11673 Layout::Relaxation_debug_check::read_sections): New method definitions.
11674 (Layout::Layout): Initialize data members
11675 record_output_section_data_from_scrips_,
11676 script_output_section_data_list_ and relaxation_debug_check_.
11677 (Layout::save_segments, Layout::restore_segments,
11678 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11679 Layout::relaxation_loop_body): New method definitions.
11680 (Layout::finalize): Support relaxation. Move section layout code to
11681 Layout::relaxation_loop_body.
11682 (Layout::set_asection_address_from_script): Move code for orphan
11683 section placement out.
11684 (Layout::place_orphan_sections_in_script): New method definition.
11685 * layout.h (Output_segment_headers, Output_file_header):
11686 New forward class declarations.
11687 (Layout::~Layout): Define.
11688 (Layout::new_output_section_data_from_script): New method definition.
11689 (Layout::place_orphan_sections_in_script): New method declaration.
11690 (Layout::Segment_states): New type declaration.
11691 (Layout::save_segments, Layout::restore_segments,
11692 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11693 Layout::relaxation_loop_body): New method declarations.
11694 (Layout::Output_section_data_list): New type declaration.
11695 (Layout::Relaxation_debug_check): New class definition.
11696 (Layout::record_output_section_data_from_script_,
11697 Layout::script_output_section_data_list_, Layout::segment_states_,
11698 Layout::relaxation_debug_check_): New data members.
11699 * output.cc: (Output_section_headers::do_size): New method definition.
11700 (Output_section_headers::Output_section_headers): Move size
11701 computation to Output_section_headers::do_size.
11702 (Output_segment_headers::do_size): New method definition.
11703 (Output_file_header::Output_file_header): Move size computation to
11704 Output_file_header::do_size and call it.
11705 (Output_file_header::do_size): New method definition.
11706 (Output_data_group::Output_data_group): Adjust call to
11707 Output_section_data.
11708 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
11709 (Output_symtab_xindex::do_write): Add array bound check.
11710 (Output_section::Input_section::print_to_mapfile): Handle
11711 RELAXED_INPUT_SECTION_CODE.
11712 (Output_section::Output_section): Initialize data member checkpoint_.
11713 (Output_section::~Output_section): Delete checkpoint object pointed
11714 by checkpoint_.
11715 (Output_section::add_input_section): Always add an Input_section if
11716 relaxing.
11717 (Output_section::add_merge_input_section): Add assert.
11718 (Output_section::relax_input_section): New method definition.
11719 (Output_section::set_final_data_size): Set load address to zero for
11720 an unallocated section.
11721 (Output_section::do_address_and_file_offset_have_reset_values):
11722 New method definition.
11723 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
11724 Handle relaxed input section.
11725 (Output_section::sort_attached_input_sections): Checkpoint input
11726 section list lazily.
11727 (Output_section::get_input_sections): Change type of input_sections to
11728 list of Simple_input_section pointers. Checkpoint input section list
11729 lazily. Also handle relaxed input sections.
11730 (Output_section::add_input_section_for_script): Take a reference to
11731 a Simple_input_section object instead of Relobj pointer and section
11732 index as parameter. Handle relaxed input sections.
11733 (Output_section::save_states, Output_section::restore_states): New
11734 method definitions.
11735 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
11736 (Output_data::is_data_size_fixed): New method definition.
11737 (Output_data::reset_addresss_and_file_offset): Do not reset data size
11738 if it is fixed.
11739 (Output_data::address_and_file_offset_have_reset_values): New method
11740 definition.
11741 (Output_data::do_address_and_file_offset_have_reset_values): New method
11742 definition.
11743 (Output_data::set_data_size): Check that data size is not fixed.
11744 (Output_data::fix_data_size): New method definition.
11745 (Output_data::is_data_size_fixed_): New data member.
11746 (Output_section_headers::set_final_data_size): New method definition.
11747 (Output_section_headers::do_size): New method declaration.
11748 (Output_segment_headers::set_final_data_size): New method definition.
11749 (Output_segment_headers::do_size): New method declaration.
11750 (Output_file_header::set_final_data_size)::New method definition.
11751 (Output_file_header::do_size)::New method declaration.
11752 (Output_section_data::Output_section_data): Add new parameter
11753 is_data_size_fixed and use it to fix data size.
11754 (Output_data_const::Output_data_const): Adjust call to base class
11755 constructor and fix data size.
11756 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
11757 base class constructor and fix data size.
11758 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
11759 base class constructor and fix data size.
11760 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
11761 class constructor and fix data size.
11762 (Output_data_group::set_final_data_size): New method definition.
11763 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
11764 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
11765 class constructor and fix data size.
11766 (Output_relaxed_input_section): New class definition.
11767 (Output_section::Simple_input_section): New class definition.
11768 (Output_section::get_input_sections): Adjust parameter list.
11769 (Output_section::add_input_section_for_script): Same.
11770 (Output_section::save_states, Output_section::restore_states,
11771 Output_section::do_address_and_file_offset_have_reset_values,
11772 (Output_section::Input_section::Input_section): Handle
11773 RELAXED_INPUT_SECTION_CODE. Add new overload for
11774 Output_relaxed_input_section.
11775 (Output_section::Input_section::is_input_section,
11776 Output_section::Input_section::set_output_section): Handle relaxed
11777 input section.
11778 (Output_section::Input_section::is_relaxed_input_section,
11779 Output_section::Input_section::output_section_data,
11780 Output_section::Input_section::relaxed_input_section): New method
11781 definitions.
11782 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
11783 value.
11784 (Output_section::Input_section::u1_): Update comments.
11785 (Output_section::Input_section::u2_): Add new union member poris.
11786 (Output_section::Checkpoint_output_section): New classs definition.
11787 (Output_section::relax_input_section): New method declaration.
11788 (Output_section::checkpoint_): New data member.
11789 (Output_segment): Update comments.
11790 (Output_segment::Output_segment): Un-privatize copy constructor.
11791 (Output_segment::operator=): Un-privatize.
11792 * script-sections.cc (Output_section_element::Input_section_list):
11793 Change element type to Output_section::Simple_input_section.
11794 (Output_section_element_dot_assignment::set_section_addresses):
11795 Register output section data for relaxation clean up.
11796 (Output_data_exression::Output_data_expression): Adjust call to base
11797 constructor to fix data size.
11798 (Output_section_element_data::set_section_addresses): Register
11799 Output_data_expression object for relaxation clean up.
11800 (struct Input_section_info): Replace Relobj pointer and section index
11801 pair with Output_section::Simple_input_section and Convert struct to a
11802 class.
11803 (Input_section_sorter::operator()): Adjust access to
11804 Input_section_info data member to use accessors.
11805 (Output_section_element_input::set_section_addresses): Use layout
11806 parameter. Adjust code to use Output_section::Simple_input_section
11807 and Input_secction_info classes. Register filler for relaxation
11808 clean up.
11809 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11810 and section index pair with Output_section::Simple_input_section
11811 class. Adjust code accordingly.
11812 (Phdrs_element::release_segment): New method definition.
11813 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11814 segment list.
11815 (Script_sections::release_segments): New method definition.
11816 * gold/script-sections.h (Script_sections::release_segments): New
11817 method declaration.
11818 * gold/target.h (Target::may_relax, Target::relax,
11819 Target::do_may_relax, Target::do_relax): New method definitions.
11820
11821 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11822
11823 * arm.cc (has_signed_unsigned_overflow): New function.
11824 (Arm_relocate_functions::abs8): New function.
11825 (Target_arm::Scan::local): Handle R_ARM_ABS8.
11826 (Target_arm::Scan::global): Likewise.
11827 (Target_arm::relocate::relocate): Likewise.
11828 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11829 Likewise.
11830
11831 2009-09-16 Cary Coutant <ccoutant@google.com>
11832
11833 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
11834 * testsuite/Makefile.in: Regenerate.
11835
11836 2009-09-11 Nick Clifton <nickc@redhat.com>
11837
11838 * po/gold.pot: Updated by the Translation project.
11839
11840 2009-09-08 Cary Coutant <ccoutant@google.com>
11841
11842 * output.cc (Output_file::open): Add execute permission to empty file.
11843 * testsuite/Makefile.am (permission_test): New test.
11844 * testsuite/Makefile.in: Regenerate.
11845
11846 2009-09-02 Ian Lance Taylor <iant@google.com>
11847
11848 * output.cc (Output_file::resize): Call map_no_anonymous rather
11849 than map.
11850
11851 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
11852
11853 * gold.cc: Include "incremental.h".
11854 (queue_initial_tasks): Call Incremental_checker methods.
11855 * incremental.cc: Include "output.h".
11856 (Incremental_checker::can_incrementally_link_output_file): New
11857 method.
11858 * incremental.h (Incremental_checker): New class.
11859
11860 * output.cc (Output_file::open_for_modification): New method.
11861 (Output_file::map_anonymous): Changed return type to bool. Record
11862 map in base_ field.
11863 (Output_file::map_no_anonymous): New method, broken out of map.
11864 (Output_file::map): Use map_no_anonymous and map_anonymous.
11865 * output.h (class Output_file): Update declarations.
11866
11867 2009-08-24 Cary Coutant <ccoutant@google.com>
11868
11869 * options.h (Command_line::Pre_options): New class.
11870 (Command_line::pre_options): New member.
11871 * options.cc (gold::options::ready_to_register): New variable.
11872 (One_option::register_option): Do nothing if not registering options.
11873 Assert if same short option registered twice.
11874 (General_options::General_options): Turn off option registration when
11875 done constructing.
11876 (Command_line::Pre_options::Pre_options): New constructor.
11877
11878 2009-08-24 Cary Coutant <ccoutant@google.com>
11879
11880 * options.h (General_options::no_keep_memory): Remove incorrect
11881 short option.
11882
11883 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11884
11885 * Makefile.am (am__skiplex, am__skipyacc): New.
11886 * Makefile.in: Regenerate.
11887
11888 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11889
11890 * Makefile.am (AM_CPPFLAGS): Renamed from ...
11891 (INCLUDES): ... this.
11892 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
11893 (AM_CPPFLAGS): Renamed from ...
11894 (INCLUDE): ... this.
11895 * Makefile.in, testsuite/Makefile.in: Regenerate.
11896
11897 * Makefile.in: Regenerate.
11898 * aclocal.m4: Likewise.
11899 * config.in: Likewise.
11900 * configure: Likewise.
11901 * testsuite/Makefile.in: Likewise.
11902
11903 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11904 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11905 * Makefile.in: Regenerate.
11906 * testsuite/Makefile.in: Regenerate.
11907
11908 2009-08-19 Cary Coutant <ccoutant@google.com>
11909
11910 * resolve.cc (Symbol_table::resolve): Don't complain about defined
11911 symbols in shared libraries overridden by hidden or internal symbols
11912 in the main program.
11913
11914 2009-08-19 Chris Demetriou <cgd@google.com>
11915
11916 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
11917 checking source file names in error messages.
11918
11919 2009-08-18 Doug Kwan <dougkwan@google.com>
11920
11921 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
11922 an elcpp::Ehdr as parameter. Adjust call to set_target.
11923 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
11924 an elfcpp::Ehdr as parameter.
11925 * object.cc (Object::set_target): Remove the version that looks up
11926 a target and sets it.
11927 (Sized_relobj::setup): Take a Target object instead of
11928 an elfcpp::Ehdr as parameter. Adjust call to set_target.
11929 (make_elf_sized_object): Find target and ask target to
11930 make an ELF object.
11931 * object.h: (Object::set_target): Remove the version that looks up
11932 a target and sets it.
11933 (Sized_relobj::setup): Take a Target object instead of
11934 an elfcpp:Ehdr as parameter.
11935 * target.cc: Include dynobj.h.
11936 (Target::do_make_elf_object_implementation): New.
11937 (Target::do_make_elf_object): New.
11938 * target.h (Target::make_elf_object): New template declaration.
11939 (Target::do_make_elf_object): New method declarations.
11940 (Target::do_make_elf_object_implementation): New template declaration.
11941
11942 2009-08-14 Ian Lance Taylor <iant@google.com>
11943
11944 * gold.h (FUNCTION_NAME): Define.
11945 (gold_unreachable): Use FUNCTION_NAME.
11946
11947 2009-08-12 Sriraman Tallam <tmsriram@google.com>
11948
11949 * icf.cc (Icf::find_identical_sections): Issue a warning when a
11950 symbol in the --keep-unique list is not found.
11951
11952 2009-08-12 Sriraman Tallam <tmsriram@google.com>
11953
11954 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
11955 been maked as --keep-unique.
11956 (Icf::unfold_section): New function.
11957 * icf.h (Icf::unfold_section): New function.
11958 * options.h (General_options::keep_unique): New option.
11959 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
11960 * testsuite/Makefile.in: Regenerate.
11961 * testsuite/icf_keep_unique_test.sh: New file.
11962 * testsuite/icf_keep_unique_test.cc: New file.
11963
11964 2009-08-12 Cary Coutant <ccoutant@google.com>
11965
11966 PR 10471
11967 * resolve.cc (Symbol_table::resolve): Check for references from
11968 dynamic objects to hidden and internal symbols.
11969 * testsuite/Makefile.am (hidden_test.sh): New test.
11970 * testsuite/Makefile.in: Regenerate.
11971 * testsuite/hidden_test.sh: New script.
11972 * testsuite/hidden_test_1.c: New test source.
11973 * testsuite/hidden_test_main.c: New test source.
11974
11975 2009-08-11 Doug Kwan <dougkwan@google.com>
11976
11977 * arm.cc: Update comments.
11978 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
11979 segment to locate the .ARM.exidx section if present.
11980
11981 2009-08-09 Doug Kwan <dougkwan@google.com>
11982
11983 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
11984 patch.
11985
11986 2009-08-07 Sriraman Tallam <tmsriram@google.com>
11987 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
11988 compiler warnings.
11989
11990 2009-08-06 Sriraman Tallam <tmsriram@google.com>
11991
11992 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
11993 valid tls_segment only for non-debug-section relocations.
11994 * testsuite/Makefile.am: Add gc_tls_test.
11995 * testsuite/Makefile.in: Regenerate.
11996 * testsuite/gc_tls_test.cc: New file.
11997 * testsuite/gc_tls_test.sh: New file.
11998
11999 2009-08-05 Sriraman Tallam <tmsriram@google.com>
12000
12001 * icf.cc: New file.
12002 * icf.h: New file.
12003 * Makefile.am (CCFILES): Add icf.cc.
12004 (HFILES): Add icf.h
12005 * Makefile.in: Regenerate.
12006 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12007 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12008 section, symbol and addend information for the relocs.
12009 * gold.cc (queue_middle_tasks): Call identical code folding.
12010 * gold.h: Add defines for multimap.
12011 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12012 to the call of finalize_local_symbols.
12013 * main.cc (main): Create object of class Icf.
12014 * object.cc (Sized_relobj::do_layout): Allow this function to be
12015 called twice during icf.
12016 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12017 to sections marked as identical by icf.
12018 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12019 when available.
12020 (Sized_relobj::do_section_entsize): New function.
12021 * object.h (Object::section_entsize): New function.
12022 (Object::do_section_entsize): New pure virtual function.
12023 (Relobj::finalize_local_symbols): Add new parameter.
12024 (Relobj::do_section_entsize): New function.
12025 * options.h (General_options::icf): New option.
12026 (General_options::icf_iterations): New option.
12027 (General_options::print_icf_sections): New option.
12028 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12029 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12030 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12031 icf.
12032 * symtab.cc (Symbol_table::is_section_folded): New function.
12033 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12034 to sections marked as identical by icf.
12035 * symtab.h (Symbol_table::set_icf): New function.
12036 (Symbol_table::icf): New function.
12037 (Symbol_table::is_section_folded): New function.
12038 (Symbol_table::icf_): New data member.
12039 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12040 * testsuite/Makefile.am: Add commands to build icf_test.
12041 * testsuite/Makefile.in: Regenerate.
12042 * testsuite/icf_test.sh: New file.
12043 * testsuite/icf_test.cc: New file.
12044
12045 2009-07-24 Chris Demetriou <cgd@google.com>
12046
12047 * layout.cc (is_compressible_debug_section): Fix incorrect
12048 comment about compressed section names.
12049
12050 2009-07-20 Ian Lance Taylor <ian@airs.com>
12051
12052 PR 10419
12053 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12054
12055 2009-07-16 Ian Lance Taylor <iant@google.com>
12056
12057 PR 10400
12058 * layout.h: #include <map>.
12059 (class Kept_section): Change from struct to class. Add accessors
12060 and setters. Add section size to Comdat_group mapping. Change
12061 Comdat_group to std::map. Add is_comdat_ field. Add
12062 linkonce_size field in union.
12063 (class Layout): Update declaration of find_or_add_kept_section.
12064 Don't declare find_kept_object.
12065 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12066 parameter. Add object, shndx, is_comdat, and is_group_name
12067 parameters. Change all callers. Adjust for new Kept_section.
12068 (Layout::find_kept_object): Remove.
12069 * object.cc (Sized_relobj::include_section_group): Update use of
12070 Kept_section. Rename secnum to shndx. Only record
12071 Kept_comdat_section if sections are the same size.
12072 (Sized_relobj::include_linkonce_section): Update use of
12073 Kept_section. Only record Kept_comdat_section if sections are the
12074 same size. Set size of linkonce section.
12075 (Sized_relobj::map_to_kept_section): Update call to
12076 get_kept_comdat_section.
12077 * object.h (class Sized_relobj): Rename fields in
12078 Kept_comdat_section to drop trailing underscores; change object
12079 field to Relobj*. Change Kept_comdat_section_table to store
12080 struct rather than pointer.
12081 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12082 Add kept_object and kept_shndx parameters. Change all callers.
12083 (Sized_relobj::get_kept_comdat_section): Change return type to
12084 bool. Add kept_object and kept_shndx parameters. Change all
12085 callers.
12086 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12087 Layout::find_or_add_kept_section.
12088
12089 2009-07-09 Ian Lance Taylor <iant@google.com>
12090
12091 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12092 Reserve space in the hash table.
12093
12094 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12095
12096 * fileread.cc (File_read::get_mtime): New method.
12097 * fileread.h (Timespec): New structure.
12098 (File_read::get_mtime): New method.
12099 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12100 Renamed from timestamp_nsec.
12101 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12102 Elf_Xword.
12103 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
12104 timestamp_nsec.
12105 (Incremental_inputs::report_archive): Save mtime; style fix.
12106 (Incremental_inputs::report_obejct): Save mtime; style fix.
12107 (Incremental_inputs::report_script): Save mtime; style fix.
12108 (Incremental_inputs::finalize_inputs): Style fix.
12109 (Incremental_inputs::finalize): Style fix.
12110 (Incremental_inputs::create_input_section_data): Store inputs
12111 mtime.
12112 * incremental.h (Incremental_inputs::report_script): Add mtime
12113 argument.
12114 (Incremental_inputs::Input_info::Input_info): Intialize only one
12115 union member.
12116 (Incremental_inputs::Input_info::archive): Move to nameless
12117 union.
12118 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12119 (Incremental_inputs::Input_info::script): Move to nameless union.
12120 (Incremental_inputs::mtime): New field.
12121 * script.cc (read_input_script): Pass file mtime to
12122 Incremental_input.
12123 * script.h (Script_info::inputs): Style fix.
12124
12125 2009-07-01 Ian Lance Taylor <ian@airs.com>
12126
12127 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12128 instead of 32.
12129
12130 2009-06-24 Ian Lance Taylor <iant@google.com>
12131
12132 PR 10156
12133 * layout.cc (Layout::choose_output_section): If we find an
12134 existing section, update the flags.
12135 (Layout::create_notes): New function, broken out of
12136 Layout::finalize.
12137 (Layout::finalize): Don't create note sections.
12138 (Layout::create_note): Don't crash if linker script discards
12139 section.
12140 (Layout::create_gold_note): Likewise.
12141 (Layout::create_build_id): Likewise. Don't set
12142 after_input_sections on the section.
12143 (Layout::create_executable_stack_info): Remove target parameter.
12144 Change caller.
12145 * layout.h (class Layout): Declare create_notes. Update
12146 declaration of create_executable_stack_info.
12147 * gold.cc (queue_middle_tasks): Call create_notes.
12148 * output.cc (Output_section::update_flags_for_input_section): Move
12149 here from output.h. If SHF_ALLOC flag is newly set, mark address
12150 invalid.
12151 * output.h (Output_data::mark_address_invalid): New function.
12152 (class Output_section): Only declare, not define,
12153 update_flags_for_input_section. Remove set_flags.
12154
12155 2009-06-24 Ian Lance Taylor <iant@google.com>
12156
12157 * script-sections.cc (Output_section_definition::
12158 set_section_addresses): Rename shadowing local load_address to
12159 laddr.
12160
12161 2009-06-24 Ian Lance Taylor <iant@google.com>
12162
12163 PR 10244
12164 * reloc.cc (relocate_sections): Skip empty relocation sections.
12165
12166 2009-06-23 Ian Lance Taylor <iant@google.com>
12167
12168 PR 10156
12169 * layout.cc (Layout::create_note): Use choose_output_section
12170 rather than make_output_section.
12171
12172 2009-06-23 Ian Lance Taylor <iant@google.com>
12173
12174 PR 10237
12175 * options.cc (General_options::parse_V): Set printed_version_.
12176 (General_options::General_options): Initialize printed_version_.
12177 * options.h (class General_options): Add printed_version_ field.
12178 * gold.cc (queue_initial_tasks): If there are no input files,
12179 don't give a fatal error if we printed the version information.
12180 (queue_middle_tasks): If using -r with a shared object, give a
12181 fatal error rather than an ordinary error.
12182
12183 2009-06-23 Ian Lance Taylor <iant@google.com>
12184
12185 PR 10219
12186 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12187 (Layout::make_output_section): Set have_stabstr_section_ if we see
12188 a .stab*str section.
12189 (Layout::finalize): Call link_stabs_sections.
12190 (Layout::link_stabs_sections): New file.
12191 * layout.h (class Layout): Add have_stabstr_section_ field.
12192 Declare link_stabs_sections.
12193
12194 2009-06-23 Doug Kwan <dougkwan@google.com>
12195
12196 * Makefile.am (libgold_a_LIBADD): New.
12197 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
12198 * Makefile.in: Regenerate.
12199 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12200 * configure: Regenerate.
12201 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12202 * fileread.cc: Include sys/state.h
12203 * gold.h: Declare memmem and strndup if found missing.
12204 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12205
12206 2009-06-23 Ian Lance Taylor <iant@google.com>
12207
12208 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12209 * configure: Rebuild.
12210
12211 2009-06-23 Ian Lance Taylor <iant@google.com>
12212
12213 PR 10147
12214 * object.cc (Object::section_contents): Don't try to get a view if
12215 the section has length zero.
12216 (Object::handle_gnu_warning_section): If the section is empty, use
12217 the name of the section as the warning.
12218
12219 2009-06-23 Ian Lance Taylor <iant@google.com>
12220
12221 PR 10133
12222 * stringpool.h (class Stringpool_template): Add optimize_ field.
12223 (Stringpool_template::set_optimize): New function.
12224 * stringpool.cc (Stringpool_template::Stringpool_template):
12225 Initialize optimize_ field.
12226 (Stringpool_template::set_string_offsets): Test local optimize
12227 fild rather than parameter.
12228 * layout.cc (Layout::Layout): Call set_optimize on the section
12229 name stringpool.
12230
12231 2009-06-22 Ian Lance Taylor <iant@google.com>
12232
12233 PR 10030
12234 * yyscript.y: Parse TARGET.
12235 * script.cc (script_set_target): New function.
12236 * script-c.h (script_set_target): Declare.
12237 * options.cc (General_options::string_to_object_format): Rename
12238 from string_to_object_format in anonymous namespace. Change
12239 callers.
12240 * options.h (class General_options): Declare
12241 string_to_object_format.
12242
12243 2009-06-22 Ian Lance Taylor <iant@google.com>
12244
12245 * script-sections.cc (Script_sections::create_segments): Don't put
12246 program headers in a PT_LOAD segment if -n or -N.
12247
12248 2009-06-22 Ian Lance Taylor <iant@google.com>
12249
12250 PR 10141
12251 * options.h (class General_options): Add -z lazy and -z now. Sort
12252 -z options into alphabetical order.
12253 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12254
12255 2009-06-21 Ian Lance Taylor <iant@google.com>
12256
12257 * layout.cc (Layout::make_output_section): Call
12258 Target::new_output_section.
12259 (Layout::attach_allocated_section_to_segment): Put large section
12260 sections in a separate load segment with the large segment flag
12261 set.
12262 (Layout::segment_precedes): Sort large data segments after other
12263 load segments.
12264 (align_file_offset): New static function.
12265 (Layout::set_segment_offsets): Use align_file_offset.
12266 * output.h (class Output_section): Add is_small_section_ and
12267 is_large_section_ fields.
12268 (Output_section::is_small_section): New function.
12269 (Output_section::set_is_small_section): New function.
12270 (Output_section::is_large_section): New function.
12271 (Output_section::set_is_large_section): New function.
12272 (Output_section::is_large_data_section): New function.
12273 (class Output_segment): Add is_large_data_segment_ field.
12274 (Output_segment::is_large_data_segment): New function.
12275 (Output_segment::set_is_large_data_segment): New function.
12276 * output.cc (Output_section::Output_section): Initialize new
12277 fields.
12278 (Output_segment::Output_segment): Likewise.
12279 (Output_segment::add_output_section): Add assertion that large
12280 data sections always go in large data segments. Force small data
12281 sections to the end of the list of data sections. Force small BSS
12282 sections to the start of the list of BSS sections. For large BSS
12283 sections to the end of the list of BSS sections.
12284 * symtab.h (class Symbol): Declare is_common_shndx.
12285 (Symbol::is_defined): Check Symbol::is_common_shndx.
12286 (Symbol::is_common): Likewise.
12287 (class Symbol_table): Define enum Commons_section_type. Update
12288 declarations. Add small_commons_ and large_commons_ fields.
12289 * symtab.cc (Symbol::is_common_shndx): New function.
12290 (Symbol_table::Symbol_table): Initialize new fields.
12291 (Symbol_table::add_from_object): Put small and large common
12292 symbols in the right list.
12293 (Symbol_table::sized_finalized_symbol): Check
12294 Symbol::is_common_shndx.
12295 (Symbol_table::sized_write_globals): Likewise.
12296 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12297 common symbol lists. Don't call do_allocate_commons_list if the
12298 list is empty.
12299 (Symbol_table::do_allocate_commons_list): Remove is_tls
12300 parameter. Add comons_section_type parameter. Change all
12301 callers. Handle small and large common symbols.
12302 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12303 Symbol::is_common_shndx.
12304 * resolve.cc (symbol_to_bits): Likewise.
12305 * target.h (Target::small_common_shndx): New function.
12306 (Target::small_common_section_flags): New function.
12307 (Target::large_common_shndx): New function.
12308 (Target::large_common_section_flags): New function.
12309 (Target::new_output_section): New function.
12310 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12311 small_common_section_flags, and large_common_section_flags
12312 fields.
12313 (Target::do_new_output_section): New virtual function.
12314 * arm.cc (Target_arm::arm_info): Initialize new fields.
12315 * i386.cc (Target_i386::i386_info): Likewise.
12316 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12317 Likewise.
12318 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12319 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12320 (Target_x86_64::do_new_output_section): New function.
12321 * configure.ac: Define conditional MCMODEL_MEDIUM.
12322 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12323 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12324 (large_LDFLAGS): Define.
12325 * testsuite/large.c: New file.
12326 * testsuite/testfile.cc (Target_test::test_target_info):
12327 Initialize new fields.
12328 * configure, testsuite/Makefile.in: Rebuild.
12329
12330 2009-06-05 Doug Kwan <dougkwan@google.com>
12331
12332 * Makefile.am (CCFILES): Add target.cc.
12333 * Makefile.in: Regenerate.
12334 * i386.cc (class Target_i386): Define new virtual method to
12335 override do_is_local_label_name in parent.
12336 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12337 local symbols if --discard-locals or -X is given.
12338 * options.h (class General_options): Declare new options
12339 '--discard-locals' and '-X' for discarding locals.
12340 * target.h (class Target): Define new methods is_local_label_name.
12341 Declare new virtual method do_is_local_label_name.
12342 * target.cc: New file.
12343 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12344 (check_SCRIPTS): Add discard_locals_test.sh.
12345 (check_DATA): Add discard_local_tests.syms.
12346 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12347 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12348 * testsuite/Makefile.in: Regenerate.
12349 * testsuite/discard_locals_test.c: New file.
12350 * testsuite/discard_locals_test.sh: Same.
12351
12352 2009-06-05 Doug Kwan <dougkwan@google.com>
12353
12354 * object.cc (Sized_relobj::Sized_relobj): Initialize
12355 discarded_eh_frame_shndx_ to -1U.
12356 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12357 section.
12358 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12359 a discarded .eh_frame section.
12360 (Sized_relobj::do_finalize_local_symbols): Ditto.
12361 * object.h (class Sized_relobj): Declare new member
12362 discarded_eh_frame_shndx_.
12363 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12364 (local_labels_test.o, local_labels_test): New rules.
12365 * testsuite/Makefile.in: Regenerate.
12366
12367 2009-06-04 Doug Kwan <dougkwan@google.com>
12368
12369 * layout.cc (Layout::section_name_mapping): Add mapping for
12370 special ARM sections.
12371
12372 2009-06-03 Doug Kwan <dougkwan@google.com>
12373
12374 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12375 (utils::has_overflow): Same.
12376
12377 2009-06-03 Ian Lance Taylor <iant@google.com>
12378
12379 * layout.cc (Layout::section_name_mapping): New array, replacing
12380 Layout::linkonce_mapping.
12381 (Layout::section_name_mapping_count): New variable, replacing
12382 Layout::linkonce_mapping_count.
12383 (Layout::linkonce_output_name): Remove.
12384 (Layout::output_section_name): Rewrite.
12385 * layout.h (class Layout): Rename Linkonce_mapping to
12386 Section_name_mapping, linkonce_mapping to section_name_mapping,
12387 linkonce_mapping_count to section_name_mapping_count. Don't
12388 declare linkonce_output_name.
12389
12390 2009-06-03 Doug Kwan <dougkwan@google.com>
12391
12392 * gold/arm.cc (namespace utils): New.
12393 (Target_arm::reloc_is_non_pic): Define new method.
12394 (class Arm_relocate_functions): New.
12395 (Target_arm::Relocate::relocate): Handle relocation types used by
12396 Android.
12397
12398 2009-06-03 Ian Lance Taylor <iant@google.com>
12399
12400 * arm.cc (Target_arm::scan::global): Use || instead of |.
12401
12402 2009-06-02 Doug Kwan <dougkwan@google.com>
12403
12404 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12405 issued_non_pic_error_.
12406 (class Target_arm::Scan): Declare new method check_non_pic.
12407 Define new method symbol_needs_plt_entry.
12408 Declare new data member issued_non_pic_error_.
12409 (class Target_arm::Relocate): Declare new method
12410 should_apply_static_reloc.
12411 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12412 (Target_arm::Scan::check_non_pic): Define new method.
12413 (Target_arm::Scan::local): Handle a small subset of reloc types used
12414 by Android.
12415 (Target_arm::Scan::local): Same.
12416 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12417
12418 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12419
12420 * incremental.cc (Incremental_inputs::report_command_line): Filter
12421 out --incremental-* options.
12422
12423 2009-05-29 Doug Kwan <dougkwan@google.com>
12424
12425 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12426 template class.
12427 (class Target_arm): Update comment.
12428 (Target_arm::Target_arm): Initialize new data members GOT_,
12429 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12430 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12431 and Target_arm::rel_dyn_section.
12432 Declare new_enum Target_arm::Got_type.
12433 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12434 and DYNBSS_.
12435 Update commments for member do_dynsym_value.
12436 (Target_arm::got_size, Target_arm::plt_section,
12437 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12438 new methods inside class defintion.
12439 (Target_arm::got_section): Define new method.
12440 (Target_arm::rel_dyn_section): Same.
12441 (Output_data_plt_arm): New template class.
12442 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12443 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12444 (Output_data_plt_arm::add_entry): Same.
12445 (Output_data_plt_arm::first_plt_entry): Define new
12446 static data member for PLT instruction template.
12447 (Output_data_plt_arm::plt_entry): Same.
12448 (Output_data_plt_arm::do_write): Define new method.
12449 (Target_arm::make_plt_entry): Same.
12450 (Target_arm::do_finalize_sections): Same.
12451 (Target_arm::do_dynsym_value): Same.
12452
12453 2009-05-28 Doug Kwan <dougkwan@google.com>
12454
12455 * Makefile.am (TARGETSOURCES): Add arm.cc.
12456 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12457 * Makefile.in: Regenerate.
12458 * arm.cc: New file.
12459 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12460
12461 2009-05-26 Doug Kwan <dougkwan@google.com>
12462
12463 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12464 (General_options::check_excluded_libs): Strip off directories in
12465 archive name before matching like GNU ld does.
12466 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12467 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12468 (exclude_libs_test_LDFLAGS): Add linker option
12469 -Wl,--exclude-libs,libexclude_libs_test_3
12470 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12471 an explicit archive without using -l.
12472 (alt/libexclude_libs_test_3.a): New make rule.
12473 * testsuite/Makefile.in: Regenerate.
12474 * testsuite/exclude_libs_test.c : Declare lib3_default().
12475 (main): Call it.
12476 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12477 * exclude_libs_test_3.c: New file.
12478
12479 2009-05-26 Nick Clifton <nickc@redhat.com>
12480
12481 * po/id.po: New Indonesian translation.
12482 * po/gold.pot: Updated template file.
12483
12484 2009-05-22 Sriraman Tallam <tmsriram@google.com>
12485
12486 * testsuite/Makefile.am: Add -ffunction-sections to compile
12487 gc_comdat_test files. Add -Wl,--gc-sections to build
12488 gc_comdat_test.
12489 * testsuite/Makefile.in: Regenerate.
12490 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12491
12492 2009-05-21 Sriraman Tallam <tmsriram@google.com>
12493
12494 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12495 kept comdat section was garbage collected.
12496 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12497 * testsuite/Makefile.in: Regenerate.
12498 * testsuite/gc_comdat_test.sh: New file.
12499 * testsuite/gc_comdat_test_1.cc: New file.
12500 * testsuite/gc_comdat_test_2.cc: New file.
12501
12502 2009-05-19 Doug Kwan <dougkwan@google.com>
12503
12504 * archive.cc (Archive::Archive): Move constructor from archive.h
12505 to here. Initialize no_export_.
12506 (Archive::get_elf_object_for_member): Set no_export flag of object.
12507 * archive.h (Archive::Archive): Move constructor body to
12508 archive.cc.
12509 (Archive::no_export): New method.
12510 (Archive::no_export_): New field.
12511 * object.h (Object::Object): Initialize no_export_ to false.
12512 (Object::no_export, Object::set_no_export): New methods.
12513 (Object::no_export_): New field.
12514 * options.cc (General_options::parse_exclude_libs): New method.
12515 (General_options::check_excluded_libs) Same.
12516 * options.h (exclude_libs): New option.
12517 (General_options::check_excluded_libs): New method declaration.
12518 (General_options::excluded_libs_): New field.
12519 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12520 default or protected visibility if an object has no-export flag set.
12521 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12522 (check_SCRIPTS): Add exclude_libs_test.sh.
12523 (check_DATA): Add exclude_libs_test.syms.
12524 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12525 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12526 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12527 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12528 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12529 libexclude_libs_test_2.a): New rules.
12530 * testsuite/Makefile.in: Regenerate.
12531 * testsuite/exclude_libs_test.c: New file.
12532 * testsuite/exclude_libs_test.sh: Ditto.
12533 * testsuite/exclude_libs_test_1.c: Ditto.
12534 * testsuite/exclude_libs_test_2.c: Ditto.
12535
12536 2009-05-15 Ian Lance Taylor <iant@google.com>
12537
12538 * configure.ac: Check for declarations for cases where libiberty.h
12539 checks HAVE_DECL_xxx.
12540 * configure, config.in: Rebuild.
12541
12542 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12543
12544 * gold.h (Incremental_argument_list): Remove (invalid) forward
12545 declaration.
12546 * incremental.cc (Incremental_inputs::report_achive): New method.
12547 (Incremental_inputs::report_object): New method.
12548 (Incremental_inputs::report_script): New method.
12549 (Incremental_inputs::finalize_inputs): New method.
12550 (Incremental_inputs::finalize): Call finalize_inputs().
12551 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12552 Create inputs entries.
12553 * incremental.h (Incremental_input_type): New enum.
12554 (Incremental_inputs::Incremental_input): Initialize new fields.
12555 (Incremental_inputs::report_inputs): New method.
12556 (Incremental_inputs::report_achive): New method.
12557 (Incremental_inputs::report_object): New method.
12558 (Incremental_inputs::report_script): New method.
12559 (Incremental_inputs::finalize_inputs): New method.
12560 (Incremental_inputs::Input_info): New struct.
12561 (Incremental_inputs::Input_info_map): New typedef.
12562 (Incremental_inputs::lock_): New field.
12563 (Incremental_inputs::Inputs_): New field.
12564 (Incremental_inputs::Inputs_map): New field.
12565 * main.cc (main): Call Incremental_input::report_inputs.
12566 * options.h (Input_argument_list): Typedef moved from
12567 Input_arguments.
12568 (Input_file_group::Files): Remove, use ::Input_argument_list.
12569 (Input_file_group::Input_argument_list): Remove, use
12570 ::Input_argument_list.
12571 * plugin.cc (Plugin_manager::add_input_file): Add error in
12572 incremental build.
12573 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12574 functions.
12575 * script.cc (read_input_script): Call
12576 Incremental_input::report_script.
12577 * script.h (Script_info): New class.
12578
12579 2009-04-27 Ian Lance Taylor <iant@google.com>
12580
12581 * x86_64.cc (do_adjust_output_section): Set entsize to
12582 plt_entry_size.
12583
12584 2009-04-23 Elliott Hughes <enh@google.com>
12585
12586 * output.cc (Output_file::close): After short writes, continue
12587 writing from the correct offset in the buffer being written.
12588
12589 2009-04-23 Chris Demetriou <cgd@google.com>
12590
12591 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
12592 * configure: Regenerate.
12593 * config.in: Regenerate.
12594 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
12595 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
12596
12597 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
12598
12599 * incremental.cc (Incremental_inputs_header_data): Renamed from
12600 Incremental_input_header_data.
12601 (Incremental_inputs_header_data::data_size): New field.
12602 (Incremental_inputs_header_data::put_input_file_count): Renamed
12603 from input_file_count.
12604 (Incremental_inputs_header_data::put_command_line_offset): Renamed
12605 from command_line_offset.
12606 (Incremental_inputs_header_data::put_reserved): Renamed from
12607 put_reserved.
12608 (Incremental_inputs_entry_data): Renamed from
12609 Incremental_input_entry_data.
12610 (Incremental_inputs_entry_data::data_size): New field.
12611 (Incremental_inputs::report_command_line): New method.
12612 (Incremental_inputs::finalize): New method.
12613 (Incremental_inputs::create_incremental_inputs_data): New method.
12614 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
12615 * incremental.h: New file.
12616 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
12617 (Layout::finalize): Create incremental inputs section in
12618 incremental builds.
12619 (Layout::create_incremental_info_sections): New method.
12620 * layout.h (Layout::incremental_inputs): New method.
12621 (Layout::create_incremental_info_sections): New method.
12622 (Layout::incremental_inputs_): New field.
12623 * main.cc (main): Notify Incremental_input of the command line.
12624
12625 2009-04-01 Ian Lance Taylor <iant@google.com>
12626 Mikolaj Zalewski <mikolajz@google.com>
12627
12628 * gold.h (reserve_unordered_map): Define, three versions, one for
12629 each version of Unordered_map.
12630 * layout.cc (Layout::Layout): Remove options parameter. Add
12631 number_of_input_files parameter. Don't initialize options_.
12632 Initialize number_of_input_files_ and resized_signatures_. Move
12633 sections_are_attached_.
12634 (Layout::layout_group): Reserve space for group_signatures_.
12635 (Layout::find_or_add_kept_section): Change name parameter to be a
12636 reference. Resize signatures_ map when it gets large enough.
12637 (Layout::layout_eh_frame): Use parameters->options() instead of
12638 this->options_.
12639 (Layout::make_output_section): Likewise.
12640 (Layout::attach_allocated_section_to_segment): Likewise.
12641 (Layout::finalize, Layout::create_executable_stack): Likewise.
12642 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
12643 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
12644 * layout.h (class Layout): Update declarations. Remove options_
12645 field. Add number_of_input_files_ and resized_signatures_
12646 fields. Move sections_are_attached_ field.
12647 * main.cc (main): Pass number of input files to Layout
12648 constructor. Don't pass options.
12649
12650 2009-03-30 Ian Lance Taylor <iant@google.com>
12651
12652 * ffsll.c (ffsll): Correct implementation.
12653
12654 2009-03-27 Ian Lance Taylor <iant@google.com>
12655
12656 * ffsll.c: New file.
12657 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
12658 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
12659 * ftruncate.c (ftruncate): Declare before definition.
12660 * mremap.c (mremap): Likewise.
12661 * pread.c (pread): Likewise.
12662 * configure, Makefile.in, config.in: Rebuild.
12663
12664 * mremap.c: New file.
12665 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
12666 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
12667 (mremap): Declare if HAVE_MREMAP is not defined.
12668 * configure, Makefile.in, config.in: Rebuild.
12669
12670 2009-03-27 Cary Coutant <ccoutant@google.com>
12671
12672 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
12673 position independent.
12674 * sparc.cc (Target_sparc::check_non_pic): Likewise.
12675 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
12676
12677 2009-03-24 Cary Coutant <ccoutant@google.com>
12678
12679 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
12680 an executable.
12681 (needs_dynamic_reloc): Likewise.
12682
12683 2009-03-24 Ian Lance Taylor <iant@google.com>
12684
12685 * yyscript.y (file_cmd): Recognize EXTERN.
12686 (extern_name_list, extern_name_list_body): New nonterminals.
12687 * script.cc (script_add_extern): Define.
12688 * script-c.h (script_add_extern): Declare.
12689
12690 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
12691
12692 * object.cc (is_elf_object): Define.
12693 * object.h (is_elf_object): Declare.
12694 * archive.cc (Archive::get_elf_object_for_member): Call
12695 is_elf_object.
12696 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
12697
12698 2009-03-24 Elliott Hughes <enh@google.com>
12699
12700 * output.cc (Output_file::map_anonymous): Define.
12701 (Output_file::map): Use map_anonymous. If the regular mmap fails,
12702 try an anonymous one. Report the size if the mmap fails.
12703 * output.h (class Output_file): Declare map_anonymous.
12704
12705 2009-03-24 Ian Lance Taylor <iant@google.com>
12706
12707 * target-select.cc (instantiate_target): Don't acquire the lock if
12708 the instantiated_target_ field has already been set.
12709
12710 2009-03-23 Ian Lance Taylor <iant@google.com>
12711
12712 * gold-threads.h (class Initialize_lock): Define.
12713 * gold-threads.cc (class Initialize_lock_once): Define.
12714 (initialize_lock_control): New static variable.
12715 (initialize_lock_pointer): New static variable.
12716 (initialize_lock_once): New static function.
12717 (Initialize_lock::Initialize_lock): Define.
12718 (Initialize_lock::initialize): Define.
12719 * target-select.h: Include "gold-threads.h".
12720 (class Target_selector): Add lock_ and initialize_lock_ fields.
12721 Don't define instantiate_target, just declare it.
12722 * target-select.cc (Target_selector::Target_selector): Initialize
12723 new fields.
12724 (Target_selector::instantiate_target): Define.
12725 * descriptors.h: Include "gold-threads.h".
12726 (class Descriptors): Add initialize_lock_ field.
12727 * descriptors.cc (Descriptors::Descriptors): Initialize new
12728 field.
12729 (Descriptors::open): Use initialize_lock_ field
12730 * errors.h (class Errors): Add initialize_lock_ field.
12731 * errors.cc (Errors::Errors): Initialize new field.
12732 (Errors::initialize_lock): Use initialize_lock_ field.
12733 * powerpc.cc (class Target_selector_powerpc): Remove
12734 instantiated_target_ field. In do_recognize call
12735 instantiate_target rather than do_instantiate_target. In
12736 do_instantiate_target just allocate a new target.
12737 * sparc.cc (class Target_selector_sparc): Likewise.
12738
12739 * freebsd.h: New file.
12740 * i386.cc: Include "freebsd.h".
12741 (Target_i386): Derive from Target_freebsd rather than
12742 Sized_target.
12743 (Target_selector_i386): Derive from Target_selector_freebsd rather
12744 than Target_selector.
12745 * x86_64.cc: Include "freebsd.h".
12746 (Target_x86_64): Derive from Target_freebsd rather than
12747 Sized_target.
12748 (Target_selector_x86_64): Derive from Target_selector_freebsd
12749 rather than Target_selector.
12750 * target.h (class Target): Add adjust_elf_header and
12751 do_adjust_elf_header.
12752 * output.cc (Output_file_header:: do_sized_write): Call target
12753 adjust_elf_header routine.
12754 * configure.tgt: Set targ_osabi.
12755 * configure.ac: Define GOLD_DEFAULT_OSABI.
12756 * parameters.cc (Parameters::default_target): Pass
12757 GOLD_DEFAULT_OSABI to select_target.
12758 * target-select.h (class Target_selector): Make instantiate_target
12759 protected rather than private.
12760 * Makefile.am (HFILES): Add freebsd.h.
12761 * configure, Makefile.in, config.in: Rebuild.
12762
12763 * merge.cc (do_add_input_section): Correct pend value. Change
12764 message about last entry not being null terminated from error to
12765 warning.
12766
12767 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
12768
12769 * incremental.cc: New file.
12770 * Makefile.am (CCFILES): Add incremental.cc.
12771 * Makefile.in: Rebuild.
12772
12773 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
12774
12775 * layout.cc (Layout::output_section_name): Preserve names
12776 of '.note.' sections.
12777
12778 2009-03-19 Ian Lance Taylor <iant@google.com>
12779
12780 * descriptors.cc (Descriptors::open): Check that the options are
12781 valid before using them.
12782
12783 2009-03-18 Ian Lance Taylor <iant@google.com>
12784
12785 * script-sections.h: Include <list>.
12786 (class Script_sections): Change Sections_elements from std::vector
12787 to std::list. Typedef public Elements_iterator. Add
12788 orphan_section_placement_, data_segment_align_start_, and
12789 saw_data_segment_align_ fields. Remove data_segment_align_index_
12790 field.
12791 * script-sections.cc (class Orphan_section_placement): New class.
12792 (class Sections_element): Add virtual functions is_relro and
12793 orphan_section_init. Remove virtual function place_orphan_here.
12794 (class Output_section_definition): Add is_relro and
12795 orphan_section_init. Remove place_orphan_here.
12796 (class Orphan_output_section): Likewise.
12797 (Script_sections::Script_sections): Update for field changes.
12798 (Script_sections::data_segment_align): Set saw_data_segment_align_
12799 and data_segment_align_start_, not data_segment_align_index.
12800 (Script_sections::data_segment_relro_end): Check
12801 saw_data_segment_align_. Use data_segment_align_start_ rather
12802 than data_segment_align_index_.
12803 (Script_sections::place_orphan): Rewrite to use
12804 Orphan_section_placement.
12805
12806 2009-03-17 Ian Lance Taylor <iant@google.com>
12807
12808 * archive.cc (Archive::add_symbols): Check for a version attached
12809 to the symbol name in the archive map.
12810 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12811 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12812 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12813 (ver_test_11.a): New target.
12814 * testsuite/Makefile.in: Rebuild.
12815
12816 * configure.ac: Check for chsize and posix_fallocate. Replace
12817 ftruncate.
12818 * ftruncate.c: New file, from gnulib.
12819 * output.cc (posix_fallocate): Define dummy version if not
12820 HAVE_POSIX_FALLOCATE.
12821 (Output_file::map): Call posix_fallocate rather than lseek and
12822 write.
12823 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
12824 * configure, Makefile.in, config.in: Rebuild.
12825
12826 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
12827
12828 * layout.h (Layout::create_note): Add section_name parameter.
12829 * layout.cc (Layout::create_note): Likewise.
12830 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
12831
12832 2009-03-17 Ian Lance Taylor <iant@google.com>
12833
12834 * descriptors.cc: Include "options.h".
12835 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
12836 (Descriptors::open): Always use O_CLOEXEC when opening a new
12837 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
12838 then set FD_CLOEXEC.
12839
12840 * sparc.cc (class Target_sparc): Add has_got_section.
12841 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
12842 make sure we have a GOT section.
12843
12844 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
12845 (Target_sparc::Scan::local): Likewise.
12846 (Target_sparc::Scan::global): Likewise.
12847 (Target_sparc::Relocate::relocate): Likewise.
12848 (Target_sparc::Relocate::relocate_tls): Likewise.
12849
12850 * symtab.cc (Symbol_table::define_default_version): New function,
12851 broken out of add_from_object.
12852 (Symbol_table::add_from_object): Call define_default_version.
12853 (Symbol_table::define_special_symbol): Add resolve_oldsym
12854 parameter. Change all callers. If the version for a symbol comes
12855 from a version script, resolve it with the symbol with the same
12856 name with no version. Also add the symbol without a version if
12857 appropriate.
12858 (do_define_in_output_data): If resolving with oldsym, don't delete
12859 sym.
12860 (do_define_in_output_segment): Likewise.
12861 (do_define_as_constant): Likewise.
12862 * symtab.h (class Symbol_table): Update declarations.
12863
12864 2009-03-13 Ian Lance Taylor <iant@google.com>
12865
12866 * readsyms.cc (Read_symbols::incompatible_warning): New function.
12867 (Read_symbols::requeue): New function.
12868 (Read_symbols::do_read_symbols): If make_elf_object fails because
12869 the target type is not configured, and the file was searched for,
12870 issue a warning and retry with the next directory.
12871 (Add_symbols::run): If the file has an incompatible format, and
12872 it was searched for, requeue the Read_symbols task. On error,
12873 release the object.
12874 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
12875 dirindex parameter to constructor. Change all callers. Declare
12876 incompatible_warning and requeue.
12877 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
12878 input_argument_ and input_group_ fields. Add them to
12879 constructor. Change all callers.
12880 (class Read_script): Add dirindex_ field. Add it to constructor.
12881 Change all callers.
12882 * archive.cc (Archive::setup): Remove input_objects parameter.
12883 Change all callers.
12884 (Archive::get_file_and_offset): Likewise.
12885 (Archive::read_all_symbols): Likewise.
12886 (Archive::read_symbols): Likewise.
12887 (Archive::get_elf_object_for_member): Remove input_objects
12888 parameter. Add punconfigured parameter. Change all callers.
12889 (Archive::add_symbols): Change return type to bool. Check return
12890 value of include_member.
12891 (Archive::include_all_members): Likewise.
12892 (Archive::include_member): Change return type to bool. Return
12893 false if first included object has incompatible target. Set
12894 included_member_ field.
12895 (Add_archive_symbols::run): If add_symbols returns false, requeue
12896 Read_symbols task.
12897 * archive.h (class Archive): Add included_member_ field.
12898 Initialize it in constructor. Add input_file and searched_for
12899 methods. Update declarations.
12900 (class Add_archive_symbols): Add dirpath_, dirindex_, and
12901 input_argument_ fields. Add them to constructor. Change all
12902 callers.
12903 * script.cc: Include "target-select.h".
12904 (class Parser_closure): Add skip_on_incompatible_target_ and
12905 found_incompatible_target_ fields. Add
12906 skip_on_incompatible_target parameter to constructor. Change all
12907 callers. Add methods skip_on_incompatible_target,
12908 clear_skip_on_incompatible_target, found_incompatible_target, and
12909 set_found_incompatible_target.
12910 (read_input_script): Add dirindex parameter. Change all callers.
12911 If parser finds an incompatible target, requeue Read_symbols
12912 task.
12913 (script_set_symbol): Clear skip_on_incompatible_target in
12914 closure.
12915 (script_add_assertion, script_parse_option): Likewise.
12916 (script_start_sections, script_add_phdr): Likewise.
12917 (script_check_output_format): New function.
12918 * script.h (read_input_script): Update declaration.
12919 * script-c.h (script_check_output_format): Declare.
12920 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
12921 (ignore_cmd): Remove OUTPUT_FORMAT.
12922 * fileread.cc (Input_file::Input_file): Add explicit this.
12923 (Input_file::will_search_for): New function.
12924 (Input_file::open): Add pindex parameter. Change all callers.
12925 * fileread.h (class Input_file): Add input_file_argument method.
12926 Declare will_search_for. Update declarations.
12927 * object.cc (make_elf_object): Add punconfigured parameter.
12928 Change all callers.
12929 * object.h (class Object): Make input_file public. Add
12930 searched_for method.
12931 (make_elf_object): Update declaration.
12932 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
12933 restart search.
12934 * dirsearch.h (class Dirsearch): Update declaration.
12935 * options.h (class General_options): Add --warn-search-mismatch.
12936 * parameters.cc (Parameters::is_compatible_target): New function.
12937 * parameters.h (class Parameters): Declare is_compatible_target.
12938 * workqueue.cc (Workqueue::add_blocker): New function.
12939 * workqueue.h (class Workqueue): Declare add_blocker.
12940
12941 * fileread.cc (Input_file::open): Remove options parameter.
12942 Change all callers.
12943 (Input_file::open_binary): Likewise.
12944 * script.cc (read_input_script): Likewise.
12945 * readsyms.h (class Read_symbols): Remove options_ field. Remove
12946 options parameter from constructor. Change all callers.
12947 (class Read_script): Likewise.
12948 * fileread.h (class Input_file): Update declarations.
12949 * script.h (read_input_script): Update declaration.
12950
12951 2009-03-10 Nick Clifton <nickc@redhat.com>
12952
12953 * po/es.po: New Spanish translation.
12954
12955 2009-03-06 Cary Coutant <ccoutant@google.com>
12956
12957 * options.cc (parse_short_option): Keep dash_z from registering itself.
12958
12959 2009-03-03 Ian Lance Taylor <iant@google.com>
12960
12961 PR 9918
12962 * target-reloc.h (relocate_section): Pass output_section to
12963 relocate.
12964 * i386.cc (Target_i386::should_apply_static_reloc): Add
12965 output_section parameter. Change all callers.
12966 (Target_i386::Relocate::relocate): Add output_section parameter.
12967 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12968 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
12969 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
12970 * testsuite/two_file_shared.sh: New script.
12971 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
12972 (check_DATA): Add two_file_shared.dbg.
12973 (two_file_shared.dbg): New target.
12974 * testsuite/Makefile.in: Rebuild.
12975
12976 2009-03-01 Ian Lance Taylor <iant@google.com>
12977
12978 * configure.ac: Check for byteswap.h.
12979 * configure: Rebuild.
12980 * config.in: Rebuild.
12981
12982 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
12983
12984 * layout.cc (Layout::find_or_add_kept_section): New function.
12985 (Layout::add_comdat): Removed.
12986 * layout.h (struct Kept_section): Move out of class Layout.
12987 Remove trailing underscores from field names. Add group_sections
12988 field. Rename group_ field to is_group. Change all uses.
12989 (class Layout): Declare find_or_add_kept_section, not add_comdat.
12990 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
12991 comdat_groups_ field.
12992 (Sized_relobj::include_section_group): Use
12993 find_or_add_kept_section and Kept_section::group_sections.
12994 (Sized_relobj::include_linkonce_section): Likewise.
12995 * object.cc (class Sized_relobj): Don't define Comdat_group or
12996 Comdat_group_table. Remove find_comdat_group and
12997 add_comdat_group. Remove comdat_groups_ field.
12998 * plugin.cc (include_comdat_group): Use
12999 Layout::find_or_add_kept_section.
13000
13001 2009-02-28 Ian Lance Taylor <iant@google.com>
13002
13003 * README: --gc-sections and map files are now supported. Document
13004 some build requirements.
13005
13006 PR 6992
13007 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13008 relocatable link set the value of the section symbol to zero.
13009 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13010 relocatable link don't include the section address in the local
13011 symbol value.
13012
13013 2009-02-27 Ian Lance Taylor <iant@google.com>
13014
13015 PR 6811
13016 * options.h (class Search_directory): Add is_system_directory.
13017 (class General_options): Declare is_in_system_directory.
13018 * options.cc (get_relative_sysroot): Make static.
13019 (get_default_sysroot): Make static.
13020 (General_optoins::is_in_system_directory): New function.
13021 * fileread.cc (Input_file::is_in_system_directory): New function.
13022 * fileread.h (class Input_file): Declare is_in_system_directory.
13023 * object.h (class Object): Add is_in_system_directory.
13024 (class Input_objects): Remove system_library_directory_ field.
13025 * object.cc (Input_objects::add_object): Don't set
13026 system_library_directory_.
13027 (input_objects::found_in_system_library_directory): Remove.
13028 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13029 parameter. Change all callers.
13030 (Symbol_table::sized_write_globals): Likewise.
13031 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13032 Call Object::is_in_system_directory.
13033 * symtab.h (class Symbol_table): Update declarations.
13034
13035 PR 5990
13036 * descriptors.h (Open_descriptor): Add is_on_stack field.
13037 * descriptors.cc (Descriptors::open): If the descriptor is on the
13038 top of the stack, remove it. Initialize is_on_stack field.
13039 (Descriptors::release): Only add pod to stack if it is not on the
13040 stack already.
13041 (Descriptors::close_some_descriptor): Clear stack_next and
13042 is_on_stack fields.
13043
13044 PR 7091
13045 * output.cc (Output_section::find_starting_output_address): Rename
13046 from starting_output_address; add PADDR parameter; change return
13047 type.
13048 * output.h (class Output_section): Declare
13049 find_starting_output_address instead of starting_output_address.
13050 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13051 section symbol for which we can't find a merge section.
13052
13053 PR 9836
13054 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13055 hidden or internal, force the symbol to be local.
13056 * resolve.cc (Symbol::override_visibility): Define.
13057 (Symbol::override_base): Use override_visibility.
13058 (Symbol_table::resolve): Likewise.
13059 (Symbol::override_base_with_special): Likewise.
13060 (Symbol_table::override_with_special): If the visibility is hidden
13061 or internal, force the symbol to be local.
13062 * symtab.h (class Symbol): Add set_visibility and
13063 override_visibility.
13064 * testsuite/ver_test_1.sh: New file.
13065 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13066 (check_DATA): Add ver_test_1.syms.
13067 (ver_test_1.syms): New target.
13068 * testsuite/Makefile.in: Rebuild.
13069
13070 2009-02-25 Cary Coutant <ccoutant@google.com>
13071
13072 * layout.cc (Layout::choose_output_section): Don't rename sections
13073 when using a linker script that has a SECTIONS clause.
13074 * Makefile.in: Regenerate.
13075
13076 * testsuite/Makefile.am (script_test_5.sh): New test case.
13077 * testsuite/Makefile.in: Regenerate.
13078 * testsuite/script_test_5.cc: New file.
13079 * testsuite/script_test_5.sh: New file.
13080 * testsuite/script_test_5.t: New file.
13081
13082 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
13083
13084 * archive.cc (Archive::include_member): Update calls to add_symbols.
13085 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13086 the Layout argument.
13087 * dynobj.h (do_add_symbols): Add the Layout argument.
13088 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13089 Layout argument.
13090 * object.h (Object::add_symbols): Add the Layout argument.
13091 (Object::do_add_symbols): Add the Layout argument.
13092 (Sized_relobj::do_add_symbols): Add the Layout argument.
13093 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13094 Unify the two versions.
13095 (Add_plugin_symbols): Remove.
13096 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13097 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13098 (Add_plugin_symbols): Remove.
13099 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13100 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13101 (Add_symbols::run): Make it work with Pulginobj.
13102
13103 2009-02-06 Ian Lance Taylor <iant@google.com>
13104
13105 * object.cc (Sized_relobj::do_layout): Make info message start
13106 with lower case letter.
13107
13108 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13109
13110 * binary.cc: Fix file comment.
13111
13112 * options.h (enum Incremental_disposition): Define.
13113 (class General_options): Add new options: --incremental,
13114 --incremental_changed, --incremental_unchanged,
13115 --incremental_unknown. Add incremental_disposition_ and
13116 implicit_incremental_ fields.
13117 (General_options::incremental_disposition): New function.
13118 (class Position_dependent_options): Add incremental_disposition
13119 option.
13120 (Position_dependent_options::copy_from_options): Set incremental
13121 dispositions.
13122 * options.cc (General_options::parse_incremental_changed): New
13123 function.
13124 (General_options::parse_incremental_unchanged): New function.
13125 (General_options::parse_incremental_unknown): New function.
13126 (General_options::General_options): Initialize new fields
13127 incremental_disposition_ and implicit_incremental_.
13128 (General_options::finalize): Check for uasge of --incremental-*
13129 without --incremental.
13130
13131 2009-02-06 Chris Demetriou <cgd@google.com>
13132
13133 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13134 pointer and to report location as the file name associated with
13135 the symbol.
13136 (gold_undefined_symbol_at_location): New function to replace the
13137 old gold_undefined_symbol functionality.
13138 * target-reloc.h (relocate_section): Update to use
13139 gold_undefined_symbol_at_location.
13140 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13141 Call gold_undefined_symbol function rather than gold_error.
13142 * errors.h (Errors::undefined_symbol): Take location as a
13143 string, rather than calculating it from a relocation.
13144 * errors.cc (Errors::fatal): Print "fatal error:" before the
13145 formatted message.
13146 (Errors::error, Errors::error_at_location): Print "error: "
13147 before the formatted message.
13148 (Errors::undefined_symbol): Take location as a string, rather
13149 than calculating it from a relocation.
13150 (gold_undefined_symbol_at_location): New function akin to
13151 old gold_undefined_symbol, calculates location from relocation.
13152 (gold_undefined_symbol): Change to take only a Symbol pointer
13153 and to report location as the file name associated with the symbol.
13154 * testsuite/debug_msg.sh: Update for changed error messages.
13155 * testsuite/undef_symbol.sh: Likewise.
13156
13157 2009-02-04 Duncan Sands <baldrick@free.fr>
13158
13159 PR 9812
13160 * reduced_debug_output.h
13161 (Output_reduced_debug_abbrev_section::failed): Use format for
13162 gold_warning.
13163 (Output_reduced_debug_info_section::faild): Likewise.
13164
13165 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13166
13167 * script.cc (Lazy_demangler): New class.
13168 (Version_script_info::get_symbol_version_helper): Demangle a
13169 symbol only once.
13170
13171 2009-01-29 Cary Coutant <ccoutant@google.com>
13172
13173 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13174 to __tls_get_addr.
13175 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13176
13177 2009-01-28 Ian Lance Taylor <iant@google.com>
13178
13179 * version.cc (version_string): Bump to 1.9.
13180
13181 * gold.h: Include <cstring> and <stdint.h>.
13182 * version.cc: Include <cstdio>.
13183 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13184 warning.
13185 * reduced_debug_output.cc (insert_into_vector): Rename from
13186 Insert_into_vector; change all callers. Use Swap_unaligned to
13187 avoid aliasing issue; remove union since it is unnecessary.
13188
13189 2009-01-27 Sriraman Tallam <tmsriram@google.com>
13190
13191 * Makefile.am (CCFILES): Add gc.cc.
13192 (HFILES): Add gc.h.
13193 * Makefile.in: Regenerate.
13194 * gold.cc (Gc_runner): New class.
13195 (queue_initial_tasks): Call garbage collection related tasks
13196 when corresponding options are invoked.
13197 (queue_middle_gc_tasks): New function.
13198 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13199 processed early before laying out sections during garbage collection.
13200 * gold.h (queue_middle_gc_tasks): New function.
13201 (is_prefix_of): Move from "layout.cc".
13202 * i386.cc (Target_i386::gc_process_relocs): New function.
13203 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13204 * main.cc (main): Create object of class "Garbage_collection".
13205 * object.cc (Relobj::copy_symbols_data): New function.
13206 (Relobj::is_section_name_included): New function.
13207 (Sized_relobj::do_layout): Allow this function to be called twice
13208 during garbage collection and defer layout of section during the
13209 first call.
13210 * object.h (Relobj::get_symbols_data): New function.
13211 (Relobj::is_section_name_included): New function.
13212 (Relobj::copy_symbols_data): New function.
13213 (Relobj::set_symbols_data): New function.
13214 (Relobj::get_relocs_data): New function.
13215 (Relobj::set_relocs_data): New function.
13216 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13217 (Relobj::gc_process_relocs): New function.
13218 (Relobj::do_gc_process_relocs): New pure virtual function.
13219 (Relobj::sd_): New data member.
13220 (Sized_relobj::is_output_section_offset_invalid): New function.
13221 (Sized_relobj::do_gc_process_relocs): New function.
13222 * options.h (General_options::gc_sections): Modify to not be a no-op.
13223 (General_options::print_gc_sections): New option.
13224 * plugin.cc (Plugin_finish::run): Remove function call to
13225 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13226 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13227 * reloc.cc (Read_relocs::run): Add task to process relocs and
13228 determine unreferenced sections when doing garbage collection.
13229 (Gc_process_relocs): New class.
13230 (Sized_relobj::do_gc_process_relocs): New function.
13231 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13232 sections that are garbage collected.
13233 * reloc.h (Gc_process_relocs): New class.
13234 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13235 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13236 symbols whose corresponding sections are garbage collected.
13237 (Symbol_table::Symbol_table): Add new parameter for the garbage
13238 collection object.
13239 (Symbol_table::gc_mark_undef_symbols): New function.
13240 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13241 (Symbol_table::gc_mark_dyn_syms): New function.
13242 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13243 as garbage.
13244 (Symbol_table::add_from_object): Likewise.
13245 (Symbol_table::add_from_relobj): When building shared objects, do not
13246 treat externally visible symbols as garbage.
13247 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13248 table information for static and relocatable links.
13249 * symtab.h (Symbol_table::set_gc): New function.
13250 (Symbol_table::gc): New function.
13251 (Symbol_table::gc_mark_undef_symbols): New function.
13252 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13253 (Symbol_table::gc_mark_dyn_syms): New function.
13254 (Symbol_table::gc_): New data member.
13255 * target.h (Sized_target::gc_process_relocs): New pure virtual
13256 function.
13257 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13258 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13259
13260 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13261
13262 * options.h (General_options::gc_sections): Define as a no-op for now.
13263 (General_options::no_keep_memory): Ditto.
13264 (General_options::Bshareable): Define.
13265 * options.cc (General_options::finalize): Honor -Bshareable.
13266
13267 2009-01-20 Andreas Schwab <schwab@suse.de>
13268
13269 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13270 read the value in the contents, since we don't use it. Use the
13271 template endianness when writing.
13272 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13273
13274 2009-01-19 Andreas Schwab <schwab@suse.de>
13275
13276 * configure.tgt (powerpc64-*): Fix targ_obj.
13277
13278 2009-01-15 Ian Lance Taylor <iant@google.com>
13279
13280 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13281 local symbols when stripping all symbols.
13282
13283 2009-01-14 Cary Coutant <ccoutant@google.com>
13284
13285 * output.cc (Output_reloc): Add explicit instantiations.
13286
13287 2009-01-14 Cary Coutant <ccoutant@google.com>
13288
13289 * archive.cc (Archive::get_elf_object_for_member): Remove call
13290 to File_read::claim_for_plugin.
13291 * descriptors.cc (Descriptors::open): Remove reference to
13292 is_claimed.
13293 (Descriptors::claim_for_plugin): Remove.
13294 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13295 (Descriptors::is_claimed): Remove.
13296 (claim_descriptor_for_plugin): Remove.
13297 * fileread.cc (File_read::claim_for_plugin): Remove.
13298 * fileread.h (File_read::claim_for_plugin): Remove.
13299 (File_read::descriptor): Reopen descriptor if necessary.
13300 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13301 (Plugin_manager::all_symbols_read): Add task parameter. Change
13302 all callers.
13303 (Plugin_manager::get_input_file): New function.
13304 (Plugin_manager::release_input_file): New function.
13305 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13306 corresponding data member.
13307 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13308 and pass to base constructor. Change all callers.
13309 (get_input_file, release_input_file): New functions.
13310 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13311 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13312 (Plugin_manager::all_symbols_read): Add task parameter.
13313 (Plugin_manager::get_input_file): New function.
13314 (Plugin_manager::release_input_file): New function.
13315 (Plugin_manager::task_): New data member.
13316 (Pluginobj::Pluginobj): Add filesize parameter.
13317 (Pluginobj::filename): New function.
13318 (Pluginobj::descriptor): New function.
13319 (Pluginobj::filesize): New function.
13320 (Pluginobj::filesize_): New data member.
13321 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13322 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13323 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13324
13325 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13326 with archive libraries.
13327 * testsuite/Makefile.in: Regenerate.
13328 * testsuite/plugin_test.c (struct sym_info): New type.
13329 (get_input_file, release_input_file): New static variables.
13330 (onload): Capture new transfer vector entries.
13331 (claim_file_hook): Stop reading at end of file according to filesize.
13332 Factor out parsing of readelf output into separate function.
13333 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13334 APIs and get the source file name from the symbol table. Convert
13335 source file name to corresponding object file name. Print info
13336 message when adding new input files.
13337 (parse_readelf_line): New function.
13338 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13339 * testsuite/plugin_test_2.sh: Likewise.
13340 * testsuite/plugin_test_3.sh: Likewise.
13341 * testsuite/plugin_test_4.sh: New test case.
13342
13343 2009-01-07 Ian Lance Taylor <iant@google.com>
13344
13345 * version.cc (version_string): Bump to 1.8.
13346
13347 2008-12-23 Cary Coutant <ccoutant@google.com>
13348
13349 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13350 * plugin.cc (Plugin_manager::finish): Rename as
13351 layout_deferred_objects. Move cleanup to separate function.
13352 (Plugin_manager::cleanup): New function.
13353 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13354 separately.
13355 * plugin.h (Plugin_manager::finish): Rename as
13356 layout_deferred_objects.
13357 (Plugin_manager::cleanup): New function.
13358 (Plugin_manager::cleanup_done): New field.
13359
13360 2008-12-23 Cary Coutant <ccoutant@google.com>
13361
13362 * plugin.cc (is_visible_from_outside): New function.
13363 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13364 so we don't return "IR only" status for exported symbols or -r links.
13365
13366 * testsuite/Makefile.am (plugin_test_3): New test case.
13367 * testsuite/Makefile.in: Regenerate.
13368 * testsuite/plugin_test_3.sh: New file.
13369
13370 2008-12-22 Cary Coutant <ccoutant@google.com>
13371
13372 * object.cc (Sized_relobj::layout_section): New function.
13373 (Sized_relobj::do_layout): Defer layout of input sections until after
13374 plugin has provided replacement files.
13375 (Sized_relobj::do_layout_deferred_sections): New function.
13376 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13377 (Relobj::layout_deferred_sections): New function.
13378 (Relobj::do_layout_deferred_sections): New function.
13379 (Sized_relobj::do_layout_deferred_sections): New function.
13380 (Sized_relobj::layout_section): New function.
13381 (Sized_relobj::Deferred_layout): New structure.
13382 (Sized_relobj::deferred_layout_): New field.
13383 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13384 Change all callers. Layout deferred sections.
13385 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13386 references.
13387 (Plugin_hook::run): Move code from do_plugin_hook inline.
13388 (Plugin_hook::do_plugin_hook): Remove.
13389 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13390 (Plugin_manager::finish): Renamed, was cleanup.
13391 (Plugin_manager::should_defer_layout): New function.
13392 (Plugin_manager::add_deferred_layout_object): New function.
13393 (Plugin_manager::Deferred_layout_list): New type.
13394 (Plugin_manager::deferred_layout_objects_): New field.
13395 (Plugin_hook::do_plugin_hook): Remove.
13396
13397 2008-12-17 Ian Lance Taylor <iant@google.com>
13398
13399 * options.h (class General_options): Add --no case for
13400 --export-dynamic.
13401
13402 2008-12-16 Cary Coutant <ccoutant@google.com>
13403
13404 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13405 vector.
13406 (Plugin_manager::claim_file): Create plugin object even if
13407 plugin did not call the add_symbols callback.
13408 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13409 asking for more symbols than were added.
13410 * testsuite/Makefile.am (plugin_test_1): Add test case with
13411 no global symbols.
13412 (empty.syms): New target.
13413 * testsuite/Makefile.in: Regenerate.
13414 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13415 message. Don't call add_symbols if no globals.
13416 (all_symbols_read_hook): Don't provide replacement for empty
13417 claimed file.
13418
13419 2008-12-12 Ian Lance Taylor <iant@google.com>
13420
13421 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13422 r_type == 0 for a local symbol with r_sym == 0.
13423 (scan_relocatable_relocs): Pass r_sym to
13424 local_non_section_strategy.
13425 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13426 r_sym parameter.
13427
13428 * configure.ac: Update test for TLS descriptors: they are
13429 supported as of glibc 2.9.
13430 * configure: Rebuild.
13431
13432 2008-12-11 Ian Lance Taylor <iant@google.com>
13433
13434 PR 7091
13435 * target-reloc.h (Default_scan_relocatable_relocs): For each
13436 function, map r_type == 0 to RELOC_DISCARD.
13437
13438 2008-12-10 Cary Coutant <ccoutant@google.com>
13439
13440 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13441 object to override a kept COMDAT group from a plugin object.
13442
13443 2008-12-09 Ian Lance Taylor <iant@google.com>
13444
13445 PR 7088
13446 * yyscript.y (file_cmd): Handle INPUT.
13447
13448 * testsuite/initpri1.c: Change all declarations to be full
13449 prototypes by adding void, to avoid compiler warnings.
13450
13451 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
13452
13453 * options.cc (General_options::parse_plugin_opt): New.
13454 (General_options::add_plugin): The argument now is just the filename.
13455 (General_options::add_plugin_option): New.
13456 * options.h (plugin_opt): New.
13457 (add_plugin): Change argument name.
13458 (add_plugin_option): New.
13459 * plugin.cc (Plugin::load): Don't parse the plugin option.
13460 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13461 (Plugin::add_option): New.
13462 (Plugin::args_): Change type.
13463 (Plugin::filename_): New.
13464 (Plugin_manager::add_plugin_option): New.
13465 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13466 * testsuite/Makefile.in: Regenerate.
13467
13468 2008-12-05 Cary Coutant <ccoutant@google.com>
13469
13470 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13471 Handle --strip-lto-sections option.
13472 * options.h (strip_lto_sections): New option.
13473
13474 2008-12-01 Cary Coutant <ccoutant@google.com>
13475
13476 * plugin.cc (ld_plugin_message): Change format parameter to const.
13477 Fix mismatch between new[] and delete.
13478
13479 2008-11-14 Cary Coutant <ccoutant@google.com>
13480
13481 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13482 instead of -1U.
13483
13484 2008-11-05 Craig Silverstein <csilvers@google.com>
13485
13486 * options.cc (General_options::parse_dynamic_list): New function.
13487 * options.h (General_options): New flags dynamic_list,
13488 dynamic_list_data, dynamic_list_cpp_new, and
13489 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13490 (General_options::in_dynamic_list): New function.
13491 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13492 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13493 (Lex::can_continue_name): Likewise.
13494 (yylex): Likewise.
13495 (read_script_file): New parameter script_options.
13496 (read_dynamic_list): New function.
13497 (Script_options::define_dynamic_list): New function.
13498 (dynamic_list_keyword_parsecodes): New variable.
13499 (dynamic_list_keywords): New variable.
13500 * script.h (Script_options::define_dynamic_list): New function
13501 prototype.
13502 (read_dynamic_list): New function prototype.
13503 * symtab.cc (strprefix): New macro.
13504 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13505 dynamic_list_data, dynamic_list_cpp_new, and
13506 dynamic_list_cpp_typeinfo.
13507 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13508 (dynamic_list_expr): New rule.
13509 (dynamic_list_nodes): Likewise.
13510 (dynamic_list_node): Likewise.
13511 * testsuite/Makefile.am (dynamic_list): New test.
13512 * testsuite/Makefile.in: Regenerated.
13513 * testsuite/dynamic_list.t: New file.
13514 * testsuite/dynamic_list.sh: New file.
13515
13516 2008-11-05 Craig Silverstein <csilvers@google.com>
13517
13518 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13519 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13520 (t11_last): Likewise.
13521 * testsuite/ver_test_6.c (main): Likewise.
13522
13523 2008-10-07 Cary Coutant <ccoutant@google.com>
13524
13525 * options.c (General_options::finalize): Add check for -static and
13526 -shared.
13527 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13528 is not empty.
13529
13530 2008-10-02 Cary Coutant <ccoutant@google.com>
13531
13532 * plugin.cc (make_sized_plugin_object): Fix conditional
13533 compilation to work when not all targets are enabled.
13534
13535 2008-09-29 Cary Coutant <ccoutant@google.com>
13536
13537 * archive.cc (Archive::get_file_and_offset): Use filename instead
13538 of name to get library path.
13539 (Archive::include_member): Unlock external member of a thin archive.
13540
13541 * testsuite/Makefile.am (TEST_AR): New variable.
13542 (thin_archive_test_1): New test.
13543 (thin_archive_test_2): New test.
13544 * testsuite/Makefile.in: Regenerate.
13545 * testsuite/thin_archive_main.cc: New file.
13546 * testsuite/thin_archive_test_1.cc: New file.
13547 * testsuite/thin_archive_test_2.cc: New file.
13548 * testsuite/thin_archive_test_3.cc: New file.
13549 * testsuite/thin_archive_test_4.cc: New file.
13550
13551 2008-09-29 Cary Coutant <ccoutant@google.com>
13552
13553 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13554 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13555 instead of -1U.
13556 (Sized_relobj::do_finalize_local_symbols): Likewise.
13557 (Sized_relobj::map_to_kept_section): Likewise.
13558 * object.h (Sized_relobj::invalid_address): New constant.
13559 (Sized_relobj::do_output_section_offset): Check for invalid_address
13560 and return -1ULL.
13561 * output.cc (Output_reloc::local_section_offset): Use constant
13562 invalid_address instead of -1U.
13563 (Output_reloc::get_address): Likewise.
13564 (Output_section::output_address): Change -1U to -1ULL.
13565 * output.h (Output_reloc::invalid_address): New constant.
13566 * reloc.cc (Sized_relobj::write_sections): Use constant
13567 invalid_address instead of -1U.
13568 (Sized_relobj::relocate_sections): Likewise.
13569 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13570 values for merge sections.
13571 * target-reloc.h (relocate_for_relocatable): Use constant
13572 invalid_address instead of -1U.
13573
13574 2008-09-19 Cary Coutant <ccoutant@google.com>
13575
13576 Add plugin functionality for link-time optimization (LTO).
13577 * configure.ac (plugins): Add --enable-plugins option.
13578 * configure: Regenerate.
13579 * config.in: Regenerate.
13580 * Makefile.am (LIBDL): New variable.
13581 (CCFILES): Add plugin.cc.
13582 (HFILES): Add plugin.h.
13583 (ldadd_var): Add LIBDL.
13584 * Makefile.in: Regenerate.
13585
13586 * archive.cc: Include "plugin.h".
13587 (Archive::setup): Don't preread archive symbols when using a plugin.
13588 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
13589 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
13590 files.
13591 (Archive::include_member): Add symbols from plugin objects.
13592 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
13593 * descriptors.cc (Descriptors::open): Check for file descriptors
13594 abandoned by plugins.
13595 (Descriptors::claim_for_plugin): New function.
13596 * descriptors.h (Descriptors::claim_for_plugin): New function.
13597 (Open_descriptor::is_claimed): New field.
13598 (claim_descriptor_for_plugin): New function.
13599 * fileread.cc (File_read::claim_for_plugin): New function.
13600 * fileread.h (File_read::claim_for_plugin): New function.
13601 (File_read::descriptor): New function.
13602 * gold.cc: Include "plugin.h".
13603 (queue_initial_tasks): Add task to call plugin hooks for generating
13604 new object files.
13605 * main.cc: Include "plugin.h".
13606 (main): Load plugin libraries.
13607 * object.h (Pluginobj): Declare.
13608 (Object::pluginobj): New function.
13609 (Object::do_pluginobj): New function.
13610 (Object::set_target): New function.
13611 * options.cc: Include "plugin.h".
13612 (General_options::parse_plugin): New function.
13613 (General_options::General_options): Initialize plugins_ field.
13614 (General_options::add_plugin): New function.
13615 * options.h (Plugin_manager): Declare.
13616 (General_options): Add --plugin option.
13617 (General_options::has_plugins): New function.
13618 (General_options::plugins): New function.
13619 (General_options::add_plugin): New function.
13620 (General_options::plugins_): New field.
13621 * plugin.cc: New file.
13622 * plugin.h: New file.
13623 * readsyms.cc: Include "plugin.h".
13624 (Read_symbols::do_read_symbols): Check for archive before checking
13625 for ELF file. Call plugin hooks to claim files.
13626 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
13627 from a real object file; force override when processing replacement
13628 files.
13629 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
13630 (Symbol::init_base_object): Likewise.
13631 (Symbol::init_base_output_data): Likewise.
13632 (Symbol::init_base_output_segment): Likewise.
13633 (Symbol::init_base_constant): Likewise.
13634 (Symbol::init_base_undefined): Likewise.
13635 (Symbol::output_section): Assert that object is not a plugin.
13636 (Symbol_table::add_from_pluginobj): New function.
13637 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
13638 undefined.
13639 (Symbol_table::sized_write_globals): Likewise.
13640 (Symbol_table::add_from_pluginobj): Instantiate template.
13641 * symtab.h (Sized_pluginobj): Declare.
13642 (Symbol::in_real_elf): New function.
13643 (Symbol::set_in_real_elf): New function.
13644 (Symbol::in_real_elf_): New field.
13645 (Symbol_table::add_from_pluginobj): New function.
13646
13647 * testsuite/Makefile.am (AM_CFLAGS): New variable.
13648 (LIBDL): New variable.
13649 (LDADD): Add LIBDL.
13650 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
13651 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
13652 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
13653 (MOSTLYCLEANFILES): Likewise.
13654 * testsuite/Makefile.in: Regenerate.
13655 * testsuite/plugin_test.c: New file.
13656 * testsuite/plugin_test_1.sh: New file.
13657 * testsuite/plugin_test_2.sh: New file.
13658
13659 2008-09-16 Ian Lance Taylor <iant@google.com>
13660
13661 * target-reloc.h (relocate_section): Check whether a symbol is
13662 defined by the ABI before reporting an undefined symbol error.
13663 * target.h (Target::is_defined_by_abi): Make parameter const.
13664 (Target::do_is_defined_by_abi): Likewise.
13665 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
13666 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
13667 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
13668 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
13669 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
13670 * testsuite/Makefile.in: Rebuild.
13671
13672 * fileread.cc (make_view): Add casts to avoid warning.
13673
13674 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
13675
13676 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
13677 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13678
13679 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
13680
13681 * options.h (General_options::output_is_executable): New.
13682 (General_options::output_is_pie): New.
13683 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
13684 for shared libraries.
13685 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13686
13687 2008-09-11 Chris Demetriou <cgd@google.com>
13688
13689 * options.h (origin): New -z option.
13690 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
13691 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
13692 in DT_FLAGS_1.
13693
13694 2008-09-05 Cary Coutant <ccoutant@google.com>
13695
13696 * fileread.cc (File_read::make_view): Add check for attempt to map
13697 beyond end of file.
13698
13699 2008-09-05 Cary Coutant <ccoutant@google.com>
13700
13701 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
13702 explicit instantiations.
13703
13704 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
13705
13706 PR gold/6858
13707 * options.cc (General_options::finalize): Allow undefined symbols
13708 in shlibs if linking -shared.
13709
13710 PR gold/6859
13711 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
13712 symbols as not needing a dynsym entry.
13713
13714 2008-08-20 Craig Silverstein <csilvers@google.com>
13715
13716 * fileread.cc (File_read::open): Do not lock the file unless it
13717 was successfully opened.
13718
13719 2008-08-14 Cary Coutant <ccoutant@google.com>
13720
13721 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
13722 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
13723 * testsuite/tls_test.cc (struct int128): 128-bit struct
13724 for testing TLS relocs with non-zero addend.
13725 (v12): New TLS variable.
13726 (t12): New test.
13727 (t_last): Add check for v12.
13728 * testsuite/tls_test.h (t12): New function.
13729 * testsuite/tls_test_main.cc (thread_routine): Call new test.
13730
13731 2008-08-13 Ian Lance Taylor <iant@google.com>
13732
13733 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
13734 set tls_segment_ or relro_segment_.
13735 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
13736 when appropriate.
13737 * output.h (Output_section::clear_is_relro): New function.
13738 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
13739 sections specially even when output_data_ is empty.
13740 (Output_segment::maximum_alignment): When first section is relro,
13741 only force alignment for PT_LOAD segments.
13742 * script.cc (script_data_segment_align): New function.
13743 (script_data_segment_relro_end): New function.
13744 * script-c.h (script_data_segment_align): Declare.
13745 (script_data_segment_relro_end): Declare.
13746 * script-sections.h (class Script_sections): Declare
13747 data_segment_align and data_segment_relro_end. Add fields
13748 segment_align_index_ and saw_relro_end_.
13749 * script-sections.cc (class Sections_element): Add set_is_relro
13750 virtual function. Add new bool* parameter to place_orphan_here.
13751 Add get_output_section virtual function.
13752 (class Output_section_definition): Add set_is_relro. Add new
13753 bool* parameter to place_orphan_here. Add get_output_section.
13754 Add is_relro_ field.
13755 (Output_section_definition::Output_section_definition): Initialize
13756 evaluated_address_, evaluated_load_address, evaluated_addralign_,
13757 and is_relro_ fields.
13758 (Output_section_definition::place_orphan_here): Add is_relro
13759 parameter.
13760 (Output_section_definition::set_section_addresses): Set relro for
13761 output section.
13762 (Output_section_definition::alternate_constraint): Likewise.
13763 (class Orphan_output_section): Add new bool* parameter to
13764 place_orphan_here. Add get_output_section.
13765 (Orphan_output_section::place_orphan_here): Add is_relro
13766 parameter.
13767 (Script_sections::Script_sections): Initialize
13768 data_segment_align_index_ and saw_relro_end_.
13769 (Script_sections::data_segment_align): New function.
13770 (Script_sections::data_segment_relro_end): New function.
13771 (Script_sections::place_orphan): Set or clear is_relro.
13772 (Script_sections::set_section_addresses): Force alignment of first
13773 TLS section.
13774 * yyscript.y (exp): Call script_data_segment_align and
13775 script_data_segment_relro_end.
13776 * testsuite/relro_script_test.t: New file.
13777 * testsuite/relro_test.cc (using_script): Declare.
13778 (t1, t2): Test using_script.
13779 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
13780 (relro_script_test_SOURCES): Define.
13781 (relro_script_test_DEPENDENCIES): Define.
13782 (relro_script_test_LDFLAGS): Define.
13783 (relro_script_test_LDADD): Define.
13784 (relro_script_test.so): New target.
13785 * testsuite/Makefile.in: Rebuild.
13786
13787 2008-08-06 Cary Coutant <ccoutant@google.com>
13788
13789 * archive.cc (Archive::total_archives, Archive::total_members)
13790 (Archive::total_members_loaded): New variables.
13791 (Archive::setup): Add parameter. Add option to preread
13792 archive symbols.
13793 (Archive::read_armap): Add counter.
13794 (Archive::get_file_and_offset): New function.
13795 (Archive::get_elf_object_for_member): New function.
13796 (Archive::read_all_symbols): New function.
13797 (Archive::read_symbols): New function.
13798 (Archive::add_symbols): Add counters.
13799 (Archive::include_all_members): Use armap to find members if it's
13800 already built.
13801 (Archive::include_member): Skip reading symbols if already read.
13802 Factored code into Archive::get_file_and_offset and
13803 Archive::get_elf_object_for_member. Changed call to
13804 Mapfile::report_include_archive_member.
13805 (Archive::print_stats): New function.
13806 * archive.h: Declare Object and Read_symbols_data classes.
13807 (Archive::Archive): Add initializers for new members.
13808 (Archive::setup): Add parameter.
13809 (Archive::print_stats): New function.
13810 (Archive::total_archives, Archive::total_members)
13811 (Archive::total_members_loaded): New variables.
13812 (Archive::get_file_and_offset): New function.
13813 (Archive::get_elf_object_for_member): New function.
13814 (Archive::read_all_symbols): New function.
13815 (Archive::read_symbols): New function.
13816 (Archive::Archive_member): New class.
13817 (Archive::members_): New member.
13818 (Archive::num_members_): New member.
13819 * main.cc: Include archive.h.
13820 (main): Call Archive::print_stats.
13821 * mapfile.cc (Mapfile::report_include_archive_member): Delete
13822 archive parameter; member_name is now the fully-decorated name.
13823 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
13824 * options.h: (General_options): Add --preread-archive-symbols option.
13825 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
13826 Archive::setup.
13827
13828 2008-08-04 Ian Lance Taylor <iant@google.com>
13829
13830 * symtab.h (Symbol::use_plt_offset): New function.
13831 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
13832 * powerpc.cc (Relocate::relocate): Likewise.
13833 * sparc.cc (Relocate::relocate): Likewise.
13834 * x86_64.cc (Relocate::relocate): Likewise.
13835 * testsuite/weak_plt.sh: New test.
13836 * testsuite/weak_plt_main.cc: New test.
13837 * testsuite/weak_plt_shared.cc: New test.
13838 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
13839 (check_PROGRAMS): Add weak_plt.
13840 (check_DATA): Add weak_plt_shared.so.
13841 (weak_plt_main_pic.o, weak_plt): New targets.
13842 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
13843 * testsuite/Makefile.in: Rebuild.
13844
13845 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
13846 gcctestdir/ld.
13847 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
13848 * testsuite/Makefile.in: Rebuild.
13849
13850 2008-08-04 Alan Modra <amodra@bigpond.net.au>
13851
13852 * Makefile.am (POTFILES.in): Set LC_ALL=C.
13853 * Makefile.in: Regenerate.
13854 * po/POTFILES.in: Regenerate.
13855
13856 2008-07-29 Ian Lance Taylor <iant@google.com>
13857
13858 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
13859 symbols before other symbols.
13860 * testsuite/script_test_2.cc (test_addr): Declare.
13861 (test_addr_alias): Declare.
13862 (main): Check that test_addr and test_addr_alias have the right
13863 values.
13864 * testsuite/script_test_2.t: Define test_addr_alias and
13865 test_addr.
13866
13867 2008-07-24 Ian Lance Taylor <iant@google.com>
13868
13869 PR 5990
13870 * descriptors.cc: New file.
13871 * descriptors.h: New file.
13872 * gold-threads.h (class Hold_optional_lock): New class.
13873 * fileread.cc: Include "descriptors.h".
13874 (File_read::~File_read): Release descriptor rather than closing
13875 it.
13876 (File_read::open) [file]: Call open_descriptor rather than open.
13877 Set is_descriptor_opened_.
13878 (File_read::open) [memory]: Assert that descriptor is not open.
13879 (File_read::reopen_descriptor): New function.
13880 (File_read::release): Release descriptor.
13881 (File_read::do_read): Make non-const. Reopen descriptor.
13882 (File_read::read): Make non-const.
13883 (File_read::make_view): Reopen descriptor.
13884 (File_read::do_readv): Likewise.
13885 * fileread.h (class File_read): Add is_descriptor_opened_ field.
13886 Update declarations.
13887 * layout.cc: Include "descriptors.h".
13888 (Layout::create_build_id): Use open_descriptor rather than open.
13889 * output.cc: Include "descriptors.h".
13890 (Output_file::open): Use open_descriptor rather than open.
13891 * archive.cc (Archive::const_iterator): Change Archive to be
13892 non-const.
13893 (Archive::begin, Archive::end): Make non-const.
13894 (Archive::count_members): Likewise.
13895 * archive.h (class Archive): Update declarations.
13896 * object.h (Object::read): Make non-const.
13897 * Makefile.am (CCFILES): Add descriptors.cc.
13898 (HFILES): Add descriptors.h.
13899 * Makefile.in: Rebuild.
13900
13901 PR 6716
13902 * gold.h: Always include <clocale>. Add Solaris workarounds
13903 following code in binutils/sysdep.h.
13904
13905 PR 6048
13906 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
13907 this->eh_frame_hdr_ is NULL before using it.
13908
13909 * dynobj.cc (Versions::Versions): Update comment.
13910
13911 * dynobj.cc (Versions::Versions): If there is an soname, use it as
13912 the base version name.
13913
13914 * stringpool.cc (Stringpool_template::add_with_length): Set key to
13915 array size plus one.
13916 (Stringpool_template::set_string_offsets): Subtract one from key
13917 before using it as an array index.
13918 (Stringpool_template::get_offset_with_length): Likewise.
13919 (Stringpool_template::write_to_buffer): Likewise.
13920 * stringpool.h (Stringpool_template::get_offset_from_key):
13921 Likewise.
13922
13923 2008-07-23 Ian Lance Taylor <iant@google.com>
13924
13925 PR 6658
13926 * object.h (Merged_symbol_value::value): Do our best to handle a
13927 negative addend.
13928
13929 PR 6647
13930 * script.cc (Version_script_info::get_versions): Don't add empty
13931 version tag to return value.
13932 (Version_script_info::get_symbol_version_helper): Change return
13933 type to bool. Add pversion parameter. Change all callers.
13934 (script_register_vers_node): Don't require a non-NULL tag.
13935 * script.h (class Version_script_info): Update declarations.
13936 (Version_script_info::get_symbol_version): Change return type to
13937 bool. Add version parameter. Change all callers.
13938 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
13939 handling. Handle an empty version from a version script.
13940 (Symbol_table::define_special_symbol): Likewise.
13941 * testsuite/ver_test_10.script: New file.
13942 * testsuite/ver_test_10.sh: New file.
13943 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
13944 (check_DATA): Add ver_test_10.syms.
13945 (ver_test_10.syms, ver_test_10.so): New target.
13946 * testsuite/Makefile.in: Rebuild.
13947
13948 2008-07-23 Simon Baldwin <simonb@google.com>
13949
13950 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
13951 to zero for undefined symbols from dynamic libraries.
13952
13953 2008-07-23 Ian Lance Taylor <iant@google.com>
13954
13955 * symtab.cc (Symbol_table::resolve): Remove version parameter.
13956 Change all callers.
13957 * symtab.h (class Symbol_table): Update declaration.
13958 * testsuite/ver_test_9.cc: New file.
13959 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
13960 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
13961 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
13962 (ver_test_9.so, ver_test_9.o): New targets.
13963 * testsuite/Makefile.in: Rebuild.
13964
13965 2008-07-22 Ian Lance Taylor <iant@google.com>
13966
13967 * options.h (class General_options): Define --check-sections.
13968 * layout.cc (Layout::set_segment_offsets): Handle
13969 --check-sections.
13970
13971 * options.h (class General_options): Define -n/--nmagic and
13972 -N/--omagic.
13973 * options.cc (General_options::finalize): For -n/--nmagic or
13974 -N/--omagic, set -static.
13975 * layout.cc (Layout::attach_allocated_section_to_segment): If
13976 -N/--omagic, don't put read-only and read-write sections in
13977 different segments.
13978 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
13979 finding a read-only segment.
13980 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
13981 don't set the minimum segment alignment to the common page size,
13982 and don't set the file offset to the address modulo the page size.
13983 * script-sections.cc (Script_sections::create_segments): If
13984 -n/--omagic, don't put read-only and read-write sections in
13985 different segments.
13986
13987 * cref.cc: New file.
13988 * cref.h: New file.
13989 * options.h (class General_options): Add --print-symbol-counts.
13990 * main.cc (main): Issue defined symbol report if requested.
13991 * archive.cc (Archive::interpret_header): Make into a const member
13992 function.
13993 (Archive::add_symbols): Call Input_objects::archive_start and
13994 archive_stop.
13995 (Archive::const_iterator): Define new class.
13996 (Archive::begin, Archive::end): New functions.
13997 (Archive::include_all_members): Rewrite to use iterator.
13998 (Archive::count_members): New function.
13999 * archive.h (class Archive): Update declarations.
14000 (Archive::filename): New function.
14001 * object.cc: Include "cref.h".
14002 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14003 (Sized_relobj::do_get_global_symbol_counts): New function.
14004 (Input_objects::add_object): Add object to cross-referencer.
14005 (Input_objects::archive_start): New function.
14006 (Input_objects::archive_stop): New function.
14007 (Input_objects::print_symbol_counts): New function.
14008 * object.h: Declare Cref and Archive.
14009 (Object::get_global_symbol_counts): New function.
14010 (Object::do_get_global_symbol_counts): New pure virtual function.
14011 (class Sized_relobj): Add defined_count_ field. Update
14012 declarations.
14013 (class Input_objects): Add cref_ field. Update constructor.
14014 Update declarations.
14015 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14016 defined_count_.
14017 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14018 symbol counts.
14019 (Sized_dynobj::do_get_global_symbol_counts): New function.
14020 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14021 defined_count_. Update declarations. Define Symbols typedef.
14022 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14023 parameter. Change all callers.
14024 (Symbol_table::add_from_dynobj): Add sympointers and defined
14025 parameters. Change all callers.
14026 * symtab.h (class Symbol_table): Update declarations.
14027 * Makefile.am (CCFILES): Add cref.cc.
14028 (HFILES): Add cref.h.
14029 * Makefile.in: Rebuild.
14030
14031 2008-07-22 Simon Baldwin <simonb@google.com>
14032
14033 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14034 to zero when writing undefined symbols.
14035
14036 2008-07-22 Ian Lance Taylor <iant@google.com>
14037
14038 * output.cc (Output_section::add_input_section): Don't try to
14039 merge empty merge sections.
14040
14041 2008-07-21 Craig Silverstein <csilvers@google.com>
14042
14043 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14044 Include symbol version in error message.
14045
14046 2008-07-20 Chris Demetriou <cgd@google.com>
14047
14048 * configure.ac (gold_cv_c_random_seed): New configured variable.
14049 (RANDOM_SEED_CFLAGS): New substituted variable.
14050 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14051 * configure: Rebuild.
14052 * Makefile.in: Likewise.
14053 * testsuite/Makefile.in: Likewise.
14054
14055 2008-07-18 Ian Lance Taylor <iant@google.com>
14056
14057 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14058 where we see NAME/NULL and NAME/VERSION as separate symbols.
14059 * testsuite/ver_test_main.cc (main): Call t4.
14060 (t4, t4_2a): Define.
14061 * testsuite/ver_test_2.cc (t4_2): Define.
14062 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14063 * testsuite/ver_test_4.cc (t4_2a): Define.
14064 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14065 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14066
14067 2008-07-17 Ian Lance Taylor <iant@google.com>
14068
14069 * dynobj.cc (Versions::add_def): If we give an error about a
14070 missing version, go ahead and create the version anyhow.
14071
14072 2008-07-10 Ian Lance Taylor <iant@google.com>
14073
14074 Handle output sections with more than 0x7fffffff bytes.
14075 * object.h (class Relobj): Change map_to_output_ to
14076 output_sections_, and just keep a section pointer. Change all
14077 uses. Move comdat group support to Sized_relobj.
14078 (Relobj::is_section_specially_mapped): Remove.
14079 (Relobj::output_section): Remove poff parameter. Change all
14080 callers.
14081 (Relobj::output_section_offset): New function.
14082 (Relobj::set_section_offset): Rewrite.
14083 (Relobj::map_to_output): Remove.
14084 (Relobj::output_sections): New function.
14085 (Relobj::do_output_section_offset): New pure virtual function.
14086 (Relobj::do_set_section_offset): Likewise.
14087 (class Sized_relobj): Add section_offsets_ field. Add comdat
14088 group support from Relobj. Update declarations.
14089 (Sized_relobj::get_output_section_offset): New function.
14090 (Sized_relobj::do_output_section_offset): New function.
14091 (Sized_relobj::do_set_section_offset): New function.
14092 * object.cc (Relobj::output_section_address): Remove.
14093 (Sized_relobj::Sized_relobj): Initialize new fields.
14094 (Sized_relobj::include_section_group): Cast find_kept_object to
14095 Sized_relobj.
14096 (Sized_relobj::include_linkonce_section): Likewise.
14097 (Sized_relobj::do_layout): Use separate arrays for output section
14098 and output offset.
14099 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14100 output_sections.
14101 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14102 output_sections and section_offsets.
14103 (Sized_relobj::write_local_symbols): Likewise.
14104 (map_to_kept_section): Compute output address directly.
14105 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14106 output_sections and section_offsets.
14107 (Sized_relobj::write_sections): Likewise.
14108 (Sized_relobj::relocate_sections): Likewise.
14109 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14110 * output.h (class Output_reloc): Update declarations. Change
14111 u2_.relobj to Sized_relobj*.
14112 (class Output_data_reloc): Change add functions to use
14113 Sized_relobj*.
14114 * output.cc (Output_reloc::Output_reloc): Change relobj to
14115 Sized_relobj*.
14116 (Output_reloc::local_section_offset): Change return type to
14117 Elf_Addr. Use get_output_section_offset.
14118 (Output_reloc::get_address): Likewise.
14119 (Output_section::is_input_address_mapped): Don't call
14120 is_section_specially_mapped.
14121 (Output_section::output_offset): Likewise.
14122 (Output_section::output_address): Likewise.
14123 (Output_section::starting_output_address): Likewise.
14124 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14125 parameter to Sized_relobj*.
14126 (Copy_relocs::need_copy_reloc): Likewise.
14127 (Copy_relocs::save): Likewise.
14128 * copy-relocs.h (class Copy_relocs): Update declarations.
14129 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14130 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14131 * target-reloc.h (relocate_for_relocatable): Change
14132 offset_in_output_section type to Elf_Addr. Change code that uses
14133 it as well.
14134 * layout.cc (Layout::layout): Always set *off.
14135 * mapfile.cc (Mapfile::print_input_section): Use
14136 output_section_offset.
14137 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14138 Sized_relobj*.
14139 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14140 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14141 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14142
14143 2008-07-03 Ian Lance Taylor <iant@google.com>
14144
14145 * layout.cc (Layout::include_section): Do not discard unrecognized
14146 SHT_STRTAB sections.
14147
14148 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14149
14150 * script.cc (Lex::can_continue_name): Make '?' allowable in
14151 version-script names.
14152 * testsuite/version_script.map: Change glob pattern to use '?'
14153
14154 2008-06-30 Manish Singh <yosh@gimp.org>
14155
14156 PR 6585
14157 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14158 Correct typo.
14159
14160 2008-06-30 Ian Lance Taylor <iant@google.com>
14161
14162 PR 6660
14163 PR 6682
14164 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14165 versions]: Don't try to read the value in the contents, since we
14166 don't use it. Use the template endianness when writing.
14167
14168 2008-06-25 Cary Coutant <ccoutant@google.com>
14169
14170 * fileread.cc (File_read::make_view): Assert on zero-length view.
14171 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14172 symbol table when there are no symbols to read.
14173
14174 2008-06-23 Craig Silverstein <csilvers@google.com>
14175
14176 * version.cc (version_string): Bump to 1.7
14177
14178 2008-06-18 Craig Silverstein <csilvers@google.com>
14179
14180 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14181 constant 0xFFFF to type Valtype.
14182 (Powerpc_relocate_functions::rel16_ha): Likewise.
14183
14184 2008-06-17 Ian Lance Taylor <iant@google.com>
14185
14186 * output.h (Output_section::Input_section): Initialize p2align_ to
14187 zero for Output_section_data constructors.
14188 (Output_section::Input_section::addralign): If not an input
14189 section, return the alignment of the Output_section_data.
14190 * testsuite/copy_test.cc: New file.
14191 * testsuite/copy_test_1.cc: New file.
14192 * testsuite/copy_test_2.cc: New file.
14193 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14194 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14195 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14196 (copy_test_1_pic.o, copy_test_1.so): New targets.
14197 (copy_test_2_pic.o, copy_test_2.so): New targets.
14198 * testsuite/Makefile.in: Rebuild.
14199
14200 * script-sections.cc (Script_sections::place_orphan): Initialize
14201 local variable exact.
14202
14203 2008-06-13 David Edelsohn <edelsohn@gnu.org>
14204
14205 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14206
14207 2008-06-12 David Edelsohn <edelsohn@gnu.org>
14208 David S. Miller <davem@davemloft.net>
14209
14210 * powerpc.cc: New file.
14211 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14212 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14213 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14214 * Makefile.in: Rebuild.
14215
14216 2008-06-09 Ian Lance Taylor <iant@google.com>
14217
14218 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14219 <exception>.
14220 (throwing, orig_terminate): New static variables.
14221 (terminate_handler): New static function.
14222 (t2): Set terminate handler.
14223
14224 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14225
14226 PR 6584
14227 * binary.cc (Binary_to_elf::sized_convert): Fix .data
14228 alignment.
14229
14230 2008-05-30 Cary Coutant <ccoutant@google.com>
14231
14232 * archive.cc (Archive::include_all_members) Correct to step
14233 over symbol table and extended name table in thin archives.
14234
14235 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14236
14237 PR 6407
14238 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14239 calculation.
14240
14241 2008-05-28 Caleb Howe <cshowe@google.com>
14242
14243 * reduced_debug_output.cc: New file.
14244 * reduced_debug_output.h: New file.
14245 * options.h (class General_options): Add --strip-debug-non-line.
14246 * options.cc (General_options::finalize): Add strip_debug_non_line
14247 to the strip heirarchy.
14248 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14249 fields.
14250 * layout.cc: Include "reduced_debug_output.h".
14251 (Layout::Layout): Initialize new fields.
14252 (line_only_debug_sections): New static array.
14253 (is_lines_only_debug_sections): New static inline function.
14254 (Layout::include_section): Handle --strip-debug-non-line.
14255 (Layout::make_output_section): If --strip-debug-non-line, build
14256 new output sections for .debug_abbrev and .debug_info.
14257 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14258 gold. Warn about possible overflow.
14259 (read_signed_LEB_128): Likewise.
14260 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14261 (read_signed_LEB_128): Declare.
14262 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14263 (HFILES): Add reduced_debug_output.h.
14264 * Makefile.in: Rebuild.
14265
14266 2008-05-21 Ian Lance Taylor <iant@google.com>
14267
14268 * mapfile.cc: New file.
14269 * mapfile.h: New file.
14270 * options.h (class General_options): Add -M/--print-map and -Map.
14271 * options.cc (General_options::finalize): Make -M equivalent to
14272 -Map -.
14273 * main.cc: Include <cstdio> and "mapfile.h".
14274 (main): Open mapfile if requested.
14275 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14276 constructor. Change caller.
14277 (queue_initial_tasks): Add mapfile parameter. Change caller.
14278 (queue_middle_tasks): Likewise.
14279 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14280 declarations.
14281 * archive.cc: Include "mapfile.h".
14282 (Archive::add_symbols): Add mapfile parameter. Change all
14283 callers. Pass mapfile, symbol, and reason to include_member.
14284 (Archive::include_all_members): Add mapfile parameter. Change all
14285 callers.
14286 (Archive::include_member): Add mapfile, sym, and why parameters.
14287 Change all callers. Report inclusion to map file.
14288 * archive.h: Include "fileread.h".
14289 (class Archive): Update declarations.
14290 (Archive::file): New const method.
14291 (class Add_archive_symbols): Add mapfile_ field. Update
14292 constructor. Change all callers.
14293 * readsyms.h (class Read_symbols): Likewise.
14294 (class Finish_group): Likewise.
14295 (class Read_script): Likewise.
14296 * common.cc: Include "mapfile.h".
14297 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14298 all callers.
14299 (Symbol_table::do_allocate_commons): Likewise.
14300 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14301 symbol allocation to mapfile.
14302 * common.h (class Allocate_commons_task): Add mapfile_ field.
14303 Update constructor. Change all callers.
14304 * symtab.h (class Symbol_table): Update declarations.
14305 * layout.cc: Include "mapfile.h".
14306 (Layout_task_runner::run): Print information to mapfile.
14307 (Layout::create_gold_note): Change Output_data_fixed_space to
14308 Output_data_zero_fill.
14309 (Layout::create_build_id): Likewise.
14310 (Layout::print_to_mapfile): New function.
14311 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14312 constructor. Change caller.
14313 (class Layout): Declare print_to_mapfile.
14314 * output.cc (Output_section::Input_section::print_to_mapfile): New
14315 function.
14316 (Output_section::add_input_section): If producing a map, always
14317 add to input_sections_ list.
14318 (Output_section::do_print_to_mapfile): New function.
14319 (Output_segment::print_sections_to_mapfile): New function.
14320 (Output_segment::print_section_list_to_mapfile): New function.
14321 * output.h: Include "mapfile.h".
14322 (Output_data::print_to_mapfile): New function.
14323 (Output_data::do_print_to_mapfile): New virtual function.
14324 (Output_segment_headers::do_print_to_mapfile): New function.
14325 (Output_file_header::do_print_to_mapfile): New function.
14326 (Output_data_const::do_print_to_mapfile): New function.
14327 (class Output_data_const_buffer): Add map_name_ field. Update
14328 constructor. Change all callers. Add do_print_to_mapfile
14329 function.
14330 (class Output_data_fixed_space): Likewise.
14331 (class Output_data_space): Likewise.
14332 (class Output_data_zero_fill): New class.
14333 (Output_data_strtab::do_print_to_mapfile): New function.
14334 (Output_data_reloc_base::do_print_to_mapfile): New function.
14335 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14336 (Output_data_group::do_print_to_mapfile): New function.
14337 (Output_data_got::do_print_to_mapfile): New function.
14338 (Output_data_dynamic::do_print_to_mapfile): New function.
14339 (Output_symtab_xindex::do_print_to_mapfile): New function.
14340 (class Output_section): Declare do_print_to_mapflie. Declare
14341 print_to_mapfile in Input_section.
14342 (class Output_segment): Declare new functions.
14343 * object.h (Sized_relobj::symbol_count): New function.
14344 * script-sections.cc
14345 (Output_section_element_dot_assignment::set_section_addresses):
14346 Change Output_data_fixed_space to Output_data_zero_fill.
14347 (Output_data_expression::do_print_to_mapfile): New function.
14348 * script.cc (read_input_script): Add mapfile parameter. Change
14349 all callers.
14350 * script.h (read_input_script): Update declaration.
14351 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14352 (Eh_frame::do_print_to_mapfile): New function.
14353 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14354 (Output_merge_string::do_print_to_mapfile): New function.
14355 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14356 function.
14357 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14358 function.
14359 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14360 function.
14361 * Makefile.am (CCFILES): Add mapfile.cc.
14362 (HFILES): Add mapfile.h.
14363 * Makefile.in: Rebuild.
14364
14365 2008-05-19 Ian Lance Taylor <iant@google.com>
14366
14367 * options.h (class General_options): Add -z relro.
14368 * layout.cc (Layout::Layout): Initialize relro_segment_.
14369 (Layout::add_output_section_data): Return the output section.
14370 (Layout::make_output_section): Rcognize relro sections and mark
14371 them appropriately.
14372 (Layout::attach_allocated_section_to_segment): Put relro sections
14373 in a PT_GNU_RELRO segment.
14374 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14375 section as relro.
14376 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14377 PT_TLS segments.
14378 (Layout::linkonce_mapping): Map d.rel.ro.local to
14379 .data.rel.ro.local.
14380 (Layout::output_section_name): Us .data.rel.ro.local for any
14381 section which begins with that.
14382 * layout.h (class Layout): Update add_output_section_data
14383 declaration. Add relro_segment_ field.
14384 * output.cc (Output_section::Output_section): Initialize is_relro_
14385 and is_relro_local_ fields.
14386 (Output_segment::add_output_section): Group relro sections.
14387 (Output_segment::is_first_section_relro): New function.
14388 (Output_segment::maximum_alignment): If there is a relro section,
14389 align the segment to the common page size.
14390 (Output_segment::set_section_addresses): Track whether we are
14391 looking at relro sections. If the last section is a relro
14392 section, align to the common page size.
14393 (Output_segment::set_section_list_addresses): Add in_relro
14394 parameter. Change all callers. Align to the page size when
14395 moving from relro to non-relro section.
14396 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14397 segment.
14398 * output.h (class Output_section): Add is_relro_ and
14399 is_relro_local_ fields.
14400 (Output_section::is_relro): New function.
14401 (Output_section::set_is_relro): New function.
14402 (Output_section::is_relro_local): New function.
14403 (Output_section::set_is_relro_local): New function.
14404 (class Output_segment): Update declarations.
14405 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14406 * sparc.cc (Target_sparc::got_section): Likewise.
14407 * x86_64.cc (Target_x86_64::got_section): Likewise.
14408 * testsuite/relro_test_main.cc: New file.
14409 * testsuite/relro_test.cc: New file.
14410 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14411 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14412 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14413 (relro_test.so, relro_test_pic.o): New targets.
14414 * testsuite/Makefile.in: Rebuild.
14415
14416 2008-05-16 Ian Lance Taylor <iant@google.com>
14417
14418 * output.cc (Output_segment::add_output_section): Remove front
14419 parameter.
14420 * output.h (class Output_segment): Remove
14421 add_initial_output_section and overloaded add_output_section.
14422 Update declaration of remaining add_output_section.
14423 * layout.cc (Layout::create_interp): Call add_output_section
14424 rather than add_initial_output_section.
14425 (Layout::finish_dynamic_section): Likewise.
14426
14427 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14428 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14429 know the dynamic type.
14430 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14431 field. Initialize it in constructor.
14432 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14433 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14434 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14435 reloc.
14436
14437 * output.cc (Output_reloc::get_address): Change return type to
14438 Elf_Addr.
14439 * output.h (class Output_reloc): Update get_address declaration.
14440 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14441 for section addresses.
14442
14443 2008-05-09 Ian Lance Taylor <iant@google.com>
14444
14445 PR 6493
14446 * gold.cc (gold_nomem): Use return value of write.
14447
14448 2008-05-08 Ian Lance Taylor <iant@google.com>
14449
14450 * symtab.c (Symbol::init_base_output_data): Add version
14451 parameter. Change all callers.
14452 (Symbol::init_base_output_segment): Likewise.
14453 (Symbol::init_base_constant): Likewise.
14454 (Symbol::init_base_undefined): Likewise.
14455 (Sized_symbol::init_output_data): Likewise.
14456 (Sized_symbol::init_output_segment): Likewise.
14457 (Sized_symbol::init_constant): Likewise.
14458 (Sized_symbol::init_undefined): Likewise.
14459 (Symbol_table::do_define_in_output_data): If the new symbol has a
14460 version, mark it as the default.
14461 (Symbol_table::do_define_in_output_segment): Likewise.
14462 (Symbol_table::do_define_as_constant): Likewise.
14463 * symtab.h (class Symbol): Update declarations.
14464 (class Sized_symbol): Likewise.
14465 * resolve.cc (Symbol::override_version): New function.
14466 (Symbol::override_base): Call override_version.
14467 (Symbol::override_base_with_special): Likewise.
14468 * testsuite/ver_script_8.script: New file.
14469 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14470 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14471 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14472 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14473
14474 2008-05-06 Ian Lance Taylor <iant@google.com>
14475
14476 PR 6049
14477 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14478 functions.
14479 (class General_options): Remove existing --undefined, and add
14480 --no-undefined instead. Add new --undefined as synonym for -u.
14481 * archive.cc (Archive::add_symbols): Check whether symbol was
14482 named with -u.
14483 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14484 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14485 all uses. Add IS_UNDEFINED. Update declarations to split
14486 different versions of init_base. Declare init_base_undefined.
14487 (Symbol::is_defined): Handle IS_UNDEFINED.
14488 (Symbol::is_undefined): Likewise.
14489 (Symbol::is_weak_undefined): Call is_undefined.
14490 (Symbol::is_absolute): Handle IS_CONSTANT.
14491 (class Sized_symbol): Update declarations to split different
14492 versions of init. Declare init_undefined.
14493 (class Symbol_table): Declare new functions.
14494 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14495 Change all callers.
14496 (Symbol::init_base_output_data): Likewise.
14497 (Symbol::init_base_output_segment): Likewise.
14498 (Symbol::init_base_constant): Likewise.
14499 (Symbol::init_base_undefined): New function.
14500 (Sized_symbol::init_object): Rename from init. Change all
14501 callers.
14502 (Sized_symbol::init_output_data): Likewise.
14503 (Sized_symbol::init_output_segment): Likewise.
14504 (Sized_symbol::init_constant): Likewise.
14505 (Sized_symbol::init_undefined): New function.
14506 (Symbol_table::add_undefined_symbols_from_command_line): New
14507 function.
14508 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14509 function.
14510 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14511 (Symbol::output_section): Likewise.
14512 (Symbol::set_output_section): Likewise.
14513 (Symbol_table::sized_finalize_symbol): Likewise.
14514 (Symbol_table::sized_write_globals): Likewise.
14515 * resolve.cc (Symbol_table::should_override): Likewise.
14516 (Symbol::override_base_with_special): Likewise.
14517
14518 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14519 symbol, change it to have default visibility.
14520 * testsuite/protected_1.cc: New file.
14521 * testsuite/protected_2.cc: New file.
14522 * testsuite/protected_3.cc: New file.
14523 * testsuite/protected_main_1.cc: New file.
14524 * testsuite/protected_main_2.cc: New file.
14525 * testsuite/protected_main_3.cc: New file.
14526 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14527 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14528 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14529 (protected_1.so): New target.
14530 (protected_1_pic.o, protected_2_pic.o): New targets.
14531 (protected_3_pic.o): New target.
14532 (check_PROGRAMS): Add protected_2.
14533 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14534 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14535 * testsuite/Makefile.in: Rebuild.
14536
14537 * options.h (DEFINE_var): Add set_user_set_##varname__.
14538 (DEFINE_bool_alias): New macro.
14539 (class General_options): Define -Bstatic using DEFINE_bool_alias
14540 rather than DEFINE_special. Add --undefined as an alias for -z
14541 defs.
14542 * options.cc (General_options::parse_Bstatic): Remove.
14543
14544 * options.h (class General_options): Add --fatal-warnings.
14545 * main.cc (main): Implement --fatal-warnings.
14546 * errors.h (Errors::warning_count): New function.
14547
14548 * options.h (class General_options): Add -Bsymbolic-functions.
14549 * symtab.h (Symbol::is_preemptible): Check for
14550 -Bsymbolic-functions.
14551
14552 2008-05-05 Ian Lance Taylor <iant@google.com>
14553
14554 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14555 as noVARNAME rather than no-VARNAME.
14556 (class General_options): Add option -z combreloc.
14557 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14558 get_address.
14559 (Output_reloc::sort_before) [SHT_REL]: New function.
14560 (Output_reloc::sort_before) [SHT_RELA]: New function.
14561 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14562 Sort_relocs_comparison.
14563 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14564 parameter. Change all callers.
14565 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14566 sort_relocs parameter. Change all callers.
14567 * output.cc (Output_reloc::get_address): New function, broken out
14568 of write_rel.
14569 (Output_reloc::write_rel): Call it.
14570 (Output_reloc::compare): New function.
14571 (Output_data_reloc_base::do_write): Optionally sort relocs.
14572
14573 * configure.ac: If targ_extra_obj is set, link it in.
14574 * configure.tgt: Initialize all variables.
14575 (x86_64*): Set targ_extra_obj and targ_extra_size.
14576 * configure: Rebuild.
14577
14578 * object.cc (Sized_relobj::include_section_group): Adjust section
14579 indexes read from group data. Build vector to pass to
14580 layout_group.
14581 * layout.cc (Layout::layout_group): Add flags and shndxes
14582 parameters. Remove contents parameter. Change caller. Update
14583 explicit instantiations.
14584 * layout.h (class Layout): Update layout_group declaration.
14585 * output.cc (Output_data_group::Output_data_group): Add flags and
14586 input_shndxes parameters. Remove contents parameter. Change
14587 caller.
14588 (Output_data_group::do_write): Change input_sections_ to
14589 input_shndxes_.
14590 * output.h (class Output_data_group): Update constructor
14591 declaration. Rename input_sections_ to input_shndxes_.
14592 * testsuite/many_sections_test.cc: Add template.
14593
14594 2008-04-30 Cary Coutant <ccoutant@google.com>
14595
14596 * target-reloc.h (relocate_section): Fix dead-pointer bug.
14597
14598 * layout.cc (Layout::include_section): Refactored check for debug
14599 info section.
14600 (Layout::add_comdat): Add new parameters. Change type
14601 of signature parameter. Add object and shndx to signatures table.
14602 (Layout::find_kept_object): New function.
14603 * layout.h: Include <cstring>.
14604 (Layout::is_debug_info_section): New function.
14605 (Layout::add_comdat): Add new parameters.
14606 (Layout::find_kept_object): New function.
14607 (Layout::Kept_section): New struct.
14608 (Layout::Signatures): Change type of map range.
14609 * object.cc (Relobj::output_section_address): New function.
14610 (Sized_relobj::include_section_group): Add new parameters. Change
14611 calls to Layout::add_comdat. Change to build table of kept comdat
14612 groups and table mapping discarded sections to kept sections.
14613 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
14614 (Sized_relobj::do_layout): Change calls to include_section_group and
14615 include_linkonce_section.
14616 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
14617 value to zero when section is discarded.
14618 (Sized_relobj::map_to_kept_section): New function.
14619 * object.h (Relobj::output_section_address): New function.
14620 (Relobj::Comdat_group): New type.
14621 (Relobj::find_comdat_group): New function.
14622 (Relobj::Comdat_group_table): New type.
14623 (Relobj::Kept_comdat_section): New type.
14624 (Relobj::Kept_comdat_section_table): New type.
14625 (Relobj::add_comdat_group): New function.
14626 (Relobj::set_kept_comdat_section): New function.
14627 (Relobj::get_kept_comdat_section): New function.
14628 (Relobj::comdat_groups_): New field.
14629 (Relobj::kept_comdat_sections_): New field.
14630 (Symbol_value::input_value): Update comment.
14631 (Sized_relobj::map_to_kept_section) New function.
14632 (Sized_relobj::include_linkonce_section): Add new parameter.
14633 * target-reloc.h (Comdat_behavior): New type.
14634 (get_comdat_behavior): New function.
14635 (relocate_section): Add code to map a discarded section to the
14636 corresponding kept section when applying a relocation.
14637
14638 2008-04-30 Craig Silverstein <csilvers@google.com>
14639
14640 * dwarf_reader.cc (next_generation_count): New static var.
14641 (Addr2line_cache_entry): New struct.
14642 (addr2line_cache): New static var.
14643 (Dwarf_line_info::one_addr2line): Added caching.
14644 (Dwarf_line_info::clear_addr2line_cache): New function.
14645 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
14646 cache-size parameter.
14647 (Dwarf_line_info::one_addr2line_cache): New function.
14648 * symtab.cc (Symbol_table::detect_odr_violations): Pass
14649 new cache-size argument to one_addr2line(), and clear cache.
14650
14651 2008-04-28 Cary Coutant <ccoutant@google.com>
14652
14653 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
14654 R_386_PC8 relocations.
14655
14656 2008-04-23 Ian Lance Taylor <iant@google.com>
14657
14658 * object.cc (Sized_relobj::include_section_group): Check for
14659 invalid section group.
14660
14661 * object.cc (make_elf_object): Correct test for 64-bit ELF file
14662 header size.
14663
14664 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
14665 than read for file header.
14666 * archive.cc (Archive::include_member): Likewise.
14667
14668 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
14669
14670 * aclocal.m4: Regenerate.
14671 * configure: Regenerate.
14672
14673 2008-04-19 Ian Lance Taylor <iant@google.com>
14674
14675 * version.cc (version_string): Bump to 1.6.
14676
14677 * testsuite/Makefile.am (many_sections_r_test): New target.
14678 (many_sections_r_test_SOURCES): Remove.
14679 (many_sections_r_test_DEPENDENCIES): Remove.
14680 (many_sections_r_test_LDFLAGS): Remove.
14681 (many_sections_r_test_LDADD): Remove.
14682
14683 * object.cc (Sized_relobj::do_add_symbols): Always pass
14684 local_symbol_count_ to add_from_relobj.
14685
14686 * testsuite/Makefile.am (many_sections_check.h): Only check one in
14687 every thousand variables.
14688 * testsuite/Makefile.in: Rebuild.
14689
14690 * object.cc (Xindex::initialize_symtab_xindex): New function.
14691 (Xindex::read_symtab_xindex): New function.
14692 (Xindex::sym_xindex_to_shndx): New function.
14693 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
14694 available.
14695 (Sized_relobj::do_initialize_xindex): New function.
14696 (Sized_relobj::do_read_symbols): Adjust section links.
14697 (Sized_relobj::symbol_section_and_value): Add is_ordinary
14698 parameter. Change all callers.
14699 (Sized_relobj::include_section_group): Adjust section links and
14700 symbol section indexes.
14701 (Sized_relobj::do_layout): Adjust section links.
14702 (Sized_relobj::do_count_local_symbols): Adjust section links and
14703 symbol section indexes.
14704 (Sized_relobj::do_finalize_local_symbols): Distinguish between
14705 ordinary and special symbols.
14706 (Sized_relobj::write_local_symbols): Add symtab_xindex and
14707 dynsym_xindex parameters. Change all callers. Adjust section
14708 links. Use SHN_XINDEX when needed.
14709 (Sized_relobj::get_symbol_location_info): Adjust section links.
14710 Don't get fooled by special symbols.
14711 * object.h (class Xindex): Define.
14712 (class Object): Add xindex_ parameter. Declare virtual functoin
14713 do_initialize_xindex.
14714 (Object::adjust_sym_shndx): New function.
14715 (Object::set_xindex): New protected function.
14716 (class Symbol_value): Add is_ordinary_shndx_ field.
14717 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
14718 (Symbol_value::value): Assert ordinary section.
14719 (Symbol_value::initialize_input_to_output_map): Likewise.
14720 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
14721 Change all callers.
14722 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
14723 all callers.
14724 (class Sized_relobj): Update declarations.
14725 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
14726 parameter. Change all callers.
14727 (Sized_relobj::adjust_shndx): New function.
14728 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
14729 field.
14730 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
14731 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
14732 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
14733 (Sized_dynobj::read_dynsym_section): Adjust section links.
14734 (Sized_dynobj::read_dynamic): Likewise.
14735 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
14736 section links.
14737 (Sized_dynobj::do_initialize_xindex): New function.
14738 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
14739 do_initialize_xindex.
14740 (Sized_dynobj::adjust_shndx): New function.
14741 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
14742 dynsym_xindex_ fields.
14743 (Layout::finalize): Add a call to set_section_indexes before
14744 creating the symtab sections.
14745 (Layout::set_section_indexes): Don't do anything if the section
14746 already has a section index.
14747 (Layout::create_symtab_sections): Add shnum parameter. Change
14748 caller. Create .symtab_shndx section if needed.
14749 (Layout::create_shdrs): Add shstrtab_section parameter. Change
14750 caller.
14751 (Layout::allocated_output_section_count): New function.
14752 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
14753 needed.
14754 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
14755 fields. Update declarations.
14756 (Layout::symtab_xindex): New function.
14757 (Layout::dynsym_xindex): New function.
14758 (class Write_symbols_task): Add layout_ field.
14759 (Write_symbols_task::Write_symbols_task): Add layout parameter.
14760 Change caller.
14761 * output.cc (Output_section_headers::Output_section_headers): Add
14762 shstrtab_section parameter. Change all callers.
14763 (Output_section_headers::do_sized_write): Store overflow values
14764 for section count and section string table section index in
14765 section header zero.
14766 (Output_file_header::do_sized_write): Check for overflow of
14767 section count and section string table section index.
14768 (Output_symtab_xindex::do_write): New function.
14769 (Output_symtab_xindex::endian_do_write): New function.
14770 * output.h (class Output_section_headers): Add shstrtab_section_.
14771 Update declarations.
14772 (class Output_symtab_xindex): Define.
14773 (Output_section::has_out_shndx): New function.
14774 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
14775 field.
14776 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
14777 Change all callers.
14778 (Sized_symbol::init): Likewise.
14779 (Symbol::output_section): Check for ordinary symbol.
14780 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
14781 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
14782 callers.
14783 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
14784 Change all callers. Simplify handling of symbols from sections
14785 not included in the link.
14786 (Symbol_table::add_from_dynobj): Handle ordinary symbol
14787 distinction.
14788 (Weak_alias_sorter::operator()): Assert that symbols are
14789 ordinary.
14790 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14791 distinction.
14792 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14793 parameters. Change all callers.
14794 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14795 symbol distinction. Use SHN_XINDEX when needed.
14796 (Symbol_table::write_section_symbol): Add symtab_xindex
14797 parameter. Change all callers.
14798 (Symbol_table::sized_write_section_symbol): Likewise. Use
14799 SHN_XINDEX when needed.
14800 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14801 declarations.
14802 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14803 (Symbol::is_defined): Check is_ordinary.
14804 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14805 (Symbol::is_absolute, Symbol::is_common): Likewise.
14806 (class Sized_symbol): Update declarations.
14807 (class Symbol_table): Update declarations.
14808 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14809 parameters. Change all callers.
14810 (Sized_symbol::override): Likewise.
14811 (Symbol_table::override): Likewise.
14812 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14813 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14814 is_ordinary, and orig_st_shndx parameters. Change all callers.
14815 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14816 to be in an ordinary section.
14817 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14818 object and is_ordinary parameters. Change all callers.
14819 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14820 Change all callers. Don't add undefined or non-ordinary symbols
14821 to reloc_map_.
14822 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
14823 Change all callers.
14824 * dwarf_reader.h (class Sized_dwarf_line_info): Update
14825 declarations.
14826 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
14827 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
14828 (Sized_relobj::relocate_sections): Likewise.
14829 * target-reloc.h (scan_relocs): Adjust section symbol index.
14830 (scan_relocatable_relocs): Likewise.
14831 * i386.cc (Scan::local): Check for ordinary symbols.
14832 * sparc.cc (Scan::local): Likewise.
14833 * x86_64.cc (Scan::local): Likewise.
14834 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
14835 to symbol_section_and_value.
14836 * testsuite/many_sections_test.cc: New file.
14837 * testsuite/Makefile.am (BUILT_SOURCES): Define.
14838 (check_PROGRAMS): Add many_sections_test.
14839 (many_sections_test_SOURCES): Define.
14840 (many_sections_test_DEPENDENCIES): Define.
14841 (many_sections_test_LDFLAGS): Define.
14842 (BUILT_SOURCES): Add many_sections_define.h.
14843 (many_sections_define.h): New target.
14844 (BUILT_SOURCES): Add many_sections_check.h.
14845 (many_sections_check.h): New target.
14846 (check_PROGRAMS): Add many_sections_r_test.
14847 (many_sections_r_test_SOURCES): Define.
14848 (many_sections_r_test_DEPENDENCIES): Define.
14849 (many_sections_r_test_LDFLAGS): Define.
14850 (many_sections_r_test_LDADD): Define.
14851 (many_sections_r_test.o): New target.
14852 * testsuite/Makefile.in: Rebuild.
14853
14854 2008-04-17 Cary Coutant <ccoutant@google.com>
14855
14856 * errors.cc (Errors::info): New function.
14857 (gold_info): New function.
14858 * errors.h (Errors::info): New function.
14859 * gold.h (gold_info): New function.
14860 * object.cc (Input_objects::add_object): Print trace output.
14861 * options.cc (options::parse_set): New function.
14862 (General_options::parse_wrap): Deleted.
14863 (General_options::General_options): Deleted initializer.
14864 * options.h (options::String_set): New typedef.
14865 (options::parse_set): New function.
14866 (DEFINE_set): New macro.
14867 (General_options::wrap): Changed to use DEFINE_set. Changed
14868 callers of any_wrap_symbols and is_wrap_symbol.
14869 (General_options::trace, General_options::trace_symbol):
14870 New options.
14871 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
14872 (General_options::wrap_symbols_): Deleted.
14873 * symtab.cc (Symbol_table::add_from_object): Print trace output.
14874
14875 2008-04-17 David S. Miller <davem@davemloft.net>
14876
14877 * options.cc (General_options::parse_V): New function.
14878 * options.h: Add entries for -V and -Qy.
14879
14880 2008-04-17 Ian Lance Taylor <iant@google.com>
14881
14882 * common.cc (Symbol_table::allocate_commons): Remove options
14883 parameter. Change caller.
14884 (Symbol_table::do_allocate_commons): Remove options parameter.
14885 Change caller. Just call do_allocate_commons_list twice.
14886 (Symbol_table::do_allocate_commons_list): New function, broken out
14887 of do_allocate_commons.
14888 * common.h (class Allocate_commons_task): Remove options_ field.
14889 Update constructor.
14890 * symtab.cc (Symbol_table::Symbol_table): Initialize
14891 tls_commons_.
14892 (Symbol_table::add_from_object): Put TLS common symbols on
14893 tls_commons_ list.
14894 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
14895 which are IN_OUTPUT_DATA.
14896 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
14897 allocate_commons and do_allocate_commons declarations. Declare
14898 do_allocate_commons_list.
14899 * gold.cc (queue_middle_tasks): Update creation of
14900 Allocate_commons_task to not pass options.
14901 * testsuite/Makefile.am (INCLUDES): Add -I.. .
14902 (TLS_TEST_C_FLAGS): New variable.
14903 (tls_test_c_pic.o): New target.
14904 (tls_test_shared.so): Link in tls_test_c_pic.o.
14905 (tls_test_c_pic_ie.o): New target.
14906 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
14907 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
14908 (tls_test_c.o): New target.
14909 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
14910 (tls_pic_test_LDADD): Likewise.
14911 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
14912 (tls_shared_gd_to_ie_test_LDADD): Likewise.
14913 (tls_test_c_gnu2.o): New target.
14914 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
14915 tls_test_c_gnu2.o.
14916 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
14917 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
14918 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
14919 * testsuite/tls_test.cc: Include "config.h".
14920 (t_last): Call t11_last.
14921 * testsuite/tls_test.h (t11, t11_last): Declare.
14922 * testsuite/tls_test_c.c: New file.
14923 * testsuite/tls_test_main.cc (thread_routine): Call t11.
14924 * configure.ac: Check for OpenMP support.
14925 * configure, config.in, Makefile.in: Rebuild.
14926 * testsuite/Makefile.in: Rebuild.
14927
14928 2008-04-16 Cary Coutant <ccoutant@google.com>
14929
14930 * i386.cc (Target_i386::define_tls_base_symbol): New function.
14931 (Target_i386::tls_base_symbol_defined_): New field.
14932 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14933 (Target_i386::Scan::global): Likewise.
14934 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
14935 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
14936 (Target_x86_64::tls_base_symbol_defined_): New field.
14937 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14938 (Target_x86_64::Scan::global): Likewise.
14939
14940 2008-04-16 Cary Coutant <ccoutant@google.com>
14941
14942 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
14943 (Symbol::needs_plt_entry): Allow weak undefined symbols.
14944 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
14945 building shared libraries.
14946 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
14947 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
14948 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
14949 * testsuite/Makefile.in: Rebuild.
14950 * testsuite/weak_undef.h: New file.
14951 * testsuite/weak_undef_file1.cc: Add extra test cases.
14952 * testsuite/weak_undef_file2.cc: Likewise.
14953 * testsuite/weak_undef_test.cc: Likewise.
14954
14955 2008-04-16 David S. Miller <davem@davemloft.net>
14956
14957 * sparc.cc (Target_sparc::Scan): Change from struct to class.
14958 Add issued_non_pic_error_ field. Declare check_non_pic.
14959 (Target_sparc::Scan::check_non_pic): New function.
14960 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
14961 (Target_sparc::Scan::global): Likewise.
14962
14963 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
14964 * configure: Rebuild.
14965
14966 * options.h (DEFINE_enable): New macro.
14967 (new_dtags): New enable option.
14968 (initfirst, interpose, loadfltr, nodefaultlib,
14969 nodelete, nodlopen, nodump): New -z options.
14970 * layout.cc (Layout:finish_dynamic_section): If new
14971 dtags enabled, emit DT_RUNPATH. Also, emit a
14972 DT_FLAGS_1 containing any specified -z flags.
14973
14974 2008-04-16 Ian Lance Taylor <iant@google.com>
14975
14976 * copy-relocs.cc: New file.
14977 * copy-relocs.h: New file.
14978 * reloc.cc: Remove Copy_relocs code.
14979 * reloc.h: Likewise.
14980 * reloc-types.h (struct Reloc_types) [both versions]: Add
14981 get_reloc_addend_noerror.
14982 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
14983 variants of add_global which take an addend which must be zero.
14984 * i386.cc: Include "copy-relocs.h".
14985 (class Target_i386): Change type of copy_relocs_ to variable,
14986 update initializer.
14987 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
14988 Change all callers.
14989 (Target_i386::do_finalize_sections): Change handling of
14990 copy_relocs_.
14991 * sparc.cc: Include "copy-relocs.h".
14992 (class Target_sparc): Change type of copy_relocs_ to variable,
14993 update initializer.
14994 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
14995 Change all callers.
14996 (Target_sparc::do_finalize_sections): Change handling of
14997 copy_relocs_.
14998 * x86_64.cc: Include "copy-relocs.h".
14999 (class Target_x86_64): Change type of copy_relocs_ to variable,
15000 update initializer.
15001 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15002 class. Change all callers.
15003 (Target_x86_64::do_finalize_sections): Change handling of
15004 copy_relocs_.
15005 * Makefile.am (CCFILES): Add copy-relocs.cc.
15006 (HFILES): Add copy-relocs.h.
15007
15008 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15009
15010 * testsuite/script_test_4.sh: Permit leading zeroes.
15011
15012 2008-04-15 Ian Lance Taylor <iant@google.com>
15013
15014 * script-sections.cc (Script_sections::create_segments): Use
15015 header_size_adjustment even when there is enough room for the
15016 headers.
15017 * testsuite/script_test_4.sh: New file.
15018 * testsuite/script_test_4.t: New file.
15019 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15020 (check_DATA): Add script_test_4.stdout.
15021 (MOSTLYCLEANFILES): Likewise.
15022 (script_test_4): New target.
15023 (script_test_4.stdout): New target.
15024 * testsuite/Makefile.in: Rebuild.
15025
15026 * sparc.cc: Add definitions for Output_data_plt_sparc class
15027 constants.
15028
15029 2008-04-14 David S. Miller <davem@davemloft.net>
15030
15031 * sparc.cc: New file.
15032 * Makefile.am (TARGETSOURCES): Add sparc.cc
15033 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15034 * configure.tgt: Document targ_extra_size and
15035 targ_extra_big_endian. Add entries for sparc-* and
15036 sparc64-*.
15037 * configure.ac: Handle targ_extra_size and
15038 targ_extra_big_endian.
15039 * Makefile.in: Rebuild.
15040 * configure: Likewise.
15041 * po/POTFILES.in: Likewise.
15042 * po/gold.pot: Likewise.
15043
15044 2008-04-14 Ian Lance Taylor <iant@google.com>
15045
15046 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15047 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15048 in the name/type/flags to section mapping. Don't call
15049 allocate_output_section.
15050 (Layout::choose_output_section): Change parameter from adjust_name
15051 to is_input_section. Don't permit input sections after sections
15052 are attached to segments. Don't call allocate_output_section.
15053 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15054 not write_enable_output_section.
15055 (Layout::make_output_section): Don't push to
15056 unattached_section_list_ nor call attach_to_segment. Call
15057 attach_section_to_segment if sections are attached.
15058 (Layout::attach_sections_to_segments): New function.
15059 (Layout::attach_section_to_segment): New function.
15060 (Layout::attach_allocated_section_to_segment): Rename from
15061 attach_to_segment. Remove flags parameter.
15062 (Layout::allocate_output_section): Remove function.
15063 (Layout::write_enable_output_section): Remove function.
15064 * layout.h (class Layout): Update for above changes. Add new
15065 field sections_are_attached_.
15066 * output.h (Output_section::update_flags_for_input_section): New
15067 function.
15068 * output.cc (Output_section::add_input_section): Call
15069 update_flags_for_input_section.
15070 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15071
15072 2008-04-11 Cary Coutant <ccoutant@google.com>
15073
15074 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15075 thought unnecessary.
15076 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15077
15078 2008-04-11 Ian Lance Taylor <iant@google.com>
15079
15080 * output.h (class Output_section_data): Remove inline definition
15081 of set_addralign.
15082 * output.cc (Output_section_data::set_addralign): New function.
15083
15084 2008-04-11 Cary Coutant <ccoutant@google.com>
15085
15086 Add support for TLS descriptors for i386 and x86_64.
15087 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15088 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15089 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15090 GOT_TYPE_TLS_DESC.
15091 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15092 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15093 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15094 relocations.
15095 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15096 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15097 Fix problem with initial-exec relocations.
15098 (Target_i386::Relocate::relocate_tls): Likewise.
15099 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15100 relaxation.
15101 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15102 support for section-plus-offset dynamic table entries.
15103 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15104 (Output_data_dynamic::Dynamic_entry): Add support for
15105 section-plus-offset dynamic table entries.
15106 (Output_data_dynamic::Classification): Likewise.
15107 (Output_data_dynamic::classification_): Renamed offset_.
15108 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15109 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15110 (Target_x86_64::make_plt_section): New function.
15111 (Target_x86_64::reserve_tlsdesc_entries): New function.
15112 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15113 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15114 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15115 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15116 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15117 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15118 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15119 add extra PLT entry for TLS descriptors.
15120 (Output_data_plt_x86_64::got_): New field.
15121 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15122 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15123 fields.
15124 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15125 descriptors.
15126 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15127 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15128 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15129 R_386_TLS_DESC_CALL relocations.
15130 (Target_x86_64::Scan::global): Likewise.
15131 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15132 for TLS descriptors.
15133 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15134 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15135 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15136 GD-to-IE relaxation.
15137 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15138 and TLS_DESCRIPTORS.
15139 * Makefile.in: Rebuild.
15140 * configure: Rebuild.
15141 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15142 (tls_test_shared2.so): New target.
15143 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15144 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15145 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15146 (tls_shared_gd_to_ie_test_LDADD): New variable.
15147 (tls_shared_gnu2_gd_to_ie_test): New target.
15148 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15149 New targets.
15150 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15151 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15152 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15153 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15154 (tls_shared_gnu2_test): New target.
15155 (tls_test_gnu2_shared.so): New target.
15156 (tls_shared_gnu2_test_SOURCES): New variable.
15157 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15158 (tls_shared_gnu2_test_LDFLAGS): New variable.
15159 (tls_shared_gnu2_test_LDADD): New variable.
15160 * testsuite/Makefile.in: Rebuild.
15161 * testsuite/Makefile.
15162
15163 2008-04-11 Ian Lance Taylor <iant@google.com>
15164
15165 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15166 justsyms.t.
15167 * testsuite/Makefile.in: Rebuild.
15168
15169 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15170 long.
15171 * testsuite/script_test_2.cc (main): Adjust test.
15172
15173 2008-04-11 David S. Miller <davem@davemloft.net>
15174 Ian Lance Taylor <iant@google.com>
15175
15176 * options.h (General_options): Add entries for '-Y' and
15177 '-relax'.
15178 * options.cc (General_options:finalize): If -Y was used, add those
15179 entries to the library path instead of the default "/lib" and
15180 "/usr/lib".
15181
15182 2008-04-11 David S. Miller <davem@davemloft.net>
15183
15184 * testsuite/justsyms.t: Start at 0x100.
15185 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
15186 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15187 long.
15188 * testsuite/script_test_2.cc: Adjust string and section length
15189 checks.
15190
15191 2008-04-09 Ian Lance Taylor <iant@google.com>
15192
15193 PR gold/5996
15194 * script-sections.cc (Sections_element::allocate_to_segment): Add
15195 orphan parameter.
15196 (Output_section_definition::allocate_to_segment): Likewise.
15197 (Orphan_output_section::allocate_to_segment): Likewise.
15198 (Script_sections::attach_sections_using_phdrs_clause): Don't
15199 propagate non-PT_LOAD segments to orphan sections.
15200 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15201 readelf rather than objdump.
15202 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15203 .interp section and PT_INTERP segment are the same size.
15204 * testsuite/Makefile.in: Rebuild.
15205
15206 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15207 aliases for symbols defined in the same object.
15208 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15209 (weak_alias_test_SOURCES): New variable.
15210 (weak_alias_test_DEPENDENCIES): New variable.
15211 (weak_alias_test_LDFLAGS): New variable.
15212 (weak_alias_test_LDADD): New variable.
15213 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15214 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15215 (weak_alias_test_3.o): New target.
15216 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15217 * testsuite/weak_alias_test_main.cc: New file.
15218 * testsuite/weak_alias_test_1.cc: New file.
15219 * testsuite/weak_alias_test_2.cc: New file.
15220 * testsuite/weak_alias_test_3.cc: New file.
15221
15222 2008-04-08 Ian Lance Taylor <iant@google.com>
15223
15224 * options.h (class General_options): Add --noinhibit-exec option.
15225 * main.cc (main): Check --noinhibit-exec.
15226
15227 * options.h (class General_options): Define --wrap as a special
15228 option. Add wrap_symbols_ field.
15229 (General_options::any_wrap_symbols): New function.
15230 (General_options::is_wrap_symbol): New function.
15231 * options.cc (General_options::parse_wrap): New function.
15232 (General_options::General_options): Initialize wrap_symbols_.
15233 * symtab.cc (Symbol_table::wrap_symbol): New function.
15234 (Symbol_table::add_from_object): Handle --wrap.
15235 * symtab.h (class Symbol_table): Declare wrap_symbol.
15236 * target.h (Target::wrap_char): New function.
15237 (Target::Target_info): Add wrap_char field.
15238 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15239 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15240 * testsuite/testfile.cc (Target_test::test_target_info):
15241 Likewise.
15242
15243 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15244 there is one.
15245
15246 * layout.h (class Layout): Add added_eh_frame_data_ field.
15247 * layout.cc (Layout::Layout): Initialize new field.
15248 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15249 output section until we find a section we merged successfully.
15250 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15251 that the size be non-zero.
15252
15253 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15254 qualifier.
15255
15256 2008-04-08 Craig Silverstein <csilvers@google.com>
15257
15258 * configure.ac: Export new conditional variable HAVE_ZLIB.
15259 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15260 on HAVE_ZLIB.
15261 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15262 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15263
15264 2008-04-07 Ian Lance Taylor <iant@google.com>
15265
15266 * version.cc (version_string): Set to "1.5".
15267
15268 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15269 Add issued_non_pic_error_ field. Declare check_non_pic.
15270 (Target_x86_64::Scan::check_non_pic): New function.
15271 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15272 (Target_x86_64::Scan::global): Likewise.
15273
15274 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15275 addend parameter. Change caller. Handle merge sections.
15276 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15277 Address to Addend. Don't add in the result of
15278 local_section_offset, pass down the addend and use the returned
15279 value.
15280 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15281 Update declarations of local_section_offset and symbol_value.
15282 * testsuite/two_file_test_1.cc (t18): New function.
15283 * testsuite/two_file_test_2.cc (f18): New function.
15284 * testsuite/two_file_test_main.cc (main): Call t18.
15285 * testsuite/two_file_test.h (t18, f18): Declare.
15286
15287 * configure.ac: Don't test for objdump, c++filt, or readelf.
15288 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15289 conditionals.
15290 (TEST_READELF): New variable.
15291 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15292 (check_PROGRAMS): Add two_file_strip_test.
15293 (two_file_strip_test): New target.
15294 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15295 (two_file_same_shared_strip_test_SOURCES): New variable.
15296 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15297 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15298 (two_file_same_shared_strip_test_LDADD): New variable.
15299 (two_file_shared_strip.so): New target.
15300 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15301 (ver_test_5.syms, ver_test_7.syms): Likewise.
15302 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15303 (strip_test_3.stdout): Use TEST_OBJDUMP.
15304 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15305
15306 2008-04-04 Cary Coutant <ccoutant@google.com>
15307
15308 * symtab.h (Symbol::is_weak_undefined): New function.
15309 (Symbol::is_strong_undefined): New function.
15310 (Symbol::is_absolute): New function.
15311 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15312 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15313 absolute symbols.
15314 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15315 (weak_undef_test): New target.
15316 * testsuite/Makefile.in: Rebuild.
15317 * testsuite/weak_undef_file1.cc: New file.
15318 * testsuite/weak_undef_file2.cc: New file.
15319 * testsuite/weak_undef_test.cc: New file.
15320
15321 2008-04-03 Craig Silverstein <csilvers@google.com>
15322
15323 * compressed_output.h (class Output_compressed_section): Use
15324 unsigned buffer.
15325 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15326 add zlib header.
15327 (zlib_compressed_suffix): Removed.
15328 (Output_compressed_section::set_final_data_size): Use unsigned
15329 buffers.
15330 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15331 Fix linker invocation.
15332 (flagstest_o_specialfile_and_compress_debug_sections):
15333 Likewise.
15334 * testsuite/Makefile.in: Regenerated.
15335
15336 2008-04-02 David S. Miller <davem@davemloft.net>
15337
15338 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15339 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15340
15341 2008-04-02 Craig Silverstein <csilvers@google.com>
15342
15343 * TODO: New file.
15344
15345 2008-04-02 Ian Lance Taylor <iant@google.com>
15346
15347 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15348 parameters. Update for new key type to views_. Change all
15349 callers.
15350 (File_read::read): Adjust for byteshift in returned view.
15351 (File_read::add_view): New function, broken out of
15352 find_and_make_view.
15353 (File_read::make_view): New function, broken out of
15354 find_and_make_view.
15355 (File_read::find_or_make_view): Add offset and aligned
15356 parameters. Rewrite accordingly. Change all callers.
15357 (File_read::get_view): Add offset and aligned parameters. Adjust
15358 for byteshift in return value.
15359 (File_read::get_lasting_view): Likewise.
15360 * fileread.h (class File_read): Update declarations.
15361 (class File_read::View): Add byteshift_ field. Add byteshift to
15362 constructor. Add byteshift method.
15363 * archive.h (Archive::clear_uncached_views): New function.
15364 (Archive::get_view): Add aligned parameter. Change all callers.
15365 * object.h (Object::get_view): Add aligned parameter. Change all
15366 callers.
15367 (Object::get_lasting_view): Likewise.
15368
15369 * fileread.cc (File_read::release): Don't call clear_views if
15370 there are multiple objects.
15371 * fileread.h (File_read::clear_uncached_views): New function.
15372 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15373 on the archive.
15374
15375 2008-03-31 Cary Coutant <ccoutant@google.com>
15376
15377 Add thin archive support.
15378 * archive.cc (Archive::armagt): New const.
15379 (Archive::setup): Remove task parameter and calls to unlock.
15380 (Archive::unlock_nested_archives): New function.
15381 (Archive::read_header): Add nested_off parameter. Change
15382 all callers.
15383 (Archive::interpret_header): Likewise.
15384 (Archive::include_all_members): Change to handle thin
15385 archives.
15386 (Archive::include_member): Likewise.
15387 * archive.h (Archive::Archive): Add new parameters and
15388 initializers.
15389 (Archive::armagt): New const.
15390 (Archive::setup): Remove task parameter.
15391 (Archive::unlock_nested_archives): New function.
15392 (Archive::read_header): Add nested_off parameter.
15393 (Archive::interpret_header): Likewise.
15394 (Archive::Nested_archive_table): New typedef.
15395 (Archive::is_thin_archive_): New field.
15396 (Archive::nested_archives_): New field.
15397 (Archive::options_): New field.
15398 (Archive::dirpath_): New field.
15399 (Archive::task_): New field.
15400 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15401 for thin archives. Pass additional parameters to
15402 Archive::Archive. Unlock the archive file after calling
15403 Archive::setup.
15404
15405 2008-03-29 Ian Lance Taylor <iant@google.com>
15406
15407 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15408 version symbol to be local.
15409 * testsuite/ver_test_4.sh: New file.
15410 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15411 (check_DATA): Add ver_test_4.syms.
15412 (ver_test_4.syms): New target.
15413 * testsuite/Makefile.in: Rebuild.
15414
15415 * output.cc
15416 (Output_section::Input_section_sort_entry::has_priority): New
15417 function.
15418 (Output_section::Input_section_sort_entry::match_file_name): New
15419 function.
15420 (Output_section::Input_section_sort_entry::match_section_name):
15421 Remove.
15422 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15423 Remove.
15424 (Output_section::Input_section_sort_entry::match_section_file):
15425 Remove.
15426 (Output_section::Input_section_sort_compare::operator()): Rewrite
15427 using new Input_section_sort_entry functions. Sort crtbegin and
15428 crtend first. Sort sections with no priority before sections with
15429 a priority.
15430 * testsuite/initpri1.c (d3): Check j != 4.
15431 (cd5): New constructor/destructor function.
15432 (main): Check j != 2.
15433
15434 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15435 new symbol when resolving, don't call set_is_default.
15436 * testsuite/ver_test_7.cc: New file.
15437 * testsuite/ver_test_7.sh: New file.
15438 * testsuite/Makefile.am (ver_test_7.so): New target.
15439 (ver_test_7.o): New target.
15440 (check_SCRIPTS): Add ver_test_7.sh.
15441 (check_DATA): Add ver_test_7.syms.
15442 (ver_test_7.syms): New target.
15443
15444 2008-03-28 Ian Lance Taylor <iant@google.com>
15445
15446 * layout.cc (Layout::layout): If we see an input section with a
15447 name that needs sorting, set the must_sort flag for the output
15448 section.
15449 (Layout::make_output_section): If the name of the output section
15450 indicates that it might require sorting, set the may_sort flag.
15451 * output.h (Output_section::may_sort_attached_input_sections): New
15452 function.
15453 (Output_section::set_may_sort_attached_input_sections): New
15454 function.
15455 (Output_section::must_sort_attached_input_sections): New
15456 function.
15457 (Output_section::set_must_sort_attached_input_sections): New
15458 function.
15459 (class Output_section): Declare Input_section_sort_entry. Define
15460 Input_section_sort_compare. Declare
15461 sort_attached_input_sections. Add new fields:
15462 may_sort_attached_input_sections_,
15463 must_sort_attached_input_sections_,
15464 attached_input_sections_are_sorted_.
15465 * output.cc (Output_section::Output_section): Initialize new
15466 fields.
15467 (Output_section::add_input_section): Add an entry to
15468 input_sections_ if may_sort or must_sort are true.
15469 (Output_section::set_final_data_size): Call
15470 sort_attached_input_sections if necessary.
15471 (Output_section::Input_section_sort_entry): Define new class.
15472 (Output_section::Input_section_sort_compare::operator()): New
15473 function.
15474 (Output_section::sort_attached_input_sections): New function.
15475 * configure.ac: Check whether the compiler supports constructor
15476 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15477 * testsuite/initpri1.c: New file.
15478 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15479 CONSTRUCTOR_PRIORITY.
15480 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15481 (initpri1_LDFLAGS): New variable.
15482 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15483
15484 2008-03-27 Ian Lance Taylor <iant@google.com>
15485
15486 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15487 * testsuite/common_test_1.c: New file.
15488 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15489 (common_test_1_SOURCES): New variable.
15490 (common_test_1_DEPENDENCIES): New variable.
15491 (common_test_1_LDFLAGS): New variable.
15492
15493 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15494 and commons_ correctly when NAME/VERSION does not override
15495 NAME/NULL.
15496 * testsuite/ver_test_6.c: New file.
15497 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15498 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15499 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15500
15501 2008-03-26 Ian Lance Taylor <iant@google.com>
15502
15503 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15504 of an undefined symbol from a version script.
15505 * testsuite/Makefile.am (ver_test_5.so): New target.
15506 (ver_test_5.o): New target.
15507 (check_SCRIPTS): Add ver_test_5.sh.
15508 (check_DATA): Add ver_test_5.syms.
15509 (ver_test_5.syms): New target.
15510 * testsuite/ver_test_5.cc: New file.
15511 * testsuite/ver_test_5.script: New file.
15512 * testsuite/ver_test_5.sh: New file.
15513 * Makefile.in, testsuite/Makefile.in: Rebuild.
15514
15515 PR gold/5986
15516 Fix problems building gold with gcc 4.3.0.
15517 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15518 (gold_error_at_location, gold_warning_at_location): Use it.
15519 * configure.ac: Check whether we can compile and use a template
15520 function with a printf attribute.
15521 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15522 when jumping over bytes.
15523 * object.cc: Instantiate Object::read_section_data.
15524 * debug.h: Include <cstring>
15525 * dwarf_reader.cc: Include <algorithm>
15526 * main.cc: Include <cstring>.
15527 * options.cc: Include <cstring>.
15528 * output.cc: Include <cstring>.
15529 * script.cc: Include <cstring>.
15530 * script.h: Include <string>.
15531 * symtab.cc: Include <cstring> and <algorithm>.
15532 * target-select.cc: Include <cstring>.
15533 * version.cc: Include <string>.
15534 * testsuite/testmain.cc: Include <cstdlib>.
15535 * configure, config.in: Rebuild.
15536
15537 2008-03-25 Ian Lance Taylor <iant@google.com>
15538
15539 * options.cc: Include "../bfd/bfdver.h".
15540 (options::help): Print bug reporting address.
15541
15542 * version.cc (print_version): Adjust output for current value of
15543 BFD_VERSION_STRING.
15544
15545 * NEWS: New file.
15546
15547 * options.cc (options::help): Print list of supported targets.
15548 * target-select.h: Include <vector>.
15549 (class Target_selector): Make machine_, size_, and is_big_endian_
15550 fields const. Add bfd_name_ and instantiated_target_ fields.
15551 (Target_selector::Target_selector): Add bfd_name parameter.
15552 (Target_selector::recognize): Make non-virtual, call
15553 do_recognize.
15554 (Target_selector::recognize_by_name): Make non-virtual, call
15555 do_recognize_by_name.
15556 (Target_selector::supported_names): New function.
15557 (Target_selector::bfd_name): New function.
15558 (Target_selector::do_instantiate_target): New pure virtual
15559 function.
15560 (Target_selector::do_recognize): New virtual function.
15561 (Target_selector::do_recognize_by_name): New virtual function.
15562 (Target_selector::instantiate_target): New private function.
15563 (supported_target_names): Declare.
15564 * target-select.cc (Target_selector::Target_selector): Update for
15565 new parameter and fields.
15566 (select_target_by_name): Check that the name matches before
15567 calling recognize_by_name.
15568 (supported_target_names): New function.
15569 * i386.cc (class Target_selector_i386): Update Target_selector
15570 constructor call. Remove recognize and recognize_by_name. Add
15571 do_instantiate_target.
15572 * x86_64.cc (class Target_selector_x86_64): Likewise.
15573 * testsuite/testfile.cc (class Target_selector_test): Update for
15574 changes to Target_selector.
15575
15576 * README: Rewrite, with some notes on unsupported features.
15577
15578 2008-03-24 Cary Coutant <ccoutant@google.com>
15579
15580 * i386.cc (Target_i386::Got_type): New enum declaration.
15581 (Target_i386::Scan::local): Updated callers of Output_data_got
15582 member functions.
15583 (Target_i386::Scan::global): Likewise.
15584 (Target_i386::Relocate::relocate): Likewise.
15585 (Target_i386::Relocate::relocate_tls): Likewise.
15586 * object.h (Got_offset_list): New class.
15587 (Sized_relobj::local_has_got_offset): Added got_type parameter.
15588 (Sized_relobj::local_got_offset): Likewise.
15589 (Sized_relobj::set_local_got_offset): Likewise.
15590 (Sized_relobj::local_has_tls_got_offset): Removed.
15591 (Sized_relobj::local_tls_got_offset): Removed.
15592 (Sized_relobj::set_local_tls_got_offset): Removed.
15593 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
15594 * output.cc (Output_data_got::add_global): Added got_type parameter.
15595 (Output_data_got::add_global_with_rel): Likewise.
15596 (Output_data_got::add_global_with_rela): Likewise.
15597 (Output_data_got::add_global_pair_with_rel): New function.
15598 (Output_data_got::add_global_pair_with_rela): New function.
15599 (Output_data_got::add_local): Added got_type parameter.
15600 (Output_data_got::add_local_with_rel): Likewise.
15601 (Output_data_got::add_local_with_rela): Likewise.
15602 (Output_data_got::add_local_pair_with_rel): New function.
15603 (Output_data_got::add_local_pair_with_rela): New function.
15604 (Output_data_got::add_global_tls): Removed.
15605 (Output_data_got::add_global_tls_with_rel): Removed.
15606 (Output_data_got::add_global_tls_with_rela): Removed.
15607 (Output_data_got::add_local_tls): Removed.
15608 (Output_data_got::add_local_tls_with_rel): Removed.
15609 (Output_data_got::add_local_tls_with_rela): Removed.
15610 * output.h (Output_data_got::add_global): Added got_type parameter.
15611 (Output_data_got::add_global_with_rel): Likewise.
15612 (Output_data_got::add_global_with_rela): Likewise.
15613 (Output_data_got::add_global_pair_with_rel): New function.
15614 (Output_data_got::add_global_pair_with_rela): New function.
15615 (Output_data_got::add_local): Added got_type parameter.
15616 (Output_data_got::add_local_with_rel): Likewise.
15617 (Output_data_got::add_local_with_rela): Likewise.
15618 (Output_data_got::add_local_pair_with_rel): New function.
15619 (Output_data_got::add_local_pair_with_rela): New function.
15620 (Output_data_got::add_global_tls): Removed.
15621 (Output_data_got::add_global_tls_with_rel): Removed.
15622 (Output_data_got::add_global_tls_with_rela): Removed.
15623 (Output_data_got::add_local_tls): Removed.
15624 (Output_data_got::add_local_tls_with_rel): Removed.
15625 (Output_data_got::add_local_tls_with_rela): Removed.
15626 * resolve.cc (Symbol::override_base_with_special): Removed
15627 reference to has_got_offset_ field.
15628 * symtab.cc (Symbol::init_fields): Replaced initialization
15629 of got_offset_ with got_offsets_. Removed initialization
15630 of has_got_offset_
15631 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
15632 (Symbol::got_offset): Likewise.
15633 (Symbol::set_got_offset): Likewise.
15634 (Symbol::has_tls_got_offset): Removed.
15635 (Symbol::tls_got_offset): Removed.
15636 (Symbol::set_tls_got_offset): Removed.
15637 (Symbol::got_offset_): Removed.
15638 (Symbol::tls_mod_got_offset_): Removed.
15639 (Symbol::tls_pair_got_offset_): Removed.
15640 (Symbol::got_offsets_): New field.
15641 (Symbol::has_got_offset): Removed.
15642 (Symbol::has_tls_mod_got_offset): Removed.
15643 (Symbol::has_tls_pair_got_offset): Removed.
15644 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
15645 (Target_x86_64::Scan::local): Updated callers of Output_data_got
15646 member functions.
15647 (Target_x86_64::Scan::global): Likewise.
15648 (Target_x86_64::Relocate::relocate): Likewise.
15649 (Target_x86_64::Relocate::relocate_tls): Likewise.
15650
15651 2008-03-25 Ben Elliston <bje@au.ibm.com>
15652
15653 * yyscript.y: Fix spelling error in comment.
15654
15655 2008-03-24 Ian Lance Taylor <iant@google.com>
15656
15657 * options.h (class General_options): Define build_id option.
15658 * layout.h (class Layout): Declare write_build_id, create_note,
15659 create_build_id. Add build_id_note_ member.
15660 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
15661 "libiberty.h", "md5.h", "sha1.h".
15662 (Layout::Layout): Initialize eh_frame_data_,
15663 eh_frame_hdr_section_, and build_id_note_.
15664 (Layout::finalize): Call create_build_id.
15665 (Layout::create_note): New function, broken out of
15666 Layout::create_gold_note.
15667 (Layout::create_gold_note): Call create_note.
15668 (Layout::create_build_id): New function.
15669 (Layout::write_build_id): New function.
15670 (Close_task_runner::run): Call write_build_id.
15671
15672 * x86_64.cc: Correct license to GPLv3.
15673
15674 2008-03-23 Ian Lance Taylor <iant@google.com>
15675
15676 * options.cc: Include "demangle.h".
15677 (parse_optional_string): New function.
15678 (parse_long_option): Handle takes_optional_argument.
15679 (parse_short_option): Update dash_z initializer. Handle
15680 takes_optional_argument.
15681 (General_options::General_options): Initialize do_demangle_.
15682 (General_options::finalize): Set do_demangle_. Handle demangling
15683 style.
15684 * options.h (parse_optional_string): Declare.
15685 (struct One_option): Add optional_arg field. Update constructor.
15686 Update call constructor calls. Add takes_optional_argument
15687 function.
15688 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
15689 (DEFINE_optional_string): Define.
15690 (General_options::demangle): Change from DEFINE_bool to
15691 DEFINE_optional_string.
15692 (General_options::no_demangle): New function.
15693 (General_options::do_demangle): New function.
15694 (General_options::set_do_demangle): New function.
15695 (General_options::execstack_status_): Move definition to end of
15696 class definition.
15697 (General_options::static_): Likewise.
15698 (General_options::do_demangle_): New field.
15699 * object.cc (big_endian>::get_symbol_location_info): Call
15700 Options::do_demangle, not Options::demangle.
15701 * symtab.cc (demangle): Likewise.
15702
15703 2008-03-22 Ian Lance Taylor <iant@google.com>
15704
15705 * gold.h: Include <cstddef> and <sys/types.h>
15706 * options.h: Include <cstring>.
15707
15708 2008-03-21 Ian Lance Taylor <iant@google.com>
15709
15710 * Added source code to GNU binutils.
15711 \f
15712 Copyright (C) 2008-2014 Free Software Foundation, Inc.
15713
15714 Copying and distribution of this file, with or without modification,
15715 are permitted in any medium without royalty provided the copyright
15716 notice and this notice are preserved.
15717
15718 Local Variables:
15719 mode: change-log
15720 left-margin: 8
15721 fill-column: 74
15722 version-control: never
15723 End: