PR breakpoints/17000: user breakpoint not inserted if software-single-step at same...
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
c23dd342
L
12014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR gold/16945
4 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
5 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
6
5fe7ffdc
AM
72014-05-15 Alan Modra <amodra@gmail.com>
8
9 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
10 Compare FDE contents with DW_CFA_nop rather than 0.
11
a82bef93
ST
122014-05-13 Sriraman Tallam <tmsriram@google.com>
13
14 * symtab.h (may_need_copy_reloc): Remove check for position independent
15 code.
16 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
17 position independence before pc absolute may_need_copy_reloc call.
18 Add check for executable output befor pc relative may_need_copy_reloc
19 call.
20 * i386.cc: Ditto.
21 * arm.cc: Ditto.
22 * sparc.cc: Ditto.
23 * tilegx.cc: Ditto.
24 * powerpc.cc: Add check for no position independence before
25 may_need_copy_reloc calls.
26 * testsuite/pie_copyrelocs_test.cc: New file.
27 * testsuite/pie_copyrelocs_shared_test.cc: New file.
28 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 29 * Makefile.in: Regenerate.
a82bef93 30
53c66605
ML
312014-05-08 Martin Liška <mliska@suse.cz>
32
33 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
34
57b2284c
CC
352014-05-06 Cary Coutant <ccoutant@google.com>
36
37 PR gold/16900
38 * i386.cc (Output_data_got_plt_i386): New class.
39 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
40 parameter. Change all callers.
41 (Output_data_plt_i386::layout_): Remove.
42 (Output_data_plt_i386::got_plt_): Change type.
43 (Target_i386::got_plt_): Change type. Change all references.
44 (Target_i386::got_section): Create instance of new class.
45 (Output_data_got_plt_i386::do_write): New function.
46 * x86_64.cc (Output_data_got_plt_x86_64): New class.
47 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
48 parameter. Change all callers.
49 (Output_data_plt_x86_64::layout_): Remove.
50 (Output_data_plt_x86_64::got_plt_): Change type.
51 (Target_x86_64::got_plt_): Change type. Change all references.
52 (Target_x86_64::got_section): Create instance of new class.
53 (Output_data_got_plt_x86_64::do_write): New function.
54 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
55 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
56 class.
57
6b97515d 582014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 59
6b97515d
CC
60 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
61 if we have pubnames/pubtypes.
62
d1bddd3c
CC
632014-05-02 Cary Coutant <ccoutant@google.com>
64
5fe7ffdc
AM
65 * defstd.cc (in_segment): Define __ehdr_start here...
66 * layout.cc (Layout::finalize): ...Instead of here. Set the
67 output segment when known.
68 * resolve.cc (Symbol::override_base_with_special): Remember
69 the original binding.
70 * symtab.cc (Symbol::set_output_segment): New function.
71 (Symbol::set_undefined): New function.
72 * symtab.h (Symbol::is_weak_undefined): Check original undef
73 binding.
74 (Symbol::is_strong_undefined): New function.
75 (Symbol::set_output_segment): New function.
76 (Symbol::set_undefined): New function.
77 * target-reloc.h (is_strong_undefined): Remove.
78 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
79 Check for hidden undefs.
80 (relocate_section): Call Symbol::is_strong_undefined.
81
82 * testsuite/Makefile.am (ehdr_start_test_1)
83 (ehdr_start_test_2, ehdr_start_test_3)
84 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
85 * testsuite/Makefile.in: Regenerate.
86 * testsuite/ehdr_start_def.cc: New source file.
87 * testsuite/ehdr_start_test.cc: New source file.
88 * testsuite/ehdr_start_test.t: New linker script.
89 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 90
7849f6d8
CC
912014-04-23 Cary Coutant <ccoutant@google.com>
92
bf2cc635 93 PR gold/16870
7849f6d8
CC
94 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
95
99fd8cff
CC
962014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
97
98 * layout.cc (Layout::include_section): Allow a target to decide
99 whether to include a section.
100 * target.h (Target::should_include_section): New function.
101 (Target::do_should_include_section): New function.
102
91f43acd
CC
1032014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
104
105 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
106 inline into ...
107 (Copy_relocs::emit): ... here.
108 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
109 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
110 (Copy_reloc_entry::entries_): Change from private to protected.
111
c4eb27e1
ST
1122014-04-02 Sriraman Tallam <tmsriram@google.com>
113
114 * icf.cc (get_section_contents): Replace copies of reloc
115 vectors with const references.
116
ae447ddd
CC
1172014-04-02 Cary Coutant <ccoutant@google.com>
118
119 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
120 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
121 * configure: Regenerate.
122 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
123 -fno-use-linker-plugin.
124 (LINK1, CXXLINK1): Add it to the link command.
125 * testsuite/Makefile.in: Regenerate.
126
fa47fa92
AM
1272014-03-12 Alan Modra <amodra@gmail.com>
128
129 * Makefile.in: Regenerate.
130
9b12c500
CC
1312014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
132
133 * symtab.h (Symbol::set_nonvis): New function.
134
beacaa96
CC
1352014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
136
137 * symtab.cc (Sized_symbol<32>::init_output_data):
138 Instantiate the template.
139 (Sized_symbol<64>::init_output_data): Likewise.
140
800d9823
CC
1412014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
142
143 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
144 adjust dynamic symbol value.
145 * target.h (Target::adjust_dyn_symbol): New function.
146 (Target::do_adjust_dyn_symbol): New function.
147
918fc1f8 1482014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 149
918fc1f8
CC
150 * output.cc (Output_data_dynamic::Dynamic_entry::write):
151 Get the value of DYNAMIC_CUSTOM dynamic entry.
152 * output.h (Output_data_dynamic::add_custom): New function.
153 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
154 dynamic entry.
155 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
156 * target.h (Target::dynamic_tag_custom_value): New function.
157 (Target::do_dynamic_tag_custom_value): New function.
158
98ff9231
CC
1592014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
160
161 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
162 dynsym indexes.
163 * target.h (Target::has_custom_set_dynsym_indexes): New function.
164 (Target::do_has_custom_set_dynsym_indexes): New function.
165 (Target::set_dynsym_indexes): New function.
166 (Target::do_set_dynsym_indexes): New function.
167
b80eed39
AM
1682014-03-07 Alan Modra <amodra@gmail.com>
169
170 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
171 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
172 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
173 (Powerpc_relocate_functions::has_overflow_bitfield,
174 overflowed): Use the above.
175 (Target_powerpc::Relocate::relocate): Correct overflow checking
176 for a number of relocations. Modify overflow test for 16-bit
177 fields in instructions to signed/unsigned according to whether
178 the field takes a signed or unsigned value.
179
4b95cf5c
AM
1802014-03-05 Alan Modra <amodra@gmail.com>
181
182 Update copyright years.
183
45965137
AM
1842014-03-05 Alan Modra <amodra@gmail.com>
185
186 * powerpc.cc (Target_powerpc::Scan::local, global): Support
187 R_PPC64_ADDR64_LOCAL.
188 (Target_powerpc::Relocate::relocate): Likewise.
189
2c80b753
AM
1902014-03-03 Alan Modra <amodra@gmail.com>
191
192 * dwp.cc (print_version): Update copyright year to current.
193
c1c69e83
AM
1942014-02-10 Alan Modra <amodra@gmail.com>
195
196 * po/gold.pot: Regenerate.
197
dd0c4e70
CC
1982014-02-06 Cary Coutant <ccoutant@google.com>
199
200 Fix problem where -u is ignored when a weak undef is seen.
201
202 * archive.cc (Library_base::should_include_member): Reorder
203 code to check for -u option if a weak undef has already been seen.
204 * testsuite/Makefile.am (weak_undef_test_2): New test case.
205 * testsuite/Makefile.in: Regenerate.
206 * testsuite/weak_undef_file3.cc: New file.
207 * testsuite/weak_undef_file4.cc: New file.
208 * testsuite/weak_undef_test_2.cc: New file.
209
1a221d3d
CC
2102014-02-05 Cary Coutant <ccoutant@google.com>
211
212 Fix issues with gold undefined symbol diagnostics.
213
214 PR binutils/15435
215 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
216 check to here.
217 * target-reloc.h (is_strong_undefined): New function.
218 (relocate_section): Move undef vtable symbol check from here.
219 Check for is_strong_undefined.
220
e889f0a4 2212014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 222
e889f0a4
CC
223 Fix problems with the --dynamic-list option.
224
225 PR gold/13577
226 * options.cc (General_options::parse_dynamic_list):
227 Set have_dynamic_list_.
228 (General_options::General_options): Initialize have_dynamic_list_.
229 (General_options::finalize): Turn off -Bsymbolic and
230 -Bsymbolic-functions if --dynamic-list provided.
231 * options.h (General_options::have_dynamic_list): New function.
232 (General_options::have_dynamic_list_): New data member.
233 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
234 correctly.
5fe7ffdc 235
e889f0a4
CC
236 PR gold/16530
237 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
238 in --dynamic-list, mark it.
5fe7ffdc 239
e889f0a4
CC
240 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
241 (dynamic_list_2): New test case.
242 * testsuite/Makefile.in: Regenerate.
243 * testsuite/dynamic_list_2.cc: New file.
244 * testsuite/dynamic_list_2.t: New file.
245 * testsuite/dynamic_list_lib1.cc: New file.
246 * testsuite/dynamic_list_lib2.cc: New file.
247 * testsuite/gc_dynamic_list_test.c: New file.
248 * testsuite/gc_dynamic_list_test.sh: New file.
249 * testsuite/gc_dynamic_list_test.t: New file.
250
ec673e64
CC
2512014-01-28 Cary Coutant <ccoutant@google.com>
252
253 Add .gdb_index version 7 support.
254
255 * gold/dwarf_reader.cc: include <utility> (for make_pair).
256 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
257 debug sections.
258 (Dwarf_ranges_table::read_ranges_table): Likewise.
259 (Dwarf_pubnames_table::read_section): Check for GNU-style
260 sections, and for compressed debug sections.
261 (Dwarf_pubnames_table::read_header): Compute end address of table.
262 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
263 for end of list by offset, not by offset == 0.
264 (Dwarf_info_reader::do_read_string_table): Check for compressed
265 debug sections.
266 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
267 Initialize new data members.
268 (Dwarf_pubnames_table::next_name): return flag_byte.
269 (Dwarf_pubnames_table::end_of_table_): New data member.
270 (Dwarf_pubnames_table::is_gnu_style_): New data member.
271 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
272 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
273 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
274 read skeleton type unit DIEs.
275 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
276 (Gdb_index::do_write): Write flag_byte.
277 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
278 (Gdb_index::Cu_vector): Store flags along with cu indexes.
279 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
280 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
281
221fd5d5
L
2822014-01-08 H.J. Lu <hongjiu.lu@intel.com>
283
284 * version.cc (print_version): Update copyright year to 2014.
285
6c09fb0b
ILT
2862013-12-19 Dimitry Andric <dimitry@andric.com>
287
288 * stringpool.cc (Stringpool_template::reserve): Add
289 HAVE_UNORDERED_MAP case.
290 * stringpool.cc (Stringpool_template::print_stats): Likewise.
291
8356f2d0
CC
2922013-12-18 Cary Coutant <ccoutant@google.com>
293
294 * configure.ac: Check for <unordered_set> and <unordered_map>.
295 * config.in: Regenerate.
296 * configure: Regenerate.
297 * system.h: Use <unordered_set> and <unordered_map> if available.
298
f2c7d7ee
RM
2992013-12-10 Roland McGrath <mcgrathr@google.com>
300
301 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
302 with $(INSTALL_PROGRAM_ENV).
303 * Makefile.in: Regenerate.
304
6632e8cc
CC
3052013-11-22 Cary Coutant <ccoutant@google.com>
306
307 * configure.ac: Add check for which library is needed for
308 dlopen.
309 * configure: Regenerate.
310
0c075858
CC
3112013-11-22 Cary Coutant <ccoutant@google.com>
312
313 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
314 assembler.
315 * testsuite/Makefile.in: Regenerate.
316
f49fe902
L
3172013-11-17 H.J. Lu <hongjiu.lu@intel.com>
318
319 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
320 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
321 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
322 (Target_x86_64<size>::Scan::local): Likewise.
323 (Target_x86_64<size>::Scan::global): Likewise.
324 (Target_x86_64<size>::Relocate::relocate): Likewise.
325 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
326 Likewise.
327 (Target_x86_64<size>::Scan::check_non_pic(): Handle
328 R_X86_64_PC32_BND.
329
330 * testsuite/Makefile.am (check_PROGRAMS): Add
331 exception_x86_64_bnd_test.
332 (exception_x86_64_bnd_test_SOURCES): New macro.
333 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
334 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
335 (exception_x86_64_bnd_test_LDADD): Likewise.
336 (exception_x86_64_bnd_1.o): New rule.
337 (exception_x86_64_bnd_2.o): Likewise.
338 * testsuite/Makefile.in: Regenerated.
339
9055360d
AM
3402013-11-15 Alan Modra <amodra@gmail.com>
341
342 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
343 accessor.
344 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
345 Only call ppc64_local_entry_offset for 64-bit. Restrict
346 symval_for_branch lookup to ELFv1.
347 (Stub_table::add_plt_call_entry): Use unsigned int off.
348 (Output_data_glink::Address, invalid_address): New.
349 (Output_data_glink::add_eh_frame): Move out of line. Add
350 support for ELFv2.
351 (Output_data_glink::add_global_entry, find_global_entry,
352 global_entry_address): New functions.
353 (Output_data_glink::global_entry_stubs_, end_branch_table_,
354 ge_size): New variables.
355 (Output_data_glink::set_final_data_size): Add global entry
356 stub sizing.
357 (Output_data_glink::do_write): Write global entry stubs.
358 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
359 parameter. Return true for ELFv2. Adjust callers.
360 (Target_powerpc::Scan::local, global): Restrict opd lookup to
361 ELFv1. Similarly for ifunc and dynamic relocation processing
362 specific to ELFv1. Recognize that symbols are defined on
363 their plt entries for ELFv2.
364 (Target_powerpc::symval_for_branch): Assert if called for
365 ELFv2 or ppc32.
366 (Target_powerpc::Relocate::relocate): Use global entry plt
367 stub for symbol value if such exists on ELFv2.
368 (Target_powerpc::Relocate::relocate): Don't call
369 symval_for_branch when ELFv2. Do adjust for local entry
370 offset when ELFv2.
371 (Target_powerpc::do_dynsym_value): Set symbols to global entry
372 plt stub for ELFv2.
373 (Target_powerpc::do_plt_address_for_global): Similarly.
374
cafdd569
CC
3752013-11-14 Cary Coutant <ccoutant@google.com>
376
377 Revert patch -- this did not fix the problem, and there is
378 no race there.
379
380 2013-11-14 Cary Coutant <ccoutant@google.com>
381
382 PR gold/14860
383 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
384 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
385 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
386 updating fde_offsets_.
387 (Eh_frame_hdr::lock_): New data member.
388
94e49e16
CC
3892013-11-14 Cary Coutant <ccoutant@google.com>
390
391 * dwp.cc (Dwo_file_entry): New type.
392 (File_list): Use Dwo_file_entry.
393 (Dwo_file::verify): New function.
394 (Dwo_file::verify_dwo_list): New function.
395 (Dwo_file::sized_verify_dwo_list): New function.
396 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
397 list.
398 (Dwp_options): New enum type.
399 (dwp_options): Add --verify-only.
400 (usage): Likewise.
401 (main): Likewise.
402 * dwp.h (gold_info): Add declaration.
403
7cdd7d57
CC
4042013-11-14 Cary Coutant <ccoutant@google.com>
405
406 PR gold/14860
407 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
408 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
409 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
410 updating fde_offsets_.
411 (Eh_frame_hdr::lock_): New data member.
412
1d946cb3
CC
4132013-11-06 Cary Coutant <ccoutant@google.com>
414
415 PR gold/15758
416 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
417 before reloc sections.
418
4f65b40e
AM
4192013-11-04 Alan Modra <amodra@gmail.com>
420
421 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
422 (Symbol::needs_dynamic_reloc): Test new flag.
423 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
424 (Target_powerpc::Scan::get_reference_flags): Add target param.
425 Return FUNC_DESC_ABI for 64-bit ELFv1.
426 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
427 call.
428 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
429 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
430
908794a9
CC
4312013-10-31 Cary Coutant <ccoutant@google.com>
432
433 Restore support for dwp v2 DWARF package file format.
434
435 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
436 tu_length parameter. Adjust all callers.
437 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
438 * dwp.cc: Include dwarf.h.
439 (Section_bounds): New struct type.
440 (Unit_set): New struct type.
441 (Dwo_file::Dwo_file): Initialize new data member.
442 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
443 Combine and rename to...
444 (Dwo_file::read_unit_index): ...this.
445 (Dwo_file::sized_read_compunit_index)
446 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
447 (Dwo_file::sized_read_unit_index): ...this.
448 (Dwo_file::copy_section): Remove section_name, is_str_offsets
449 parameters; add section_id parameter.
450 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
451 (Dwo_file::add_unit_set): ...this.
452 (Dwo_file::shndx_map_): Remove.
453 (Dwo_file::sect_offsets_): New data member.
454 (Dwp_output_file::Dwp_output_file): Initialize new data members.
455 (Dwp_output_file::add_section): Rename to...
456 (Dwp_output_file::add_contribution): ...this.
457 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
458 (Dwp_output_file::add_tu_set): Likewise.
459 (Dwp_output_file::Contribution): New type.
460 (Dwp_output_file::Section::contributions): New data member.
461 (Dwp_output_file::Cu_or_tu_set): Remove.
462 (Dwp_output_file::Section::Section): New ctor.
463 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
464 (Dwp_output_file::Dwp_index::Section_table): New type.
465 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
466 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
467 parameter.
468 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
469 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
470 (Dwp_output_file::Dwp_index::section_table): New member function.
471 (Dwp_output_file::Dwp_index::section_table_end): New member function.
472 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
473 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
474 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
475 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
476 (Dwp_output_file::Dwp_index::section_table_): New data member.
477 (Dwp_output_file::Dwp_index::section_mask_): New data member.
478 (Dwp_output_file::add_output_section): New member function.
479 (Dwp_output_file::write_new_section): New member function.
480 (Dwp_output_file::write_contributions): New member function.
481 (Dwp_output_file::section_id_map_): New data member.
482 (class Dwo_id_info_reader): Remove.
483 (class Unit_reader): New class.
484 (get_dwarf_section_name): New function.
485 (Dwo_file::read_executable): Adjust initializations of class data.
486 (Dwo_file::read): Add support for v2 package file format.
487 (Dwo_file::read_unit_index): Likewise.
488 (Dwo_file::sized_read_unit_index): Likewise.
489 (Dwo_file::copy_section): Likewise.
490 (Dwo_file::add_unit_set): Likewise.
491 (Dwp_output_file::add_output_section): Likewise.
492 (Dwp_output_file::add_contribution): Likewise.
493 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
494 for empty slot.
495 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
496 file format.
497 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
498 slot.
499 (Dwp_output_file::initialize): Remove unused function.
500 (Dwp_output_file::finalize): Add support for v2 package file format.
501 (Dwp_output_file::write_index): Likewise.
502 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
503 function prototype.
504
2500c017
CC
5052013-10-31 Cary Coutant <ccoutant@google.com>
506
507 * configure.ac: Fix check for -fmerge-constants.
508 * configure.ac: Regenerate.
509
dd0845d7
RM
5102013-10-30 Roland McGrath <mcgrathr@google.com>
511
512 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
513 Correct 9-byte nop sequence to match what the assembler generates.
514
b4f7960d
AM
5152013-10-30 Alan Modra <amodra@gmail.com>
516
517 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
518 ppc64_local_entry_offset, ppc64_local_entry_offset,
519 do_read_symbols): New functions.
520 (Powerpc_relobj::e_flags_, st_other_): New vars.
521 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
522 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
523 (Powerpc_relobj::e_flags_): New var.
524 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
525 and adjust for ELFv2.
526 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
527 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
528 (Powerpc_dynobj::do_find_special_sections): Likewise.
529 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
530 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
531 to ELFv2 local entry.
532 (Target_powerpc::do_relax): No thread safe barriers needed for
533 ELFv2.
534 (Output_data_plt_powerpc::initial_plt_entry_size_,
535 plt_entry_size): Delete. Replace all uses with
536 first_plt_entry_offset() and plt_entry_size().
537 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
538 reserved_size parm. Update callers.
539 (Output_data_plt_powerpc::entry_count): Update.
540 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
541 and use Target_powerpc::first_plt_entry_offset().
542 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
543 rename to plt_entry_size.
544 (Output_data_plt_powerpc::add_ifunc_entry,
545 add_local_ifunc_entry): Adjust reloc for ELFv2.
546 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
547 (glink_eh_frame_fde_64v2): New.
548 (Stub_table::plt_call_size): Support ELFv2 sizing.
549 (Output_data_glink::add_eh_frame): Use the new FDE.
550 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
551 (Stub_table::do_write): Write ELFv2 stubs and glink.
552 (Target_powerpc::Relocate::relocate): Replaces nop after call
553 with ld 2,24(1) and adjust local offset destination for ELFv2.
554
f9c6b907
AM
5552013-10-30 Alan Modra <amodra@gmail.com>
556
557 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
558 (Target_powerpc::Scan::global, local): Likewise.
559 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
560 on all ppc64 @h and @ha relocs.
561
e84fe78f
AM
5622013-10-14 Alan Modra <amodra@gmail.com>
563
564 * output.h (Output_data_got::add_constant): Tidy.
565 (Output_data_got::add_constant_pair): New function.
566 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
567 methods used so as to first call reserve_ent().
568
679e4abf
RM
5692013-10-11 Roland McGrath <mcgrathr@google.com>
570
44dcb735
RM
571 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
572 add_got_entry and add_got_entry_pair.
573
13323c49
RM
574 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
575 (HAVE_PUBNAMES): Likewise.
576 * configure: Regenerate.
577
1496b446
RM
578 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
579 * testsuite/Makefile.in: Regenerate.
580
cc84c10b
RM
581 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
582 Remove const from declaration.
583 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
584 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
585 * output.h (Output_file_header): Remove const from member target_
586 and corresponding constructor argument.
587 * output.cc (Output_file_header::Output_file_header): Update prototype.
588 (Output_file_header::do_sized_write): Use this->target_ in place
589 of parameters()->target().
590
52f66a2c
RM
591 * testsuite/undef_symbol.cc (Foo::get_a): New method.
592
2b64b551
RM
593 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
594 * configure: Regenerate.
595 * Makefile.in: Regenerate.
596 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
597 * testsuite/merge_string_literals_2.c: Likewise.
598 * testsuite/Makefile.am
599 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
600 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
601 literal -fmerge-constants.
602 * testsuite/Makefile.in: Regenerate.
603
43819297
RM
604 * i386.cc (Target_i386): Remove unused member dynbss_.
605 * arm.cc (Target_arm): Likewise.
606 * powerpc.cc (Target_powerpc): Likewise.
607 * sparc.cc (Target_sparc): Likewise.
608 * tilegx.cc (Target_tilegx): Likewise.
609 * x86_64.cc (Target_x86_64): Likewise.
610 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
611 type_signature_, type_offset_.
612 * plugin.h (Plugin_hook): Remove unused member layout_.
613 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
614 mapfile_.
615 (Read_member): Remove unused members input_objects_, symtab_,
616 mapfile_, layout_.
617 (Check_library): Remove unused member symtab_.
618 * archive.h (Lib_group): Remove unused member lib_.
619 * archive.cc (Lib_group::Lib_group): Update initializer.
620 * incremental.h (Incremental_binary): Remove unused member target_.
621 (Incremental_script_entry): Removed unused member script_.
622 * layout.h (Write_symbols_task): Remove unused member input_objects_.
623 * icf.h (Icf): Remove unused member num_tracked_relocs.
624
39d9ead7
RM
625 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
626 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
627 its only use.
628 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
629
679e4abf
RM
630 * archive.h: Use struct rather than class for forward declaration
631 of Read_symbols_data.
632
54de2ea6
CC
6332013-10-07 Cary Coutant <ccoutant@google.com>
634
635 PR gold/16010
636 * testsuite/Makefile.am (icf_test): Fix dependencies.
637 (icf_safe_test): Likewise.
638 (icf_safe_so_test): Likewise.
639 (large_symbol_alignment): Add empty _LDADD rule.
640 * testsuite/Makefile.in: Regenerate.
641
b14016f0
L
6422013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
643
644 PR gold/15927
645 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
646 relocation for R_X86_64_32 on x32.
647
eb426534
RM
6482013-08-27 Roland McGrath <mcgrathr@google.com>
649
650 * output.cc (Output_segment::set_section_addresses): Take new
651 Target* argument. If target->isolate_execinstr() and the segment
652 is executable and starts at a target->abi_pagesize() boundary,
653 pad its end out to a target->abi_pagesize() boundary with code fill.
654 * output.h (Output_segment::set_section_addresses): Update decl.
655 * layout.h (Layout::check_output_data_for_reset_values): Take new
656 argument RELAX_OUTPUTS.
657 (Layout): New member relax_output_list_.
658 (Layout::add_relax_output): New method.
659 * layout.cc (Layout::Layout): Update constructor.
660 (Layout::reset_relax_output): New method.
661 (Layout::clean_up_after_relaxation): Call it.
662 (Layout::prepare_for_relaxation): Update caller.
663 (Layout::set_segment_offsets): Update callers of set_section_addresses.
664 Call reset_relax_output before re-processing segments for
665 isolate_execinstr case.
666 (Layout::write_data): Handle relax_output_list_.
667 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
668 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
669
9aff4b7a
NC
6702013-08-23 Yuri Chornoivan <yurchor@ukr.net>
671
672 PR binutils/15834
673 * object.h: Fix typos.
674
93f8221c
RM
6752013-08-16 Roland McGrath <mcgrathr@google.com>
676
677 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
678 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
679
e44c3715
CC
6802013-08-07 Cary Coutant <ccoutant@google.com>
681
682 Revert support for v2 DWP files:
683
684 2013-03-01 Cary Coutant <ccoutant@google.com>
685
686 Add dwp support for v2 DWARF package file format.
687 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
688 tu_length parameter. Adjust all callers.
689 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
690 * dwp.cc: Include dwarf.h.
691 (Section_bounds): New struct type.
692 (Unit_set): New struct type.
693 (Dwo_file::Dwo_file): Initialize new data member.
694 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
695 Combine and rename to...
696 (Dwo_file::read_unit_index): ...this.
697 (Dwo_file::sized_read_compunit_index)
698 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
699 (Dwo_file::sized_read_unit_index): ...this.
700 (Dwo_file::copy_section): Remove section_name, is_str_offsets
701 parameters; add section_id parameter.
702 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
703 (Dwo_file::add_unit_set): ...this.
704 (Dwo_file::shndx_map_): Remove.
705 (Dwo_file::sect_offsets_): New data member.
706 (Dwp_output_file::Dwp_output_file): Initialize new data members.
707 (Dwp_output_file::add_section): Rename to...
708 (Dwp_output_file::add_contribution): ...this.
709 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
710 (Dwp_output_file::add_tu_set): Likewise.
711 (Dwp_output_file::Contribution): New type.
712 (Dwp_output_file::Section::contributions): New data member.
713 (Dwp_output_file::Cu_or_tu_set): Remove.
714 (Dwp_output_file::Section::Section): New ctor.
715 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
716 (Dwp_output_file::Dwp_index::Section_table): New type.
717 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
718 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
719 parameter.
720 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
721 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
722 (Dwp_output_file::Dwp_index::section_table): New member function.
723 (Dwp_output_file::Dwp_index::section_table_end): New member function.
724 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
725 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
726 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
727 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
728 (Dwp_output_file::Dwp_index::section_table_): New data member.
729 (Dwp_output_file::Dwp_index::section_mask_): New data member.
730 (Dwp_output_file::add_output_section): New member function.
731 (Dwp_output_file::write_new_section): New member function.
732 (Dwp_output_file::write_contributions): New member function.
733 (Dwp_output_file::section_id_map_): New data member.
734 (class Dwo_id_info_reader): Remove.
735 (class Unit_reader): New class.
736 (get_dwarf_section_name): New function.
737 (Dwo_file::read_executable): Adjust initializations of class data.
738 (Dwo_file::read): Add support for v2 package file format.
739 (Dwo_file::read_unit_index): Likewise.
740 (Dwo_file::sized_read_unit_index): Likewise.
741 (Dwo_file::copy_section): Likewise.
742 (Dwo_file::add_unit_set): Likewise.
743 (Dwp_output_file::add_output_section): Likewise.
744 (Dwp_output_file::add_contribution): Likewise.
745 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
746 for empty slot.
747 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
748 file format.
749 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
750 slot.
751 (Dwp_output_file::initialize): Remove unused function.
752 (Dwp_output_file::finalize): Add support for v2 package file format.
753 (Dwp_output_file::write_index): Likewise.
754 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
755 function prototype.
756
c6905c28
CC
7572013-07-31 Cary Coutant <ccoutant@google.com>
758
759 * object.cc (Sized_relobj::do_output_section_address): New function.
760 (Sized_relobj): Instantiate explicitly.
761 * object.h (Object::output_section_address): New function.
762 (Object::do_output_section_address): New function.
763 (Sized_relobj::do_output_section_address): New function.
764 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
765
7662013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 767 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
768
769 * parameters.cc (Parameters::entry): Return target-specific entry
770 symbol name.
771 * target.h (Target::entry_symbol_name): New function.
772 (Target_info::entry_symbol_name): New data member.
773
774 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
775 * i386.cc (Target_i386::i386_info): Likewise.
776 (Target_i386_nacl::i386_nacl_info): Likewise.
777 * sparc.cc (Target_sparc::sparc_info): Likewise.
778 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
779 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
780 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
781 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
782
234d4ab8
SA
7832013-07-22 Sterling Augustine <saugustine@google.com>
784
785 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
786 Convert parameter shndx to local variable. Add parameters symtab
787 and symtab_size. Scan over section names. Find relocation
788 section corresponding to current section. Create and initialize
789 reloc_mapper_ and reloc_type_.
790 (Dwarf_pubnames_table::read_header): Add assertion. Change
791 unit_length to off_t. Initialize member unit_length_. Fill in field
792 cu_offset_.
793 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
794 Initialize new fields unit_length_ and cu_offset_.
795 (Dwarf_pubnames_table::read_section): Update prototype.
796 (Dwarf_pubnames_table::cu_offset): New member function.
797 (Dwarf_pubnames_table::subsection_size): Likewise.
798 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
799 New fields.
800 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
801 member functions public.
802 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
803 Update comment. Rework logic. Move repeated parts to...
804 (Gdb_index_info_reader::read_pubtable): ...here. New function.
805 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
806 pubtypes_table_, and stmt_list_offset.
807 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
808 Gdb_index::find_pubtype_offset,
809 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
810 (Gdb_index::pubnames_read): Update prototype and rework logic.
811 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
812 Forward declare.
813 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
814 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
815 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
816 Gdb_index::map_pubtable_to_dies):
817 Declare functions.
818 (Gdb_index::pubnames_read): Update declaration.
819 (Gdb_index::Pubname_offset_map): New type.
820 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
821 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
822 Gdb_index::stmt_list_offset): Declare.
823 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
824 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
825 Gdb_index::pubtypes_offset_): Remove.
826
a3ed37d8
RM
8272013-07-19 Roland McGrath <mcgrathr@google.com>
828
829 * options.h (General_options): Add -Trodata-segment option.
830 * parameters.cc (Parameters::check_rodata_segment): New function.
831 (Parameters::set_target_once): Call it.
832 * parameters.h (Parameters): Declare it (private member function).
833 * layout.cc (load_seg_unusable_for_headers): New function, broken
834 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
835 then validate rodata segment rather than text segment.
836 (relaxation_loop_body): Call that.
837 (is_text_segment): New function. Don't admit a non-executable
838 segment if TARGET->isolate_execinstr().
839 (set_segment_offsets): Call it. Honor -Trodata-segment option.
840
eb5b4ded
CC
8412013-07-15 Shawn Landden <shawnlandden@gmail.com>
842
843 PR gold/15070
844 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
845 * nacl.h (Sniff_file::View::View): Request aligned view.
846
4d5effb9
CC
8472013-07-11 Cary Coutant <ccoutant@google.com>
848
849 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
850 correct BRLT entry size.
851
ba8ca3e7
AM
8522013-07-03 Alan Modra <amodra@gmail.com>
853
854 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
855 comment.
856
267257d2
CC
8572013-07-01 Cary Coutant <ccoutant@google.com>
858
859 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
860 reloc_type_.
861 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
862 (Dwarf_ranges_table::lookup_reloc): New function.
863 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
864 reloc_type_.
865 (Dwarf_ranges_table::lookup_reloc): New function.
866 (Dwarf_ranges_table::reloc_type_): New data member.
867
06f30c9d
CC
8682013-06-27 Jing Yu <jingyu@google.com>
869
870 PR gold/15662
871 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
872 function.
873 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
874 (Target_powerpc::do_relax): Call the above.
875
a2d7bf59
AM
8762013-06-27 Cary Coutant <ccoutant@google.com>
877
878 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
879 on garbage collected .opd section.
880
8812013-06-27 Alan Modra <amodra@gmail.com>
882
883 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
884 is non-zero.
885 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
886 (Target_powerpc::do_function_location): Likewise for loc->shndx.
887
32364e50
CC
8882013-06-14 Cary Coutant <ccoutant@google.com>
889
890 * resolve.cc (Symbol::override_base): Don't override st_type
891 from plugin placeholder symbols.
892 (Symbol_table::resolve): Likewise.
893 (Symbol_table::should_override): Don't complain about TLS mismatch
894 if the TO symbol is a plugin placeholder.
895 * testsuite/Makefile.am (plugin_test_tls): New test.
896 * testsuite/Makefile.in: Regenerate.
897 * testsuite/plugin_test_tls.sh: New test script.
898 * testsuite/two_file_test_2_tls.cc: New test source.
899 * testsuite/two_file_test_tls.cc: New test source.
900
7fb47cc9
CC
9012013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
902
903 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
904 the maximum segment alignment is larger than the page size.
905 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
906 correctly aligns the symbols with large alignemnt.
907 * testsuite/Makefile.in: Regenerate.
908 * testsuite/large_symbol_alignment.cc: New file.
909
6934001a
CC
9102013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
911 Sriraman Tallam <tmsriram@google.com>
912
913 * options.h (sort_section): New option.
914 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
915 Rename from Input_section_sort_section_name_special_ordering_compare.
916 (Input_section_sort_section_name_compare): New struct.
917 * output.cc (Output_section::Input_section_sort_section_name_compare::
918 operator()): New function.
919 (Output_section::sort_attached_input_sections): Use new sort function
920 for .text if --sort-section=name is specified.
921 * layout.cc (Layout::make_output_section):
922 Add sorting by name when --sort-section=name is specified.
923 * testsuite/Makefile.am (text_section_grouping): Test option
924 --sort-section=name.
925 * testsuite/Makefile.in: Regenerate.
926 * testsuite/section_sorting_name.cc: New file.
927 * testsuite/section_sorting_name.sh: New file.
928
93acabad
CC
9292013-05-21 Cary Coutant <ccoutant@google.com>
930
931 * symtab.h (Symbol::is_cxx_vtable): New function.
932 * target-reloc.h (relocate_section): Check for vtable symbol.
933 * testsuite/Makefile.am (missing_key_func.sh): New test case.
934 * testsuite/Makefile.in: Regenerate.
935 * testsuite/missing_key_func.cc: New test source.
936 * testsuite/missing_key_func.sh: New test script.
937
60e8b3fc
CC
9382013-05-21 Cary Coutant <ccoutant@google.com>
939
2b64b551
RM
940 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
941 type of enclosing symbol.
942 (Relocate_info::location): Check symbol type when describing symbol.
943 * object.h (Symbol_location_info): Remove unused line_number;
944 add enclosing_symbol_type.
945 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 946
9df9de2c
CC
9472013-05-13 Cary Coutant <ccoutant@google.com>
948
2b64b551
RM
949 * configure.ac: Export DEFAULT_TARGET.
950 * configure: Regenerate.
951 * Makefile.in: Regenerate.
952 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
953 * testsuite/Makefile.in: Regenerate.
954 * testsuite/debug_msg.sh: Delete duplicate tests.
955 Don't check undef_int error message match for powerpc where the
956 source file and line number aren't available.
9df9de2c 957
bbc5ae17
RM
9582013-05-10 Roland McGrath <mcgrathr@google.com>
959
960 * options.h (General_options): Add --rosegment-gap option.
961 * options.cc (finalize): --rosegment-gap implies --rosegment.
962 * layout.cc (set_segment_offsets): Let user option override
963 target->rosegment_gap().
964
0c6e6c39
RM
9652013-05-10 Roland McGrath <mcgrathr@google.com>
966
967 * options.h (General_options): Remove leading space from help
968 messages for -nostdlib and --rosegment.
969
cde7cb01
MR
9702013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
971
972 PR ld/15365
973 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
974
f31ae5b8
AM
9752013-05-03 Alan Modra <amodra@gmail.com>
976
977 * merge.cc (Output_merge_string::do_add_input_section): Correct
978 scan for number of strings. Rename vars to avoid shadowing.
979 Include missing terminator in input_size_.
980
d3a7cd45
L
9812013-05-01 H.J. Lu <hongjiu.lu@intel.com>
982
983 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
984 Restore empty string handling.
985
6ad3daba
CC
9862013-05-01 Cary Coutant <ccoutant@google.com>
987
988 * stringpool.cc (Stringpool_template::new_key_offset): Fix
989 uninitialized warning.
990
e31908b6
CC
9912013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
992
993 * output.cc (Output_section::add_merge_input_section): Allow
994 to merge sections if the alignment is more than character size.
995 * merge.h (Output_merge_string::Output_merge_string): Remove
996 assert.
997 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
998 only not-null strings. Check the alignment of strings.
999 * stringpool.h
1000 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1001 alignment as the argument.
1002 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1003 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1004 Align non-zero length strings according to the addralign_.
1005 (Stringpool_template<Stringpool_char>::set_string_offsets):
1006 Updating offsets according to the given alignment.
1007 * testsuite/Makefile.am (text_section_grouping): Test if string
1008 literals are getting merged.
1009 * testsuite/Makefile.in: Regenerate.
1010 * testsuite/merge_string_literals_1.c: New file.
1011 * testsuite/merge_string_literals_2.c: Ditto.
1012 * testsuite/merge_string_literals.sh: Ditto.
1013
0e804863
ILT
10142013-04-26 Ian Lance Taylor <iant@google.com>
1015
1016 * target-reloc.h (relocate_section): If the reloc offset is out of
1017 range, pass VIEW as NULL to relocate.relocate.
1018 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1019 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1020 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1021 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1022 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1023 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1024
e7c5ea40
CC
10252013-04-26 Geoff Pike <gpike@chromium.org>
1026
1027 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1028 * layout.cc (Hash_task): New class.
1029 (Layout::queue_build_id_tasks): New function.
1030 (Layout::write_build_id): Handle single-thread portion of build ID
1031 computation. (In some cases, all of it is single-threaded.) Replace
1032 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1033 functionality in fewer lines of code.
1034 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1035 * options.h (General_options): make "--build-id" default to tree
1036 rather than sha1. Add two new options related to --build-id=tree:
1037 --build-id-chunk-size-for-treehash and
1038 --build-id-min-file-size-for-treehash.
1039 * Makefile.am: add testing of --build-id=tree and related new options
1040 (these tests will be invoked by "make check").
1041 * Makefile.in: Regenerate.
1042
49926cd0
AM
10432013-04-25 Alan Modra <amodra@gmail.com>
1044
1045 * configure.tgt: Add powerpcle and powerpc64le.
1046
a4034750
AM
10472013-04-22 Alan Modra <amodra@gmail.com>
1048
1049 PR gold/15355
1050 * layout.cc (Layout::segment_precedes): Allow more than one
1051 segment with the same type and flags.
1052
e79c84aa
CC
10532013-04-15 Cary Coutant <ccoutant@google.com>
1054
1055 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1056 allocate space in file for BSS sections.
1057
2199fbe7
CC
10582013-04-15 Cary Coutant <ccoutant@google.com>
1059
1060 * script-sections.cc (Orphan_output_section): Reset address
1061 to zero after each orphaned section for relocatable links.
1062
502e8a84
CC
10632013-04-15 Cary Coutant <ccoutant@google.com>
1064
a4034750
AM
1065 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1066 section starting address for relocatable link.
1067 * testsuite/Makefile.am (script_test_11): New test.
1068 * testsuite/Makefile.in: Regenerate.
1069 * testsuite/script_test_11.c: New source file.
1070 * testsuite/script_test_11.t: New linker script.
502e8a84 1071
0cfdc767
AM
10722013-04-13 Alan Modra <amodra@gmail.com>
1073
1074 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1075 owner when sections are not adjacent and exceed group size.
1076 (Target_powerpc::group_sections): Handle corner case.
1077 (Target_powerpc::Branch_info::make_stub): Handle case where
1078 stub table doesn't exist due to branches in non-exec sections.
1079 (Target_powerpc::Relocate::relocate): Likewise.
1080
6830ee24
AM
10812013-04-11 Alan Modra <amodra@gmail.com>
1082
1083 PR gold/15354
1084 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1085 .branch_lt to match bfd ld. Adjust comments throughout file.
1086
54a3d865
ILT
10872013-04-04 Ian Lance Taylor <iant@google.com>
1088
1089 GCC PR c++/56840
1090 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1091 sections before checking whether they are included in the link.
1092
9993ba11
ST
10932013-03-29 Sriraman Tallam <tmsriram@google.com>
1094
1095 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1096 object before calling the plugin claim_file handler. Pass the elf
1097 object of the archive to the plugin. Delete the elf object if the
1098 plugin claims the file.
1099
ebacd51e
AM
11002013-03-21 Alan Modra <amodra@gmail.com>
1101
1102 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1103 segment when omagic.
1104
117be58f
AM
11052013-03-21 Alan Modra <amodra@gmail.com>
1106
1107 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1108 comparison warning.
1109 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1110 uninitialized" warning.
1111
32e2b61d
AM
11122013-03-20 Alan Modra <amodra@gmail.com>
1113
1114 * symtab.h (Symbol::clear_version): New function.
1115 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1116 is_needed by weak references. Clear version for symbols defined
1117 in as-needed objects that are not needed.
1118
b3ccdeb5
AM
11192013-03-15 Alan Modra <amodra@gmail.com>
1120
1121 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1122 static and public. Add report_err param. Return false for data refs.
1123 (Target_powerpc::rela_dyn_section): New overloaded function.
1124 (Target_powerpc::plt_, iplt_): Elucidate.
1125 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1126 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1127 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1128 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1129 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1130 push_branch and make_plt_entry for ifunc syms when
1131 reloc_needs_plt_for_ifunc.
1132 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1133 for ifunc unless reloc_needs_plt_for_ifunc.
1134
ad3d8a2f
AM
11352013-03-15 Alan Modra <amodra@gmail.com>
1136
1137 * gc.h (gc_process_relocs): Don't look through function descriptors.
1138 * icf.cc (get_section_contents): Do so here instead.
1139
4d9aa155
AM
11402013-03-13 Alan Modra <amodra@gmail.com>
1141
1142 * powerpc.cc (is_branch_reloc): Forward declare.
1143 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1144 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1145 false for 64-bit, true for 32-bit non-branch relocs.
1146 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1147 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1148 nm output.
1149 (icf_safe_test): Generate linker map file as well as nm output.
1150 (icf_safe_so_test): Likewise.
1151 * testsuite/Makefile.in: Regenerate.
1152 * testsuite/icf_test.sh: Parse linker map file to determine
1153 section folding.
1154 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1155 * testsuite/icf_safe_so_test.sh: Likewise.
1156 (X86_32_or_ARM_specific_safe_fold): Merge into..
1157 (arch_specific_safe_fold): ..this.
1158 (X86_64_specific_safe_fold): Delete unused function.
1159
57420c20
AM
11602013-03-12 Alan Modra <amodra@gmail.com>
1161
1162 * gc.h (gc_process_relocs): Look through function descriptors
1163 to determine shndx, symvalue and addend used by ICF. Tidy
1164 variable duplication.
1165
dc3714f3
AM
11662013-03-11 Alan Modra <amodra@gmail.com>
1167
1168 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1169 * layout.cc (Layout_task_runner::run): ..to here.
1170 * symtab.h (struct Symbol_location): Extract from..
1171 (class Symbol_table): ..here.
1172 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1173 * target.h (class Target): Add function_location and
1174 do_function_location functions.
1175 (class Sized_target): Add do_function_location.
1176 * object.h (class Sized_relobj_file): Move find_shdr..
1177 (class Object): ..to here.
1178 * object.cc: Likewise. Update to suit. Instantiate.
1179 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1180 * powerpc.cc (class Powerpc_dynobj): New.
1181 (Target_powerpc::do_function_location): New function.
1182 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1183 (Powerpc_dynobj::do_read_symbols): New function.
1184 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1185
956b03bb
ILT
11862013-03-08 Ian Lance Taylor <iant@google.com>
1187
1188 * options.cc (General_options::string_to_object_format): Accept
1189 "default".
1190
4bead2d5
AM
11912013-03-08 Alan Modra <amodra@gmail.com>
1192
1193 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1194 pointer to Post_fde.
1195 (struct Post_fde): Move definition to here..
1196 * ehframe.cc (struct Post_fde): ..from here.
1197 (Cie::write): Don't alloc Post_fde.
1198 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1199
02e60bf7
AM
12002013-03-07 Alan Modra <amodra@gmail.com>
1201
1202 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1203 relocation referencing .LC0.
1204 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1205
8343f03a
AM
12062013-03-07 Alan Modra <amodra@gmail.com>
1207
1208 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1209 always_inline. Add assembly for powerpc to avoid GOT.
1210
3366d57c
AM
12112013-03-07 Alan Modra <amodra@gmail.com>
1212
1213 * testsuite/script_test_10.sh: Don't test .bss section
1214 header number.
1215
6c77229c
AM
12162013-03-06 Alan Modra <amodra@gmail.com>
1217
1218 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1219 (Target_powerpc::symval_for_branch): Add symtab param. Update
1220 all callers. Handle folded sections.
1221 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1222 to Powerpc_relobj.
1223 (Global_symbol_visitor_opd::operator()): Likewise.
1224
a39e4af6
AM
12252013-03-04 Alan Modra <amodra@gmail.com>
1226
1227 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1228 * testsuite/Makefile.in: Regenerate.
1229
d5834edb
CC
12302013-03-01 Cary Coutant <ccoutant@google.com>
1231
1232 Add dwp support for v2 DWARF package file format.
1233 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1234 tu_length parameter. Adjust all callers.
1235 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1236 * dwp.cc: Include dwarf.h.
1237 (Section_bounds): New struct type.
1238 (Unit_set): New struct type.
1239 (Dwo_file::Dwo_file): Initialize new data member.
1240 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1241 Combine and rename to...
1242 (Dwo_file::read_unit_index): ...this.
1243 (Dwo_file::sized_read_compunit_index)
1244 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1245 (Dwo_file::sized_read_unit_index): ...this.
1246 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1247 parameters; add section_id parameter.
1248 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1249 (Dwo_file::add_unit_set): ...this.
1250 (Dwo_file::shndx_map_): Remove.
1251 (Dwo_file::sect_offsets_): New data member.
1252 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1253 (Dwp_output_file::add_section): Rename to...
1254 (Dwp_output_file::add_contribution): ...this.
1255 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1256 (Dwp_output_file::add_tu_set): Likewise.
1257 (Dwp_output_file::Contribution): New type.
1258 (Dwp_output_file::Section::contributions): New data member.
1259 (Dwp_output_file::Cu_or_tu_set): Remove.
1260 (Dwp_output_file::Section::Section): New ctor.
1261 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1262 (Dwp_output_file::Dwp_index::Section_table): New type.
1263 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1264 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1265 parameter.
1266 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1267 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1268 (Dwp_output_file::Dwp_index::section_table): New member function.
1269 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1270 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1271 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1272 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1273 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1274 (Dwp_output_file::Dwp_index::section_table_): New data member.
1275 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1276 (Dwp_output_file::add_output_section): New member function.
1277 (Dwp_output_file::write_new_section): New member function.
1278 (Dwp_output_file::write_contributions): New member function.
1279 (Dwp_output_file::section_id_map_): New data member.
1280 (class Dwo_id_info_reader): Remove.
1281 (class Unit_reader): New class.
1282 (get_dwarf_section_name): New function.
1283 (Dwo_file::read_executable): Adjust initializations of class data.
1284 (Dwo_file::read): Add support for v2 package file format.
1285 (Dwo_file::read_unit_index): Likewise.
1286 (Dwo_file::sized_read_unit_index): Likewise.
1287 (Dwo_file::copy_section): Likewise.
1288 (Dwo_file::add_unit_set): Likewise.
1289 (Dwp_output_file::add_output_section): Likewise.
1290 (Dwp_output_file::add_contribution): Likewise.
1291 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1292 for empty slot.
1293 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1294 file format.
1295 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1296 slot.
1297 (Dwp_output_file::initialize): Remove unused function.
1298 (Dwp_output_file::finalize): Add support for v2 package file format.
1299 (Dwp_output_file::write_index): Likewise.
1300 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1301 function prototype.
1302
a68a081d
CC
13032013-03-01 Cary Coutant <ccoutant@google.com>
1304
1305 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1306 function into class definition in header file.
1307 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1308 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1309 New function.
1310 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1311
9d5781f8
AM
13122013-02-28 Alan Modra <amodra@gmail.com>
1313
1314 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1315 * target.cc (Target::do_plt_fde_location): New function.
1316 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1317 accessor function, and constructor param.
1318 (struct Post_fde, Post_fdes): Declare.
1319 (Cie::write): Add post_fdes param.
1320 * ehframe.cc (Fde::write): Use plt_fde_location.
1321 (struct Post_fde): Define.
1322 (Cie::write): Stash FDEs added post merge mapping.
1323 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1324 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1325 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1326 other FDEs.
1327 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1328 (Target_powerpc::has_glink): New function.
1329 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1330 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1331 glink_eh_frame_fde_32, default_fde): New data.
1332 (Stub_table::eh_frame_added_): New var.
1333 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1334 Make const.
1335 (Stub_table::add_eh_frame): New function.
1336 (Output_data_glink::add_eh_frame): New function.
1337 (Target_powerpc::make_glink_section): Call add_eh_frame.
1338
214383dd
ILT
13392013-02-15 Ian Lance Taylor <iant@google.com>
1340
1341 * options.h (DEFINE_uint64_alias): Define.
1342 (class General_options): Add -Ttext-segment as an alias for
1343 -Ttext.
1344
91c2b899
AM
13452013-02-15 Alan Modra <amodra@gmail.com>
1346
1347 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1348 (Stub_table::do_write): ..here, two places.
1349 (Stub_table::plt_call_size): Use it here too.
1350
20e2a8aa
ILT
13512013-02-11 Ian Lance Taylor <iant@google.com>
1352
1353 * descriptors.cc (Descriptors::close_all): New function.
1354 * descriptors.h (class Descriptors): Declare close_all.
1355 (close_all_descriptors): New inline function.
1356 * plugin.cc: Include "descriptors.h".
1357 (Plugin_manager::cleanup): Call close_all_descriptors.
1358
8952bc69
AM
13592013-02-06 Alan Modra <amodra@gmail.com>
1360
1361 * README: Update coding style link.
1362
29bd8b6b
CC
13632013-01-28 Cary Coutant <ccoutant@google.com>
1364
a4034750
AM
1365 * dwp.cc (File_list): New typedef.
1366 (Dwo_name_info_reader): New class.
1367 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1368 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1369 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1370 (Dwo_file::read_executable): New function.
1371 (Dwo_file::read): Move common setup code to ...
1372 (Dwo_file::make_object): ... here.
1373 (dwp_options): Add --exec/-e.
1374 (usage): Likewise.
1375 (main): Likewise.
29bd8b6b 1376
c6ac678d
ST
13772013-01-24 Sriraman Tallam <tmsriram@google.com>
1378
1379 * layout.cc (Layout::layout): Check for option text_reorder.
1380 (Layout::make_output_section): Ditto.
1381 * options.h (text_reorder): New option.
1382 * output.cc (Input_section_sort_compare): Remove special ordering
1383 of section names.
1384 (Output_section::
1385 Input_section_sort_section_name_special_ordering_compare::
1386 operator()): New function.
1387 (Output_section::sort_attached_input_sections): Use new sort function
1388 for .text.
1389 * output.h (Input_section_sort_section_name_special_ordering_compare):
1390 New struct.
1391 * testsuite/Makefile.am (text_section_grouping): Test option
1392 --no-text-reorder
1393 * testsuite/Makefile.in: Regenerate.
1394 * testsuite/text_section_grouping.sh: Check order of functions without
1395 default text reordering.
1396
50701cc1
MF
13972013-01-18 Mike Frysinger <vapier@gentoo.org>
1398
1399 * options.h (General_options): Change default to true for new_dtags.
1400
b1b00fcc
MF
14012013-01-18 Mike Frysinger <vapier@gentoo.org>
1402
1403 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1404 when enable_new_dtags is false. Only add DT_RUNPATH when
1405 enable_new_dtags is true.
1406
ec5b8187
AM
14072013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1408
1409 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1410 used in declaration and definition consistent.
1411 (Target_powerpc::symval_for_branch): Ditto.
1412
a880d4c4
ST
14132013-01-16 Sriraman Tallam <tmsriram@google.com>
1414
1415 * testsuite/plugin_final_layout.cc: Fix comment.
1416
7c381248
ST
14172013-01-16 Sriraman Tallam <tmsriram@google.com>
1418
1419 * layout.cc (Layout::layout): Do not do default sorting for
1420 text sections when section ordering is specified.
1421 (make_output_section): Ditto.
1422 * testsuite/plugin_final_layout.cc: Name the function sections
1423 to catch reordering issues.
1424
e2458743
AM
14252013-01-15 Alan Modra <amodra@gmail.com>
1426
1427 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1428 plt-thread-safe.
1429
431ed302
AM
14302013-01-15 Alan Modra <amodra@gmail.com>
1431
1432 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1433 * testsuite/Makefile.in: Regenerate.
1434
0ec6429b
AM
14352013-01-14 Alan Modra <amodra@gmail.com>
1436
1437 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1438 * testsuite/Makefile.in: Regenerate.
1439
0bf402d5
ILT
14402013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1441
36af3926 1442 PR bfd/14430
0bf402d5
ILT
1443 Fix mingw gold build with plugins enabled
1444 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1445 * configure.ac: Export DLOPEN_LIBS and add headers check.
1446 * plugin.cc: Handle non-dlfcn case.
1447 * Makefile.in: Regenerate.
1448 * config.in: Regenerate.
1449 * configure: Regenerate.
1450 * testsuite/Makefile.in: Regenerate.
1451
9e9143bc
ST
14522013-01-09 Sriraman Tallam <tmsriram@google.com>
1453
1454 * output.h (sort_attached_input_sections): Change to be public.
1455 * script-sections.cc
1456 (Output_section_definition::set_section_addresses): Sort
1457 attached input sections according to section order before linker
1458 script assigns section addresses.
1459 (Orphan_output_section::set_section_addresses): Sort
1460 attached input sections according to section order before linker
1461 script assigns section addresses.
1462 * Makefile.am (final_layout.sh): Use a simple linker script to
1463 check if section ordering still works.
1464 * Makefile.in: Regenerate.
1465
679af368
ILT
14662013-01-09 Ben Cheng <bccheng@google.com>
1467
1468 * arm.cc (Target_arm::attributes_accept_div): New function.
1469 (Target_arm::attributes_forbid_div): New function.
1470 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1471 attribute using the same new functions as what bfd/elf32_arm.c
1472 does.
1473
3136a00e
CC
14742013-01-07 Cary Coutant <ccoutant@google.com>
1475
1476 PR gold/14993
1477 * output.cc (Output_section::add_input_section): For incremental
1478 updates, don't track input sections that are allocated from patch
1479 space.
1480
f2a6224b
L
14812013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1482 Ian Lance Taylor <iant@google.com>
1483
1484 PR gold/14897
1485 * configure.ac (--enable-ld): Removed.
1486 (install_as_default): Set to yes only for --enable-gold=default
1487 or --disable-ld.
1488 * configure: Regenerated.
1489
4f46f626
L
14902013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1491
1492 * options.h (General_options): Add -fuse-ld= for GCC linker
1493 option compatibility.
1494
26e4ef59
CC
14952013-01-04 Cary Coutant <ccoutant@google.com>
1496
1497 * configure.ac: Fix typo restoring CXXFLAGS.
1498 * configure: Regenerate.
1499
3d587466
CC
15002013-01-04 Cary Coutant <ccoutant@google.com>
1501
4f46f626
L
1502 * testsuite/Makefile.am (CXXLINK_S): New macro.
1503 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1504 * testsuite/Makefile.in: Regenerate.
3d587466 1505
44db6695
L
15062013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1507
1508 * version.cc (print_version): Update copyright year to 2013.
1509
edcac0c1
ILT
15102012-12-20 Ian Lance Taylor <iant@google.com>
1511
1512 * layout.cc (Layout::special_ordering_of_input_section): New
1513 function.
1514 (Layout::layout): If input section requires special ordering, must
1515 sort input sections.
1516 (Layout::make_output_section): May sort .text input sections.
1517 (Layout::is_section_name_prefix_grouped): Remove.
1518 * layout.h (class Layout): Declare
1519 special_ordering_of_input_section. Don't declare
1520 is_section_name_prefix_grouped.
1521 * output.cc (Output_section::add_input_section): Revert last
1522 change.
1523 (Output_section::Input_section_sort::match_file_name): Don't crash
1524 if called on output section data.
1525 (Output_section::Input_section_sort_compare): Sort based on
1526 special ordering.
1527 (Output_section::Input_section_sort_section_order_index_compare):
1528 Revert last patch.
1529 (Output_section::sort_attached_input_sections): Likewise.
1530
28f2a4ac
ST
15312012-12-18 Sriraman Tallam <tmsriram@google.com>
1532
edcac0c1 1533 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
1534 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1535 * output.cc (Output_section::add_input_section): Check if section
1536 name contains special prefix. Keep input sections to sort such
1537 sections.
1538 (Output_section::Input_section_sort_section_order_index_compare
1539 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
1540 (Output_section::sort_attached_input_sections): Add condition to
1541 Input_section_entry constructor call.
28f2a4ac
ST
1542 * testsuite/Makefile.am (text_section_grouping): New test.
1543 * testsuite/Makefile.in: Regenerate.
1544 * testsuite/text_section_grouping.cc: New file.
1545 * testsuite/text_section_grouping.sh: New file.
1546
5bf135a7
NC
15472012-12-17 Nick Clifton <nickc@redhat.com>
1548
1549 * Makefile.am: Add copyright notice.
1550 * NEWS: Likewise.
1551 * README: Likewise.
1552 * configure.ac: Likewise.
1553 * ftruncate.c: Likewise.
1554 * Makefile.in: Regenerate.
1555
59965708
CC
15562012-12-14 Cary Coutant <ccoutant@google.com>
1557
a4034750
AM
1558 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1559 --no-as-needed flag.
1560 (exception_separate_shared_12_test): Likewise.
1561 (incremental_copy_test): Likewise.
1562 * testsuite/Makefile.in: Regenerate.
59965708 1563
2a77e2ab
CC
15642012-12-14 Cary Coutant <ccoutant@google.com>
1565
1566 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1567 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1568
e3deeb9c
AM
15692012-12-12 Alan Modra <amodra@gmail.com>
1570
1571 * powerpc.cc (class Track_tls): New.
1572 (class Relocate, class Scan): Inherit Track_tls.
1573 (Target_powerpc::Scan::local, global): Track tls optimization
1574 and avoid creating plt entry for __tls_get_addr if all uses
1575 are optimized away.
1576 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1577
d8f5a274
AM
15782012-12-12 Alan Modra <amodra@gmail.com>
1579
1580 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1581 Replace no_toc_optimize with toc_optimize.
1582 * output.h (Output_section::input_sections): Provide non-const variant.
1583 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1584 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1585 accessors.
1586 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1587 (class Sort_toc_sections): New.
1588 (Target_powerpc::do_finalize_sections): Sort toc sections.
1589 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1590
4c8a1de1
RM
15912012-12-10 Roland McGrath <mcgrathr@google.com>
1592
1593 * testsuite/binary_unittest.cc (read_all): New function.
1594 (Sized_binary_test): Use it instead of ::read.
1595 * fileread.cc (do_read): Don't assume pread always reads the whole
1596 amount in a single call.
1597
edc27beb
AM
15982012-12-10 Alan Modra <amodra@gmail.com>
1599
1600 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1601 Set EM_PPC64 or EM_PPC here.
1602 (Target_selector_powerpc::do_recognize): Delete.
1603
906b9150
AM
16042012-12-10 Alan Modra <amodra@gmail.com>
1605
1606 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1607 stub_table_.
1608 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1609
418c15ae
RM
16102012-12-07 Roland McGrath <mcgrathr@google.com>
1611
1612 * testsuite/binary_unittest.cc (Sized_binary_test):
1613 Use open_descriptor rather than ::open.
1614
decdd3bc
AM
16152012-12-07 Alan Modra <amodra@gmail.com>
1616
1617 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1618 typedef and invalid_address constant.
1619 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1620 instantiate constants.
1621
db399005
ILT
16222012-12-06 Roland McGrath <mcgrathr@google.com>
1623
1624 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1625 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1626 * aclocal.m4: Regenerate.
1627 * configure: Regenerate.
1628 * Makefile.in: Regenerate.
1629 * testsuite/Makefile.in: Regenerate.
1630
aba6bc71
AM
16312012-12-07 Alan Modra <amodra@gmail.com>
1632
1633 * options.h (General_options): Add no_toc_optimize.
1634 * powerpc.cc (ok_lo_toc_insn): New function.
1635 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1636
9e69ed50
AM
16372012-12-06 Alan Modra <amodra@gmail.com>
1638
1639 * options.h (General_options): Add plt_align, plt_static_chain,
1640 plt_thread_safe. Update stub_group_size help text.
1641 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1642 for new plt_thread_safe_ var.
1643 (use_plt_offset): Correct comments.
1644 (Target_powerpc::do_relax): Look for thread creation symbols to
1645 determine default plt_thread_safe value. Clear plt call stubs
1646 as well as branch stubs each iteration.
1647 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
1648 insn constants.
1649 (l, hi, ha, write_insn): Move earlier.
1650 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
1651 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
1652 plt stubs too.
1653 (Stub_table::update_size): Adjust.
1654 (Stub_table::prev_size, set_prev_size): Delete.
1655 (Stub_table::stub_align): Let --plt-align affect result.
1656 (Stub_table::plt_call_size): Calculate sizes for various stubs.
1657 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
1658 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
1659 (Stub_table::do_write): Support more stub variants.
1660
f43ba157
AM
16612012-12-04 Alan Modra <amodra@gmail.com>
1662
1663 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
1664 (Target_powerpc::do_define_standard_symbols): New function.
1665
34171bc5
AM
16662012-12-03 Alan Modra <amodra@gmail.com>
1667
1668 * output.h: Formatting, whitespace.
1669
dc9589e9 16702012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
1671
1672 * layout.h (Layout::get_executable_sections): Declare.
1673 * layout.cc (Layout::get_executable_sections): New function.
1674 * arm.cc (Target_arm::group_sections): Use it.
1675 (Arm_output_section::group_sections): Delete now redundant test.
1676 * output.cc (Output_reloc::Output_reloc): Add is_relative.
1677 param to handle relative relocs.
1678 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
1679 (Output_data_reloc::add_absolute): Adjust.
1680 (Output_data_reloc::add_relative): New function.
1681 (Output_data::reset_data_size): New function.
1682 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
1683 (Output_section::set_addralign): New function.
1684 (Output_section::checkpoint_set_addralign): New function.
1685 (Output_section::clear_section_offsets_need_adjustment): New function.
1686 (Output_section::input_sections): Make public.
1687 * powerpc.cc (class Output_data_brlt_powerpc): New.
1688 (class Stub_table, class Stub_control): New.
1689 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
1690 stub_table_, set_stub_table, stub_table): New vectors and accessor
1691 functions.
1692 (Target_powerpc::do_may_relax, do_relax, push_branch,
1693 new_stub_table, stub_tables, brlt_section, group_sections,
1694 add_branch_lookup_table, find_branch_lookup_table,
1695 write_branch_lookup_table, make_brlt_section): New functions.
1696 (Target_powerpc::struct Sort_sections, class Branch_info): New.
1697 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
1698 branch_info_): New vars.
1699 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
1700 make call stubs here.
1701 (Output_data_glink): Remove all call stub handling from this class.
1702 (Target_powerpc::Scan::local, global): Save interesting branch
1703 relocs and relocs for ifunc. Adjust calls to plt entry functions.
1704 (Target_powerpc::do_finalize_sections): Only make reg save/restore
1705 functions on final link.
1706 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
1707 Handle long branch destinations too.
1708 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
1709 do_plt_address_for_local): Adjust lookup of plt call stubs.
1710
627b30b7
AM
17112012-11-30 Alan Modra <amodra@gmail.com>
1712
1713 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
1714 relocs against protected symbols when building 32-bit shared libs.
1715
40b469d7
AM
17162012-11-30 Alan Modra <amodra@gmail.com>
1717
1718 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
1719 param. Call got_section() to make .got. Update all callers
1720 and their callers and so on.
1721
bb66a627
AM
17222012-11-30 Alan Modra <amodra@gmail.com>
1723
1724 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
1725 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
1726 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
1727 value if it already exists.
1728
d2cf1c6c
L
17292012-11-19 H.J. Lu <hongjiu.lu@intel.com>
1730
1731 PR gold/14858
1732 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
1733
edccdf7c
RM
17342012-11-14 Roland McGrath <mcgrathr@google.com>
1735
1736 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
1737 than bfc instruction for data sandboxing.
1738
6febeb74
AM
17392012-11-08 Alan Modra <amodra@gmail.com>
1740
1741 * po/POTFILES.in: Regenerate.
1742
0a6f1bf2
AM
17432012-11-05 Alan Modra <amodra@gmail.com>
1744
1745 * configure.ac: Apply 2012-09-10 change to config.in here.
1746 * configure: Regenerate.
1747
26a4e9cb
AM
17482012-11-05 Alan Modra <amodra@gmail.com>
1749
1750 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
1751 (struct Opd_ent): Use "Address" rather than "Offset".
1752 (Output_data_got_powerpc::got_base_offset): Return Valtype.
1753 (Target_powerpc::got_section): Make public.
1754 (Target_powerpc::scan_relocs): Move code setting symbols..
1755 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
1756 Create _SDA_BASE_ only when referenced.
1757
cc928013
RM
17582012-11-02 Roland McGrath <mcgrathr@google.com>
1759
1760 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
1761 from last change.
1762
50ed5eb1
RM
17632012-11-01 Roland McGrath <mcgrathr@google.com>
1764
62fe925a
RM
1765 * target.h (Sized_target::relocate_relocs): Use Elf_Off
1766 for offset_in_output_section parameter.
1767 (Sized_target::relocate_special_relocatable): Likewise.
1768 * arm.cc (Target_arm::relocate_relocs): Likewise.
1769 (Target_arm::relocate_special_relocatable): Likewise.
1770 * i386.cc (Target_i386::relocate_relocs): Likewise.
1771 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
1772 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
1773 * target-reloc.h (relocate_relocs): Likewise.
1774 * testsuite/testfile.cc (Target_test): Likewise.
1775 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
1776 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
1777
1778 * system.h: Move inclusion of <clocale> to after <libintl.h> in
1779 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
1780
1781 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
1782 parameter, which is unused in the [!F_SETFD] case.
1783
50ed5eb1
RM
1784 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
1785 SYMNDX to off_t before comparing it to this->data_size().
1786 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
1787 * incremental.cc (Output_section_incremental_inputs::do_write):
1788 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
1789
2cadc0bf
RM
1790 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
1791
3bfcb652
NC
17922012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
1793
1794 * gold.cc (Target_arm::do_adjust_elf_header): Add the
1795 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
1796 in EABI_VER5.
1797
c1a8d56e
CC
17982012-10-29 Cary Coutant <ccoutant@google.com>
1799
1800 * dwp.cc (usage): Add file and exit status parameters;
1801 add --help and --version options.
1802 (print_version): New function.
1803 (main): Add --help and --version options.
1804
b2490a7b
L
18052012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1806
1807 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
1808 final_layout_sequence.txt.
1809 * testsuite/Makefile.in: Regenerated.
1810
aa543512
L
18112012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1812
1813 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
1814 COMPILE generated by automake.
1815 (LINK1): Likewise.
1816 (CXXCOMPILE1): Likewise.
1817 (CXXLINK1): Likewise.
1818 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
1819 (LINK): Likewise.
1820 (CXXCOMPILE): Likewise.
1821 (CXXLINK): Likewise.
1822 * testsuite/Makefile.in: Regenerated.
1823
d361fafb
L
18242012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1825
1826 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
1827 on bad fwrite return.
1828
598c7410
L
18292012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1830
1831 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
1832 on val.
1833
35c813e2
CC
18342012-10-23 Cary Coutant <ccoutant@google.com>
1835
1836 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
1837 * testsuite/Makefile.in: Regenerate.
1838 * testsuite/dwp_test.h: New source file.
1839 * testsuite/dwp_test_1.cc: New source file.
1840 * testsuite/dwp_test_1.s: New source file.
1841 * testsuite/dwp_test_1.sh: New source file.
1842 * testsuite/dwp_test_1b.cc: New source file.
1843 * testsuite/dwp_test_1b.s: New source file.
1844 * testsuite/dwp_test_2.cc: New source file.
1845 * testsuite/dwp_test_2.s: New source file.
1846 * testsuite/dwp_test_2.sh: New source file.
1847 * testsuite/dwp_test_main.cc: New source file.
1848 * testsuite/dwp_test_main.s: New source file.
1849
77429909
CC
18502012-10-23 Cary Coutant <ccoutant@google.com>
1851
1852 * dwp.h: New header file.
1853 * dwp.cc: New source file.
1854 * gold.h: Move shared declarations to system.h.
1855 * system.h: New header file.
1856 * Makefile.am: Add dwp.
1857 * Makefile.in: Regenerate.
1858
ed5d6712
CC
18592012-10-23 Cary Coutant <ccoutant@google.com>
1860
1861 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1862 Dwarf_info_reader::read_from_pointer.
1863 (Dwarf_pubnames_table::read_header): Likewise.
1864 (Dwarf_pubnames_table::next_name): Likewise.
1865 (Dwarf_die::read_attributes): Likewise.
1866 (Dwarf_die::skip_attributes): Likewise.
1867 (Dwarf_info_reader::read_from_pointer): New function template.
1868 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1869 (Dwarf_pubnames_table): Likewise.
1870 (Dwarf_info_reader::read_from_pointer): New function template.
1871 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1872 Dwarf_pubnames_table ctor.
1873
8787852d
CC
18742012-10-23 Cary Coutant <ccoutant@google.com>
1875
1876 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1877 abbrev_shndx.
1878 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1879 abbrev_shndx_.
1880 (Dwarf_info_reader::set_abbrev_shndx): New method.
1881 (Dwarf_info_reader::abbrev_shndx_): New data member.
1882
9fc236f3
CC
18832012-10-23 Cary Coutant <ccoutant@google.com>
1884
1885 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
1886 from object, not parameters.
1887 (Dwarf_info_reader::parse): Likewise.
1888 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
1889 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
1890 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
1891 methods.
1892
effe8365
CC
18932012-10-23 Cary Coutant <ccoutant@google.com>
1894
1895 * fileread.cc (Input_file::Input_file): New constructor.
1896 * fileread.h (class Input_file): Add new constructor.
1897
1698990d
AM
18982012-10-18 Alan Modra <amodra@gmail.com>
1899
1900 PR gold/14727
1901 * object.cc (Relobj::is_section_name_included): Also match
1902 .sdata personality section.
1903
168a4726
AM
19042012-10-18 Alan Modra <amodra@gmail.com>
1905
1906 * target-reloc.h (class Default_comdat_behavior): New, package up..
1907 (get_comdat_behaviour): ..this.
1908 (relocate_section): Add Relocate_comdat_behavior template arg,
1909 adjust code to suit.
1910 * arm.cc (Target_arm::relocate_section): Adjust to suit.
1911 (Target_arm::scan_reloc_section): Likewise.
1912 * i386.cc (Target_i386::relocate_section): Likewise.
1913 * sparc.cc (Target_sparc::relocate_section): Likewise.
1914 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
1915 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
1916 * powerpc.cc (class Relocate_comdat_behavior): New.
1917 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
1918 gold::relocate_section with new template arg.
1919
acc276d8
AM
19202012-10-18 Alan Modra <amodra@gmail.com>
1921
1922 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
1923 dynamic relocs for GOT_TPREL got entries, without symbol if
1924 resolving locally.
1925 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
1926 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
1927 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
1928
e10f9870
AM
19292012-10-17 Alan Modra <amodra@gmail.com>
1930
1931 PR gold/14726
1932 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
1933
ae034989
ST
19342012-10-16 Sriraman Tallam <tmsriram@google.com>
1935
1936 * layout.cc (Layout::include_section): Keep sections marked
1937 SHF_EXCLUDE when doing relocatable links.
1938
f3a0ed29
AM
19392012-10-16 Alan Modra <amodra@gmail.com>
1940
1941 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
1942 (Target_powerpc::do_finalize_sections): Call it.
1943 (Output_data_save_res): New class and supporting functions.
1944 (Target_powerpc::symval_for_branch): Only look up .opd entry for
1945 normal symbols defined in object files.
1946
c6de8ed4
AM
19472012-10-12 Alan Modra <amodra@gmail.com>
1948
1949 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
1950 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
1951 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
1952 section if scan_opd_relocs not yet called.
1953 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
1954
03e25981
AM
19552012-10-12 Alan Modra <amodra@gmail.com>
1956
1957 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1958 add_local_ifunc_entry): Revert last change.
1959 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
1960
c9824451
AM
19612012-10-05 Alan Modra <amodra@gmail.com>
1962
1963 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
1964 do_plt_address_for_global): New functions.
1965 (Output_data_got_powerpc::do_write): Don't segfault when linking
1966 statically.
1967 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1968 add_local_ifunc_entry): Return true on adding entry..
1969 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
1970 glink->add_entry call. Remove unused symtab param. Adjust calls.
1971 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
1972 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
1973 set up symbols here.
1974 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
1975 syms here. Do so even when no .iplt. Don't segfault when linking
1976 statically.
1977 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
1978 new variants without reloc param.
1979 (Glink_sym_ent::Glink_sym_ent): Likewise.
1980 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
1981 reloc when refs will resolve to plt call stub.
1982 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
1983 R_PPC_PLTREL24 to resolve locally.
1984 (Target_powerpc::Scan::global): Correct ifunc handling.
1985 (Target_powerpc::Relocate::relocate): Correct local sym glink
1986 lookup. Don't destroy "value" when we have a plt call stub,
1987 and when checking plt call validity.
1988 (Target_powerpc::do_dynsym_value): Simplify.
1989
19fec8c1
AM
19902012-10-05 Alan Modra <amodra@gmail.com>
1991
1992 * i386.cc (Output_data_plt_i386::address_for_global,
1993 address_for_local): Add plt offset to returned value. Adjust uses.
1994 * sparc.cc (Output_data_plt_sparc::address_for_global,
1995 address_for_local): Likewise.
1996 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
1997 address_for_local): Likewise.
1998 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
1999 address_for_local): Likewise.
2000 * target.h (Target::plt_address_for_global, plt_address_for_local):
2001 Update comment.
2002 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2003 (Output_data_got::Got_entry::write): Nor here.
2004 * output.h: Comment fix.
2005
e867b647
WL
20062012-10-02 Jiong Wang <jiwang@tilera.com>
2007
2008 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2009 global_offset_table_ value for larget got.
2010 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2011
e5d5f5ed
AM
20122012-09-29 Alan Modra <amodra@gmail.com>
2013
2014 * powerpc.cc (Target_powerpc::iplt_): New output section.
2015 (Target_powerpc::iplt_section, make_iplt_section,
2016 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2017 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2018 Target_powerpc::plt_entry_count): Count iplt entries too.
2019 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2020 reloc section in constructor. New params.
2021 (Target_powerpc::make_plt_section): Create reloc section here instead.
2022 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2023 functions.
2024 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2025 (Output_data_glink::add_entry, find_entry): New functions to
2026 deal with local syms.
2027 (Glink_sym_ent): Add support for local syms.
2028 (Output_data_glink::do_write): Handle ifunc plt entries.
2029 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2030 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2031 (Target_powerpc::Relocate::relocate): Likewise.
2032 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2033
ec4dbad3
AM
20342012-09-25 Alan Modra <amodra@gmail.com>
2035
2036 * object.h (Sized_relobj_file::adjust_local_symbol,
2037 do_adjust_local_symbol): New functions.
2038 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2039 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2040 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2041 and irregular opd entry spacing.
2042 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2043 (Global_symbol_visitor_opd): New functor.
2044 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2045 on deleted opd entries.
2046
5c0b3823
WL
20472012-09-15 Jiong Wang <jiwang@tilera.com>
2048
2049 * tilegx.cc: New file.
2050 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2051 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2052 * configure.tgt: Add entries for tilegx*.
2053 * configure.ac: Likewise.
2054 * Makefile.in: Rebuild.
2055 * configure: Likewise.
2056 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2057 tilegx.
2058
bfdfa4cd
AM
20592012-09-13 Alan Modra <amodra@gmail.com>
2060
2061 * target-reloc.h (scan_relocs): Call scan.local for relocs
2062 against symbols in discarded sections. Pass is_discarded
2063 param.
2064 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2065 Add is_discarded param.
2066 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2067 is_discarded to flag opd entry as discarded. Don't emit dyn
2068 relocs on such entries.
2069 (Target_powerpc::Scan::global): Similarly detect and handle
2070 such opd entries.
2071 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2072 opd_ent_. Update all uses.
2073 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2074 (Target_powerpc::relocate_section): Zero out discarded opd
2075 entry relocs.
2076
d77a0555
ILT
20772012-09-12 Ian Lance Taylor <iant@google.com>
2078
2079 PR gold/14570
2080 * output.cc: Rename Output_data_got template parameter from size
2081 to got_size for all functions. Compile all variants of
2082 Output_data_got.
2083 (Output_data_got::Got_entry::write): Correct use of size for
2084 symbol value. Use local_is_tls rather than casting to
2085 Sized_relobj_file.
2086 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2087 (class Sized_relobj_file): Add do_local_is_tls.
2088 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2089
815a1205
AM
20902012-09-11 Alan Modra <amodra@gmail.com>
2091
2092 PR gold/14566
2093 * layout.cc (Layout::set_segment_offsets): When using
2094 common-page-size alignment, ensure we are on a new max-page-size
2095 page.
2096 * output.cc (Output_segment::set_section_addresses): Use
2097 abi_pagesize, not common_pagesize for relro boundary.
2098 (Output_segment::set_offset): Likewise.
2099
bd73a62d
AM
21002012-09-11 Alan Modra <amodra@gmail.com>
2101
2102 * output.h (Output_data_got::add_global_tls, add_local_tls,
2103 add_local_tls_pair): New functions.
2104 (Output_data_got::add_local_pair_with_rel): Remove second
2105 reloc param. Expand comment.
2106 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2107 use_plt_or_tls_offset_, similarly for constructor param.
2108 (Output_data_got::Got_entry::write): Add got_index param.
2109 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2110 add_local_tls_pair): New functions.
2111 (Output_data_got::Got_entry::write): Handle tls symbols
2112 with use_plt_or_tls_offset_ set specially.
2113 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2114 (Output_data_got::do_write): Replace iterator with index, pass
2115 index to entry write function.
2116 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2117 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2118 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2119 call.
2120 * i386.cc (Target_i386::Scan::local): Likewise.
2121 * sparc.cc (Target_sparc::Scan::local): Likewise.
2122 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2123 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2124 do_tls_offset_for_global): New functions.
2125 (Target_powerpc::Scan::local): Correct TLS relocations and got
2126 entry values.
2127 (Target_powerpc::Scan::global): Don't emit unnecessary
2128 dynamic relocations on TLS GOT entries.
2129
00716ab1
AM
21302012-09-10 Matthias Klose <doko@ubuntu.com>
2131
2132 * config.in: Disable sanity check for kfreebsd.
2133
c891b3f9
SA
21342012-09-10 Sterling Augustine <saugustine@google.com>
2135
2136 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2137 (Gdb_index::pubtypes_read): New parameter.
2138 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2139 to calls.
2140 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2141 pubtypes_object_.
2142
e81fea4d
AM
21432012-09-09 Alan Modra <amodra@gmail.com>
2144
2145 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2146 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2147 * gc.h (gc_process_relocs): Call target gc_add_reference.
2148 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2149 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2150 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2151 unnecessary cast.
2152 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2153 to cater for when we don't need code offset. Update use.
2154 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2155 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2156 set_opd_valid): New functions.
2157 (Target_powerpc::do_gc_add_reference): New function.
2158 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2159 stashed refs.
2160 (Target_powerpc::do_gc_mark_symbol): New function.
2161
d2d60eef
CC
21622012-09-06 Cary Coutant <ccoutant@google.com>
2163
2164 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2165 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2166 (Dwarf_die::skip_attributes): Likewise.
2167 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2168 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2169 (main): Call it.
2170 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2171
32ed4573
L
21722012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2173
2174 * testsuite/script_test_3.t: Add .got.plt output section
2175 statement.
2176 * testsuite/script_test_4.t: Likewise.
2177
f4baf0d4
AM
21782012-09-05 Alan Modra <amodra@gmail.com>
2179
2180 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2181 update all uses and lose "enum" when using type.
2182
864a1b56
AM
21832012-09-05 Alan Modra <amodra@gmail.com>
2184
2185 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2186 * configure: Regenerate.
2187 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2188 (plugin_final_layout.stdout): Likewise.
2189 (memory_test): Set page sizes to 0x1000.
2190 * testsuite/Makefile.in: Regenerate.
2191 * testsuite/discard_locals_test.sh: Add FIXME comment.
2192 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2193 * testsuite/pr14265.t: Add .got output section statement.
2194 * testsuite/script_test_2.t: Likewise.
2195 * testsuite/script_test_3.t: Likewise.
2196 * testsuite/script_test_4.t: Likewise.
2197 * testsuite/script_test_5.t: Likewise.
2198 * testsuite/script_test_6.t: Likewise.
2199 * testsuite/script_test_7.t: Likewise.
2200 * testsuite/script_test_9.t: Likewise.
2201
3ea0a085
AM
22022012-09-05 Alan Modra <amodra@gmail.com>
2203
2204 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2205 (Powerpc_relocate_functions::Status): New typedef.
2206 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2207 (Target_powerpc::Scan::local): Handle REL64.
2208 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2209 for REL32 and REL64.
2210 (Target_powerpc::symval_for_branch): New function, extracted from..
2211 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2212 checks. Report overflow errors.
2213
7404fe1b
AM
22142012-09-05 Alan Modra <amodra@gmail.com>
2215
2216 * object.h (Sized_relobj_file::emit_relocs): Delete.
2217 (Sized_relobj_file::emit_relocs_reltype): Delete.
2218 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2219 relocate_relocs for --emit-relocs.
2220 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2221 * output.h: Update comment.
2222 (Output_segment::first_section): New function.
2223 (Output_segment::first_section_load_address): Use first_section.
2224 * output.cc (Output_segment::first_section): New function extracted..
2225 (Output_segment::first_section_load_address): ..from here. Delete.
2226 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2227 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2228 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2229 adjust call to target.h function.
2230 * i386.cc (Target_i386): Likewise.
2231 * sparc.cc (Target_sparc): Likewise.
2232 * x86_64.cc (Target_x86_64): Likewise.
2233 * powerpc.cc (Target_powerpc): Likewise.
2234 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2235 first tls section has section symbol for optimised local dynamic
2236 output relocs.
2237 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2238 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2239 optimised tls code.
2240 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2241 Rename to relocate_relocs. Update error message.
2242
957564c9
AS
22432012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2244
2245 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2246 --just-symbols.
2247
dd93cd0a
AM
22482012-08-31 Alan Modra <amodra@gmail.com>
2249
2250 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2251 (Powerpc_relobj::toc_base_offset): New stub function.
2252 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2253 got_mod_index_offset to tlsld_got_offset. Update all refs.
2254 (Target_powerpc::Relocate::enum skip_tls): New.
2255 (Target_powerpc::call_tls_get_addr_): New var.
2256 (Target_powerpc::is_branch_reloc): Move to file scope.
2257 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2258 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2259 New functions.
2260 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2261 (powerpc_info): Correct common_pagesize for ppc64.
2262 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2263 (Powerpc_relocate_functions): Add overflow check enums and functions.
2264 Add non-shift version of rela, rela_ua. Delete all rel public
2265 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2266 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2267 addr16_ha3, addr14 functions.
2268 (Output_data_got_powerpc::add_constant_pair): New function.
2269 (Output_data_got_powerpc::got_base_offset): Likewise.
2270 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2271 (instruction constants): Sort, add some more.
2272 (Output_data_glink::do_write): Add and use Address typedef. Use
2273 object->toc_base_offset() stub for 64-bit.
2274 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2275 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2276 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2277 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2278 Always treat .opd relocs as against locally defined symbol.
2279 Correct condition for RELATIVE relocs.
2280 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2281 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2282 for 32-bit syms with a plt entry. Correct ppc64 toc base
2283 calculations. Handle TLS relocs, and more. Add overflow
2284 checking and adjust for Powerpc_relocate_functions changes.
2285 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2286 Reinstate --emit-relocs code with FIXME.
2287
a1373b60
AM
22882012-08-30 Alan Modra <amodra@gmail.com>
2289
2290 * layout.cc (Layout::set_segment_offsets): Set p_align to
2291 abi_pagesize, not common_pagesize.
2292 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2293 to determine whether file header can go in segment.
2294
703d02da
AM
22952012-08-30 Alan Modra <amodra@gmail.com>
2296
2297 * output.h (Output_reloc::Output_reloc <output section>): Add
2298 is_relative param. Adjust calls.
2299 (Output_reloc::add_output_section_relative): New functions.
2300 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2301 is_relative.
2302 (Output_reloc::symbol_value): Handle SECTION_CODE.
2303
16164a6b
ST
23042012-08-24 Sriraman Tallam <tmsriram@google.com>
2305
2306 * gold.cc (queue_middle_tasks): Call layout again when unique
2307 segments for sections is desired.
2308 * layout.cc (Layout::Layout): Initialize new members.
2309 (Layout::get_output_section_flags): New function.
2310 (Layout::choose_output_section): Call get_output_section_flags.
2311 (Layout::layout): Make output section for mapping to a unique segment.
2312 (Layout::insert_section_segment_map): New function.
2313 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2314 output sections marked so.
16164a6b
ST
2315 (Layout::segment_precedes): Check for unique segments when sorting.
2316 * layout.h (Layout::Unique_segment_info): New struct.
2317 (Layout::Section_segment_map): New typedef.
2318 (Layout::insert_section_segment_map): New function.
2319 (Layout::get_output_section_flags): New function.
2320 (Layout::is_unique_segment_for_sections_specified): New function.
2321 (Layout::set_unique_segment_for_sections_specified): New function.
2322 (Layout::unique_segment_for_sections_specified_): New member.
2323 (Layout::section_segment_map_): New member.
2324 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2325 Rename is_gc_pass_one to is_pass_one.
2326 Rename is_gc_pass_two to is_pass_two.
2327 Rename is_gc_or_icf to is_two_pass.
2328 Check for which pass based on whether symbols data is present.
2329 Make it two pass when unique segments for sections is desired.
2330 * output.cc (Output_section::Output_section): Initialize new
2331 members.
2332 * output.h (Output_section::is_unique_segment): New function.
2333 (Output_section::set_is_unique_segment): New function.
2334 (Output_section::is_unique_segment_): New member.
2335 (Output_section::extra_segment_flags): New function.
2336 (Output_section::set_extra_segment_flags): New function.
2337 (Output_section::extra_segment_flags_): New member.
2338 (Output_section::segment_alignment): New function.
2339 (Output_section::set_segment_alignment): New function.
2340 (Output_section::segment_alignment_): New member.
2341 (Output_segment::Output_segment): Initialize is_unique_segment_.
2342 (Output_segment::is_unique_segment): New function.
2343 (Output_segment::set_is_unique_segment): New function.
2344 (Output_segment::is_unique_segment_): New member.
2345 * plugin.cc (allow_unique_segment_for_sections): New function.
2346 (unique_segment_for_sections): New function.
2347 (Plugin::load): Add new functions to transfer vector.
2348 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2349 * Makefile.in: Regenerate.
2350 * testsuite/plugin_final_layout.sh: Check if unique segment
2351 functionality works.
2352 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2353 are available.
2354 (allow_unique_segment_for_sections): New global.
2355 (unique_segment_for_sections): New global.
2356 (claim_file_hook): Call allow_unique_segment_for_sections.
2357 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2358
1e2bee4f
CC
23592012-08-22 Cary Coutant <ccoutant@google.com>
2360
2361 * layout.cc (Layout::include_section): Don't assert on GROUP
2362 sections with --emit-relocs.
2363
1d5dfe78
CC
23642012-08-21 Cary Coutant <ccoutant@google.com>
2365
2366 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2367 if --export-dynamic-symbol names an undef symbol.
2368
c9269dff
AM
23692012-08-18 Alan Modra <amodra@gmail.com>
2370
2371 * powerpc.cc: Formatting and white space.
2372 (Powerpc_relobj): Rename got2_section_ to special_.
2373 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2374 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2375 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2376 (Target_powerpc): Add Address typedef and invalid_address. Use
2377 throughout.
2378 (Target_powerpc::is_branch_reloc): New function.
2379 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2380 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2381 for dst_mask, value and addend.
2382 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2383 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2384 (Output_data_glink::do_write): Correct toc base. Don't try to use
2385 uint16_t for 24-bit offset. Use get_output_section_offset and
2386 check return.
2387 (Target_powerpc::Scan::local): Handle more relocs.
2388 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2389 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2390 Plug in toc restoring insn after plt calls. Translate branches
2391 to function descriptor symbols to corresponding entry point.
2392 (Target_powerpc::relocate_for_relocatable): Check return from
2393 get_output_section_offset.
2394 * symtab.h: Comment typo.
2395
b1759dce
ILT
23962012-08-14 Ian Lance Taylor <iant@google.com>
2397
2398 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2399 unsupported_relocal_local to call unsupported_reloc_global.
2400
b9b2ae8b
NC
24012012-08-14 Nick Clifton <nickc@redhat.com>
2402
2403 PR ld/14265
2404 * script-sections.cc (Sections_element::output_section_name): Add
2405 keep return parameter.
2406 (Output_section_element::match_name): Add keep return parameter.
2407 Return the value of the keep_ member.
2408 * script-sections.h (class Output_section): Update
2409 output_section_name prototype.
2410 * layout.cc (Layout::keep_input_section): New public member
2411 function.
2412 (Layout::choose_output_section): Pass keep parameter to
2413 output_section_name.
2414 * layout.h (class Layout): Add keep_input_section.
2415 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2416 sections.
2417 * testsuite/Makefile.am: Add a test.
2418 * testsuite/Makefile.in: Regenerate.
2419 * testsuite/pr14265.c: Source file for the test.
2420 * testsuite/pr14265.t: Linker script for the test.
2421 * testsuite/pr14265.sh: Shell script for the test.
2422
921b5322
AM
24232012-08-14 Alan Modra <amodra@gmail.com>
2424
2425 * target.h (Target::output_section_name): New function.
2426 (Target::do_output_section_name): New function.
2427 * layout.cc (Layout::choose_output_section): Call the above.
2428 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2429
6ce78956
AM
24302012-08-14 Alan Modra <amodra@gmail.com>
2431
2432 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2433 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2434 for replace_constant call.
2435 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2436 (Output_data_glink::do_print_to_mapfile): New function.
2437 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2438 (Target_powerpc::Relocate::relocate): Likewise.
2439
d1a8cabd
AM
24402012-08-14 Alan Modra <amodra@gmail.com>
2441
2442 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2443 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2444 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2445 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2446 all references to shndx_. Handle special case for R_PPC_PLTREL24
2447 here.
2448 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2449 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2450 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2451 here.
2452 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2453 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2454
d83ce4e3
AM
24552012-08-12 Alan Modra <amodra@gmail.com>
2456
2457 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2458 (glink insn constants): Use uint32_t.
2459 (Output_data_glink::add_entry): Use insert, not [] operator.
2460
cf43a2fe
AM
24612012-08-11 Alan Modra <amodra@gmail.com>
2462
2463 * object.h (Sized_relobj_file::find_shdr): New function.
2464 (Sized_relobj_file::find_special_sections): New function.
2465 * object.cc (Sized_relobj_file::find_shdr): New function.
2466 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2467 (Sized_relobj_file::find_special_sections): New function, split out..
2468 (Sized_relobj_file::do_read_symbols): ..from here.
2469 * output.h (Output_data_got::replace_constant): New function.
2470 (Output_data_got::num_entries): New function.
2471 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2472 (Output_data_got::got_offset): Protected rather than private.
2473 (Output_data_got::replace_got_entry): New function.
2474 * output.cc (Output_data_got::replace_got_entry): New function.
2475 * powerpc.cc (class Powerpc_relobj): New.
2476 (class Powerpc_relocate_functions): Delete all psymval variants or
2477 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2478 Implement _ha functions using corresponding _hi function.
2479 (Powerpc_relobj::find_special_sections): New function.
2480 (Target_powerpc::do_make_elf_object): New function.
2481 (class Output_data_got_powerpc): New.
2482 (class Output_data_glink): New.
2483 (class Powerpc_scan_relocatable_reloc): New.
2484 Many more changes througout file.
2485
3c892704
NC
24862012-08-09 Nick Clifton <nickc@redhat.com>
2487
2488 * po/vi.po: Updated Vietnamese translation.
2489
82435b3b
ILT
24902012-08-07 Ian Lance Taylor <iant@google.com>
2491
2492 * layout.cc (Layout::add_target_dynamic_tags): If
2493 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2494 plt_rel.
2495
a6dc81d2
NC
24962012-07-30 Nick Clifton <nickc@redhat.com>
2497
2498 * po/gold.pot: Updated template.
2499 * po/es.po: Updated Spanish translation.
2500
f1415016
CC
25012012-07-18 Cary Coutant <ccoutant@google.com>
2502
2503 PR gold/14344
2504 * configure.ac: Add check for -gpubnames support.
2505 * configure: Regenerate.
2506 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2507 support; force -gno-pubnames.
2508 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2509 support.
2510 (gdb_index_test_4): New test.
2511 * testsuite/Makefile.in: Regenerate.
2512 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2513 * testsuite/gdb_index_test_2.sh: Likewise.
2514 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2515 * testsuite/gdb_index_test_4.sh: New script.
2516 * testsuite/gdb_index_test_comm.sh: New script with common code;
2517 don't look for space after colon.
2518
b7fd7c37
ST
25192012-07-16 Sriraman Tallam <tmsriram@google.com>
2520
2521 * gold.cc (queue_middle_tasks): Update function order only after
2522 deferred objects due to plugins are processed.
2523
1f3212db
ILT
25242012-07-11 Ian Lance Taylor <iant@google.com>
2525
2526 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2527 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2528 (Target_arm::scan_reloc_for_stub): Likewise.
2529 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2530 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2531 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2532 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2533 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2534
81c82a68
ILT
25352012-07-10 Dodji Seketeli <dodji@redhat.com>
2536 Ian Lance Taylor <iant@google.com>
2537
2538 PR gold/14309
2539 * configure.ac: Test whether std::tr1::hash<off_t> works.
2540 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2541 needed.
2542 * output.h (class Output_fill): Add virtual destructor.
2543 * configure, config.in: Rebuild.
2544
eabc84f4
RM
25452012-06-22 Roland McGrath <mcgrathr@google.com>
2546
2547 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2548
370e30b6
RÁE
25492012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2550
2551 * plugin.cc (Plugin::load): Handle position independent executables.
2552
fb1b895d
CC
25532012-06-06 Cary Coutant <ccoutant@google.com>
2554
2555 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2556 add .debug_macro.
2557 (lines_only_debug_sections): Likewise.
2558 (gdb_fast_lookup_sections): New static array.
2559 (is_gdb_debug_section): Rename formal parameter.
2560 (is_lines_only_debug_section): Likewise.
2561 (is_gdb_fast_lookup_section): New function.
2562 (Layout::include_section): Check for ".zdebug_" prefix; pass
2563 section name suffix to is_gdb_debug_section, et al.; check for
2564 fast-lookup sections when building .gdb_index.
2565 * options.h (--strip-debug-gdb): Update GDB version number.
2566
7c0640fa
CC
25672012-06-06 Cary Coutant <ccoutant@google.com>
2568
2569 * configure.ac: Add check for fallocate.
2570 * configure: Regenerate.
2571 * config.in: Regenerate.
2572
2573 * options.h (class General_options): Add --mmap-output-file and
2574 --posix-fallocate options.
2575 * output.cc: (posix_fallocate): Remove; replace with...
2576 (gold_fallocate): New function.
2577 (Output_file::map_no_anonymous): Call gold_fallocate.
2578 (Output_file::map): Check --mmap-output-file option.
2579
2a49eb69
DK
25802012-06-05 Jing Yu <jingyu@google.com>
2581
2582 * gold.h (textdomain): Add do {} to empty while(0).
2583 (bindtextdomain): Likewise.
2584
fad072ac
CC
25852012-06-04 Cary Coutant <ccoutant@google.com>
2586
2587 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2588 has_dynsym_index.
2589
8cc69fb6
ST
25902012-05-25 Sriraman Tallam <tmsriram@google.com>
2591
2592 * symtab.cc (Symbol_table::define_special_symbol):
2593 Initialize *poldsym to prevent uninitialized variable errors.
2594
1be75daa
CC
25952012-05-23 Cary Coutant <ccoutant@google.com>
2596
2597 * layout.cc (Layout::section_name_mapping): Add rules to handle
2598 exact match on .data.rel.ro.local or .data.rel.ro.
2599 (Layout::output_section_name): Check for exact matches.
2600
9b689de0
CC
26012012-05-23 Cary Coutant <ccoutant@google.com>
2602
2603 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2604 more carefully.
2605
b24fdbf5
CC
26062012-05-22 Cary Coutant <ccoutant@google.com>
2607
2608 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2609 object before exporting symbol.
2610
e550e1a2
L
26112012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2612
2613 * testsuite/tls_test.cc: Include "config.h" first.
2614 * testsuite/tls_test_c.c: Likewise.
2615
df7b86aa
NC
26162012-05-17 Daniel Richard G. <skunk@iskunk.org>
2617 Nick Clifton <nickc@redhat.com>
2618
2619 PR 14072
2620 * configure.in: Add check that sysdep.h has been included before
2621 any system header files.
2622 * configure: Regenerate.
2623 * config.in: Regenerate.
2624
1007b503
CC
26252012-05-14 Cary Coutant <ccoutant@google.com>
2626
2627 * layout.cc (Layout::make_output_section): Mark .tdata section
2628 as RELRO.
2629 * testsuite/relro_test.cc: Add a TLS variable.
2630
fd885f3a
L
26312012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2632
2633 PR gold/14091
2634 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2635 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2636 R_X86_64_64.
2637
80f5885c
CC
26382012-05-08 Cary Coutant <ccoutant@google.com>
2639
2640 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2641 (lines_only_debug_sections): Likewise.
2642
2e702c99
RM
26432012-05-02 Roland McGrath <mcgrathr@google.com>
2644
2645 * nacl.cc: New file.
2646 * nacl.h: New file.
2647 * Makefile.am (CCFILES, HFILES): Add them.
2648 * Makefile.in: Regenerate.
2649 * i386.cc (Output_data_plt_i386_nacl): New class.
2650 (Output_data_plt_i386_nacl_exec): New class.
2651 (Output_data_plt_i386_nacl_dyn): New class.
2652 (Target_i386_nacl): New class.
2653 (Target_selector_i386_nacl): New class.
2654 (target_selector_i386): Use it instead of Target_selector_i386.
2655 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
2656 (Target_x86_64_nacl): New class.
2657 (Target_selector_x86_64_nacl): New class.
2658 (target_selector_x86_64, target_selector_x32): Use it instead of
2659 Target_selector_x86_64.
2660 * arm.cc (Output_data_plt_arm_nacl): New class.
2661 (Target_arm_nacl): New class.
2662 (Target_selector_arm_nacl): New class.
2663 (target_selector_arm, target_selector_armbe): Use it instead of
2664 Target_selector_arm.
2665
2666 * target-select.cc (select_target): Take new Input_file* and off_t
2667 arguments, pass them on to recognize method of selector.
2668 * object.cc (make_elf_sized_object): Update caller.
2669 * parameters.cc (parameters_force_valid_target): Likewise.
2670 * incremental.cc (make_sized_incremental_binary): Likewise.
2671 * target-select.h: Update decl.
2672 (Target_selector::recognize): Take new Input_file* argument,
2673 pass it on to do_recognize.
2674 (Target_selector::do_recognize): Take new Input_file* argument.
2675 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
2676 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
2677 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
2678 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
2679
2680 * target.h (Target::Target_info): New members isolate_execinstr
2681 and rosegment_gap.
2682 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
2683 * arm.cc (Target_arm::arm_info): Update initializer.
2684 * i386.cc (Target_i386::i386_info): Likewise.
2685 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
2686 * sparc.cc (Target_sparc::sparc_info): Likewise.
2687 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2688 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2689 * layout.cc (Layout::attach_allocated_section_to_segment):
2690 Take new const Target* argument. If target->isolate_execinstr(), act
2691 like --rosegment.
2692 (Layout::find_first_load_seg): Take new const Target* argument;
2693 if target->isolate_execinstr(), reject PF_X segments.
2694 (Layout::relaxation_loop_body): Update caller.
2695 (Layout::set_segment_offsets): If target->isolate_execinstr(),
2696 reset file offset to zero when we hit LOAD_SEG, and then do a second
2697 loop over the segments before LOAD_SEG to reassign offsets after
2698 addresses have been determined. Handle target->rosegment_gap().
2699 (Layout::attach_section_to_segment): Take new const Target* argument;
2700 pass it to attach_allocated_section_to_segment.
2701 (Layout::make_output_section): Update caller.
2702 (Layout::attach_sections_to_segments): Take new const Target* argument;
2703 pass it to attach_section_to_segment.
2704 * gold.cc (queue_middle_tasks): Update caller.
2705 * layout.h (Layout): Update method decls with new arguments.
2706
2707 * arm.cc (Target_arm::Target_arm): Take optional argument for the
2708 Target_info pointer to use.
2709 (Target_arm::do_make_data_plt): New virtual method.
2710 (Target_arm::make_data_plt): New method that calls it.
2711 (Target_arm::make_plt_entry): Use it.
2712 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
2713 for the section alignment.
2714 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
2715 method.
2716 (Output_data_plt_arm::first_plt_entry_offset): Call it.
2717 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
2718 method.
2719 (Output_data_plt_arm::get_plt_entry_size): Call it.
2720 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
2721 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
2722 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
2723 method.
2724 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
2725 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
2726 method instead of sizeof(plt_entry).
2727 (Output_data_plt_arm::add_entry): Likewise.
2728 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
2729 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
2730 than static method.
2731 (Target_arm::plt_entry_size): Likewise.
2732 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
2733 Move to ...
2734 (Output_data_plt_arm_standard): ... here, new class.
2735 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
2736 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
2737 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
2738
2739 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2740 Take additional argument for the PLT entry size.
2741 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
2742 Use get_plt_entry_size method rather than plt_entry_size variable.
2743 (Output_data_plt_x86_64::reserve_slot): Likewise.
2744 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
2745 (Output_data_plt_x86_64::add_entry): Likewise.
2746 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
2747 (Output_data_plt_x86_64::address_for_global): Likewise.
2748 (Output_data_plt_x86_64::address_for_local): Likewise.
2749 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2750 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
2751 Make method non-static.
2752 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
2753 method.
2754 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
2755 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
2756 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
2757 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
2758 virtual method.
2759 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
2760 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
2761 virtual method.
2762 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
2763 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
2764 virtual method.
2765 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
2766 (Output_data_plt_x86_64::plt_entry_size)
2767 (Output_data_plt_x86_64::first_plt_entry)
2768 (Output_data_plt_x86_64::plt_entry)
2769 (Output_data_plt_x86_64::tlsdesc_plt_entry)
2770 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
2771 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
2772 (Output_data_plt_x86_64_standard): ... here, new class.
2773 (Target_x86_64::Target_x86_64): Take optional argument for the
2774 Target_info pointer to use.
2775 (Target_x86_64::do_make_data_plt): New virtual method.
2776 (Target_x86_64::make_data_plt): New method to call it.
2777 (Target_x86_64::init_got_plt_for_update): Use that.
2778 Call this->plt_->add_eh_frame method here.
2779 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
2780 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
2781 rather than static method.
2782 (Target_x86_64::plt_entry_size): Likewise.
2783 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
2784 rather than plt_entry_size variable. Move guts of PLT filling to...
2785 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
2786 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
2787 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
2788
2789 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
2790 additional argument for the section alignment.
2791 Don't do add_eh_frame_for_plt here.
2792 (Output_data_plt_i386::first_plt_entry_offset): Make the method
2793 non-static. Use get_plt_entry_size method rather than plt_entry_size
2794 variable.
2795 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
2796 method.
2797 (Output_data_plt_i386::get_plt_entry_size): Call it.
2798 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
2799 (Output_data_plt_i386::add_eh_frame): New method to call it.
2800 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
2801 method.
2802 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
2803 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
2804 method.
2805 (Output_data_plt_i386::fill_plt_entry): New method to call it.
2806 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
2807 method instead of plt_entry_size.
2808 (Output_data_plt_i386::plt_entry_size)
2809 (Output_data_plt_i386::plt_eh_frame_fde_size)
2810 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
2811 (Output_data_plt_i386_standard): ... here, new class.
2812 (Output_data_plt_i386_exec): New class.
2813 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
2814 (Output_data_plt_i386_exec::first_plt_entry): ... here.
2815 (Output_data_plt_i386::exec_plt_entry): Move to ...
2816 (Output_data_plt_i386_exec::plt_entry): ... here.
2817 (Output_data_plt_i386_dyn): New class.
2818 (Output_data_plt_i386::first_plt_entry): Move to ...
2819 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
2820 (Output_data_plt_i386::dyn_plt_entry): Move to ...
2821 (Output_data_plt_i386_dyn::plt_entry): ... here.
2822 (Target_i386::Target_i386): Take optional argument for the Target_info
2823 pointer to use.
2824 (Target_i386::do_make_data_plt): New virtual method.
2825 (Target_i386::make_data_plt): New method to call it.
2826 (Target_i386::make_plt_section): Use that.
2827 Call this->plt_->add_eh_frame method here.
2828 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
2829 rather than plt_entry_size variable.
2830 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
2831 (Output_data_plt_i386::address_for_local): Likewise.
2832 (Output_data_plt_i386::do_write): Likewise.
2833 Move guts of PLT filling to...
2834 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
2835 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
2836 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
2837 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
2838
b9b9f2ee
CC
28392012-05-01 Cary Coutant <ccoutant@google.com>
2840
2841 * dwarf_reader.cc (Dwarf_die::read_attributes)
2842 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
2843 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
2844 * reduced_debug_output.cc
2845 (Output_reduced_debug_info_section::get_die_end): Remove
2846 DW_FORM_GNU_ref_index. Add default case.
2847
57923f48
MW
28482012-04-26 Mark Wielaard <mjw@redhat.com>
2849
2850 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2851 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2852 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2853 DW_AT_high_pc as offset from DW_AT_low_pc.
2854
2855 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2856 * testsuite/Makefile.in: Regenerate.
2857 * testsuite/gdb_index_test_3.c: New test source file.
2858 * testsuite/gdb_index_test_3.sh: New test source file.
2859
2c54b4f4
ILT
28602012-04-25 Ian Lance Taylor <iant@google.com>
2861
2862 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2863 pointer.
2864 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2865 as a class, not a struct.
2866 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2867 (Target_arm::apply_cortex_a8_workaround): Likewise.
2868 * gc.h: Declare Reloc_types as a struct, not a class.
2869 * object.h: Declare Symbols_data as a struct.
2870 * reloc.h: Declare Read_relocs_data as a struct.
2871 * target.h: Declare Relocate_info as a struct.
2872
a5a5f7a3
DM
28732012-04-24 David S. Miller <davem@davemloft.net>
2874
2875 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2876 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2877 and R_SPARC_WPLT30.
2878
f038d496
CC
28792012-04-24 Cary Coutant <ccoutant@google.com>
2880
2881 * incremental-dump.cc (find_input_containing_global): Replace
2882 magic number with symbolic constant.
2883 (dump_incremental_inputs): Update version number.
2884 * incremental.cc (Output_section_incremental_inputs): Update version
2885 number; import symbolic constants from Incremental_inputs_reader.
2886 (Incremental_inputs::create_data_sections): Align relocations
2887 section correctly for 64-bit targets.
2888 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
2889 constants; add padding.
2890 (Output_section_incremental_inputs::write_header): Add assert for
2891 header_size.
2892 (Output_section_incremental_inputs::write_input_files): Add assert
2893 for input_entry_size.
2894 (Output_section_incremental_inputs::write_info_blocks): Add padding;
2895 add assert for object_info_size, input_section_entry_size,
2896 global_sym_entry_size.
2897 * incremental.h (Incremental_inputs_reader): Add symbolic constants
2898 for data structure sizes; use them.
2899 (Incremental_input_entry_reader): Import symbolic constants from
2900 Incremental_inputs_reader; use them.
2901
a4d85145
DM
29022012-04-23 David S. Miller <davem@davemloft.net>
2903
2904 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
2905 and elf_flags_set_.
2906 (Target_sparc::Target_sparc): Initialize new fields.
2907 (Target_sparc::do_make_elf_object): New function.
2908 (Target_sparc::do_adjust_elf_header): New function.
2909
1d509098
CC
29102012-04-23 Cary Coutant <ccoutant@google.com>
2911
2912 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
2913 CU range table of gdb index.
2914
7ebeff7f
DM
29152012-04-20 David S. Miller <davem@davemloft.net>
2916
2917 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
2918 instead of false.
2919
13cf9988
DM
29202012-04-16 David S. Miller <davem@davemloft.net>
2921
2a1079e8
DM
2922 * sparc.cc (Target_sparc::got_address): New function.
2923 (Sparc_relocate_functions::gdop_hix22): New function.
2924 (Sparc_relocate_functions::gdop_lox10): New function.
2925 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
2926 relocs.
2927 (Target_sparc::Scan::local): Likewise if the global symbol is not
2928 preemptible and is not IFUNC.
2929 (Target_sparc::Relocate::relocate): Perform GOTDATA code
2930 transformations for local and non-preemptible non-IFUNC global
2931 symbols.
2932
0bc964fc
DM
2933 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
2934 writing out 64-bit part of ranges.
2935
661d7a80
DM
2936 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
2937 -fpic and -fpie respectively.
2938 * Makefile.in: Regenerate.
2939
8c2bf391
DM
2940 * sparc.cc (class Target_sparc): Add rela_ifunc_.
2941 (Target_sparc::Target_sparc): Initialize new field.
2942 (Target_sparc::do_plt_section_for_global): New function.
2943 (Target_sparc::do_plt_section_for_local): New function.
2944 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
2945 (Target_sparc::make_plt_section): New function, broken out of
2946 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
2947 (Target_sparc::make_plt_entry): Call make_plt_section.
2948 (Target_sparc::make_local_ifunc_plt_entry): New function.
2949 (Target_sparc::rela_ifunc_section): New function.
2950 (Target_sparc::plt_section): Remove const.
2951 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
2952 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
2953 and ifunc_count_ fields.
2954 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
2955 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
2956 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
2957 (Output_data_plt_sparc::rela_ifunc): New function.
2958 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
2959 (Output_data_plt_sparc::has_ifunc_section): New function.
2960 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
2961 (Output_data_plt_sparc::address_for_global): New function.
2962 (Output_data_plt_sparc::address_for_local): New function.
2963 (Output_data_plt_sparc::plt_index_to_offset): New function.
2964 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
2965 and entry_count.
2966 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
2967 entry_count.
2968 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
2969 R_SPARC_JMP_IREL to switch.
2970 (Target_sparc::Scan::check_non_pic): Likewise.
2971 (Target_sparc::Scan::local): Handle IFUNC symbols.
2972 (Target_sparc::Scan::local): Likewise.
2973 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
2974 and plt_address_for_local.
2975 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
2976 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
2977
13cf9988
DM
2978 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
2979 (class Output_data_reloc): Adjust calls to Output_reloc_type.
2980 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
2981 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
2982 global relocs too.
2983 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
2984 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
2985 calls.
2986 * sparc.cc (Target_sparc::Scan::global): Likewise.
2987 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2988
31821be0
CC
29892012-04-16 Cary Coutant <ccoutant@google.com>
2990
2991 * archive.cc (Library_base::should_include_member): Check for
2992 --export-dynamic-symbol.
2993 * options.h (class General_options): Add --export-dynamic-symbol.
2994 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
2995 --export-dynamic-symbol.
2996 (Symbol_table::gc_mark_undef_symbols): Likewise.
2997 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
2998
2615994e
DM
29992012-04-12 David S. Miller <davem@davemloft.net>
3000
3001 * sparc.cc (Reloc::wdisp10): New relocation method.
3002 (Reloc::h34): Likewise.
3003 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3004 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3005 R_SPARC_WDISP10.
3006 (Target_sparc::Scan::local): Likewise.
3007 (Target_sparc::Scan::global): Likewise.
3008 (Target_sparc::Relocate::relocate): Likewise.
3009
6782735d
CC
30102012-04-09 Cary Coutant <ccoutant@google.com>
3011
3012 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3013 low_pc == 0.
3014
8c7a0b00
ILT
30152012-04-06 Ian Lance Taylor <iant@google.com>
3016
3017 * timer.cc: #include <unistd.h>.
3018
58797674
RM
30192012-04-06 Roland McGrath <mcgrathr@google.com>
3020
3021 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3022 * config.in: Regenerate.
3023 * configure: Regenerate.
3024
44350750
NC
30252012-04-05 Nick Clifton <nickc@redhat.com>
3026
3027 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3028 (AM_LC_MESSAGES): Add.
3029 * aclocal.m4: Regenerate.
3030 * config.in: Regenerate.
3031 * configure: Regenerate.
3032
c1027032
CC
30332012-03-21 Cary Coutant <ccoutant@google.com>
3034
3035 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3036 * Makefile.in: Regenerate.
3037 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3038 (Sized_elf_reloc_mapper::symbol_section): New function.
3039 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3040 (make_elf_reloc_mapper): New function.
3041 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3042 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3043 (Dwarf_abbrev_table::do_get_abbrev): New function.
3044 (Dwarf_ranges_table::read_ranges_table): New function.
3045 (Dwarf_ranges_table::read_range_list): New function.
3046 (Dwarf_pubnames_table::read_section): New function.
3047 (Dwarf_pubnames_table::read_header): New function.
3048 (Dwarf_pubnames_table::next_name): New function.
3049 (Dwarf_die::Dwarf_die): New function.
3050 (Dwarf_die::read_attributes): New function.
3051 (Dwarf_die::skip_attributes): New function.
3052 (Dwarf_die::set_name): New function.
3053 (Dwarf_die::set_linkage_name): New function.
3054 (Dwarf_die::attribute): New function.
3055 (Dwarf_die::string_attribute): New function.
3056 (Dwarf_die::int_attribute): New function.
3057 (Dwarf_die::uint_attribute): New function.
3058 (Dwarf_die::ref_attribute): New function.
3059 (Dwarf_die::child_offset): New function.
3060 (Dwarf_die::sibling_offset): New function.
3061 (Dwarf_info_reader::check_buffer): New function.
3062 (Dwarf_info_reader::parse): New function.
3063 (Dwarf_info_reader::do_parse): New function.
3064 (Dwarf_info_reader::do_read_string_table): New function.
3065 (Dwarf_info_reader::lookup_reloc): New function.
3066 (Dwarf_info_reader::get_string): New function.
3067 (Dwarf_info_reader::visit_compilation_unit): New function.
3068 (Dwarf_info_reader::visit_type_unit): New function.
3069 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3070 Sized_elf_reloc_mapper.
3071 (Sized_dwarf_line_info::symbol_section): Remove function.
3072 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3073 (Sized_dwarf_line_info::read_line_mappings): Remove object
3074 parameter, adjust callers.
3075 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3076 * dwarf_reader.h: Include <sys/types.h>.
3077 (class Track_relocs): Remove forward declaration.
3078 (class Elf_reloc_mapper): New class.
3079 (class Sized_elf_reloc_mapper): New class.
3080 (class Dwarf_abbrev_table): New class.
3081 (class Dwarf_range_list): New class.
3082 (class Dwarf_ranges_table): New class.
3083 (class Dwarf_pubnames_table): New class.
3084 (class Dwarf_die): New class.
3085 (class Dwarf_info_reader): New class.
3086 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3087 (Sized_dwarf_line_info::symbol_section): Remove member function.
3088 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3089 base class.
3090 * gdb-index.cc: New source file.
3091 * gdb-index.h: New source file.
3092 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3093 and .debug_types sections, call Layout::add_to_gdb_index.
3094 (Sized_relobj_incr::do_section_name): Implement.
3095 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3096 return type; Implement.
3097 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3098 return type.
3099 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3100 parameter list and return type.
3101 (Sized_incr_dynobj::do_section_contents): Likewise.
3102 * layout.cc: Include gdb-index.h.
3103 (Layout::Layout): Initialize gdb_index_data_.
3104 (Layout::init_fixed_output_section): Check for .gdb_index section.
3105 (Layout::add_to_gdb_index): New function. Instantiate.
3106 * layout.h: Add forward declaration for class Gdb_index.
3107 (Layout::add_to_gdb_index): New member function.
3108 (Layout::gdb_index_data_): New data member.
3109 * main.cc: Include gdb-index.h.
3110 (main): Print statistics for gdb index.
3111 * object.cc (Object::section_contents): Move code into
3112 do_section_contents.
3113 (need_decompressed_section): Check for sections needed when building
3114 gdb index.
3115 (build_compressed_section_map): Likewise.
3116 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3117 gdb index.
3118 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3119 sections; call Layout::add_to_gdb_index.
3120 (Sized_relobj_file::do_decompressed_section_contents): Call
3121 do_section_contents directly.
3122 * object.h (Object::do_section_contents): Adjust parameter list and
3123 return type.
3124 (Object::do_decompressed_section_contents): Call do_section_contents
3125 directly.
3126 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3127 return type.
3128 * options.h (class General_options): Add --gdb-index option.
3129 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3130 list and return type.
3131 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3132 * reloc.h (Track_relocs::checkpoint): New function.
3133 (Track_relocs::reset): New function.
3134
3135 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3136 New test cases.
3137 * testsuite/Makefile.in: Regenerate.
3138 * testsuite/gdb_index_test.cc: New test source file.
3139 * testsuite/gdb_index_test_1.sh: New test source file.
3140 * testsuite/gdb_index_test_2.sh: New test source file.
3141
647f1574
DK
31422012-03-19 Doug Kwan <dougkwan@google.com>
3143
3144 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3145 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3146 __exidx_start and __exidx_end. Make symbol table parameter
3147 anonymous as it is not used.
3148 * gold.cc (queue_middle_tasks): Call target hook to define any
3149 target-specific symbols.
3150 * target.h (Target::define_standard_symbols): New method.
3151 (Target::do_define_standard_symbols): Same.
3152 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3153 * testsuite/Makefile.in: Regenerate.
3154 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3155 and __exidx_end.
3156 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3157 relocations are generated for __exidx_start and __exidx_end.
3158
7c6109da
DK
31592012-03-16 Doug Kwan <dougkwan@google.com>
3160
3161 * testsuite/Makefile.am: Disable test initpri3b.
3162 * testsuite/Makefile.in: Regenerate.
3163
7b8957f8
DK
31642012-03-15 Doug Kwan <dougkwan@google.com>
3165
3166 * arm.cc (Target_arm::got_section): Make .got section read-only
3167 if -z now is given.
3168
14dc9ef7
ILT
31692012-03-15 Ian Lance Taylor <iant@google.com>
3170
3171 PR gold/13850
3172 * layout.cc (Layout::make_output_section): Correctly mark
3173 SHT_INIT_ARRAY, et. al., as relro.
3174
fa40b62a
DK
31752012-03-14 Doug Kwan <dougkwan@google.com>
3176
3177 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3178 dynamic relocations for protected symbols in shared objects.
3179
fd325007
ILT
31802012-03-13 Ian Lance Taylor <iant@google.com>
3181
3182 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3183 keep the larger alignment.
3184
e8dd54e1
CC
31852012-03-12 Cary Coutant <ccoutant@google.com>
3186
3187 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3188 handling of DW_LNE_define_file.
3189
feb5f3b0
CC
31902012-03-12 Cary Coutant <ccoutant@google.com>
3191
3192 * reduced_debug_output.cc
3193 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3194 codes to switch.
3195
a1fb4256
CC
31962012-02-29 Cary Coutant <ccoutant@google.com>
3197
3198 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3199
5dd8762a
CC
32002012-02-29 Cary Coutant <ccoutant@google.com>
3201
3202 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3203 Call Object::decompressed_section_contents.
3204 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3205 New dtor.
3206 (Sized_dwarf_line_info::buffer_start_): New data member.
3207 * merge.cc (Output_merge_data::do_add_input_section): Call
3208 Object::decompressed_section_contents.
3209 (Output_merge_string::do_add_input_section): Likewise.
3210 * object.cc (need_decompressed_section): New function.
3211 (build_compressed_section_map): Decompress sections needed later.
3212 (Sized_relobj_file::do_decompressed_section_contents): New function.
3213 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3214 * object.h (Object::decompressed_section_contents): New function.
3215 (Object::discard_decompressed_sections): New function.
3216 (Object::do_decompressed_section_contents): New function.
3217 (Object::do_discard_decompressed_sections): New function.
3218 (Compressed_section_info): New type.
3219 (Compressed_section_map): Include decompressed section contents.
3220 (Sized_relobj_file::do_decompressed_section_contents): New function.
3221 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3222
7b5de7ee
CC
32232012-02-16 Cary Coutant <ccoutant@google.com>
3224
3225 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3226 * testsuite/Makefile.in: Regenerate.
3227
f9fa4a63
CC
32282012-02-14 Cary Coutant <ccoutant@google.com>
3229
3230 * options.cc (General_options::finalize): Disallow -pie and -static.
3231
2c175ebc
DK
32322012-02-03 Doug Kwan <dougkwan@google.com>
3233
3234 * arm.cc (Arm_relocate_functions::abs8,
3235 Arm_relocate_functions::abs16): Use
3236 Bits::has_signed_unsigned_overflow32.
3237 (Arm_relocate_functions::thm_abs8): Correct range of
3238 overflow check.
3239 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3240 in assertions.
3241
90cff06f
DK
32422012-02-02 Doug Kwan <dougkwan@google.com>
3243
3244 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3245 position independent outputs, not just shared objects.
3246
63887f3d
L
32472012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3248
3249 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3250 * configure: Regenerated.
3251
bef2b434
ILT
32522012-01-27 Ian Lance Taylor <iant@google.com>
3253
3254 * reloc.h (Bits): New class with static functions, copied from
3255 namespace utils in arm.cc.
3256 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3257 instead.
3258
c335b55d
L
32592012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3260
3261 * incremental.cc (write_info_blocks): Correct relocation offset.
3262
41194d9f
L
32632012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3264
3265 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3266 (Relocate::tls_gd_to_le): Likewise.
3267
1bae613c
L
32682012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3269
3270 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3271
24482ca0
L
32722012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3273
3274 * configure.ac: Check if -mcmodel=medium works.
3275 * configure: Regenerated.
3276
c2c7840a
CC
32772012-01-24 Cary Coutant <ccoutant@google.com>
3278
3279 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3280 definition and ...
3281 (read_unsigned_LEB_128_x): ... this new function.
3282 (read_signed_LEB_128): Replaced with inline definition and ...
3283 (read_signed_LEB_128_x): ... this new function.
3284 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3285 (read_unsigned_LEB_128): Add inline definition.
3286 (read_signed_LEB_128_x): New function.
3287 (read_signed_LEB_128): Add inline definition.
3288 * testsuite/Makefile.am (leb128_unittest): New unit test.
3289 * testsuite/Makefile.in: Regenerate.
3290 * testsuite/leb128_unittest.cc: New unit test.
3291
833de760 32922012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3293
3294 PR gold/13617
3295 * i386.cc (Target_i386::do_code_fill): When using a jmp
3296 instruction, pad with nop instructions.
3297 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3298
618d6666
L
32992012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3300
3301 * x86_64.cc (gc_process_relocs): Add typename on types used in
3302 template.
3303 (scan_relocs): Likewise.
3304 (relocate_section): Likewise.
3305 (apply_relocation): Likewise.
3306
3660ff06
L
33072012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3308
3309 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3310 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3311 under x32.
3312
fc51264f
L
33132012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3314
3315 * x86_64.cc: Initial support for x32.
3316
dd74ae06
CC
33172012-01-03 Cary Coutant <ccoutant@google.com>
3318
3319 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3320 Use abstract base class for GOT.
3321 * gold/output.h (class Output_data_got_base): New abstract base class.
3322 (class Output_data_got): Derive from new base class, adjust ctors.
3323 (Output_data_got::reserve_slot): Make virtual; rename to
3324 do_reserve_slot; Adjust callers.
3325 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3326 pointer to abstract base class.
3327 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3328
83896202
ILT
33292011-12-18 Ian Lance Taylor <iant@google.com>
3330
3331 * object.h (Relobj::local_symbol_value): New function.
3332 (Relobj::local_plt_offset): New function.
3333 (Relobj::local_has_got_offset): New function.
3334 (Relobj::local_got_offset): New function.
3335 (Relobj::set_local_got_offset): New function.
3336 (Relobj::do_local_symbol_value): New pure virtual function.
3337 (Relobj::do_local_plt_offset): Likewise.
3338 (Relobj::do_local_has_got_offset): Likewise.
3339 (Relobj::do_local_got_offset): Likewise.
3340 (Relobj::do_set_local_got_offset): Likewise.
3341 (Sized_relobj::do_local_has_got_offset): Rename from
3342 local_has_got_offset.
3343 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3344 (Sized_relobj::do_set_local_got_offset): Rename from
3345 set_local_got_offset.
3346 (Sized_relobj_file::do_local_plt_offset): Rename from
3347 local_plt_offset.
3348 (Sized_relobj_file::do_local_symbol_value): New function.
3349 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3350 local_plt_offset.
3351 * output.cc (Output_data_got::Got_entry::write): Change object to
3352 Relobj. Use local_symbol_value.
3353 (Output_data_got::add_global_with_rel): Change rel_dyn to
3354 Output_data_reloc_generic*. Use add_global_generic.
3355 (Output_data_got::add_global_with_rela): Remove. Change all
3356 callers to use add_global_with_rel.
3357 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3358 Output_data_reloc_generic*. Use add_global_generic.
3359 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3360 callers to use add_global_pair_with_rel.
3361 (Output_data_got::add_local): Change object to Relobj*.
3362 (Output_data_got::add_local_plt): Likewise.
3363 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3364 change rel_dyn to Output_data_reloc_generic*. Use
3365 add_local_generic.
3366 (Output_data_got::add_local_with_rela): Remove. Change all
3367 callers to use all_local_with_rel.
3368 (Output_data_got::add_local_pair_with_rel): Change object to
3369 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3370 add_output_section_generic.
3371 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3372 callers to use add_local_pair_with_rel.
3373 (Output_data_got::reserve_local): Change object to Relobj*.
3374 * output.h: (class Output_data_reloc_generic): Add pure virtual
3375 declarations for add_global_generic, add_local_generic,
3376 add_output_section_generic.
3377 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3378 functions for Output_data_reloc_generic. Update declarations for
3379 changes listed in output.cc.
3380 (class Output_data_got): Change template parameter to got_size.
3381 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3382 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3383 function.
3384 (Sized_relobj_incr::do_local_plt_offset): New function.
3385 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3386 add_global_generic.
3387
76677ad0
CC
33882011-12-17 Cary Coutant <ccoutant@google.com>
3389
3390 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3391 * resolve.cc (Symbol_table::resolve): Likewise.
3392 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3393 arrays.
3394 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3395
8b8dd8d5
ILT
33962011-12-16 Ian Lance Taylor <iant@google.com>
3397
3398 * output.h (Output_data_reloc_generic::add): Only call
3399 add_dynamic_reloc if this is a dynamic reloc section.
3400
d55525b9
L
34012011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3402
3403 PR gold/13505
3404 * target-reloc.h (apply_relocation): Replace <64, false> with
3405 <size, big_endian>.
3406
ff81c7c1
NC
34072011-11-25 Nick Clifton <nickc@redhat.com>
3408
3409 * po/it.po: New Italian translation.
3410
628f39be
SA
34112011-11-17 Sterling Augustine <saugustine@google.com>
3412
3413 * script.cc (script_include_directive): Implement.
3414 (read_script_file): New local variables name and search_path. Update
3415 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3416 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3417 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3418
98ef3ea4
SA
34192011-11-11 Sterling Augustine <saugustine@google.com>
3420
3421 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3422 (file_or_sections_cmd): Likewise.
3423
f4a8b6d7
DK
34242011-11-11 Doug Kwan <dougkwan@google.com>
3425
3426 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3427 if --just-symbols is given.
3428
29ab395d
DK
34292011-11-10 Doug Kwan <dougkwan@google.com>
3430
3431 PR gold/13362
3432 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3433 when processing data relocs.
3434 * reloc.h (Relocate_functions::rel_unaligned): New method.
3435 (Relocate_functions::pcrel_unaligned): Ditto.
3436 (Relocate_functions::rel32_unaligned): Ditto.
3437 (Relocate_functions::pcrel32_unaligned): Ditto.
3438
2c339f71
DK
34392011-11-09 Doug Kwan <dougkwan@google.com>
3440
3441 PR gold/13362
3442 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3443 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3444 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3445 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3446 (Relocate_functions::rel_unaligned): New.
3447 (Relocate_functions::rel32_unaligned): New.
3448 * target-reloc.h (relocate_for_relocatable): Add code to handle
3449 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3450 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3451 arm_unaligned_reloc_r): New targets.
3452 * testsuite/Makefile.in: Regenerate.
3453 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3454 linking.
3455
3f3cddf1
ILT
34562011-11-02 Ian Lance Taylor <iant@google.com>
3457
3458 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3459 NATIVE_LINKER.
3460 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3461 * options.cc (General_options::finalize): Use library search path
3462 from configure script if specified. If not native and no sysroot,
3463 only search TOOLLIBDIR.
3464 * options.h (Search_directory::Search_directory): Change name to
3465 const std::string&.
3466 (General_options::add_to_library_path_with_sysroot): Change arg to
3467 const std::string&.
3468 * configure, Makefile.in, config.in: Rebuild.
3469
a8e2273b
ILT
34702011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3471
3472 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3473 we are working around the ARM1176 Erratum.
3474 * options.h (General_options::fix_arm1176): Add option.
3475 * testsuite/Makefile.am: Add testcases, and keep current ones
3476 working.
3477 * testsuite/Makefile.in: Regenerate.
3478 * testsuite/arm_fix_1176.s: New file.
3479 * testsuite/arm_fix_1176.sh: Likewise.
3480
cd6eab1c
ILT
34812011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3482
3483 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3484 may_use_blx_.
3485 (Target_arm::may_use_blx): Remove method.
3486 (Target_arm::set_may_use_blx): Likewise.
3487 (Target_arm::may_use_v4t_interworking): New method.
3488 (Target_arm::may_use_v5t_interworking): Likewise.
3489 (Target_arm::may_use_blx_): Remove member variable.
3490 (Arm_relocate_functions::arm_branch_common): Check for v5T
3491 interworking.
3492 (Arm_relocate_functions::thumb_branch_common): Likewise.
3493 (Reloc_stub::stub_type_for_reloc): Likewise.
3494 (Target_arm::do_finalize_sections): Correct interworking checks.
3495 * testsuite/Makefile.am: Add new tests.
3496 * testsuite/Makefile.in: Regenerate.
3497 * testsuite/arm_farcall_arm_arm.s: New test.
3498 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3499 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3500 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3501 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3502 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3503 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3504 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3505
286adcf4
CC
35062011-10-31 Cary Coutant <ccoutant@google.com>
3507
3508 PR gold/13023
3509 * expression.cc (Expression::eval_with_dot): Add
3510 is_section_dot_assignment parameter.
3511 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3512 absolute and assigning to dot within a section.
3513 * script-sections.cc
3514 (Output_section_element_assignment::set_section_addresses): Pass
3515 dot_section to set_if_absolute.
3516 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3517 as is_section_dot_assignment flag to eval_with_dot.
3518 (Output_section_element_dot_assignment::set_section_addresses):
3519 Likewise.
3520 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3521 parameter. Also set value if relative to dot_section; set the
3522 symbol's output_section.
3523 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3524 parameter. Adjust all callers.
3525 (Expression::eval_maybe_dot): Likewise.
3526 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3527 Adjust all callers.
3528 * testsuite/script_test_2.t: Test assignment of an absolute value
3529 to dot within an output section element.
3530
9634ed06
CC
35312011-10-31 Cary Coutant <ccoutant@google.com>
3532
3533 * options.h (class General_options): Add --[no-]gnu-unique options.
3534 * symtab.cc (Symbol_table::sized_write_globals): Convert
3535 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3536
de4101c7
CC
35372011-10-31 Cary Coutant <ccoutant@google.com>
3538
3539 PR gold/13359
3540 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3541 unnecessary assertion.
3542 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3543
7257cc92
ST
35442011-10-31 Sriraman Tallam <tmsriram@google.com>
3545
3546 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3547 gc_mark_symbol.
3548 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3549 gc_mark_symbol.
3550 Change to just keep the section associated with symbol.
3551 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3552 they are externally visible and --export-dynamic is turned on.
3553 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3554
bfc34b3f
ILT
35552011-10-19 Ian Lance Taylor <iant@google.com>
3556
3557 PR gold/13163
3558 * script-sections.cc
3559 (Output_section_element_dot_assignment::needs_output_section): New
3560 function.
3561
ea0d8c47
ILT
35622011-10-19 Ian Lance Taylor <iant@google.com>
3563
3564 PR gold/13204
3565 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3566 --section-start option was seen.
3567 * options.h (General_options::any_section_start): New function.
3568
abd242a9
DM
35692011-10-18 David S. Miller <davem@davemloft.net>
3570
3571 PR binutils/13301
3572 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3573 member to track relocation locations that have moved during TLS
3574 reloc optimizations.
3575 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3576 (Target_sparc::Relocate::relocate): Adjust view down by 4
3577 bytes if it matches reloc_adjust_addr_.
3578 (Target_sparc::Relocate::relocate_tls): Always move the
3579 __tls_get_addr call delay slot instruction forward 4 bytes when
3580 performing relaxation.
3581
bab9090f
CC
35822011-10-18 Cary Coutant <ccoutant@google.com>
3583
3584 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3585 (Output_file::map_no_anonymous): Check for non-zero
3586 return code from posix_fallocate.
3587
f7c5b166
CC
35882011-10-17 Cary Coutant <ccoutant@google.com>
3589
3590 PR gold/13245
3591 * plugin.cc (is_visible_from_outside): Check for symbols
3592 referenced from dynamic objects.
3593 * resolve.cc (Symbol_table::resolve): Don't count references
3594 from dynamic objects as references from real ELF files.
3595 * testsuite/plugin_test_2.sh: Adjust expected result.
3596
b490c0bb
CC
35972011-10-17 Cary Coutant <ccoutant@google.com>
3598
3599 * gold.cc: Include timer.h.
3600 (queue_middle_tasks): Stamp time.
3601 (queue_final_tasks): Likewise.
3602 * main.cc (main): Store timer in parameters. Print timers
3603 for each pass.
3604 * parameters.cc (Parameters::Parameters): Initialize timer_.
3605 (Parameters::set_timer): New function.
3606 (set_parameters_timer): New function.
3607 * parameters.h (Parameters::set_timer): New function.
3608 (Parameters::timer): New function.
3609 (Parameters::timer_): New data member.
3610 (set_parameters_timer): New function.
3611 * timer.cc (Timer::stamp): New function.
3612 (Timer::get_pass_time): New function.
3613 * timer.h (Timer::stamp): New function.
3614 (Timer::get_pass_time): New function.
3615 (Timer::pass_times_): New data member.
3616
f475cf7b
CC
36172011-10-17 Cary Coutant <ccoutant@google.com>
3618
3619 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3620 task for members of lib groups.
3621
cdd7e244
CC
36222011-10-17 Cary Coutant <ccoutant@google.com>
3623
3624 PR gold/13288
4f95c8b4 3625 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
3626 (File_read::make_view): Move bounds check (replace with assert)...
3627 (File_read::find_or_make_view): ... to here.
3628
dfb45471
CC
36292011-10-12 Cary Coutant <ccoutant@google.com>
3630
4f95c8b4 3631 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
3632 ::read returns less than requested size.
3633
53bbcc1b
CC
36342011-10-10 Cary Coutant <ccoutant@google.com>
3635
4f95c8b4 3636 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
3637 Initialize defined_count_.
3638 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3639 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3640 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3641 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3642 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 3643 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
3644 member.
3645 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 3646 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
3647 Return zeroes instead of internal error.
3648
397b129b
CC
36492011-10-10 Cary Coutant <ccoutant@google.com>
3650
3651 PR gold/13249
4f95c8b4 3652 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 3653 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 3654 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
3655 (Output_reloc::type_): Adjust size of bit field.
3656 (Output_reloc::use_plt_offset_): New bit field.
3657 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
3658 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
3659 flag. Adjust all callers.
4f95c8b4 3660 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
3661 creating RELATIVE relocations.
3662
d5698657
NC
36632011-10-10 Nick Clifton <nickc@redhat.com>
3664
3665 * po/es.po: Updated Spanish translation.
3666 * po/fi.po: Updated Finnish translation.
3667
6a59a5c2
DN
36682011-10-03 Diego Novillo <dnovillo@google.com>
3669
3670 * options.cc (parse_uint): Fix dereference of RETVAL.
3671
f0558624
ST
36722011-09-29 Sriraman Tallam <tmsriram@google.com>
3673
3674 * layout.h (section_order_map_): New member.
3675 (get_section_order_map): New member function.
3676 * output.cc (Output_section::add_input_section): Check for patterns
3677 only when --section-ordering-file is specified.
3678 * gold.cc (queue_middle_tasks): Delay updating order of sections till
3679 output_sections have been formed.
3680 * layout.cc (Layout_Layout): Initialize section_order_map_.
3681 * plugin.cc (update_section_order): Store order in order_map. Do not
3682 update the order.
3683 * testsuite/Makefile.am: Add test case for plugin_final_layout.
3684 * testsuite/Makefile.in: Regenerate.
3685 * testsuite/plugin_section_order.c: New file.
3686 * testsuite/plugin_final_layout.cc: New file.
3687 * testsuite/plugin_final_layout.sh: New file.
3688
a7dac153
CC
36892011-09-29 Cary Coutant <ccoutant@google.com>
3690
4f95c8b4 3691 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 3692 Check for NULL.
4f95c8b4 3693 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
3694 symbols during incremental update.
3695 (Symbol_table::add_from_dynobj): Likewise.
3696
eebd87a5
ILT
36972011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3698 Ian Lance Taylor <iant@google.com>
3699
3700 * symtab.cc (Symbol_table::define_special_symbol): Always
3701 canonicalize version string.
3702
403a3331
CC
37032011-09-26 Cary Coutant <ccoutant@google.com>
3704
4f95c8b4
CC
3705 * gold.cc (queue_initial_tasks): Move option checks ...
3706 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
3707 some options; make others fatal.
3708
235061c2
CC
37092011-09-26 Cary Coutant <ccoutant@google.com>
3710
3711 gcc PR lto/47247
3712 * plugin.cc (get_symbols_v2): New function.
3713 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
3714 (is_referenced_from_outside): New function.
3715 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
3716 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
3717 (get_symbols): Pass version parameter.
3718 (get_symbols_v2): New function.
3719 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
3720 parameter.
3721 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
3722 (onload): Add LDPT_GET_SYMBOLS_V2.
3723 (all_symbols_read_hook): Use get_symbols_v2; check for
3724 LDPR_PREVAILING_DEF_IRONLY_EXP.
3725 * testsuite/plugin_test_3.sh: Update expected results.
3726
dc87f620
ILT
37272011-09-23 Simon Baldwin <simonb@google.com>
3728
3729 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
3730 configuration options.
3731 * configure: Regenerate.
3732 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
3733 * Makefile.in: Regenerate.
3734 * testsuite/Makefile.in: Regenerate.
3735
a8279f82
ST
37362011-09-19 Sriraman Tallam <tmsriram@google.com>
3737
3738 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
3739
0c9350c8
CC
37402011-09-19 Cary Coutant <ccoutant@google.com>
3741
3742 * incremental.cc (can_incremental_update): Fix typo in comment.
3743 * incremental.h (can_incremental_update): Likewise.
3744
aa06ae28
CC
37452011-09-18 Cary Coutant <ccoutant@google.com>
3746
3747 * incremental.cc (can_incremental_update): New function.
3748 * incremental.h (can_incremental_update): New function.
3749 * layout.cc (Layout::init_fixed_output_section): Call it.
3750 (Layout::make_output_section): Don't allow patch space in .eh_frame.
3751 * object.cc (Sized_relobj_file::do_layout): Call
3752 can_incremental_update.
3753
ebb300b2
CC
37542011-09-13 Cary Coutant <ccoutant@google.com>
3755
3756 * configure.ac: Check for glibc support for gnu_indirect_function
3757 support with static linking, setting automake conditional
3758 IFUNC_STATIC.
3759 * Makefile.in: Regenerate.
3760 * configure: Regenerate.
3761
3762 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
3763 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
3764 for IFUNC_STATIC.
3765 * testsuite/Makefile.in: Regenerate.
3766
1206d0d5
CC
37672011-09-13 Cary Coutant <ccoutant@google.com>
3768
3769 * incremental.cc (Sized_relobj_incr::do_layout): Call
3770 report_comdat_group for kept comdat sections.
3771 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
3772 * testsuite/Makefile.in: Regenerate.
3773 * testsuite/incr_comdat_test_1.cc: New source file.
3774 * testsuite/incr_comdat_test_2_v1.cc: New source file.
3775 * testsuite/incr_comdat_test_2_v2.cc: New source file.
3776 * testsuite/incr_comdat_test_2_v3.cc: New source file.
3777
40b29874
ILT
37782011-09-13 Ian Lance Taylor <iant@google.com>
3779
3780 * object.cc (Sized_relobj_file::do_layout): Remove unused local
3781 variable external_symbols_offset.
3782
1b045aac
ILT
37832011-09-12 Ian Lance Taylor <iant@google.com>
3784
3785 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
3786 triggered if object has no symbols.
3787
24c6c55a
DM
37882011-09-09 David S. Miller <davem@davemloft.net>
3789
3790 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
3791 (Output_fill_debug_line::do_write): Likewise.
3792
66570254
CC
37932011-08-29 Cary Coutant <ccoutant@google.com>
3794
3795 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
3796 casts to match formatting specs.
3797 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
3798
8ea8cd50
CC
37992011-08-26 Cary Coutant <ccoutant@google.com>
3800
3801 * layout.cc (Free_list::allocate): Provide guarantee of minimum
3802 remaining hole size when allocating.
3803 (Layout::make_output_section): Set fill methods for debug sections.
3804 * layout.h (Free_list::Free_list_node): Move from private to
3805 public.
3806 (Free_list::set_min_hole_size): New function.
3807 (Free_list::begin, Free_list::end): New functions.
3808 (Free_list::min_hole_): New data member.
3809 * output.cc: Include dwarf.h.
3810 (Output_fill_debug_info::do_minimum_hole_size): New function.
3811 (Output_fill_debug_info::do_write): New function.
3812 (Output_fill_debug_line::do_minimum_hole_size): New function.
3813 (Output_fill_debug_line::do_write): New function.
3814 (Output_section::Output_section): Initialize new data member.
3815 (Output_section::set_final_data_size): Ensure patch space is larger
3816 than minimum hole size.
3817 (Output_section::do_write): Fill holes in debug sections.
3818 * output.h (Output_fill): New class.
3819 (Output_fill_debug_info): New class.
3820 (Output_fill_debug_line): New class.
3821 (Output_section::set_free_space_fill): New function.
3822 (Output_section::free_space_fill_): New data member.
3823 * testsuite/Makefile.am (incremental_test_3): Add
3824 --incremental-patch option.
3825 (incremental_test_4): Likewise.
3826 (incremental_test_5): Likewise.
3827 (incremental_test_6): Likewise.
3828 (incremental_copy_test): Likewise.
3829 (incremental_common_test_1): Likewise.
3830 * testsuite/Makefile.in: Regenerate.
3831
7cf80422
NC
38322011-08-26 Nick Clifton <nickc@redhat.com>
3833
3834 * po/es.po: Updated Spanish translation.
3835
c3f7b0e5
CC
38362011-08-01 Cary Coutant <ccoutant@google.com>
3837
3838 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
3839 * gold/testsuite/Makefile.in: Regenerate.
3840 * gold/testsuite/justsyms_exec.c: New source file.
3841 * gold/testsuite/justsyms_lib.c: New source file.
3842
9590bf25
CC
38432011-08-01 Cary Coutant <ccoutant@google.com>
3844
3845 * layout.cc (Layout::set_segment_offsets): Don't realign text
3846 segment if -Ttext was specified.
3847 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
3848 file type.
3849 * object.h (Sized_relobj_file::e_type): New function.
3850 (Sized_relobj_file::e_type_): New data member.
3851 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3852 base address for ET_EXEC files.
3853 * target.cc (Target::do_make_elf_object_implementation): Allow
3854 ET_EXEC files with --just-symbols option.
3855
dcd8d12e
CC
38562011-07-28 Cary Coutant <ccoutant@google.com>
3857
3858 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3859 Add thread_number parameter.
3860 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3861 * workqueue-threads.cc
3862 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3863 current thread if its thread number is greater than desired thread
3864 count.
3865 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3866 Add thread_number parameter.
3867 (Workqueue::should_cancel_thread): Likewise.
3868 (Workqueue::find_runnable_or_wait): Pass thread_number to
3869 should_cancel_thread.
3870 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3871 parameter.
3872
804eb480
ST
38732011-07-22 Sriraman Tallam <tmsriram@google.com>
3874
3875 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3876 only after checking if it cannot be forced local.
3877 * symtab.h (is_externally_visible): Check if the symbol is not forced
3878 local.
3879
f1ddb600
ILT
38802011-07-15 Ian Lance Taylor <iant@google.com>
3881
3882 * options.h (class General_options): Add --print-output-format.
3883 Move -EL next to -EB, for better --help output.
3884 * target-select.cc: Include <cstdio>, "options.h", and
3885 "parameters.h".
3886 (Target_selector::do_target_bfd_name): New function.
3887 (print_output_format): New function.
3888 * target-select.h (class Target_selector): Update declarations.
3889 (Target_selector::target_bfd_name): New function.
3890 (print_output_format): Declare.
3891 * main.cc: Include "target-select.h".
3892 (main): Handle --print-output-format.
3893 * gold.cc: Include "target-select.h".
3894 (queue_initial_tasks): Handle --print-output-format when there are
3895 no input files.
3896 * parameters.cc (parameters_force_valid_target): Give a better
3897 error message if -EB/-EL does not match target.
3898 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
3899 function.
3900
7d172687
ILT
39012011-07-15 Ian Lance Taylor <iant@google.com>
3902
3903 * i386.cc (class Output_data_plt_i386): Add layout_ field.
3904 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
3905 (Output_data_plt_i386::do_write): Write address of .dynamic
3906 section to first entry in .got.plt section.
3907 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
3908 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3909 Initialize layout_.
3910 (Output_data_plt_x86_64::do_write): Write address of .dynamic
3911 section to first entry in .got.plt section.
3912 * layout.h (Layout::dynamic_section): New function.
3913
e9552f7e
ST
39142011-07-13 Sriraman Tallam <tmsriram@google.com>
3915
3916 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
3917 to claim_file call.
3918 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
3919 input_section_position_, and input_section_glob_.
3920 (read_layout_from_file): Call function section_ordering_specified.
3921 * layout.h (is_section_ordering_specified): New function.
3922 (section_ordering_specified): New function.
3923 (section_ordering_specified_): New boolean member.
3924 * main.cc(main): Call load_plugins after layout object is defined.
3925 * output.cc (Output_section::add_input_section): Use
3926 function section_ordering_specified to check if section ordering is
3927 needed.
3928 * output.cc (Output_section::add_relaxed_input_section): Use
3929 function section_ordering_specified to check if section ordering is
3930 needed.
3931 (Output_section::update_section_layout): New function.
3932 (Output_section::sort_attached_input_sections): Check if input section
3933 must be reordered.
3934 * output.h (Output_section::update_section_layout): New function.
3935 * plugin.cc (get_section_count): New function.
3936 (get_section_type): New function.
3937 (get_section_name): New function.
3938 (get_section_contents): New function.
3939 (update_section_order): New function.
58797674 3940 (allow_section_ordering): New function.
e9552f7e
ST
3941 (Plugin::load): Add the new interfaces to the transfer vector.
3942 (Plugin_manager::load_plugins): New parameter.
3943 (Plugin_manager::all_symbols_read): New parameter.
3944 (Plugin_manager::claim_file): New parameter. Save the elf object for
3945 unclaimed objects.
3946 (Plugin_manager::get_elf_object): New function.
3947 (Plugin_manager::get_view): Change to directly use the bool to check
3948 if get_view is called from claim_file_hook.
3949 * plugin.h (input_objects): New function
3950 (Plugin__manager::load_plugins): New parameter.
3951 (Plugin_manager::claim_file): New parameter.
3952 (Plugin_manager::get_elf_object): New function.
3953 (Plugin_manager::in_claim_file_handler): New function.
3954 (Plugin_manager::in_claim_file_handler_): New member.
3955 (layout): New function.
3956 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
3957 handler with an extra parameter. Make the elf object before calling
3958 claim_file handler.
3959 * testsuite/plugin_test.c (get_section_count): New function pointer.
3960 (get_section_type): New function pointer.
3961 (get_section_name): New function pointer.
3962 (get_section_contents): New function pointer.
3963 (update_section_order): New function pointer.
3964 (allow_section_ordering): New function pointer.
3965 (onload): Check if the new interfaces exist.
3966
9446efde
ILT
39672011-07-13 Ian Lance Taylor <iant@google.com>
3968
3969 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
3970 relro section.
3971 * x86_64.cc (Target_x86_64::got_section): Likewise.
3972 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
3973 (relro_now_test_SOURCES): New variable.
3974 (relro_now_test_DEPENDENCIES): New variable.
3975 (relro_now_test_LDFLAGS): New variable.
3976 (relro_now_test_LDADD): New variable.
3977 (relro_now_test.so): New target.
3978 * testsuite/Makefile.in: Rebuild.
3979
07aa62f2
ILT
39802011-07-12 Ian Lance Taylor <iant@google.com>
3981
3982 PR gold/12980
3983 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
3984 GLOB_DAT relocation rather than a RELATIVE relocation for a
3985 protected symbol when creating a shared library.
3986 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3987 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
3988 * testsuite/protected_main_1.cc (main): Test that protected
3989 function has same address.
3990
e2153196
ILT
39912011-07-11 Ian Lance Taylor <iant@google.com>
3992
3993 PR gold/12979
3994 * options.h (class General_options): Add -Bgroup.
3995 * options.cc (General_options::finalize): If -Bgroup is set,
3996 default to --unresolved-symbols=report-all.
3997 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
3998 * target-reloc.h (issue_undefined_symbol_error): Handle
3999 --unresolved-symbols=report-all.
4000
6daf5215
ILT
40012011-07-08 Ian Lance Taylor <iant@google.com>
4002
4003 PR gold/11985
4004 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4005 if linker script discards key sections.
4006 (Layout::create_dynamic_symtab): Likewise.
4007 (Layout::assign_local_dynsym_offsets): Likewise.
4008 (Layout::sized_create_version_sections): Likewise.
4009 (Layout::create_interp): Likewise.
4010 (Layout::finish_dynamic_section): Likewise.
4011 (Layout::set_dynamic_symbol_size): Likewise.
4012
beabb2c6
ILT
40132011-07-08 Ian Lance Taylor <iant@google.com>
4014
4015 PR gold/12386
4016 * options.h (class General_options): Add --unresolved-symbols.
4017 * target-reloc.h (issue_undefined_symbol_error): Check
4018 --unresolved-symbols. Add comments.
4019
9c16daf1
ILT
40202011-07-08 Ian Lance Taylor <iant@google.com>
4021
4022 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4023 expression more complex.
4024
191f1a2d
ILT
40252011-07-08 Ian Lance Taylor <iant@google.com>
4026
4027 PR gold/11317
4028 * target-reloc.h (issue_undefined_symbol_error): New inline
4029 function, broken out of relocate_section.
4030 (relocate_section): Call issue_undefined_symbol_error.
4031 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4032 there is no TLS segment if we are about to issue an undefined
4033 symbol error.
4034 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4035
62855347
ILT
40362011-07-08 Ian Lance Taylor <iant@google.com>
4037
4038 PR gold/12279
4039 * resolve.cc (Symbol_table::should_override): Add fromtype
4040 parameter. Change all callers. Give error when linking together
4041 TLS and non-TLS symbol.
4042 (Symbol_table::should_override_with_special): Add fromtype
4043 parameter. Change all callers.
4044 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4045 there is no TLS segment if we have reported some errors.
4046 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4047
67181c72
ILT
40482011-07-08 Ian Lance Taylor <iant@google.com>
4049
4050 PR gold/12372
4051 * target.h (Target::plt_address_for_global): New function.
4052 (Target::plt_address_for_local): New function.
4053 (Target::plt_section_for_global): Remove.
4054 (Target::plt_section_for_local): Remove.
4055 (Target::do_plt_address_for_global): New virtual function.
4056 (Target::do_plt_address_for_local): New virtual function.
4057 (Target::do_plt_section_for_global): Remove.
4058 (Target::do_plt_section_for_local): Remove.
4059 (Target::register_global_plt_entry): Add Symbol_table and Layout
4060 parameters.
4061 * output.cc (Output_data_got::Got_entry::write): Use
4062 plt_address_for_global and plt_address_for_local.
4063 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4064 address of output section.
4065 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4066 got_irelative_, and irelative_count_ fields. Update
4067 declarations.
4068 (Output_data_plt_i386::has_irelative_section): New function.
4069 (Output_data_plt_i386::entry_count): Add irelative_count_.
4070 (Output_data_plt_i386::set_final_data_size): Likewise.
4071 (class Target_i386): Add got_irelative_ and rel_irelative_
4072 fields. Update declarations.
4073 (Target_i386::Target_i386): Initialize new fields.
4074 (Target_i386::do_plt_address_for_global): New function replacing
4075 do_plt_section_for_global.
4076 (Target_i386::do_plt_address_for_local): New function replacing
4077 do_plt_section_for_local.
4078 (Target_i386::got_section): Create got_irelative_.
4079 (Target_i386::rel_irelative_section): New function.
4080 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4081 fields. Don't define __rel_iplt_{start,end}.
4082 (Output_data_plt_i386::add_entry): Add symtab and layout
4083 parameters. Change all callers. Use different PLT and GOT for
4084 IFUNC symbols.
4085 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4086 layout parameters. Change all callers. Use different PLT and
4087 GOT.
4088 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4089 (Output_data_plt_i386::rel_irelative): New function.
4090 (Output_data_plt_i386::address_for_global): New function.
4091 (Output_data_plt_i386::address_for_local): New function.
4092 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4093 IRELATIVE GOT when changing IFUNC GOT entries.
4094 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4095 reloc.
4096 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4097 if we didn't create an IRELATIVE GOT.
4098 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4099 plt_address_for_local.
4100 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4101 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4102 got_irelative_, and irelative_count_ fields. Update
4103 declarations.
4104 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4105 Initialize new fields. Remove symtab parameter. Change all
4106 callers.
4107 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4108 irelative_count_.
4109 (Output_data_plt_x86_64::has_irelative_section): New function.
4110 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4111 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4112 fields. Update declarations.
4113 (Target_x86_64::Target_x86_64): Initialize new fields.
4114 (Target_x86_64::do_plt_address_for_global): New function replacing
4115 do_plt_section_for_global.
4116 (Target_x86_64::do_plt_address_for_local): New function replacing
4117 do_plt_section_for_local.
4118 (Target_x86_64::got_section): Create got_irelative_.
4119 (Target_x86_64::rela_irelative_section): New function.
4120 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4121 all callers. Don't create __rel_iplt_{start,end}.
4122 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4123 parameters. Change all callers. Use different PLT and GOT for
4124 IFUNC symbols.
4125 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4126 layout parameters. Change all callers. Use different PLT and
4127 GOT.
4128 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4129 parameters. Change all callers. Use different PLT and GOT for
4130 IFUNC symbols.
4131 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4132 (Output_data_plt_x86_64::rela_irelative): New function.
4133 (Output_data_plt_x86_64::address_for_global): New function.
4134 (Output_data_plt_x86_64::address_for_local): New function.
4135 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4136 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4137 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4138 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4139 parameters.
4140 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4141 reloc.
4142 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4143 symbols if we didn't create an IRELATIVE GOT.
4144 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4145 plt_address_for_local.
4146 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4147 * testsuite/ifuncvar1.c: New test file.
4148 * testsuite/ifuncvar2.c: New test file.
4149 * testsuite/ifuncvar3.c: New test file.
4150 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4151 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4152 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4153 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4154 * testsuite/Makefile.in: Rebuild.
4155
33c15b45
CC
41562011-07-07 Cary Coutant <ccoutant@google.com>
4157
4158 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4159 (two_file_test_1_ndebug.o): Likewise.
4160 (two_file_test_1b_ndebug.o): Likewise.
4161 (two_file_test_2_ndebug.o): Likewise.
4162 (two_file_test_main_ndebug.o): Likewise.
4163 (incremental_test_2): Link with no-debug versions.
4164
f48b5fb7
CC
41652011-07-06 Cary Coutant <ccoutant@google.com>
4166
4167 * gold/incremental.cc
4168 (Output_section_incremental_inputs::write_info_blocks): Check for
4169 hidden and internal symbols.
4170
221597a5
CC
41712011-07-06 Cary Coutant <ccoutant@google.com>
4172
4173 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4174 Check disposition for startup file.
4175 (Incremental_inputs::report_command_line): Ignore
4176 --incremental-startup-unchanged option.
4177 * options.cc (General_options::parse_incremental_startup_unchanged):
4178 New function.
4179 (General_options::General_options): Initialize new data member.
4180 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4181 (General_options): Add --incremental-startup-unchanged option.
4182 (General_options::incremental_startup_disposition): New function.
4183 (General_options::incremental_startup_disposition_): New data member.
4184
e24719f6
CC
41852011-07-06 Cary Coutant <ccoutant@google.com>
4186
4187 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4188 input file index to Script_info ctor.
4189 (Sized_incremental_binary::do_file_has_changed): Find the
4190 command-line argument for files named in scripts.
4191 * incremental.h (Script_info::Script_info): New ctor
4192 with input file index.
4193 (Script_info::input_file_index): New function.
4194 (Script_info::input_file_index_): New data member.
4195 (Incremental_binary::get_library): Add const.
4196 (Incremental_binary::get_script_info): Add const.
4197 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4198 * testsuite/Makefile.am (incremental_test_5): New test case.
4199 (incremental_test_6): New test case.
4200 * testsuite/Makefile.in: Regenerate.
4201
8f7c81e8
CC
42022011-07-06 Cary Coutant <ccoutant@google.com>
4203
4204 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4205 debug output when command lines differ.
4206
9fbd3822
CC
42072011-07-06 Cary Coutant <ccoutant@google.com>
4208
4209 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4210 --incremental-patch option.
4211 * layout.cc (Free_list::allocate): Extend allocation beyond original
4212 end if enabled.
4213 (Layout::make_output_section): Mark sections that should get
4214 patch space.
4215 * options.cc (parse_percent): New function.
4216 * options.h (parse_percent): New function.
4217 (DEFINE_percent): New macro.
4218 (General_options): Add --incremental-patch option.
4219 * output.cc (Output_section::Output_section): Initialize new data
4220 members.
4221 (Output_section::add_input_section): Print section name when out
4222 of patch space.
4223 (Output_section::add_output_section_data): Likewise.
4224 (Output_section::set_final_data_size): Add patch space when
4225 doing --incremental-full.
4226 (Output_section::do_reset_address_and_file_offset): Remove patch
4227 space.
4228 (Output_segment::set_section_list_addresses): Print debug output
4229 only if --incremental-update.
4230 * output.h (Output_section::set_is_patch_space_allowed): New function.
4231 (Output_section::is_patch_space_allowed_): New data member.
4232 (Output_section::patch_space_): New data member.
4233 * parameters.cc (Parameters::incremental_full): New function.
4234 * parameters.h (Parameters::incremental_full): New function
4235 * testsuite/Makefile.am (incremental_test_2): Add test for
4236 --incremental-patch option.
4237 * testsuite/Makefile.in: Regenerate.
4238 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4239 (t18): Remove function body.
4240
f6cccc2c
DK
42412011-07-05 Doug Kwan <dougkwan@google.com>
4242
4243 PR gold/12771
4244 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4245 Arm_Address type for relocation result.
4246 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4247 overflow check.
4248 (Arm_relocate_functions::abs32): Use unaligned access.
4249 (Arm_relocate_functions::rel32): Ditto.
4250 (Arm_relocate_functions::prel31): Ditto.
4251 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4252 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4253 static data relocations.
4254 * testsuite/Makefile.in: Regnerate.
4255 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4256
28a13fec
ILT
42572011-07-05 Ian Lance Taylor <iant@google.com>
4258
4259 PR gold/12392
4260 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4261 symbols if necessary.
4262 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4263
24d47b34
ILT
42642011-07-05 Ian Lance Taylor <iant@google.com>
4265
4266 PR gold/12952
4267 * resolve.cc (Symbol::override_base_with_special): Simply override
4268 version with special symbol version, ignoring previous version.
4269
41f9cbbe
ILT
42702011-07-05 Ian Lance Taylor <iant@google.com>
4271
4272 * object.cc (Sized_relobj_file::include_section_group): Add
4273 information to comment about signature location.
4274
886288f1
ILT
42752011-07-02 Ian Lance Taylor <iant@google.com>
4276
4277 PR gold/12957
4278 * options.h (class General_options): Add -f and -F.
4279 * options.cc (General_options::finalize): Fatal error if -f/-F
4280 are used without -shared.
4281 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4282
ae3a6d4f
ILT
42832011-07-02 Ian Lance Taylor <iant@google.com>
4284
4285 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4286
21131061
ILT
42872011-07-01 Ian Lance Taylor <iant@google.com>
4288
4289 PR gold/12525
4290 PR gold/12952
4291 * resolve.cc (Symbol::override_base_with_special): Don't override
4292 the version if the overriding symbol has a different name.
4293 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4294 all callers. If we give an error about an undefined version,
4295 define the base version if necessary.
4296 * dynobj.h (class Versions): Update declaration.
4297 * testsuite/weak_alias_test_5.cc: New file.
4298 * testsuite/weak_alias_test.script: New file.
4299 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4300 and versioned_alias have the right value, and call t2.
4301 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4302 weak_alias_test_5.so.
4303 (weak_alias_test_LDADD): Likewise.
4304 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4305 * testsuite/Makefile.in: Rebuild.
4306
611062c0
ILT
43072011-07-01 Ian Lance Taylor <iant@google.com>
4308
4309 PR gold/12525
4310 * options.h (class General_options): Support -z notext.
4311 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4312 -Wl,-z,notext.
4313 (two_file_shared_nonpic.so): Likewise.
4314 (two_file_shared_mixed.so): Likewise.
4315 (two_file_shared_mixed_1.so): Likewise.
4316 (weak_undef_lib_nonpic.so): Likewise.
4317 (alt/weak_undef_lib_nonpic.so): Likewise.
4318 (tls_test_shared_nonpic.so): Likewise.
4319 * testsuite/Makefile.in: Rebuild.
4320
328c7c2f
ILT
43212011-07-01 Ian Lance Taylor <iant@google.com>
4322
4323 PR gold/12525
4324 * configure.ac: Test whether static linking works, setting
4325 the automake conditional HAVE_STATIC.
4326 * testsuite/Makefile.am: Disable tests using -static if
4327 HAVE_STATIC is not true.
4328 * configure, testsuite/Makefile.in: Rebuild.
4329
02d7cd44
ILT
43302011-07-01 Ian Lance Taylor <iant@google.com>
4331
4332 PR gold/12525
4333 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4334 Assert if we see DW_EH_PE_indirect.
4335 * target.h (Target::ehframe_datarel_base): New function.
4336 (Target::do_ehframe_datarel_base): New target function.
4337 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4338 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4339 function.
4340
07a60597
ILT
43412011-07-01 Ian Lance Taylor <iant@google.com>
4342
4343 PR gold/12571
4344 * options.h (class General_options): Add
4345 --ld-generated-unwind-info.
4346 * ehframe.cc (Fde::write): Add address parameter. Change all
4347 callers. If associated with PLT, fill in address and size.
4348 (Cie::set_output_offset): Only add merge mapping if there is an
4349 object.
4350 (Cie::write): Add address parameter. Change all callers.
4351 (Eh_frame::add_ehframe_for_plt): New function.
4352 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4353 input_offset_ fields into union u_, with new plt field.
4354 (Fde::Fde): Adjust for new union field.
4355 (Fde::Fde) [Output_data version]: New constructor.
4356 (Fde::add_mapping): Only add merge mapping if there is an object.
4357 (class Cie): Update declarations.
4358 (class Eh_frame): Declare add_ehframe_for_plt.
4359 * layout.cc (Layout::layout_eh_frame): Break out code into
4360 make_eh_frame_section, and call it.
4361 (Layout::make_eh_frame_section): New function.
4362 (Layout::add_eh_frame_for_plt): New function.
4363 * layout.h (class Layout): Update declarations.
4364 * merge.cc (Merge_map::add_mapping): Add assertion.
4365 * i386.cc: Include "dwarf.h".
4366 (class Output_data_plt_i386): Make first_plt_entry,
4367 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4368 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4369 and plt_eh_frame_fde.
4370 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4371 boundary. Call add_eh_frame_for_plt if appropriate.
4372 * x86_64.cc: Include "dwarf.h".
4373 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4374 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4375 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4376 and plt_eh_frame_fde.
4377 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4378 appropriate.
4379
14788a3f
ILT
43802011-06-29 Ian Lance Taylor <iant@google.com>
4381
4382 PR gold/12629
4383 * object.cc (Sized_relobj_file::layout_section): Change shdr
4384 parameter to be const.
4385 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4386 out of do_layout.
4387 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4388 appropriate. Call layout_eh_frame_section.
4389 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4390 sections.
4391 * object.h (class Sized_relobj_file): Update declarations.
4392
6c21fce1
ILT
43932011-06-29 Ian Lance Taylor <iant@google.com>
4394
37e41b03 4395 PR gold/12652
6c21fce1
ILT
4396 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4397 modifier.
4398 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4399
4d5e4e62
ILT
44002011-06-29 Ian Lance Taylor <iant@google.com>
4401
4402 PR gold/12675
4403 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4404 SHT_X86_64_UNWIND.
4405 * layout.cc (Layout::layout_eh_frame): Likewise.
4406
886f533a
ILT
44072011-06-29 Ian Lance Taylor <iant@google.com>
4408
4409 PR gold/12695
4410 * layout.cc (Layout::symtab_section_shndx): New function.
4411 * layout.h (class Layout): Declare symtab_section_shndx.
4412 * output.cc (Output_section::write_header): Call it.
4413
f3ae1b28
ILT
44142011-06-29 Ian Lance Taylor <iant@google.com>
4415
4416 PR gold/12818
4417 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4418 symbols which are not used in a relocation.
4419
aecf301f
ILT
44202011-06-28 Ian Lance Taylor <iant@google.com>
4421
4422 PR gold/12898
4423 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4424 script create indistinguishable segments.
4425 (Layout::set_segment_offsets): Use stable_sort when sorting
4426 segments. Pass this to Compare_segments constructor.
4427 * layout.h (class Layout): Make segment_precedes non-static.
4428 (class Compare_segments): Change from struct to class. Add
4429 layout_ field. Add constructor.
4430 * script-sections.cc
4431 (Script_sections::attach_sections_using_phdrs_clause): Rename
4432 local orphan to is_orphan. Don't report failure to put empty
4433 section in segment. On attachment failure, report name of
4434 section, and attach to first PT_LOAD segment.
4435
03ef7571
ILT
44362011-06-28 Ian Lance Taylor <iant@google.com>
4437
4438 PR gold/12934
4439 * target-select.cc (Target_selector::Target_selector): Add
4440 emulation parameter. Change all callers.
4441 (select_target_by_bfd_name): Rename from select_target_by_name.
4442 Change all callers.
4443 (select_target_by_emulation): New function.
4444 (supported_emulation_names): New function.
4445 * target-select.h (class Target_selector): Add emulation_ field.
4446 Update declarations.
4447 (Target_selector::recognize_by_bfd_name): Rename from
4448 recognize_by_name. Change all callers.
4449 (Target_selector::supported_bfd_names): Rename from
4450 supported_names. Change all callers.
4451 (Target_selector::recognize_by_emulation): New function.
4452 (Target_selector::supported_emulations): New function.
4453 (Target_selector::emulation): New function.
4454 (Target_selector::do_recognize_by_bfd_name): Rename from
4455 do_recognize_by_name. Change all callers.
4456 (Target_selector::do_supported_bfd_names): Rename from
4457 do_supported_names. Change all callers.
4458 (Target_selector::do_recognize_by_emulation): New function.
4459 (Target_selector::do_supported_emulations): New function.
4460 (select_target_by_bfd_name): Change name in declaration.
4461 (select_target_by_emulation): Declare.
4462 (supported_emulation_names): Declare.
4463 * parameters.cc (parameters_force_valid_target): Try to find
4464 target based on emulation from -m option.
4465 * options.h (class General_options): Change doc string for -m.
4466 * options.cc (help): Print emulations.
4467 (General_options::parse_V): Likewise.
4468 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4469 Add emulation parameter. Change all callers.
4470
200b2bb9
ILT
44712011-06-28 Ian Lance Taylor <iant@google.com>
4472
4473 * target.h (class Target): Add osabi_ field.
4474 (Target::osabi): New function.
4475 (Target::set_osabi): New function.
4476 (Target::Target): Initialize osabi_.
4477 (Target::do_adjust_elf_header): Make pure virtual.
4478 (Sized_target::do_adjust_elf_header): Declare.
4479 * target.cc (Sized_target::do_adjust_elf_header): New function.
4480 (class Sized_target): Instantiate all versions.
4481 * freebsd.h (class Target_freebsd): Remove.
4482 (Target_selector_freebsd::do_recognize): Call set_osabi on
4483 Target.
4484 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4485 (Target_selector_freebsd::set_osabi): Remove.
4486 * i386.cc (class Target_i386): Inherit from Sized_target rather
4487 than Target_freebsd.
4488 * x86_64.cc (class Target_x86_64): Likewise.
4489
b3ce541e
ILT
44902011-06-28 Ian Lance Taylor <iant@google.com>
4491
4492 * target.h (Target::can_check_for_function_pointers): Rewrite.
4493 Make non-virtual.
4494 (Target::can_icf_inline_merge_sections): Likewise.
4495 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4496 (Target::Target_info): Add can_icf_inline_merge_sections field.
4497 (Target::do_can_check_for_function_pointers): New virtual
4498 function.
4499 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4500 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4501 from can_check_for_function_pointers, move in file.
4502 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4503 section_may_have_icf_unsafe_poineters, move in file.
4504 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4505 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4506 Rename from can_check_for_function_pointers, move in file.
4507 (Target_i386::can_icf_inline_merge_sections): Remove.
4508 (Target_i386::i386_info): Initialize
4509 can_icf_inline_merge_sections.
4510 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4511 Initialize can_icf_inline_merge_sections.
4512 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4513 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4514 Rename from can_check_for_function_pointers, move in file.
4515 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4516 (Target_x86_64::x86_64_info): Initialize
4517 can_icf_inline_merge_sections.
4518 * testsuite/testfile.cc (Target_test::test_target_info):
4519 Likewise.
4520 * icf.cc (get_section_contents): Correct formatting.
4521
6d1c4efb
ILT
45222011-06-27 Ian Lance Taylor <iant@google.com>
4523
4524 * symtab.cc (Symbol::versioned_name): New function.
4525 (Symbol_table::add_to_final_symtab): Use versioned_name when
4526 appropriate.
4527 (Symbol_table::sized_write_symbol): Likewise.
4528 * symtab.h (class Symbol): Declare versioned_name.
4529 * stringpool.h (class Stringpool_template): Add variant of add
4530 which takes a std::basic_string.
4531 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4532 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4533 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4534 (ver_test_12.o): New target.
4535 * testsuite/Makefile.in: Rebuild.
4536
57eb9b50
DK
45372011-06-27 Doug Kwan <dougkwan@google.com>
4538
4539 * arm.cc (Arm_relocate_functions::thm_jump8,
4540 Arm_relocate_functions::thm_jump11): Use a wider signed
4541 type to compute offset.
4542 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4543 arm_thm_jump8.
4544 * testsuite/Makefile.in: Regenerate.
4545 * testsuite/arm_branch_in_range.sh: Check test results of
4546 arm_thm_jump11 and arm_thm_jump8.
4547 * testsuite/arm_thm_jump11.s: New test source file.
4548 * testsuite/arm_thm_jump11.t: New linker script.
4549 * testsuite/arm_thm_jump8.s: New test source file.
4550 * testsuite/arm_thm_jump8.t: New linker script.
4551
487b39df
ILT
45522011-06-24 Ian Lance Taylor <iant@google.com>
4553
4554 * layout.cc: Include "object.h".
4555 (ctors_sections_in_init_array): New static variable.
4556 (Layout::is_ctors_in_init_array): New function.
4557 (Layout::layout): Add entry to ctors_sections_in_init_array if
4558 appropriate.
4559 * layout.h (class Layout): Declare is_ctors_in_init_array.
4560 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4561 is_ctors_reverse_view is set.
4562 (Sized_relobj_file::write_sections): Add layout parameter. Change
4563 all callers. Set is_ctors_reverse_view field of View_size.
4564 (Sized_relobj_file::reverse_words): New function.
4565 * object.h (Sized_relobj_file::View_size): Add
4566 is_ctors_reverse_view field.
4567 (class Sized_relobj_file): Update declarations.
4568 * testsuite/initpri3.c: New test.
4569 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4570 initpri3b.
4571 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4572 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4573 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4574 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4575 * testsuite/Makefile.in: Rebuild.
4576
472076e4
CC
45772011-06-24 Cary Coutant <ccoutant@google.com>
4578
4579 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4580 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4581 (debug_msg_cdebug.err): New targets.
4582 * testsuite/Makefile.in: Regenerate.
4583 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4584 Fix checks for link with shared library.
4585
a60af0db
DK
45862011-06-24 Doug Kwan <dougkwan@google.com>
4587
4588 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4589 skip empty text sections.
4590 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4591
5393d741
ILT
45922011-06-22 Ian Lance Taylor <iant@google.com>
4593
4594 PR gold/12910
4595 * options.h (class General_options): Add --ctors-in-init-array.
4596 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4597 friends as SHT_PROGBITS for merging sections.
4598 (Layout::layout): Remove special handling of .init_array and
4599 friends. Don't sort if doing relocatable link. Sort for .ctors
4600 and .dtors if ctors_in_init_array.
4601 (Layout::make_output_section): Force correct section types for
4602 .init_array and friends. Don't sort if doing relocatable link,
4603 Don't sort .ctors and .dtors if ctors_in_init_array.
4604 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4605 (Layout::output_section_name): Add relobj parameter. Change all
4606 callers. Handle .ctors. and .dtors. in code rather than table.
4607 Handle .ctors and .dtors if ctors_in_init_array.
4608 (Layout::match_file_name): New function, moved from output.cc.
4609 * layout.h (class Layout): Update declarations.
4610 * output.cc: Include "layout.h".
4611 (Input_section_sort_entry::get_priority): New function.
4612 (Input_section_sort_entry::match_file_name): Just call
4613 Layout::match_file_name.
4614 (Output_section::Input_section_sort_init_fini_compare::operator()):
4615 Handle .ctors and .dtors. Sort by explicit priority rather than
4616 by name.
4617 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4618 * testsuite/initpri2.c: New test.
4619 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4620 (check_PROGRAMS): Add initpri2.
4621 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4622 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4623 * configure, testsuite/Makefile.in: Rebuild.
4624
e1f74f98
ILT
46252011-06-19 Ian Lance Taylor <iant@google.com>
4626
4627 PR gold/12880
4628 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4629 .interp section to a PT_INTERP segment even if we have seen a
4630 --dynamic-linker option. Don't do it if we have seen a PHDRS
4631 clause in a linker script.
4632 (Layout::finalize): Don't create a .interp section if we've
4633 already create a PT_INTERP segment.
4634 (Layout::create_interp): Always call choose_output_section (revert
4635 patch of 2011-06-17). Don't create PT_INTERP segment.
4636 * script-sections.cc
4637 (Script_sections::create_note_and_tls_segments): Add a .interp
4638 section to a PT_INTERP segment even if we have seen a
4639 --dynamic-linker option.
4640
766f91bb
ILT
46412011-06-18 Ian Lance Taylor <iant@google.com>
4642
4643 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
4644 merely because a non-PT_LOAD segment has a dynamic reloc.
4645
0d212c3a
ILT
46462011-06-18 Ian Lance Taylor <iant@google.com>
4647
4648 * layout.cc (Layout::finish_dynamic_section): Don't create
4649 DT_FLAGS entry if not needed.
4650
911a5072
ILT
46512011-06-18 Ian Lance Taylor <iant@google.com>
4652
4653 PR gold/12745
4654 * layout.cc (Layout::layout_eh_frame): Correct handling of
4655 writable .eh_frame section.
4656
534b4e5f
ILT
46572011-06-17 Ian Lance Taylor <iant@google.com>
4658
4659 PR gold/12893
4660 * resolve.cc (Symbol_table::resolve): Don't give an error if a
4661 symbol is redefined with the exact same object and value.
4662
10b4f102
ILT
46632011-06-17 Ian Lance Taylor <iant@google.com>
4664
4665 PR gold/12880
4666 * layout.h (class Layout): Add interp_segment_ field.
4667 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
4668 (Layout::attach_allocated_section_to_segment): If making shared
4669 library, put .interp section in PT_INTERP segment.
4670 (Layout::finalize): Also call create_interp if -dynamic-linker
4671 option was used.
4672 (Layout::create_interp): Assert that there is no PT_INTERP
4673 segment. If not using a SECTIONS clause, use make_output_section.
4674 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
4675 * script-sections.cc
4676 (Script_sections::create_note_and_tls_segments): If making shared
4677 library, put .interp section in PT_INTERP segment.
4678
a29b0dad
ILT
46792011-06-17 Ian Lance Taylor <iant@google.com>
4680
e588ea8d
ILT
4681 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
4682 when making a shared library.
4683
46842011-06-17 Ian Lance Taylor <iant@google.com>
4685
4686 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
4687 parameter. Change all callers. Don't issue warning about PC32
4688 against locally defined symbol.
a29b0dad 4689
9d3b0698
ILT
46902011-06-16 Ian Lance Taylor <iant@google.com>
4691
4692 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
4693 occurs in same object.
4694
85b0f90c
AM
46952011-06-14 Alan Modra <amodra@gmail.com>
4696
4697 * po/POTFILES.in: Regenerate.
4698
a94907d9
ILT
46992011-06-09 Ian Lance Taylor <iant@google.com>
4700
4701 * script-sections.cc
4702 (Orphan_output_section::set_section_addresses): For a relocatable
4703 link set address to 0.
4704
4fb3a1c3
CC
47052011-06-09 Cary Coutant <ccoutant@google.com>
4706
4707 PR gold/12804
4708 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
4709 used with --compress-debug-sections.
4710 * gold/object.cc (Sized_relobj_file::do_layout): Report
4711 uncompressed size of compressed input sections.
4712
61220854
CC
47132011-06-08 Cary Coutant <ccoutant@google.com>
4714
4715 PR gold/12804
4716 * testsuite/two_file_test_2_v1.cc: Change initialization of
4717 v2 to keep it in .data.
4718
e6455dfb
CC
47192011-06-07 Cary Coutant <ccoutant@google.com>
4720
4721 * common.cc (Symbol_table::do_allocate_commons_list): Call
4722 gold_fallback.
4723 * errors.cc (Errors::fatal): Adjust call to gold_exit.
4724 (Errors::fallback): New function.
4725 (gold_fallback): New function.
4726 * errors.h (Errors::fallback): New function.
4727 * gold.cc (gold_exit): Change status parameter to enum; adjust
4728 all callers.
4729 (queue_initial_tasks): Call gold_fallback.
4730 * gold.h: Include cstdlib.
4731 (Exit_status): New enum type.
4732 (gold_exit): Change status parameter to enum.
4733 (gold_fallback): New function.
4734 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
4735 (Layout::create_symtab_sections): Likewise.
4736 (Layout::create_shdrs): Likewise.
4737 * main.cc (main): Adjust call to gold_exit.
4738 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
4739 (Output_data_got::add_got_entry_pair): Likewise.
4740 (Output_section::add_input_section): Likewise.
4741 (Output_section::add_output_section_data): Likewise.
4742 (Output_segment::set_section_list_addresses): Likewise.
4743 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
4744
fb0e076f
CC
47452011-06-07 Cary Coutant <ccoutant@google.com>
4746
4747 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
4748 for incremental links.
4749 * output.cc (Output_segment::set_section_list_addresses): Remove
4750 FIXME and test for TLS or BSS.
4751
a5ee4d5d
CC
47522011-06-07 Cary Coutant <ccoutant@google.com>
4753
4754 * testsuite/Makefile.am: Add incremental_copy_test,
4755 incremental_common_test_1.
4756 * testsuite/Makefile.in: Regenerate.
4757 * testsuite/common_test_1_v1.c: New source file.
4758 * testsuite/common_test_1_v2.c: New source file.
4759 * testsuite/copy_test_v1.cc: New source file.
4760
5146f448
CC
47612011-06-07 Cary Coutant <ccoutant@google.com>
4762
4763 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
4764 update, allocate common from bss section's free list.
4765 * incremental-dump.cc (dump_incremental_inputs): Print flag for
4766 linker-defined symbols.
4767 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4768 Skip GOT and PLT entries that are no longer referenced.
4769 (Output_section_incremental_inputs::write_info_blocks): Mark
4770 linker-defined symbols.
4771 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
4772 * output.cc (Output_section::allocate): New function.
4773 * output.h (Output_section::allocate): New function.
4774 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
4775 linker-defined symbols.
4776 (Symbol::override_base_with_special): Copy is_predefined_ flag.
4777 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
4778 (Symbol::init_base_output_data): Likewise.
4779 (Symbol::init_base_output_segment): Likewise.
4780 (Symbol::init_base_constant): Likewise.
4781 (Sized_symbol::init_output_data): Likewise.
4782 (Sized_symbol::init_output_segment): Likewise.
4783 (Sized_symbol::init_constant): Likewise.
4784 (Symbol_table::do_define_in_output_data): Likewise.
4785 (Symbol_table::do_define_in_output_segment): Likewise.
4786 (Symbol_table::do_define_as_constant): Likewise.
4787 * symtab.h (Symbol::is_predefined): New function.
4788 (Symbol::init_base_output_data): Add is_predefined parameter.
4789 (Symbol::init_base_output_segment): Likewise.
4790 (Symbol::init_base_constant): Likewise.
4791 (Symbol::is_predefined_): New data member.
4792 (Sized_symbol::init_output_data): Add is_predefined parameter.
4793 (Sized_symbol::init_output_segment): Likewise.
4794 (Sized_symbol::init_constant): Likewise.
4795 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
4796
26d3c67d
CC
47972011-06-07 Cary Coutant <ccoutant@google.com>
4798
4799 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
4800 instead of emit_copy_reloc.
4801 (Copy_relocs::emit_copy_reloc): Refactor.
4802 (Copy_relocs::make_copy_reloc): New function.
4803 (Copy_relocs::add_copy_reloc): Remove.
4804 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
4805 section.
4806 (Copy_relocs::make_copy_reloc): New function.
4807 (Copy_relocs::add_copy_reloc): Remove.
4808 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
4809 unchanged input files.
4810 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
4811 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
4812 Reserve BSS space for COPY relocations.
4813 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4814 (Output_section_incremental_inputs::write_info_blocks): Record
4815 whether a symbol is copied from a shared object.
4816 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
4817 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
4818 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
4819 (Incremental_input_entry_reader::get_output_symbol_index): Add
4820 is_copy parameter.
4821 (Incremental_binary::emit_copy_relocs): New function.
4822 (Incremental_binary::do_emit_copy_relocs): New function.
4823 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4824 new data member.
4825 (Sized_incremental_binary::add_copy_reloc): New function.
4826 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4827 (Sized_incremental_binary::Copy_reloc): New struct.
4828 (Sized_incremental_binary::Copy_relocs): New typedef.
4829 (Sized_incremental_binary::copy_relocs_): New data member.
4830 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
4831 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
4832 * target.h (Sized_target::emit_copy_reloc): New function.
4833 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
4834
7cdb37d9
CC
48352011-06-02 Cary Coutant <ccoutant@google.com>
4836
4837 PR gold/12163
4838 * gold/archive.cc (Archive::Archive): Initialize new data member.
4839 (Archive::include_all_members): Return if archive has already been
4840 included.
4841 * gold/archive.h (Archive::include_all_members_): New data member.
4842
cc643b88
NC
48432011-06-02 Nick Clifton <nickc@redhat.com>
4844
4845 * dynobj.h: Fix spelling mistake in comment.
4846 * output.cc: Likewise.
4847
f62a3ca7 48482011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 4849 Asier Llano
f62a3ca7
DK
4850
4851 PR gold/12826
cc643b88 4852 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
4853 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4854 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4855 redundant arm_exidx_test.so.
4856 * testsuite/Makefile.in: Regenerate.
4857 (check_SCRIPTS): Add pr12826.sh
4858 (check_DATA): Add pr12826.stdout
4859 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4860 * testsuite/pr12826.sh: New file.
4861 * testsuite/pr12826_1.s: Ditto.
4862 * testsuite/pr12826_1.s: Ditto.
4863
8dbe1edc
ILT
48642011-05-30 Ian Lance Taylor <iant@google.com>
4865
4866 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4867 sections.
4868
c49875be
ILT
48692011-05-29 Ian Lance Taylor <iant@google.com>
4870
4871 PR gold/12804
4872 * testsuite/Makefile.am: Use different file name for two_file_test
4873 temporary file for each incremental test.
4874 * testsuite/Makefile.in: Rebuild.
4875
69d53f7a
ILT
48762011-05-29 Ian Lance Taylor <iant@google.com>
4877
4878 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4879 binary input file is empty.
4880
41d0ab5f
ILT
48812011-05-27 Ian Lance Taylor <iant@google.com>
4882
4883 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4884 (ver_test_9.so): Likewise.
4885 * testsuite/Makefile.in: Rebuild.
4886
89d8a36b
CC
48872011-05-26 Cary Coutant <ccoutant@google.com>
4888
4889 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4890 * incremental.cc (Incremental_inputs::report_input_section): Fix
4891 comment, indentation.
4892 (Incremental_inputs::report_comdat_group): New function.
4893 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4894 of data for incremental input file entry.
4895 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
4896 group count, COMDAT group signatures.
4897 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
4898 an unchanged input file.
4899 * incremental.h (Incremental_object_entry::Incremental_object_entry):
4900 Initialize new data member.
4901 (Incremental_object_entry::add_comdat_group): New function.
4902 (Incremental_object_entry::get_comdat_group_count): New function.
4903 (Incremental_object_entry::get_comdat_signature_key): New function.
4904 (Incremental_object_entry::groups_): New data member.
4905 (Incremental_inputs::report_comdat_group): New function.
4906 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
4907 data for incremental input file entry.
4908 (Incremental_input_entry_reader::get_comdat_group_count): New function.
4909 (Incremental_input_entry_reader::get_input_section): Adjust size of
4910 data for incremental input file entry.
4911 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
4912 (Incremental_input_entry_reader::get_comdat_group_signature): New
4913 function.
4914 * object.cc (Sized_relobj::include_section_group): Report kept
4915 COMDAT groups for incremental links.
4916
1706a06f
ILT
49172011-05-24 David Meyer <pdox@google.com>
4918
4919 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
4920 with name parameter. Add found_name parameter.
4921 * fileread.cc (Input_file::find_file): Adjust code accordingly.
4922 * dirsearch.h (class Dirsearch): Update declaration.
4923
a10ae760
ILT
49242011-05-24 Ian Lance Taylor <iant@google.com>
4925
4926 * archive.cc (Library_base::should_include_member): Pull in object
4927 from archive if it defines the entry symbol.
4928 * parameters.cc (Parameters::entry): New function.
4929 * parameters.h (class Parameters): Declare entry.
4930 * output.h (class Output_file_header): Remove entry_ field.
4931 * output.cc (Output_file_header::Output_file_header): Remove entry
4932 parameter. Change all callers.
4933 (Output_file_header::entry): Use parameters->entry.
4934 * gold.cc (queue_middle_tasks): Likewise.
4935 * plugin.cc (Plugin_hook::run): Likewise.
4936
aa92d6ed
CC
49372011-05-24 Cary Coutant <ccoutant@google.com>
4938
4939 * gold.cc (queue_initial_tasks): Pass incremental base filename
4940 to Output_file::open_base_file; don't print error message.
4941 * incremental-dump.cc (main): Adjust call to
4942 Output_file::open_for_modification.
4943 * incremental-dump.cc (main): Likewise.
4944 * incremental.cc (Incremental_inputs::report_command_line):
4945 Ignore --incremental-base option when comparing command lines.
4946 Ignore parameter when given as separate argument.
4947 * options.h (class General_options): Add --incremental-base.
4948 * output.cc (Output_file::Output_file):
4949 (Output_file::open_base_file): Add base_name and writable parameters;
4950 read base file into new file; print error message here.
4951 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4952 callers.
4953 * output.h (Output_file::open_for_modification): Rename to...
4954 (Output_file::open_base_file): ...this; add base_name and
4955 writable parameters; adjust all callers.
4956 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4957 callers.
4958 * testsuite/Makefile.am (incremental_test_4): Test
4959 --incremental-base.
4960 * testsuite/Makefile.in: Regenerate.
4961
2eedd706
CC
49622011-05-24 Cary Coutant <ccoutant@google.com>
4963
4964 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
4965 incremental_test_4.
4966 * testsuite/Makefile.in: Regenerate.
4967 * testsuite/two_file_test_1_v1.cc: New test source file.
4968 * testsuite/two_file_test_1b_v1.cc: New test source file.
4969 * testsuite/two_file_test_2_v1.cc: New test source file.
4970
0f1c85a6
CC
49712011-05-24 Cary Coutant <ccoutant@google.com>
4972
4973 * dynobj.h (Dynobj::do_dynobj): New function.
4974 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
4975 flag and soname for shared objects.
4976 * incremental.cc (Incremental_inputs::report_object): Make
4977 either Incremental_object_entry or Incremental_dynobj_entry; add
4978 soname to string table.
4979 (Incremental_inputs::report_input_section): Add assertion.
4980 (Output_section_incremental_inputs::set_final_data_size): Adjust
4981 type of input file entry for shared libraries; adjust size of
4982 shared library info entry.
4983 (Output_section_incremental_inputs::write_input_files): Write
4984 as_needed flag for shared libraries.
4985 (Output_section_incremental_inputs::write_info_blocks): Adjust type
4986 of input file entry for shared libraries; write soname.
4987 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
4988 soname from incremental info.
4989 * incremental.h (enum Incremental_input_flags): Add
4990 INCREMENTAL_INPUT_AS_NEEDED.
4991 (Incremental_input_entry::Incremental_input_entry): Initialize new
4992 data member.
4993 (Incremental_input_entry::set_as_needed): New function.
4994 (Incremental_input_entry::as_needed): New function.
4995 (Incremental_input_entry::do_dynobj_entry): New function.
4996 (Incremental_input_entry::as_needed_): New data member.
4997 (Incremental_object_entry::Incremental_object_entry): Don't check
4998 for shared library.
4999 (Incremental_object_entry::do_type): Likewise.
5000 (class Incremental_dynobj_entry): New class.
5001 (Incremental_input_entry_reader::as_needed): New function.
5002 (Incremental_input_entry_reader::get_soname): New function.
5003 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5004 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5005 size of shared library info entry.
58797674 5006 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5007 incremental link when adding DT_NEEDED entries.
5008 * object.h (Object::Object): Initialize new data member.
5009 (Object::dynobj): New function.
5010 (Object::set_as_needed): New function.
5011 (Object::as_needed): New function.
5012 (Object::do_dynobj): New function.
5013 (Object::as_needed_): New data member.
5014
6fa2a40b
CC
50152011-05-24 Cary Coutant <ccoutant@google.com>
5016
5017 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5018 info; adjust display of GOT entries.
5019 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5020 vector of input objects; remove file_status_.
5021 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5022 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5023 got_plt reader; call target hooks to reserve GOT entries.
5024 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5025 of input file info header and GOT info entry.
5026 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5027 relocation info.
5028 (Got_plt_view_info::got_descriptor): Remove.
5029 (Got_plt_view_info::sym_index): New data member.
5030 (Got_plt_view_info::input_index): New data member.
5031 (Local_got_offset_visitor::visit): Write input file index.
5032 (Global_got_offset_visitor::visit): Write 0 for input file index.
5033 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5034 with sym_index and input_index.
5035 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5036 incremental info GOT entry; replace got_descriptor with input_index.
5037 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5038 map from input file index to object.
5039 (Sized_relobj_incr::do_layout): Replace direct data member reference
5040 with accessor function.
5041 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5042 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5043 Adjust size of input file info header.
5044 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5045 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5046 (Incremental_input_entry_reader::get_input_section): Adjust size of
5047 input file info header.
5048 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5049 of incremental info GOT entry.
5050 (Incremental_got_plt_reader::get_got_desc): Remove.
5051 (Incremental_got_plt_reader::get_got_symndx): New function.
5052 (Incremental_got_plt_reader::get_got_input_index): New function.
5053 (Sized_incremental_binary::Sized_incremental_binary): Remove
5054 file_status_; add input_objects_.
5055 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5056 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5057 (Sized_incremental_binary::file_is_unchanged): Remove.
5058 (Sized_incremental_binary::set_input_object): New function.
5059 (Sized_incremental_binary::input_object): New function.
5060 (Sized_incremental_binary::file_status_): Remove.
5061 (Sized_incremental_binary::input_objects_): New data member.
5062 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5063 references.
5064 (Sized_relobj_incr::invalid_address): Move to base class.
5065 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5066 class.
5067 (Sized_relobj_incr::do_output_section_offset): Likewise.
5068 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5069 (Sized_relobj_incr::section_offsets_): Likewise.
5070 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5071 function.
5072 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5073 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5074 with accessor function.
5075 (Sized_relobj_file::do_layout): Likewise.
5076 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5077 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5078 (Sized_relobj_file::compute_final_local_value): Replace refs to
5079 section_offsets_ with accessor function.
5080 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5081 * object.h (Relobj::Relobj): Initialize new data members.
5082 (Relobj::add_dyn_reloc): New function.
5083 (Relobj::first_dyn_reloc): New function.
5084 (Relobj::dyn_reloc_count): New function.
5085 (Relobj::first_dyn_reloc_): New data member.
5086 (Relobj::dyn_reloc_count_): New data member.
5087 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5088 references.
5089 (Sized_relobj::Address): New typedef.
5090 (Sized_relobj::invalid_address): Move here from child class.
5091 (Sized_relobj::Sized_relobj): Initialize new data members.
5092 (Sized_relobj::sized_relobj): New function.
5093 (Sized_relobj::is_output_section_offset_invalid): Move here from
5094 child class.
5095 (Sized_relobj::get_output_section_offset): Likewise.
5096 (Sized_relobj::local_has_got_offset): Likewise.
5097 (Sized_relobj::local_got_offset): Likewise.
5098 (Sized_relobj::set_local_got_offset): Likewise.
5099 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5100 (Sized_relobj::clear_got_offsets): New function.
5101 (Sized_relobj::section_offsets): Move here from child class.
5102 (Sized_relobj::do_output_section_offset): Likewise.
5103 (Sized_relobj::do_set_section_offset): Likewise.
5104 (Sized_relobj::Local_got_offsets): Likewise.
5105 (Sized_relobj::local_got_offsets_): Likewise.
5106 (Sized_relobj::section_offsets_): Likewise.
5107 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5108 references.
5109 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5110 class.
5111 (Sized_relobj_file::sized_relobj): New function
5112 (Sized_relobj_file::local_has_got_offset): Move to base class.
5113 (Sized_relobj_file::local_got_offset): Likewise.
5114 (Sized_relobj_file::set_local_got_offset): Likewise.
5115 (Sized_relobj_file::get_output_section_offset): Likewise.
5116 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5117 (Sized_relobj_file::do_output_section_offset): Likewise.
5118 (Sized_relobj_file::do_set_section_offset): Likewise.
5119 (Sized_relobj_file::Local_got_offsets): Likewise.
5120 (Sized_relobj_file::local_got_offsets_): Likewise.
5121 (Sized_relobj_file::section_offsets_): Likewise.
5122 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5123 (all constructors).
5124 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5125 (Output_reloc::get_symbol_index): Likewise.
5126 (Output_reloc::local_section_offset): Likewise.
5127 (Output_reloc::get_address): Likewise.
5128 (Output_reloc::symbol_value): Likewise.
5129 (Output_data_got::reserve_slot): Move to class definition.
5130 (Output_data_got::reserve_local): New function.
5131 (Output_data_got::reserve_slot_for_global): Remove.
5132 (Output_data_got::reserve_global): New function.
5133 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5134 (all constructors, two instantiations).
5135 (Output_reloc::get_relobj): New function (two instantiations).
5136 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5137 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5138 (Output_data_reloc::add_global): Adjust type of relobj.
5139 (Output_data_reloc::add_global_relative): Likewise.
5140 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5141 (Output_data_reloc::add_local): Likewise.
5142 (Output_data_reloc::add_local_relative): Likewise.
5143 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5144 (Output_data_reloc::add_local_section): Likewise.
5145 (Output_data_reloc::add_output_section): Likewise.
5146 (Output_data_reloc::add_absolute): Likewise.
5147 (Output_data_reloc::add_target_specific): Likewise.
5148 (Output_data_got::reserve_slot): Move definition here.
5149 (Output_data_got::reserve_local): New function.
5150 (Output_data_got::reserve_global): New function.
5151 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5152 section_offsets_ with accessor function.
5153 (Sized_relobj_file::write_sections): Likewise.
5154 (Sized_relobj_file::do_relocate_sections): Likewise.
5155 * target.h (Sized_target::reserve_local_got_entry): New function.
5156 (Sized_target::reserve_global_got_entry): New function.
5157 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5158 (Target_x86_64::reserve_global_got_entry): New function.
5159 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5160
4829d394
CC
51612011-05-23 Cary Coutant <ccoutant@google.com>
5162
5163 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5164 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5165 bit when checking got_type.
5166 * incremental.cc (Sized_incremental_binary::setup_readers):
5167 Store symbol table and string table locations; initialize bit vector
5168 of file status flags.
5169 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5170 unchanged files.
5171 (Sized_incremental_binary::do_process_got_plt): New function.
5172 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5173 (Output_section_incremental_inputs::set_final_data_size): Record
5174 file index for each input file.
5175 (Output_section_incremental_inputs::write_got_plt): Store file index
5176 instead of input entry offset for each GOT entry.
5177 * incremental.h
5178 (Incremental_input_entry::Incremental_input_entry): Initialize new
5179 data member.
5180 (Incremental_input_entry::set_offset): Store file index.
5181 (Incremental_input_entry::get_file_index): New function.
5182 (Incremental_input_entry::file_index_): New data member.
5183 (Incremental_binary::process_got_plt): New function.
5184 (Incremental_binary::do_process_got_plt): New function.
5185 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5186 data members.
5187 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5188 (Sized_incremental_binary::set_file_is_unchanged): New function.
5189 (Sized_incremental_binary::file_is_unchanged): New function.
5190 (Sized_incremental_binary::do_process_got_plt): New function.
5191 (Sized_incremental_binary::file_status_): New data member.
5192 (Sized_incremental_binary::main_symtab_loc_): New data member.
5193 (Sized_incremental_binary::main_strtab_loc_): New data member.
5194 * output.cc (Output_data_got::Got_entry::write): Add case
5195 RESERVED_CODE.
5196 (Output_data_got::add_global): Call add_got_entry.
5197 (Output_data_got::add_global_plt): Likewise.
5198 (Output_data_got::add_global_with_rel): Likewise.
5199 (Output_data_got::add_global_with_rela): Likewise.
5200 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5201 (Output_data_got::add_global_pair_with_rela): Likewise.
5202 (Output_data_got::add_local): Call add_got_entry.
5203 (Output_data_got::add_local_plt): Likewise.
5204 (Output_data_got::add_local_with_rel): Likewise.
5205 (Output_data_got::add_local_with_rela): Likewise.
5206 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5207 (Output_data_got::add_local_pair_with_rela): Likewise.
5208 (Output_data_got::reserve_slot): New function.
5209 (Output_data_got::reserve_slot_for_global): New function.
5210 (Output_data_got::add_got_entry): New function.
5211 (Output_data_got::add_got_entry_pair): New function.
5212 (Output_section::add_output_section_data): Edit FIXME.
5213 * output.h
5214 (Output_section_data_build::Output_section_data_build): New
5215 constructor with size parameter.
5216 (Output_data_space::Output_data_space): Likewise.
5217 (Output_data_got::Output_data_got): Initialize new data member; new
5218 constructor with size parameter.
5219 (Output_data_got::add_constant): Call add_got_entry.
5220 (Output_data_got::reserve_slot): New function.
5221 (Output_data_got::reserve_slot_for_global): New function.
5222 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5223 (Output_data_got::add_got_entry): New function.
5224 (Output_data_got::add_got_entry_pair): New function.
5225 (Output_data_got::free_list_): New data member.
5226 * target.h (Sized_target::init_got_plt_for_update): New function.
5227 (Sized_target::register_global_plt_entry): New function.
5228 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5229 Initialize new data member; call init; add constructor with PLT count.
5230 (Output_data_plt_x86_64::init): New function.
5231 (Output_data_plt_x86_64::add_relocation): New function.
5232 (Output_data_plt_x86_64::reserve_slot): New function.
5233 (Output_data_plt_x86_64::free_list_): New data member.
5234 (Target_x86_64::init_got_plt_for_update): New function.
5235 (Target_x86_64::register_global_plt_entry): New function.
5236 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5237 incremental updates.
5238 (Output_data_plt_x86_64::add_relocation): New function.
5239 * testsuite/object_unittest.cc (Object_test): Set default options.
5240
ec69d6da
ILT
52412011-05-16 Ian Lance Taylor <iant@google.com>
5242
5243 * options.h (class General_options): Make -i a synonym for -r.
5244
732e31de
ILT
52452011-05-16 Ian Lance Taylor <iant@google.com>
5246
5247 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5248
403676b5
CC
52492011-05-10 Cary Coutant <ccoutant@google.com>
5250
5251 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5252 strip_all (-s).
5253
5b7b7d6e
ILT
52542011-05-06 Ian Lance Taylor <iant@google.com>
5255
5256 * layout.cc (Layout::layout): If the output section flags change,
5257 update the ordering.
5258
f0f9babf
CC
52592011-04-25 Cary Coutant <ccoutant@google.com>
5260
5261 * incremental-dump.cc (dump_incremental_inputs): Print local
5262 symbol info for each input file.
5263 * incremental.cc
5264 (Output_section_incremental_inputs::set_final_data_size): Add local
5265 symbol info to input file entries in incremental info.
5266 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5267 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5268 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5269 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5270 implementation.
5271 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5272 (Sized_incr_relobj::do_relocate): Write the local symbols.
5273 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5274 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5275 Adjust size of input file header.
5276 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5277 (Incremental_inputs_reader::get_local_symbol_count): New function.
5278 (Incremental_inputs_reader::get_input_section): Adjust size of input
5279 file header.
5280 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5281 (Sized_incr_relobj::This): New typedef.
5282 (Sized_incr_relobj::sym_size): New const data member.
5283 (Sized_incr_relobj::Local_symbol): New struct.
5284 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5285 (Sized_incr_relobj::do_local_symbol_offset): New function.
5286 (Sized_incr_relobj::local_symbol_count_): New data member.
5287 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5288 (Sized_incr_relobj::local_symbol_index_): New data member.
5289 (Sized_incr_relobj::local_symbol_offset_): New data member.
5290 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5291 (Sized_incr_relobj::local_symbols_): New data member.
5292 * object.h (Relobj::output_local_symbol_count): New function.
5293 (Relobj::local_symbol_offset): New function.
5294 (Relobj::do_output_local_symbol_count): New function.
5295 (Relobj::do_local_symbol_offset): New function.
5296 (Sized_relobj::do_output_local_symbol_count): New function.
5297 (Sized_relobj::do_local_symbol_offset): New function.
5298
d0a9ace3
ILT
52992011-04-22 Vladimir Simonov <sv@sw.ru>
5300
5301 * descriptors.cc (set_close_on_exec): New function.
5302 (Descriptors::open): Use set_close_on_exec.
5303 * output.cc (S_ISLNK): Define if not defined.
5304
94a3fc8b
CC
53052011-04-22 Cary Coutant <ccoutant@google.com>
5306
5307 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5308 global symbol map.
5309 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5310 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5311 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5312 relocations.
5313 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5314 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5315 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5316 * incremental.h
5317 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5318 function.
5319 (Incremental_binary::apply_incremental_relocs): New function.
5320 (Incremental_binary::do_apply_incremental_relocs): New function.
5321 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5322 data member.
5323 (Sized_incremental_binary::add_global_symbol): New function.
5324 (Sized_incremental_binary::global_symbol): New function.
5325 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5326 (Sized_incremental_binary::symbol_map_): New data member.
5327 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5328 * target.h (Sized_target::apply_relocation): New function.
5329 * target-reloc.h (apply_relocation): New function.
5330 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5331
c87e4302
DK
53322011-04-22 Doug Kwan <dougkwan@google.com>
5333
5334 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5335 flag of a SHT_ARM_EXIDX section.
2e702c99 5336 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5337 * testsuite/Makefile.in: Regenerate.
5338 * testsuite/arm_exidx_test.s: New file.
5339 * testsuite/arm_exidx_test.sh: Same.
5340
e7782cf6
CC
53412011-04-20 Cary Coutant <ccoutant@google.com>
5342
5343 PR gold/12689
5344 * archive.h (Incremental_archive_entry::Archive_member):
5345 Initialize arg_serial_ (second constructor).
5346
308ecdc7
ILT
53472011-04-17 Ian Lance Taylor <iant@google.com>
5348
5349 * object.cc (Relocate_info::location): Simplify location string.
5350 * errors.cc (Errors::error_at_location): Don't print program
5351 name.
5352 (Errors::warning_at_location): Likewise.
5353 (Errors::undefined_symbol): Likewise.
5354 * testsuite/debug_msg.sh: Update accordingly.
5355
bec5b579
CC
53562011-04-14 Cary Coutant <ccoutant@google.com>
5357
5358 * gold/layout.cc (Layout::symtab_section_offset): New function.
5359 * gold/layout.h (Layout::symtab_section_offset): New function.
5360 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5361
88597d34
ILT
53622011-04-12 Ian Lance Taylor <iant@google.com>
5363
5364 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5365 with MREMAP_MAYMOVE.
5366 * output.h (class Output_file): Add map_is_allocated_ field.
5367 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5368 not available, provide stubs. If mremap is not available, #define
5369 it to gold_mremap.
5370 (MREMAP_MAYMOVE): Define if not defined.
5371 (Output_file::Output_file): Initialize map_is_allocated_.
5372 (Output_file::resize): Check map_is_allocated_.
5373 (Output_file::map_anonymous): If mmap fails, use malloc.
5374 (Output_file::unmap): Don't do anything for an anonymous map.
5375 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5376 is not available, provide stubs.
5377 (File_read::View::~View): Use free rather than delete[].
5378 (File_read::make_view): Use malloc rather than new[]. If mmap
5379 fails, use malloc.
5380 (File_read::find_or_make_view): Use malloc rather than new[].
5381 * gold.h: Remove HAVE_REMAP code.
5382 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5383 exists. Rename mremap to gold_mremap. If mmap is not available
5384 don't do anything.
5385 * configure, config.in: Rebuild.
5386
11e361bc
ILT
53872011-04-11 Ian Lance Taylor <iant@google.com>
5388
5389 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5390 initialize local variable v.
5391
cdc29364
CC
53922011-04-11 Cary Coutant <ccoutant@google.com>
5393
5394 * archive.cc (Archive::include_member): Adjust call to
5395 report_object.
5396 (Add_archive_symbols::run): Track argument serial numbers.
5397 (Lib_group::include_member): Likewise.
5398 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5399 * archive.h (Incremental_archive_entry::Archive_member):
5400 Initialize arg_serial_.
5401 (Archive_member::arg_serial_): New data member.
5402 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5403 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5404 incremental link.
5405 (Sized_dynobj::do_for_all_local_got_entries): New function.
5406 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5407 function.
5408 * fileread.cc (get_mtime): New function.
5409 * fileread.h (get_mtime): New function.
5410 * gold.cc (queue_initial_tasks): Check for incremental update.
5411 (process_incremental_input): New function.
5412 (queue_middle_tasks): Don't force valid target for incremental
5413 update.
5414 * incremental-dump.cc (find_input_containing_global): Adjust
5415 size of symbol info entry.
5416 (dump_incremental_inputs): Dump argument serial number and
5417 in_system_directory flag; bias shndx by 1; print symbol names
5418 when dumping per-file symbol lists; use new symbol info readers.
5419 * incremental.cc
5420 (Output_section_incremental_inputs:update_data_size): New function.
5421 (Sized_incremental_binary::setup_readers): Setup input readers
5422 for each input file; build maps for files added from libraries
5423 and scripts.
5424 (Sized_incremental_binary::check_input_args): New function.
5425 (Sized_incremental_binary::do_check_inputs): Build map of argument
5426 serial numbers to input arguments.
5427 (Sized_incremental_binary::do_file_has_changed): Rename
5428 do_file_is_unchanged to this; compare file modification times.
5429 (Sized_incremental_binary::do_init_layout): New function.
5430 (Sized_incremental_binary::do_reserve_layout): New function.
5431 (Sized_incremental_binary::do_get_input_reader): Remove.
5432 (Sized_incremental_binary::get_symtab_view): New function.
5433 (Incremental_checker::can_incrementally_link_output_file): Remove.
5434 (Incremental_inputs::report_command_line): Exclude --debug options.
5435 (Incremental_inputs::report_archive_begin): Add parameter; track
5436 argument serial numbers; don't put input file entry for archive
5437 before archive members.
5438 (Incremental_inputs::report_archive_end): Put input file entry
5439 for archive after archive members.
5440 (Incremental_inputs::report_object): Add parameter; track argument
5441 serial numbers and in_system_directory flag.
5442 (Incremental_inputs::report_script): Add parameter; track argument
5443 serial numbers.
5444 (Output_section_incremental_inputs::set_final_data_size): Adjust
5445 size of symbol info entry; check for forwarding symbols.
5446 (Output_section_incremental_inputs::write_input_files): Write
5447 in_system_directory flag and argument serial number.
5448 (Output_section_incremental_inputs::write_info_blocks): Map section
5449 indices between incremental info and original input file; store
5450 input section index for each symbol.
5451 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5452 change operator() to visit().
5453 (class Global_got_offset_visitor): Likewise.
5454 (class Global_symbol_visitor_got_plt):
5455 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5456 classes.
5457 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5458 (Sized_incr_relobj::do_read_symbols): New function.
5459 (Sized_incr_relobj::do_layout): New function.
5460 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5461 (Sized_incr_relobj::do_add_symbols): New function.
5462 (Sized_incr_relobj::do_should_include_member): New function.
5463 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5464 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5465 (Sized_incr_relobj::do_section_size): New function.
5466 (Sized_incr_relobj::do_section_name): New function.
5467 (Sized_incr_relobj::do_section_contents): New function.
5468 (Sized_incr_relobj::do_section_flags): New function.
5469 (Sized_incr_relobj::do_section_entsize): New function.
5470 (Sized_incr_relobj::do_section_address): New function.
5471 (Sized_incr_relobj::do_section_type): New function.
5472 (Sized_incr_relobj::do_section_link): New function.
5473 (Sized_incr_relobj::do_section_info): New function.
5474 (Sized_incr_relobj::do_section_addralign): New function.
5475 (Sized_incr_relobj::do_initialize_xindex): New function.
5476 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5477 (Sized_incr_relobj::do_read_relocs): New function.
5478 (Sized_incr_relobj::do_gc_process_relocs): New function.
5479 (Sized_incr_relobj::do_scan_relocs): New function.
5480 (Sized_incr_relobj::do_count_local_symbols): New function.
5481 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5482 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5483 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5484 (Sized_incr_relobj::do_relocate): New function.
5485 (Sized_incr_relobj::do_set_section_offset): New function.
5486 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5487 (Sized_incr_dynobj::do_read_symbols): New function.
5488 (Sized_incr_dynobj::do_layout): New function.
5489 (Sized_incr_dynobj::do_add_symbols): New function.
5490 (Sized_incr_dynobj::do_should_include_member): New function.
5491 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5492 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5493 (Sized_incr_dynobj::do_section_size): New function.
5494 (Sized_incr_dynobj::do_section_name): New function.
5495 (Sized_incr_dynobj::do_section_contents): New function.
5496 (Sized_incr_dynobj::do_section_flags): New function.
5497 (Sized_incr_dynobj::do_section_entsize): New function.
5498 (Sized_incr_dynobj::do_section_address): New function.
5499 (Sized_incr_dynobj::do_section_type): New function.
5500 (Sized_incr_dynobj::do_section_link): New function.
5501 (Sized_incr_dynobj::do_section_info): New function.
5502 (Sized_incr_dynobj::do_section_addralign): New function.
5503 (Sized_incr_dynobj::do_initialize_xindex): New function.
5504 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5505 (make_sized_incremental_object): New function.
5506 (Incremental_library::copy_unused_symbols): New function.
5507 (Incremental_library::do_for_all_unused_symbols): New function.
5508 * incremental.h (enum Incremental_input_flags): New type.
5509 (class Incremental_checker): Remove.
5510 (Incremental_input_entry::Incremental_input_entry): Add argument
5511 serial number.
5512 (Incremental_input_entry::arg_serial): New function.
5513 (Incremental_input_entry::set_is_in_system_directory): New function.
5514 (Incremental_input_entry::is_in_system_directory): New function.
5515 (Incremental_input_entry::arg_serial_): New data member.
5516 (Incremental_input_entry::is_in_system_directory_): New data member.
5517 (class Script_info): Move here from script.h.
5518 (Script_info::Script_info): Add filename parameter.
5519 (Script_info::filename): New function.
5520 (Script_info::filename_): New data member.
5521 (Incremental_script_entry::Incremental_script_entry): Add argument
5522 serial number.
5523 (Incremental_object_entry::Incremental_object_entry): Likewise.
5524 (Incremental_object_entry::add_input_section): Build list of input
5525 sections with map to original shndx.
5526 (Incremental_object_entry::get_input_section_index): New function.
5527 (Incremental_object_entry::shndx_): New data member.
5528 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5529 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5530 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5531 serial number.
5532 (Incremental_inputs::report_archive_begin): Likewise.
5533 (Incremental_inputs::report_object): Likewise.
5534 (Incremental_inputs::report_script): Likewise.
5535 (class Incremental_global_symbol_reader): New class.
5536 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5537 and store flags and input file type.
5538 (Incremental_input_entry_reader::arg_serial): New function.
5539 (Incremental_input_entry_reader::type): Extract type from flags.
5540 (Incremental_input_entry_reader::is_in_system_directory): New function.
5541 (Incremental_input_entry_reader::get_input_section_count): Call
5542 accessor function for type.
5543 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5544 function for type; adjust size of global symbol entry.
5545 (Incremental_input_entry_reader::get_global_symbol_count): Call
5546 accessor function for type.
5547 (Incremental_input_entry_reader::get_object_count): Likewise.
5548 (Incremental_input_entry_reader::get_object_offset): Likewise.
5549 (Incremental_input_entry_reader::get_member_count): Likewise.
5550 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5551 (Incremental_input_entry_reader::get_member_offset): Likewise.
5552 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5553 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5554 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5555 (Incremental_input_entry_reader::get_global_symbol_reader): New
5556 function.
5557 (Incremental_input_entry_reader::get_output_symbol_index): New
5558 function.
5559 (Incremental_input_entry_reader::type_): Remove.
5560 (Incremental_input_entry_reader::flags_): New data member.
5561 (Incremental_inputs_reader::input_file_offset): New function.
5562 (Incremental_inputs_reader::input_file_index): New function.
5563 (Incremental_inputs_reader::input_file): Call input_file_offset.
5564 (Incremental_inputs_reader::input_file_at_offset): New function.
5565 (Incremental_relocs_reader::get_r_type): Reformat.
5566 (Incremental_relocs_reader::get_r_shndx): Reformat.
5567 (Incremental_relocs_reader::get_r_offset): Reformat.
5568 (Incremental_relocs_reader::data): New function.
5569 (Incremental_binary::Incremental_binary): Initialize new data members.
5570 (Incremental_binary::check_inputs): Add cmdline parameter.
5571 (Incremental_binary::file_is_unchanged): Remove.
5572 (Input_reader::arg_serial): New function.
5573 (Input_reader::get_unused_symbol_count): New function.
5574 (Input_reader::get_unused_symbol): New function.
5575 (Input_reader::do_arg_serial): New function.
5576 (Input_reader::do_get_unused_symbol_count): New function.
5577 (Input_reader::do_get_unused_symbol): New function.
5578 (Incremental_binary::input_file_count): New function.
5579 (Incremental_binary::get_input_reader): Change signature to use
5580 index instead of filename.
5581 (Incremental_binary::file_has_changed): New function.
5582 (Incremental_binary::get_input_argument): New function.
5583 (Incremental_binary::get_library): New function.
5584 (Incremental_binary::get_script_info): New function.
5585 (Incremental_binary::init_layout): New function.
5586 (Incremental_binary::reserve_layout): New function.
5587 (Incremental_binary::output_file): New function.
5588 (Incremental_binary::do_check_inputs): New function.
5589 (Incremental_binary::do_file_is_unchanged): Remove.
5590 (Incremental_binary::do_file_has_changed): New function.
5591 (Incremental_binary::do_init_layout): New function.
5592 (Incremental_binary::do_reserve_layout): New function.
5593 (Incremental_binary::do_input_file_count): New function.
5594 (Incremental_binary::do_get_input_reader): Change signature.
5595 (Incremental_binary::input_args_map_): New data member.
5596 (Incremental_binary::library_map_): New data member.
5597 (Incremental_binary::script_map_): New data member.
5598 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5599 new data members.
5600 (Sized_incremental_binary::output_section): New function.
5601 (Sized_incremental_binary::inputs_reader): Add const.
5602 (Sized_incremental_binary::symtab_reader): Add const.
5603 (Sized_incremental_binary::relocs_reader): Add const.
5604 (Sized_incremental_binary::got_plt_reader): Add const.
5605 (Sized_incremental_binary::get_symtab_view): New function.
5606 (Sized_incremental_binary::Inputs_reader): New typedef.
5607 (Sized_incremental_binary::Input_entry_reader): New typedef.
5608 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5609 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5610 (Sized_incremental_binary::do_file_has_changed): New function.
5611 (Sized_incremental_binary::do_init_layout): New function.
5612 (Sized_incremental_binary::do_reserve_layout): New function.
5613 (Sized_input_reader::Inputs_reader): Remove.
5614 (Sized_input_reader::Input_entry_reader): Remove.
5615 (Sized_input_reader::do_arg_serial): New function.
5616 (Sized_input_reader::do_get_unused_symbol_count): New function.
5617 (Sized_input_reader::do_get_unused_symbol): New function.
5618 (Sized_incremental_binary::do_input_file_count): New function.
5619 (Sized_incremental_binary::do_get_input_reader): Change signature;
5620 use index instead of filename.
5621 (Sized_incremental_binary::section_map_): New data member.
5622 (Sized_incremental_binary::input_entry_readers_): New data member.
5623 (class Sized_incr_relobj): New class.
5624 (class Sized_incr_dynobj): New class.
5625 (make_sized_incremental_object): New function.
5626 (class Incremental_library): New class.
5627 * layout.cc (Free_list::num_lists): New static data member.
5628 (Free_list::num_nodes): New static data member.
5629 (Free_list::num_removes): New static data member.
5630 (Free_list::num_remove_visits): New static data member.
5631 (Free_list::num_allocates): New static data member.
5632 (Free_list::num_allocate_visits): New static data member.
5633 (Free_list::init): New function.
5634 (Free_list::remove): New function.
5635 (Free_list::allocate): New function.
5636 (Free_list::dump): New function.
5637 (Free_list::print_stats): New function.
5638 (Layout_task_runner::run): Resize output file for incremental updates.
5639 (Layout::Layout): Initialize new data members.
5640 (Layout::set_incremental_base): New function.
5641 (Layout::init_fixed_output_section): New function.
5642 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
5643 incremental updates.
5644 (Layout::create_gold_note): Do not create gold note section for
5645 incremental updates.
5646 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
5647 for incremental updates.
5648 (Layout::set_section_offsets): For incremental updates, allocate space
5649 from free list.
5650 (Layout::create_symtab_sections): Layout with offsets relative to
5651 start of section; for incremental updates, allocate space from free
5652 list.
5653 (Layout::create_shdrs): For incremental updates, allocate space from
5654 free list.
5655 (Layout::finish_dynamic_section): For incremental updates, do not
5656 check --as-needed (fixed in subsequent patch).
5657 * layout.h (class Free_list): New class.
5658 (Layout::set_incremental_base): New function.
5659 (Layout::incremental_base): New function.
5660 (Layout::init_fixed_output_section): New function.
5661 (Layout::allocate): New function.
5662 (Layout::incremental_base_): New data member.
5663 (Layout::free_list_): New data member.
5664 * main.cc (main): Print Free_list statistics.
5665 * object.cc (Relobj::finalize_incremental_relocs): Add
5666 clear_counts parameter; clear counts only when clear_counts is set.
5667 (Sized_relobj::Sized_relobj): Initialize new base class.
5668 (Sized_relobj::do_layout): Don't report special sections.
5669 (Sized_relobj::do_for_all_local_got_entries): New function.
5670 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
5671 symtab_off to all symbol table offsets.
5672 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
5673 * object.h (class Got_offset_list): Move to top of file.
5674 (Object::Object): Allow case where input_file == NULL.
5675 (Object::~Object): Likewise.
5676 (Object::input_file): Assert that input_file != NULL.
5677 (Object::lock): Allow case where input_file == NULL.
5678 (Object::unlock): Likewise.
5679 (Object::is_locked): Likewise.
5680 (Object::token): Likewise.
5681 (Object::release): Likewise.
5682 (Object::is_incremental): New function.
5683 (Object::get_mtime): New function.
5684 (Object::for_all_local_got_entries): New function.
5685 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
5686 (Object::set_is_in_system_directory): New function.
5687 (Object::is_in_system_directory): New function.
5688 (Object::do_is_incremental): New function.
5689 (Object::do_get_mtime): New function.
5690 (Object::do_for_all_local_got_entries): New function.
5691 (Object::is_in_system_directory_): New data member.
5692 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
5693 (class Sized_relobj_base): New class.
5694 (class Sized_relobj): Derive from Sized_relobj_base.
5695 (class Sized_relobj::Symbols): Redeclare from base class.
5696 (class Sized_relobj::local_got_offset_list): Remove.
5697 (class Sized_relobj::Output_sections): Redeclare from base class.
5698 (class Sized_relobj::do_for_all_local_got_entries): New function.
5699 (class Sized_relobj::write_local_symbols): Add offset parameter.
5700 (class Sized_relobj::local_symbol_offset_): Update comment.
5701 (class Sized_relobj::local_dynsym_offset_): Update comment.
5702 * options.cc (Input_arguments::add_file): Remove const.
5703 * options.h (Input_file_argument::Input_file_argument):
5704 Initialize arg_serial_ (all constructors).
5705 (Input_file_argument::set_arg_serial): New function.
5706 (Input_file_argument::arg_serial): New function.
5707 (Input_file_argument::arg_serial_): New data member.
5708 (Input_arguments::Input_arguments): Initialize file_count_.
5709 (Input_arguments::add_file): Remove const.
5710 (Input_arguments::number_of_input_files): New function.
5711 (Input_arguments::file_count_): New data member.
5712 (Command_line::number_of_input_files): Call
5713 Input_arguments::number_of_input_files.
5714 * output.cc (Output_segment_headers::Output_segment_headers):
5715 Set current size.
5716 (Output_section::Input_section::current_data_size): New function.
5717 (Output_section::Output_section): Initialize new data members.
5718 (Output_section::add_input_section): Don't do merge sections for
5719 an incremental link; allocate space from free list for an
5720 incremental update.
5721 (Output_section::add_output_section_data): Allocate space from
5722 free list for an incremental update.
5723 (Output_section::update_data_size): New function.
5724 (Output_section::set_fixed_layout): New function.
5725 (Output_section::reserve): New function.
5726 (Output_segment::set_section_addresses): Remove const.
5727 (Output_segment::set_section_list_addresses): Remove const; allocate
5728 space from free list for an incremental update.
5729 (Output_segment::set_offset): Adjust size of RELRO segment for an
5730 incremental update.
5731 * output.h (Output_data::current_data_size): Move here from
5732 child classes.
5733 (Output_data::pre_finalize_data_size): New function.
5734 (Output_data::update_data_size): New function.
5735 (Output_section_headers::update_data_size): new function.
5736 (Output_section_data_build::current_data_size): Move to Output_data.
5737 (Output_data_strtab::update_data_size): New function.
5738 (Output_section::current_data_size): Move to Output_data.
5739 (Output_section::set_fixed_layout): New function.
5740 (Output_section::has_fixed_layout): New function.
5741 (Output_section::reserve): New function.
5742 (Output_section::update_data_size): New function.
5743 (Output_section::has_fixed_layout_): New data member.
5744 (Output_section::free_list_): New data member.
5745 (Output_segment::set_section_addresses): Remove const.
5746 (Output_segment::set_section_list_addresses): Remove const.
5747 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
5748 New function.
5749 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
5750 New function.
5751 * readsyms.cc (Read_symbols::do_read_symbols): Add library
5752 parameter when calling Add_symbols constructor; store argument
5753 serial number for members of a lib group.
5754 (Add_symbols::locks): Allow case where token == NULL.
5755 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
5756 (Read_member::~Read_member): New function.
5757 (Read_member::is_runnable): New function.
5758 (Read_member::locks): New function.
5759 (Read_member::run): New function.
5760 (Check_script::~Check_script): New function.
5761 (Check_script::is_runnable): New function.
5762 (Check_script::locks): New function.
5763 (Check_script::run): New function.
5764 (Check_library::~Check_library): New function.
5765 (Check_library::is_runnable): New function.
5766 (Check_library::locks): New function.
5767 (Check_library::run): New function.
5768 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
5769 (Add_symbols::library_): New data member.
5770 (class Read_member): New class.
5771 (class Check_script): New class.
5772 (class Check_library): New class.
5773 * reloc.cc (Read_relocs::is_runnable): Allow case where
5774 token == NULL.
5775 (Read_relocs::locks): Likewise.
5776 (Scan_relocs::locks): Likewise.
5777 (Relocate_task::locks): Likewise.
5778 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
5779 to clear counters.
5780 (Sized_relobj::incremental_relocs_scan): Fix comment.
5781 (Sized_relobj::do_relocate): Pass output file offset to
5782 write_local_symbols.
5783 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
5784 from class declaration.
5785 * script.cc (read_input_script): Allocate Script_info; pass
5786 argument serial number to report_script.
5787 * script.h (class Script_info): Move to incremental.h.
5788 * symtab.cc (Symbol_table::add_from_incrobj): New function.
5789 * symtab.h (Symbol_table::add_from_incrobj): New function.
5790 (Symbol_table::set_file_offset): New function.
5791
b961d0d7
CC
57922011-04-05 Cary Coutant <ccoutant@google.com>
5793
5794 * incremental-dump.cc (dump_incremental_inputs): Change signature
5795 to take a Sized_incremental_binary; change caller. Use readers
5796 in Sized_incremental_binary.
5797 * incremental.cc
5798 (Sized_incremental_binary::find_incremental_inputs_sections):
5799 Rename do_find_incremental_inputs_sections to this.
5800 (Sized_incremental_binary::setup_readers): New function.
5801 (Sized_incremental_binary::do_check_inputs): Check
5802 has_incremental_info_ flag; move setup code to setup_readers;
5803 use input readers.
5804 (Sized_incremental_binary::do_file_is_unchanged): New function.
5805 (Sized_incremental_binary::do_get_input_reader): New function.
5806 * incremental.h (class Incremental_binary): Move to end of file.
5807 (Incremental_binary::file_is_unchanged): New function.
5808 (Incremental_binary::do_file_is_unchanged): New function.
5809 (Incremental_binary::Input_reader): New class.
5810 (Incremental_binary::get_input_reader): New function.
5811 (class Sized_incremental_binary): Move to end of file.
5812 (Sized_incremental_binary::Sized_incremental_binary): Setup the
5813 input section reader classes.
5814 (Sized_incremental_binary::has_incremental_info): New function.
5815 (Sized_incremental_binary::inputs_reader): New function.
5816 (Sized_incremental_binary::symtab_reader): New function.
5817 (Sized_incremental_binary::relocs_reader): New function.
5818 (Sized_incremental_binary::got_plt_reader): New function.
5819 (Sized_incremental_binary::do_file_is_unchanged): New function.
5820 (Sized_incremental_binary::Sized_input_reader): New class.
5821 (Sized_incremental_binary::get_input_reader): New function.
5822 (Sized_incremental_binary::find_incremental_inputs_sections):
5823 Rename do_find_incremental_inputs_sections to this.
5824 (Sized_incremental_binary::setup_readers): New function.
5825 (Sized_incremental_binary::has_incremental_info_): New data member.
5826 (Sized_incremental_binary::inputs_reader_): New data member.
5827 (Sized_incremental_binary::symtab_reader_): New data member.
5828 (Sized_incremental_binary::relocs_reader_): New data member.
5829 (Sized_incremental_binary::got_plt_reader_): New data member.
5830 (Sized_incremental_binary::current_input_file_): New data member.
5831
a869183f
PP
58322011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
5833
5834 PR gold/12640
5835 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5836 violation.
5837
58382011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
5839
5840 * archive.cc (Archive::include_member): Adjust call to report_object.
5841 (Add_archive_symbols::run): Add script_info to call to
5842 report_archive_begin.
5843 (Lib_group::include_member): Adjust call to report_object.
5844 (Add_lib_group_symbols::run): Adjust call to report_object.
5845 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
5846 blocks. Add object count for script input files.
5847 * incremental.cc (Incremental_inputs::report_archive_begin): Add
5848 script_info parameter; change all callers.
5849 (Incremental_inputs::report_object): Add script_info parameter;
5850 change all callers.
5851 (Incremental_inputs::report_script): Store backpointer to
5852 incremental info entry.
5853 (Output_section_incremental_inputs::set_final_data_size): Record
5854 additional information for scripts.
5855 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5856 * incremental.h (Incremental_script_entry::add_object): New function.
5857 (Incremental_script_entry::get_object_count): New function.
5858 (Incremental_script_entry::get_object): New function.
5859 (Incremental_script_entry::objects_): New data member; adjust
5860 constructor.
5861 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5862 (Incremental_inputs::report_object): Add script_info parameter.
5863 (Incremental_inputs_reader::get_object_count): New function.
5864 (Incremental_inputs_reader::get_object_offset): New function.
5865 * options.cc (Input_arguments::add_file): Return reference to
5866 new input argument.
5867 * options.h (Input_argument::set_script_info): New function.
5868 (Input_argument::script_info): New function.
5869 (Input_argument::script_info_): New data member; adjust all
5870 constructors.
5871 (Input_file_group::add_file): Return reference to new input argument.
5872 (Input_file_lib::add_file): Likewise.
5873 (Input_arguments::add_file): Likewise.
5874 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5875 * script.cc (Parser_closure::Parser_closure): Add script_info
5876 parameter; adjust all callers.
5877 (Parser_closure::script_info): New function.
5878 (Parser_closure::script_info_): New data member.
5879 (read_input_script): Report scripts earlier to incremental info.
5880 (script_add_file): Set script_info in Input_argument.
5881 (script_add_library): Likewise.
5882 * script.h (Script_options::Script_info): Rewrite class.
5883
a869183f 58842011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
5885
5886 * archive.cc (Library_base::should_include_member): Move
5887 method here from class Archive.
5888 (Archive::Archive): Initialize base class.
5889 (Archive::should_include_member): Move to base class.
5890 (Archive::do_for_all_unused_symbols): New function.
5891 (Add_archive_symbols::run): Remove redundant access to
5892 incremental_inputs.
5893 (Lib_group::Lib_group): Initialize base class.
5894 (Lib_group::do_filename): New function.
5895 (Lib_group::include_member): Pass pointer to Lib_group to
5896 report_object.
5897 (Lib_group::do_for_all_unused_symbols): New function.
5898 (Add_lib_group_symbols::run): Report archive information for
5899 incremental links.
5900 * archive.h (class Library_base): New base class.
5901 (class Archive): Derive from Library_base.
5902 (Archive::filename): Move to base class.
5903 (Archive::set_incremental_info): Likewise.
5904 (Archive::incremental_info): Likewise.
5905 (Archive::Should_include): Likewise.
5906 (Archive::should_include_member): Likewise.
5907 (Archive::Armap_entry): Remove.
5908 (Archive::Unused_symbol_iterator): Remove.
5909 (Archive::unused_symbols_begin): Remove.
5910 (Archive::unused_symbols_end): Remove.
5911 (Archive::do_filename): New function.
5912 (Archive::do_get_mtime): New function.
5913 (Archive::do_for_all_unused_symbols): New function.
5914 (Archive::task_): Move to base class.
5915 (Archive::incremental_info_): Likewise.
5916 (class Lib_group): Derive from Library_base.
5917 (Lib_group::do_filename): New function.
5918 (Lib_group::do_get_mtime): New function.
5919 (Lib_group::do_for_all_unused_symbols): New function.
5920 (Lib_group::task_): Move to base class.
5921 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
5922 function.
5923 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
5924 function.
5925 * incremental.cc (Incremental_inputs::report_archive_begin):
5926 Use Library_base; call library's get_mtime; add incremental inputs
5927 entry before members.
5928 (class Unused_symbol_visitor): New class.
5929 (Incremental_inputs::report_archive_end): Use Library_base; use
5930 visitor class to record unused symbols; don't add incremental inputs
5931 entry after members.
5932 (Incremental_inputs::report_object): Use Library_base.
5933 * incremental.h
5934 (Incremental_archive_entry::Incremental_archive_entry): Remove
5935 unused Archive parameter.
5936 (Incremental_inputs::report_archive_begin): Use Library_base.
5937 (Incremental_inputs::report_archive_end): Likewise.
5938 (Incremental_inputs::report_object): Likewise.
5939 * object.cc (Sized_relobj::do_for_all_global_symbols): New
5940 function.
5941 * object.h (Object::for_all_global_symbols): New function.
5942 (Object::do_for_all_global_symbols): New function.
5943 (Sized_relobj::do_for_all_global_symbols): New function.
5944 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
5945 function.
5946 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
5947 function.
5948
61ab3e40
ILT
59492011-03-27 Ian Lance Taylor <iant@google.com>
5950
5951 * archive.cc (Archive::interpret_header): Return -1 if something
5952 goes wrong. Change callers accordingly.
5953
30e1f9e6
CC
59542011-03-25 Cary Coutant <ccoutant@google.com>
5955
5956 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
5957 * testsuite/Makefile.in: Regenerate.
5958
9370ce59 59592011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
5960
5961 * plugin.cc (get_view): New.
5962 (Plugin::load): Pass get_view to the plugin.
5963 (Plugin_manager::get_view): New.
5964
9312bb0a
ILT
59652011-03-21 Ian Lance Taylor <iant@google.com>
5966
5967 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 5968 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 5969
7e12ba9e
ST
59702011-03-21 Sriraman Tallam <tmsriram@google.com>
5971
5972 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
5973 Change == to -eq.
5974 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
5975 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
5976 Change == to -eq.
5977 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
5978 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
5979
fd7a005d
ILT
59802011-03-14 Ian Lance Taylor <iant@google.com>
5981
5982 * script-sections.cc (Sort_output_sections::script_compare):
5983 Rename from is_before, change return type.
5984 (Sort_output_sections::operator()): Adjust accordingly.
5985
ed16fd1b
ILT
59862011-03-11 Jeffrey Yasskin <jyasskin@google.com>
5987
5988 PR gold/12572
5989 * testsuite/odr_violation2.cc: Add comment to make all error line
5990 numbers double digits.
5991 * testsuite/debug_msg.sh: Adjust expected errors.
5992
71ff8986
ILT
59932011-03-09 Jeffrey Yasskin <jyasskin@google.com>
5994
5995 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
5996 but mark earlier ones as non-canonical
5997 (offset_to_iterator): Update search target and example
5998 (do_addr2line): Return extra lines in a vector*
5999 (format_file_lineno): Extract from do_addr2line
6000 (one_addr2line): Add vector* out-param
6001 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6002 when a lineno entry appeared last for its instruction
6003 (Dwarf_line_info): Add vector* out-param
6004 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6005 * symtab.cc (Odr_violation_compare): Include the lineno in the
6006 comparison again.
6007 (linenos_from_loc): New. Combine the canonical line for an
6008 address with its other lines.
6009 (True_if_intersect): New. Helper functor to make
6010 std::set_intersection a query.
6011 (detect_odr_violations): Compare sets of lines instead of just
6012 one line for each function. This became less deterministic, but
6013 has fewer false positives.
6014 * symtab.h: Declarations.
6015 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6016 mix an optimized and non-optimized object in the same binary
6017 (odr_violation2.so): Same.
6018 * testsuite/Makefile.in: Regenerate from Makefile.am.
6019 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6020 * testsuite/debug_msg.sh: Update line numbers and add
6021 assertions.
6022 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6023 non-optimized context.
6024 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6025 isn't inlined, and use OdrDerived in an optimized context.
6026 * testsuite/odr_header1.h: Defines OdrDerived, where
6027 optimization will change the
6028 first-instruction-in-the-destructor's file and line number.
6029 * testsuite/odr_header2.h: Defines OdrBase.
6030
a19fefdc
ILT
60312011-03-09 Ian Lance Taylor <iant@google.com>
6032
6033 * fileread.cc (File_read::clear_views): Don't delete the whole
6034 file view.
6035
ecb351e9
ILT
60362011-03-08 Ian Lance Taylor <iant@google.com>
6037
6038 PR gold/12525
6039 * fileread.cc: #include <climits>.
6040 (GOLD_IOV_MAX): Define.
6041 (File_read::read_multiple): Limit number of entries by iov_max.
6042 * fileread.h (class File_read): Always set max_readv_entries to
6043 128.
6044
b821d13c
ILT
60452011-03-07 Ian Lance Taylor <iant@google.com>
6046
6047 PR gold/12525
6048 * options.h (class General_options): Add -dy and -dn.
6049
89243142
CC
60502011-03-02 Cary Coutant <ccoutant@google.com>
6051
6052 * testsuite/script_test_9.t: Add TLS segment.
6053
d0773f31
ILT
60542011-03-02 Simon Baldwin <simonb@google.com>
6055
6056 * configure.ac: Add check for gnu_indirect_function support in
6057 the toolchain building binutils.
6058 * configure: Rebuild.
6059
9370ce59 60602011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6061
6062 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6063 plugin only symbols.
6064 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6065 in plugin files as not needed in the symbol table.
6066
4cf7a849
ST
60672011-02-11 Sriraman Tallam <tmsriram@google.com>
6068
6069 * output.cc (Output_section::add_input_section): Delay fill
6070 generation for section ordering.
6071
b578bd7d
ILT
60722011-02-09 Ian Lance Taylor <iant@google.com>
6073
6074 PR gold/12316
6075 * object.h (class Sized_relobj): Remove clear_local_symbols.
6076 * reloc.cc (Sized_relobj::do_relocate): Don't call
6077 clear_local_symbols.
6078
9370ce59 60792011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6080
6081 * plugin.cc (is_visible_from_outside): Return true for symbols
6082 in the -u option.
6083
55382fb7
ILT
60842011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6085
6086 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6087 filename.
6088
4e271fff
ST
60892011-02-02 Sriraman Tallam <tmsriram@google.com>
6090
6091 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6092 to std::string.
4e271fff 6093 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6094 section_name to be std::string.
4e271fff
ST
6095 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6096
d433c3ac
ILT
60972011-01-25 Ian Lance Taylor <iant@google.com>
6098
6099 * script.cc (script_add_extern): Rewrite to use
6100 add_symbol_reference.
6101
880473a6
DK
61022011-01-25 Doug Kwan <dougkwan@google.com>
6103
d433c3ac 6104 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6105
f30f86fa
ILT
61062011-01-24 Ian Lance Taylor <iant@google.com>
6107
6108 * options.h (class General_options): Accept
6109 --no-detect-odr-violations.
6110
8e51a0b9
ILT
61112011-01-24 Ian Lance Taylor <iant@google.com>
6112
6113 * version.cc (version_string): Bump to 1.11.
6114
0f3b89d8
ILT
61152011-01-24 Ian Lance Taylor <iant@google.com>
6116
6117 * plugin.cc (class Plugin_rescan): Define new class.
6118 (Plugin_manager::claim_file): Set any_claimed_.
6119 (Plugin_manager::save_archive): New function.
6120 (Plugin_manager::save_input_group): New function.
6121 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6122 necessary.
6123 (Plugin_manager::new_undefined_symbol): New function.
6124 (Plugin_manager::rescan): New function.
6125 (Plugin_manager::rescannable_defines): New function.
6126 (Plugin_manager::add_input_file): Set any_added_.
6127 * plugin.h (class Plugin_manager): define new fields rescannable_,
6128 undefined_symbols_, any_claimed_, and any_added_. Declare
6129 Plugin_rescan as friend. Declare new functions.
6130 (Plugin_manager::Rescannable): Define type.
6131 (Plugin_manager::Rescannable_list): Define type.
6132 (Plugin_manager::Undefined_symbol_list): Define type.
6133 (Plugin_manager::Plugin_manager): Initialize new fields.
6134 * archive.cc (Archive::defines_symbol): New function.
6135 (Add_archive_symbols::run): Pass archive to plugins if any.
6136 * archive.h (class Archive): Declare defines_symbol.
6137 * readsyms.cc (Input_group::~Input_group): New function.
6138 (Finish_group::run): Pass input_group to plugins if any.
6139 * readsyms.h (class Input_group): Declare destructor.
6140 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6141 any.
6142
3bb951e5
ILT
61432011-01-10 Ian Lance Taylor <iant@google.com>
6144
6145 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6146 section as relro.
6147 (Layout::set_segment_offsets): Reset increase_relro before calling
6148 set_section_addresses a second time.
6149
0aa45fac
CC
61502011-01-04 Cary Coutant <ccoutant@google.com>
6151
6152 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6153 sections before NOBITS sections.
6154
0db46eb4
L
61552011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6156
6157 * version.cc (print_version): Update copyright to 2011.
6158
829c9745
CC
61592010-12-23 Cary Coutant <ccoutant@google.com>
6160
6161 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6162 of OS to this->add. Add OD parameter to second form of the function.
6163
7500420b
ILT
61642010-12-20 Ian Lance Taylor <iant@google.com>
6165
6166 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6167 second of two consecutive entries with same offset.
6168
f8e9a930
RW
61692010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6170
6171 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6172 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6173 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6174 to avoid unneeded links against $(LDADD).
6175 * testsuite/Makefile.in: Regenerate.
6176
2fbb4320
ILT
61772010-12-15 Ian Lance Taylor <iant@google.com>
6178
6179 PR gold/12324
6180 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6181 for R_X86_64_32 and R_X86_64_PC32.
6182 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6183 ver_matching_def_pic.o.
6184 (ver_matching_def_pic.o): New target.
6185
fedb228d
RW
61862010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6187
6188 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6189 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6190 Move definition before File_read::View member definitions.
6191 (File_read::View::~View): Initialize and hold lock before
6192 updating current_mapped_bytes.
6193
9b547ce6
RW
61942010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6195
6196 * dwarf_reader.cc: Remove outdated comment.
6197 * gold-threads.cc: Fix typo in error message.
6198 * archive.cc: Fix typos in comments.
6199 * archive.h: Likewise.
6200 * arm-reloc-property.cc: Likewise.
6201 * arm-reloc-property.h: Likewise.
6202 * arm-reloc.def: Likewise.
6203 * arm.cc: Likewise.
6204 * attributes.h: Likewise.
6205 * cref.cc: Likewise.
6206 * ehframe.cc: Likewise.
6207 * fileread.h: Likewise.
6208 * gold.h: Likewise.
6209 * i386.cc: Likewise.
6210 * icf.cc: Likewise.
6211 * incremental.h: Likewise.
6212 * int_encoding.cc: Likewise.
6213 * layout.h: Likewise.
6214 * main.cc: Likewise.
6215 * merge.h: Likewise.
6216 * object.cc: Likewise.
6217 * object.h: Likewise.
6218 * options.cc: Likewise.
6219 * readsyms.cc: Likewise.
6220 * reduced_debug_output.cc: Likewise.
6221 * reloc.cc: Likewise.
6222 * script-sections.cc: Likewise.
6223 * sparc.cc: Likewise.
6224 * symtab.h: Likewise.
6225 * target-reloc.h: Likewise.
6226 * target.cc: Likewise.
6227 * target.h: Likewise.
6228 * timer.cc: Likewise.
6229 * timer.h: Likewise.
6230 * x86_64.cc: Likewise.
6231
83e17bd5
CC
62322010-12-09 Cary Coutant <ccoutant@google.com>
6233
6234 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6235 stack.
6236 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6237 parameter; change all callers.
6238 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6239 * options.h (warn_execstack): New option.
6240
017257f8
DK
62412010-12-07 Doug Kwan <dougkwan@google.com>
6242
6243 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6244 like function call relocations.
6245
c20cbc06
ILT
62462010-12-07 Ian Lance Taylor <iant@google.com>
6247
6248 * archive.cc (Archive::get_elf_object_for_member): Permit
6249 punconfigured to be NULL.
6250 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6251 (Archive::include_member): Pass NULL to get_elf_object_for_member
6252 if we searched for the archive and this is the first included
6253 object.
6254
4dbfafcc
ILT
62552010-12-01 Ian Lance Taylor <iant@google.com>
6256
6257 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6258 track_relocs_type_ field.
6259 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6260 Set track_relocs_type_.
6261 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6262 contents when using RELA relocs.
6263 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6264 reloc_map_.
6265 * reloc.cc (Track_relocs::next_addend): New function.
6266 * reloc.h (class Track_relocs): Declare next_addend.
6267
e5e19edd
ILT
62682010-12-01 Ian Lance Taylor <iant@google.com>
6269
6270 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6271 virtual destructor.
6272
9a5ce24c
ILT
62732010-12-01 Ian Lance Taylor <iant@google.com>
6274
6275 * README: Update compilers known to work and fail.
6276
c7791212
NC
62772010-11-23 Matthias Klose <doko@ubuntu.com>
6278
6279 * configure.in: For --enable-gold, handle value `default' instead of
6280 `both*'. Always install ld as ld.bfd, install as ld if gold is
6281 not the default.
6282 * configure: Regenerate.
6283
0ad220c9
DK
62842010-11-18 Doug Kwan <dougkwan@google.com>
6285
6286 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6287 and right_alignment to be zero. Store result alignment only if it is
6288 greater than existing alignment.
6289
ab8056e0
CC
62902010-11-16 Cary Coutant <ccoutant@google.com>
6291
6292 PR gold/12220
6293 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6294 Check for ".zdebug_line".
6295
fd064a5b
CC
62962010-11-16 Doug Kwan <dougkwan@google.com>
6297 Cary Coutant <ccoutant@google.com>
6298
6299 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6300 by reference; adjust all callers.
6301 * output.cc (Output_segment::set_section_addresses): Adjust references
6302 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6303 list is empty.
6304 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6305 end at page boundary.
6306
6fc6ea19
CC
63072010-11-16 Cary Coutant <ccoutant@google.com>
6308
6309 PR gold/12220
6310 * layout.cc (Layout::choose_output_section): Transform names of
6311 compressed sections even when using a script with a SECTIONS clause.
6312 (Layout::output_section_name): Remove code to transform
6313 compressed debug section names.
6314 * output.cc (Output_section::add_input_section): Use uncompressed
6315 section size when tracking input sections.
6316
95a2c8d6
RS
63172010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6318
6319 * symtab.h (Symbol::NON_PIC_REF): Remove.
6320 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6321 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6322 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6323 (Symbol::use_plt_offset): Take a flags argument and pass it
6324 directly to needs_dynamic_reloc. Restrict check for undefined
6325 weak symbols to function calls.
6326 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6327 (Target_arm::Scan::global): Use it.
6328 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6329 (Target_arm::Relocate::relocate): Likewise.
6330 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6331 parameter with an r_type parameter. Use get_reference_flags
6332 to get the flags.
6333 (Target_arm::Relocate::relocate): Update accordingly.
6334 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6335 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6336 (Target_i386::Scan::global): Likewise.
6337 (Target_i386::Relocate::relocate): Likewise.
6338 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6339 parameter with an r_type parameter. Use get_reference_flags
6340 to get the flags.
6341 (Target_i386::Relocate::relocate): Update accordingly.
6342 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6343 (Target_powerpc::Scan::global): Use it.
6344 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6345 (Target_powerpc::Relocate::relocate): Likewise.
6346 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6347 (Target_sparc::Scan::global): Use it.
6348 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6349 (Target_sparc::Relocate::relocate): Likewise.
6350 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6351 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6352 (Target_x86_64::Scan::global): Likewise.
6353 (Target_x86_64::Relocate::relocate): Likewise.
6354
f625ae50
DK
63552010-11-08 Doug Kwan <dougkwan@google.com>
6356 Cary Coutant <ccoutant@google.com>
6357
6358 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6359 (Arm_exidx_merge_section::section_contents_): New data member.
6360 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6361 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6362 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6363 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6364 in parameters instead of calling Object::section_contents without
6365 locking.
6366 (Arm_output_section::group_section): New parameter TASK. Pass it
6367 to callees that need locking objects.
6368 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6369 to lock EXIDX input sections. Fix a formatting issue. Call
6370 Arm_exidx_merged_section::build_contents to create merged section
6371 contents.
6372 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6373 to lock object of stub table owner.
6374 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6375 TEXT_SIZE to initialize data member TEXT_SIZE_.
6376 (Arm_exidx_input_section::addralign): Fix typo in comment.
6377 (Arm_exidx_input_section::text_size): New method.
6378 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6379 that require locking objects. Lock objects before scanning for stubs
6380 and updating local symbols.
6381 (Arm_input_section<big_endian>::init): Copy contents of original
6382 input section.
2e702c99 6383 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6384 original input section instead of calling Object::section_contents
6385 without locking.
6386 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6387 size without calling Object::section_size().
6388 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6389 for size. Allocate a buffer for merged EXIDX entries.
6390 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 6391 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
6392 building code to Arm_exidx_merged_section::build_contetns. Write
6393 out contetns in buffer instead of building it on the fly.
6394 (Arm_relobj::make_exidx_input_section): Also pass text section size
6395 to Arm_exidx_input_section constructor.
6396 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6397 (Arm_dynobj::do_read_symbols): Fix memory leak.
6398 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6399 * target.h: (class Task): Add forward declaration.
6400 (Target::relax): Add new parameter TASK and pass it to
6401 Target::do_relax().
6402 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6403
5f9bcf58
CC
64042010-11-05 Cary Coutant <ccoutant@google.com>
6405
6406 PR gold/10708
6407 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6408 object when reading from the file.
6409 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6410 second layout pass.
6411 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6412 when reading section contents.
6413 (get_section_contents): Likewise.
6414 (icf::find_identical_sections): Likewise.
6415 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6416 object when reading from the file.
6417 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6418 the object when doing deferred section layout.
6419
e597fa08
NC
64202010-11-03 Nick Clifton <nickc@redhat.com>
6421
6422 PR gold/12001
6423 * script.h (class Symbol_assignment: name): New member. Returns
6424 the name of the symbol.
6425 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6426 Returns true if the given symbol name is on the list of
6427 assignments wating to be processed.
6428 * archive.cc (should_incldue_member): If the symbol is undefined,
6429 check to see if it is on the list of symbols pending assignment.
6430
3f9a3278
ILT
64312010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6432
6433 * script-sections.cc (Script_sections::find_memory_region): Check
6434 for a NULL output section pointer.
6435
d06fb4d1
DK
64362010-10-29 Doug Kwan <dougkwan@google.com>
6437
6438 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6439 Output_section::add_relaxed_input_section.
6440 * output.cc (Output_section::add_relaxed_input_section): Add new
6441 arguments LAYOUT and NAME. Set section order index.
6442 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6443 Copy section order index.
6444 * output.h (Output_section::add_relaxed_input_section): Add new
6445 arguments LAYOUT and NAME.
6446
90e24de5
ILT
64472010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6448
6449 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 6450 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
6451 * testsuite/Makefile.in: Regenerate.
6452
c9484ea5
DK
64532010-10-20 Doug Kwan <dougkwan@google.com>
6454
6455 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6456 without SHF_LINK_ORDER flags.
6457 * layout.cc (Layout::choose_output_section): Do not filter
6458 SHF_LINK_ORDER flag in a relocatable link.
6459
5bc2f5be
CC
64602010-10-17 Cary Coutant <ccoutant@google.com>
6461
6462 * output.h (Output_segment::set_section_addresses): Change function
6463 signature. Update all callers.
6464 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6465 sections.
6466 (Output_segment::set_section_addresses): Align after last TLS
6467 section. Add padding before last relro section instead of after.
6468
0c91cf04
DK
64692010-10-17 Doug Kwan <dougkwan@google.com>
6470
6471 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6472 GOT output section to be writable.
6473
8c21d9d3
CC
64742010-10-14 Cary Coutant <ccoutant@google.com>
6475
6476 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
6477 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6478 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6479 mode.
6480 * incremental.cc (report_command_line): Ignore all forms of
6481 --incremental.
6482 * layout.cc (Layout::Layout): Check parameters for incremental link
6483 mode.
6484 * options.cc (General_options::parse_incremental): New function.
6485 (General_options::parse_no_incremental): New function.
6486 (General_options::parse_incremental_full): New function.
6487 (General_options::parse_incremental_update): New function.
6488 (General_options::incremental_mode_): New data member.
6489 (General_options::finalize): Check incremental_mode_.
6490 * options.h (General_options): Update help text for --incremental.
6491 Add --no-incremental, --incremental-full, --incremental-update.
6492 (General_options::Incremental_mode): New enum type.
6493 (General_options::incremental_mode): New function.
6494 (General_options::incremental_mode_): New data member.
6495 * parameters.cc (Parameters::incremental_mode_): New data member.
6496 (Parameters::set_options): Set incremental_mode_.
6497 (Parameters::set_incremental_full): New function.
6498 (Parameters::incremental): New function.
6499 (Parameters::incremental_update): New function.
6500 (set_parameters_incremental_full): New function.
6501 * parameters.h (Parameters::set_incremental_full): New function.
6502 (Parameters::incremental): New function.
6503 (Parameters::incremental_update): New function.
6504 (Parameters::incremental_mode_): New data member.
6505 (set_parameters_incremental_full): New function.
6506 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6507 incremental link mode.
6508 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6509 (Sized_relobj::do_relocate_sections): Likewise.
6510 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6511 option.
6512 * testsuite/Makefile.in: Regenerate.
6513 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 6514
bb32aa18 65152010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
6516
6517 * script-sections.h (class Script_sections): Make
6518 Sections_elements typedef public.
6519 * script-sections.cc (class Sort_output_sections): Add elements_
6520 field. Add constructor which sets it; change all callers.
6521 (Sort_output_sections::is_before): New function.
6522 (Sort_output_sections::operator()): Call is_before.
6523 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6524 conditional.
6525 * testsuite/script_test_10.sh: New test. Test script section
6526 order.
6527 * testsuite/script_test_10.t: Likewise.
6528 * testsuite/script_test_10.s: Likewise.
6529 * testsuite/Makefile.am: Wrap the cross linker tests and the
6530 common tests into NATIVE_OR_CROSS_LINKER.
6531 (check_SCRIPTS): Add script_test_10.sh.
6532 (check_DATA): Add script_test_10.stdout.
6533 (script_test_10.o, script_test_10): New targets.
6534 (script_test_10.stdout): New target.
6535 * configure, testsuite/Makefile.in: Regenerate.
6536
3cef7179
ILT
65372010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6538
6539 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6540 error for the deprecated relocations.
6541 (Target_arm::Scan::global): Likewise.
6542 (Target_arm::Relocate::relocate): Likewise.
6543
7411e9a8
RS
65442010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6545
6546 * fileread.cc (Input_file::find_file): Initialize *found_name
6547 and *namep when using the fallback search for case 4.
6548
6a9da32a
CC
65492010-10-11 Cary Coutant <ccoutant@google.com>
6550
6551 * options.h (class General_options): Redefine -z lazy as an alias for
6552 the negation of -z now.
6553
ac897c20
ILT
65542010-10-11 Ian Lance Taylor <iant@google.com>
6555
6556 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6557 binding.
6558
ea5cae92
NC
65592010-10-06 Nick Clifton <nickc@redhat.com>
6560
6561 * script-sections.cc(class Memory_region): Remove
6562 current_lma_offset_ field. Rename current_vma_offset_ to
6563 current_offset_. Add last_section_ field.
6564 (Memory_region::get_current_vma_address): Rename to
6565 get_current_address.
6566 (Memory_region::get_current_lma_address): Delete.
6567 (Memory_region::increment_vma_offset): Rename to
6568 increment_offset.
6569 (Memory_region::increment_lma_offset): Delete.
6570 (Memory_region::attributes_compatible): New method. Returns
6571 true if the provided section is compatible with the region.
6572 (Memory_region::get_last_section): New method. Returns the last
6573 section to use the region.
6574 (Memory_region::set_last_section): New method. Stores the last
6575 section to use the region.
6576 (Script_sections::block_in_region): New method. Returns true if
6577 a block of memory is contained within a region.
6578 (Script_sections::find_memory_region): New method. Locates a
6579 memory region to be used to set a VMA or LMA address.
6580 (Output_section_definition::set_section_addresses): Add code to
6581 check for addresses set by memory regions.
6582 (Output_segment::set_section_addresses): Remove memory region
6583 walking code.
6584 (Script_sections::create_segment): Add a warning if a header
6585 segment is created outside of any region.
6586 * script-sections.h (class Script_sections): Add prototypes for
6587 find_memory_region and block_in_region methods.
6588 * testsuite/memory_test.s: Use .long instead of .word.
6589 * testsuite/memory_test.t: Add some more output sections.
6590 * testsuite/memory_test.sh: Update expected output.
6591
a9bfd952
DK
65922010-10-02 Doug Kwan <dougkwan@google.com>
6593
6594 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6595 defintion to symtab.h
6596 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6597 declaration to defintion.
6598
bacff3ab
NC
65992010-10-01 Nick Clifton <nickc@redhat.com>
6600
6601 * expression.cc (eval): Replace dummy argument with NULL.
6602 (eval_maybe_dot): Check for a NULL result section pointer.
6603 (Symbol_expression::value): Likewise.
6604 (Dot_expression::value): Likewise.
6605 (BINARY_EXPRESSION): Likewise.
6606 (Max_expression::value): Likewise.
6607 (Min_expression::value): Likewise.
6608 (Absolute_expression::value): Likewise.
6609 (Addr_expression::value_from_output_section): Likewise.
6610 (Loaddddr_expression::value_from_output_section): Likewise.
6611 (Segment_start_expression::value): Likewise.
6612 * script-sections.cc
6613 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6614 argument with NULL.
6615 (Sections_elememt_dot_assignment::set_section_addresses):
6616 Likewise.
6617 (Output_data_expression::do_write_to_buffer): Likewise.
6618 (Output_section_definition::finalize_symbols): Likewise.
6619 (Output_section_definition::set_section_addresses): Likewise.
6620
f81bc8b5
DK
66212010-09-30 Doug Kwan <dougkwan@google.com>
6622
6623 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6624
c95e9f27
ST
66252010-09-28 Sriraman Tallam <tmsriram@google.com>
6626
6627 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 6628 function.
c95e9f27
ST
6629 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6630 virtual function.
6631 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6632 virtual function.
6633 * icf.cc (get_section_contents): Inline merge sections only when
6634 target allows it.
6635
3cac54d2
RW
66362010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6637
6638 * configure: Regenerate.
6639
2904037a
ILT
66402010-09-17 Ian Lance Taylor <iant@google.com>
6641
6642 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
6643 * testsuite/Makefile.am (memory_test.o): New target.
6644 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
6645 memory_test.t.
6646 * testsuite/Makefile.in: Rebuild.
2904037a 6647
bca7fb63
DK
66482010-09-17 Doug Kwan <dougkwan@google.com>
6649
6650 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
6651 defintion if relocation uses GOT entries of the symbol.
6652 * testsuite/icf_safe_test.sh: Fix test.
6653 * testsuite/icf_safe_so_test.sh: Fix test.
6654
4ef28648
CC
66552010-09-16 Cary Coutant <ccoutant@google.com>
6656
6657 * script_sections.cc (class Memory_region): Remove "NULL" from
6658 vector initializations.
6659
793990de
CC
66602010-09-15 Cary Coutant <ccoutant@google.com>
6661
6662 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
6663 Resolve forwarding symbols.
6664
81e015e2
DK
66652010-09-15 Doug Kwan <dougkwan@google.com>
6666
6667 * gold/testsuite/script_test_3.t: Add ARM special sections.
6668 * gold/testsuite/script_test_4.t: Same.
6669 * gold/testsuite/script_test_5.t: Same.
6670 * gold/testsuite/script_test_6.t: Same.
6671 * gold/testsuite/script_test_7.t: Same.
6672 * gold/testsuite/script_test_7.t: Same.
6673 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
6674
36171d64
CC
66752010-09-14 Cary Coutant <ccoutant@google.com>
6676
6677 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
6678 (Target_x86_64::Relocate::relocate_tls): Replace check for
6679 saw_tls_block_reloc_ with test for executable section.
6680
d89051bd
CC
66812010-09-12 Cary Coutant <ccoutant@google.com>
6682
6683 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
6684 position-independent executables to shared libraries need dynamic
6685 relocations.
6686 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
6687 position-independent executables.
6688 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
6689 * testsuite/Makefile.in: Regenerate.
6690
fca41f0f
NC
66912010-09-10 Nick Clifton <nickc@redhat.com>
6692
6693 PR gold/11997
6694 * testsuite/memory_test.t: Discard any sections that are not
6695 needed.
6696
6695e4b3
L
66972010-09-09 H.J. Lu <hongjiu.lu@intel.com>
6698
6699 PR gold/11996
6700 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
6701 "This::" to work around a bug in gcc 4.2.
6702
6703 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
6704
0f72bf6f
RÁE
67052010-09-09 Rafael Espindola <espindola@google.com>
6706
6707 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
6708 sections with different PF_X flags in the same segment.
6709 (Layout::find_first_load_seg): Search all segments to find the first
6710 one.
6711 * options.h (rosegment): New.
6712
67132010-09-08 Rafael Espindola <espindola@google.com>
a6577478 6714
05a79166 6715 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 6716
aa98ff75
DK
67172010-09-08 Doug Kwan <dougkwan@google.com>
6718
6719 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
6720 (Arm_relobj::do_relocate_sections): Add new parameter for output
6721 file to match the parent.
6722 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
6723 of local symbols instead of input values. Update code to track
6724 changes in gold::relocate_section.
6725 * object.cc (Sized_relobj::compute_final_local_value): New methods.
6726 (Sized_relobj::compute_final_local_value_internal): New methods.
6727 (Sized_relobj::do_finalize_local_symbols): Move code from loop
6728 body into private version of Sized_relobj::compute_final_local_value.
6729 Call the inline method.
6730 * object.h (Symbol_value::Symbol_value): Define destructor. Free
6731 merged symbol value if there is one.
6732 (Symbol_value::has_output_value): New method defintiion.
6733 (Sized_relobj::Compute_final_local_value_status): New enum type.
6734 (Sized_relobj::compute_final_local_value): New methods.
6735 (Sized_relobj::compute_final_local_value_internal): New methods.
6736 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
6737 and arm_cortex_a8.sh.
6738 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
6739 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
6740 New tests.
6741 * Makefile.in: Regenerate.
6742 * testsuite/arm_bl_out_of_range.s: Update test.
6743 * testsuite/thumb_bl_out_of_range.s: Ditto.
6744 * testsuite/thumb_blx_out_of_range.s: Ditto.
6745 * testsuite/arm_branch_out_of_range.sh: New file.
6746 * testsuite/arm_cortex_a8.sh: Ditto.
6747 * testsuite/arm_cortex_a8_b.s: Ditto.
6748 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
6749 * testsuite/arm_cortex_a8_b_local.s: Ditto.
6750 * testsuite/arm_cortex_a8_bl.s: Ditto.
6751 * testsuite/arm_cortex_a8_blx.s: Ditto.
6752 * testsuite/arm_cortex_a8_local.s: Ditto.
6753 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
6754 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
6755
05a79166
L
67562010-09-08 Rafael Espindola <espindola@google.com>
6757
6758 * Makefile.am (memory_test.stdout): Run readelf with -W.
6759 * Makefile.in: Regenerate.
6760 * testsuite/memory_test.sh: Make the regexps accept both 32 and
6761 64 bit output.
6762
33dbc701
RÁE
67632010-09-08 Rafael Espindola <espindola@google.com>
6764
6765 * script-sections.cc (Script_sections::add_memory_region): Convert
6766 field precision to int.
6767 * script.cc (script_set_section_region, script_set_section_region):
6768 Convert field precision to int.
6769
731ca54a
RÁE
67702010-09-08 Rafael Espindola <espindola@google.com>
6771
6772 * arm.cc (do_finalize_sections): Create the __exidx_start and
6773 __exdix_end symbols even when the section is missing.
6774
7f8cd844
NC
67752010-09-08 Nick Clifton <nickc@redhat.com>
6776
6777 * README: Remove claim that MEMORY is not supported.
6778 * expression.cc (script_exp_function_origin)
6779 (script_exp_function_length): Move from here to ...
6780 * script.cc: ... here.
6781 (script_set_section_region, script_add_memory)
6782 (script_parse_memory_attr, script_include_directive): New
6783 functions.
6784 * script-sections.cc
6785 (class Memory_region): New class.
6786 (class Output_section_definition): Add set_memory_region,
6787 set_section_vma, set_section_lma and get_section_name methods.
6788 (class Script_Sections): Add add_memory_region,
6789 find_memory_region, find_memory_region_origin,
6790 find_memory_region_length and set_memory_region methods.
6791 Have set_section_addresses method walk the list of set memory
6792 regions.
6793 Extend the print methos to display memory regions.
6794 * script-sections.h: Add prototypes for new methods.
6795 Add enum for MEMORY region attributes.
6796 * yyscript.y: Add support for parsing MEMORY regions.
6797 * script-c.h: Add prototypes for new functions.
6798 * testsuite/Makefile.am: Add test of MEMORY region functionality.
6799 * testsuite/Makefile.in: Regenerate.
6800 * testsuite/memory_test.sh: New script.
6801 * testsuite/memory_test.s: New assembler source file.
6802 * testsuite/memory_test.t: New linker script.
6803
a4649286
DK
68042010-08-27 Doug Kwan <dougkwan@google.com>
6805
6806 * gold/resolve.cc (Symbol_table::should_override): Let a weak
6807 reference override an existing dynamic weak reference.
6808 * testsuite/Makefile.am: Add new test dyn_weak_ref.
6809 * testsuite/Makefile.in: Regenerate.
6810 * testsuite/dyn_weak_ref.sh: New file.
6811 * testsuite/dyn_weak_ref_1.c: Ditto.
6812 * testsuite/dyn_weak_ref_2.c: Ditto.
6813
b56648ad
ILT
68142010-08-27 Ian Lance Taylor <iant@google.com>
6815
6816 * incremental.h (class Incremental_input_entry): Add virtual
6817 destructor.
6818
809313cb
ILT
68192010-08-27 Ian Lance Taylor <iant@google.com>
6820
6821 * testsuite/start_lib_test_3.c: Mark t3 as used.
6822
11e32464
NC
68232010-08-27 Nick Clifton <nickc@redhat.com>
6824
6825 * options.cc (version_script): Fix small typo in previous
6826 whitespace tidyup.
6827
ca09d69a
NC
68282010-08-25 Nick Clifton <nickc@redhat.com>
6829
6830 * archive.cc: Formatting fixes: Remove whitespace between
6831 typename and following asterisk. Remove whitespace between
6832 function name and opening parenthesis.
6833 * archive.h: Likewise.
6834 * arm.cc: Likewise.
6835 * attributes.cc: Likewise.
6836 * attributes.h: Likewise.
6837 * common.cc: Likewise.
6838 * copy-relocs.cc: Likewise.
6839 * dirsearch.h: Likewise.
6840 * dynobj.cc: Likewise.
6841 * ehframe.cc: Likewise.
6842 * ehframe.h: Likewise.
6843 * expression.cc: Likewise.
6844 * fileread.cc: Likewise.
6845 * fileread.h: Likewise.
6846 * gc.h: Likewise.
6847 * gold-threads.cc: Likewise.
6848 * gold.cc: Likewise.
6849 * i386.cc: Likewise.
6850 * icf.h: Likewise.
6851 * incremental-dump.cc: Likewise.
6852 * incremental.cc: Likewise.
6853 * layout.cc: Likewise.
6854 * layout.h: Likewise.
6855 * main.cc: Likewise.
6856 * merge.cc: Likewise.
6857 * merge.h: Likewise.
6858 * object.cc: Likewise.
6859 * object.h: Likewise.
6860 * options.cc: Likewise.
6861 * options.h: Likewise.
6862 * output.cc: Likewise.
6863 * output.h: Likewise.
6864 * plugin.cc: Likewise.
6865 * plugin.h: Likewise.
6866 * powerpc.cc: Likewise.
6867 * reloc.cc: Likewise.
6868 * script-c.h: Likewise.
6869 * script-sections.cc: Likewise.
6870 * script.cc: Likewise.
6871 * stringpool.cc: Likewise.
6872 * symtab.cc: Likewise.
6873 * symtab.h: Likewise.
6874 * target.cc: Likewise.
6875 * timer.cc: Likewise.
6876 * timer.h: Likewise.
6877 * version.cc: Likewise.
6878 * x86_64.cc: Likewise.
6879
b8fa8750
NC
68802010-08-24 Nick Clifton <nickc@redhat.com>
6881
6882 PR 11899
6883 * layout.cc (segment_precedes): Sort segments by their physical
6884 addresses, if they have been set.
6885
9919d93b
CC
68862010-08-23 Cary Coutant <ccoutant@google.com>
6887
6888 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
6889 symbols data.
6890 (Lib_group::include_member): Unlock object after deleting its
6891 symbols data.
6892 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
6893 the bug fixed here.
6894
97b4be1c
CC
68952010-08-19 Neil Vachharajani <nvachhar@google.com>
6896 Cary Coutant <ccoutant@google.com>
6897
6898 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
6899 constructor, and set_blocker.
6900 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
6901 readsyms_blocker_.
6902 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
6903 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
6904 * testsuite/Makefile.am (start_lib_test): New test case.
6905 * testsuite/Makefile.in: Regenerate.
6906 * testsuite/start_lib_test_main.c: New file.
6907 * testsuite/start_lib_test_1.c: New file.
6908 * testsuite/start_lib_test_2.c: New file.
6909 * testsuite/start_lib_test_3.c: New file.
6910
dd0b1884
ILT
69112010-08-19 Ian Lance Taylor <iant@google.com>
6912
6913 * Makefile.in: Rebuild with automake 1.11.1.
6914 * aclocal.m4: Likewise.
6915 * testsuite/Makefile.in: Likewise.
6916
7223e9ca
ILT
69172010-08-19 Ian Lance Taylor <iant@google.com>
6918
6919 PR 10893
6920 * i386.cc (class Output_data_plt_i386): Update declarations.
6921 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
6922 local_ifuncs_ fields.
6923 (Target_i386::do_plt_section_for_global): New function.
6924 (Target_i386::do_plt_section_for_local): New function.
6925 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
6926 parameter; change all callers. Initialize global_ifuncs_ and
6927 local_ifuncs_. If doing a static link define __rel_iplt_start and
6928 __rel_iplt_end.
6929 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
6930 (Output_data_plt_i386::add_local_ifunc_entry): New function.
6931 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
6932 symbols.
6933 (Target_i386::make_plt_section): New function, broken out of
6934 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
6935 (Target_i386::make_plt_entry): Call make_plt_section.
6936 (Target_i386::make_local_ifunc_plt_entry): New function.
6937 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
6938 (Target_i386::Scan::local): Handle IFUNC symbols. Add
6939 R_386_IRELATIVE to switch.
6940 (Target_i386::Scan::global): Likewise.
6941 (Target_i386::Relocate::relocate): Likewise.
6942 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
6943 switch.
6944 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
6945 (Target_x86_64::do_plt_section_for_global): New function.
6946 (Target_x86_64::do_plt_section_for_local): New function.
6947 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
6948 parameter; change all callers. If doing a static link define
6949 __rela_iplt_start and __rela_iplt_end.
6950 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
6951 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
6952 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
6953 to point to .plt.
6954 (Target_x86_64::make_local_ifunc_plt_entry): New function.
6955 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
6956 switch.
6957 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
6958 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
6959 R_X86_64_IRELATIVE to switch.
6960 (Target_x86_64::Scan::global): Likewise.
6961 (Target_x86_64::Relocate::relocate): Likewise.
6962 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
6963 switch.
6964 * target.h (class Target): Add plt_section_for_global and
6965 plt_section_for_local functions. Add do_plt_section_for_global
6966 and do_plt_section_for_local virtual functions.
6967 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
6968 clarifying comments.
6969 (Symbol::use_plt_offset): Handle IFUNC symbol.
6970 * object.cc (Sized_relobj::Sized_relobj): Initialize
6971 local_plt_offsets_.
6972 (Sized_relobj::local_has_plt_offset): New function.
6973 (Sized_relobj::local_plt_offset): New function.
6974 (Sized_relobj::set_local_plt_offset): New function.
6975 (Sized_relobj::do_count): Handle IFUNC symbol.
6976 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
6977 a bit away from input_shndx_ field. Add set_is_func_symbol and
6978 is_ifunc_symbol functions.
6979 (class Sized_relobj): Update declarations. Remove Tls_got_entry
6980 and Local_tls_got_offsets. Define Local_plt_offsets. Add
6981 local_plt_offsets_ field.
6982 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
6983 * output.h (class Output_section_data): Add non-const
6984 output_section function.
6985 (class Output_data_got): Update declarations.
6986 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
6987 Add use_plt_offset parameter to global and local constructors.
6988 Change all callers. Change local_sym_index_ field to 31 bits.
6989 Change GSYM_CODE and CONSTANT_CODE accordingly.
6990 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
6991 doing a static link don't set sh_link field.
6992 (Output_data_got::Got_entry::write): Use PLT offset if
6993 appropriate.
6994 (Output_data_got::add_global_plt): New function.
6995 (Output_data_got::add_local_plt): New function.
6996 * target-reloc.h (relocate_section): Handle IFUNC symbol.
6997 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
6998 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
6999 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7000 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7001 IFUNC conditional.
7002 * testsuite/ifunc-sel.h: New file.
7003 * testsuite/ifuncmain1.c: New file.
7004 * testsuite/ifuncmain1vis.c: New file.
7005 * testsuite/ifuncmod1.c: New file.
7006 * testsuite/ifuncdep2.c: New file.
7007 * testsuite/ifuncmain2.c: New file.
7008 * testsuite/ifuncmain3.c: New file.
7009 * testsuite/ifuncmod3.c: New file.
7010 * testsuite/ifuncmain4.c: New file.
7011 * testsuite/ifuncmain5.c: New file.
7012 * testsuite/ifuncmod5.c: New file.
7013 * testsuite/ifuncmain6pie.c: New file.
7014 * testsuite/ifuncmod6.c: New file.
7015 * testsuite/ifuncmain7.c: New file.
7016 * configure, testsuite/Makefile.in: Rebuild.
7017
56f75c03
ILT
70182010-08-18 Ian Lance Taylor <iant@google.com>
7019
7020 * incremental.cc
7021 (Output_section_incremental_inputs::write_input_files): Add cast
7022 to avoid signed/unsigned comparison warning.
7023 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7024
55455f89
CC
70252010-08-12 Cary Coutant <ccoutant@google.com>
7026
7027 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7028
e2054bcb
ILT
70292010-08-13 Ian Lance Taylor <iant@google.com>
7030
7031 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7032
74f67560
DK
70332010-08-12 Cary Coutant <ccoutant@google.com>
7034 Doug Kwan <dougkwan@google.com>
7035
7036 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7037 defintion overrides non-weak undef, remember that the original undef
7038 is not weak.
7039 * symtab.cc (Symbol_table::sized_write_global): For undef without
7040 an original weak binding, set binding to global in output.
7041 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7042 * testsuite/Makefile.in: Regenerate.
7043 * testsuite/strong_ref_weak_def.sh: New file.
7044 * testsuite/strong_ref_weak_def_1.c: Ditto.
7045 * testsuite/strong_ref_weak_def_2.c: Ditto.
7046
d1238d12
CC
70472010-08-12 Cary Coutant <ccoutant@google.com>
7048
7049 * testsuite/incremental_test.sh: Rewrite.
7050 * testsuite/incremental_test_1.c: Rewrite.
7051 * testsuite/incremental_test_2.c: Rewrite.
7052
0e70b911
CC
70532010-08-12 Cary Coutant <ccoutant@google.com>
7054
7055 * arm.cc (Target_arm::got_size): Add const.
7056 (Target_arm::got_entry_count): New function.
7057 (Target_arm::plt_entry_count): New function.
7058 (Target_arm::first_plt_entry_offset): New function.
7059 (Target_arm::plt_entry_size): New function.
7060 (Output_data_plt_arm::entry_count): New function.
7061 (Output_data_plt_arm::first_plt_entry_offset): New function.
7062 (Output_data_plt_arm::get_plt_entry_size): New function.
7063 * i386.cc (Target_i386::got_size): Add const.
7064 (Target_i386::got_entry_count): New function.
7065 (Target_i386::plt_entry_count): New function.
7066 (Target_i386::first_plt_entry_offset): New function.
7067 (Target_i386::plt_entry_size): New function.
7068 (Output_data_plt_i386::entry_count): New function.
7069 (Output_data_plt_i386::first_plt_entry_offset): New function.
7070 (Output_data_plt_i386::get_plt_entry_size): New function.
7071 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7072 find_incremental_inputs_sections. Dump incremental_got_plt section.
7073 * incremental.cc: Include target.h.
7074 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7075 parameter. Adjust all callers. Find incremental_got_plt section.
7076 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7077 section.
7078 (Output_section_incremental_inputs::set_final_data_size): Calculate
7079 size of incremental_got_plt section.
7080 (Output_section_incremental_inputs::do_write): Write the
7081 incremental_got_plt section.
7082 (Got_plt_view_info): New struct.
7083 (Local_got_offset_visitor): New class.
7084 (Global_got_offset_visitor): New class.
7085 (Global_symbol_visitor_got_plt): New class.
7086 (Output_section_incremental_inputs::write_got_plt): New function.
7087 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7088 Add parameter. Adjust all callers.
7089 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7090 (Incremental_inputs::got_plt_section): New function.
7091 (Incremental_inputs::got_plt_section_): New data member.
7092 (Incremental_got_plt_reader): New class.
7093 * layout.cc (Layout::create_incremental_info_sections): Add the
7094 incremental_got_plt section.
7095 * object.h (Got_offset_list::get_list): New function.
7096 (Got offset_list::for_all_got_offsets): New function.
7097 (Sized_relobj::local_got_offset_list): New function.
7098 * powerpc.cc (Target_powerpc::got_size): Add const.
7099 (Target_powerpc::got_entry_count): New function.
7100 (Target_powerpc::plt_entry_count): New function.
7101 (Target_powerpc::first_plt_entry_offset): New function.
7102 (Target_powerpc::plt_entry_size): New function.
7103 (Output_data_plt_powerpc::entry_count): New function.
7104 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7105 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7106 * sparc.cc (Target_sparc::got_size): Add const.
7107 (Target_sparc::got_entry_count): New function.
7108 (Target_sparc::plt_entry_count): New function.
7109 (Target_sparc::first_plt_entry_offset): New function.
7110 (Target_sparc::plt_entry_size): New function.
7111 (Output_data_plt_sparc::entry_count): New function.
7112 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7113 (Output_data_plt_sparc::get_plt_entry_size): New function.
7114 * symtab.h (Symbol::got_offset_list): New function.
7115 (Symbol_table::for_all_symbols): New function.
7116 * target.h (Sized_target::got_entry_count): New function.
7117 (Sized_target::plt_entry_count): New function.
7118 (Sized_target::plt_entry_size): New function.
7119 * x86_64.cc (Target_x86_64::got_size): Add const.
7120 (Target_x86_64::got_entry_count): New function.
7121 (Target_x86_64::plt_entry_count): New function.
7122 (Target_x86_64::first_plt_entry_offset): New function.
7123 (Target_x86_64::plt_entry_size): New function.
7124 (Output_data_plt_x86_64::entry_count): New function.
7125 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7126 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7127
09ec0418
CC
71282010-08-12 Cary Coutant <ccoutant@google.com>
7129
7130 * archive.cc: Include incremental.h.
7131 (Archive::Archive): Initialize incremental_info_.
7132 (Archive::include_member): Record archive members in incremental info.
7133 (Add_archive_symbols::run): Record begin and end of an archive in
7134 incremental info.
7135 (Lib_group::include_member): Record objects in incremental info.
7136 * archive.h (Incremental_archive_entry): Forward declaration.
7137 (Archive::set_incremental_info): New member function.
7138 (Archive::incremental_info): New member function.
7139 (Archive::Unused_symbol_iterator): New class.
7140 (Archive::unused_symbols_begin): New member function.
7141 (Archive::unused_symbols_end): New member function.
7142 (Archive::incremental_info_): New data member.
7143 * incremental-dump.cc (find_input_containing_global): New function.
7144 (dump_incremental_inputs): Dump new incremental info sections.
7145 * incremental.cc: Include symtab.h.
7146 (Output_section_incremental_inputs): New class.
7147 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7148 new incremental info sections.
7149 (Sized_incremental_binary::do_check_inputs): Likewise.
7150 (Incremental_inputs::report_archive): Remove.
7151 (Incremental_inputs::report_archive_begin): New function.
7152 (Incremental_inputs::report_archive_end): New function.
7153 (Incremental_inputs::report_object): New function.
7154 (Incremental_inputs::finalize_inputs): Remove.
7155 (Incremental_inputs::report_input_section): New function.
7156 (Incremental_inputs::report_script): Rewrite.
7157 (Incremental_inputs::finalize): Do nothing but finalize string table.
7158 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7159 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7160 (Incremental_inputs::create_data_sections): New function.
7161 (Incremental_inputs::relocs_entsize): New function.
7162 (Output_section_incremental_inputs::set_final_data_size): New function.
7163 (Output_section_incremental_inputs::do_write): New function.
7164 (Output_section_incremental_inputs::write_header): New function.
7165 (Output_section_incremental_inputs::write_input_files): New function.
7166 (Output_section_incremental_inputs::write_info_blocks): New function.
7167 (Output_section_incremental_inputs::write_symtab): New function.
7168 * incremental.h (Incremental_script_entry): Forward declaration.
7169 (Incremental_object_entry): Forward declaration.
7170 (Incremental_archive_entry): Forward declaration.
7171 (Incremental_inputs): Forward declaration.
7172 (Incremental_inputs_header_data): Remove.
7173 (Incremental_inputs_header): Remove.
7174 (Incremental_inputs_header_write): Remove.
7175 (Incremental_inputs_entry_data): Remove.
7176 (Incremental_inputs_entry): Remove.
7177 (Incremental_inputs_entry_write): Remove.
7178 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7179 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7180 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7181 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7182 Likewise.
7183 (Incremental_input_entry): New class.
7184 (Incremental_script_entry): New class.
7185 (Incremental_object_entry): New class.
7186 (Incremental_archive_entry): New class.
7187 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7188 (Incremental_inputs::report_inputs): Remove.
7189 (Incremental_inputs::report_archive): Remove.
7190 (Incremental_inputs::report_archive_begin): New function.
7191 (Incremental_inputs::report_archive_end): New function.
7192 (Incremental_inputs::report_object): Change prototype.
7193 (Incremental_inputs::report_input_section): New function.
7194 (Incremental_inputs::report_script): Change prototype.
7195 (Incremental_inputs::get_reloc_count): New function.
7196 (Incremental_inputs::set_reloc_count): New function.
7197 (Incremental_inputs::create_data_sections): New function.
7198 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7199 (Incremental_inputs::inputs_section): New function.
7200 (Incremental_inputs::symtab_section): New function.
7201 (Incremental_inputs::relocs_section): New function.
7202 (Incremental_inputs::get_stringpool): Add const.
7203 (Incremental_inputs::command_line): Add const.
7204 (Incremental_inputs::inputs): Remove.
7205 (Incremental_inputs::command_line_key): New function.
7206 (Incremental_inputs::input_file_count): New function.
7207 (Incremental_inputs::input_files): New function.
7208 (Incremental_inputs::relocs_entsize): New function.
7209 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7210 (Incremental_inputs::finalize_inputs): Remove.
7211 (Incremental_inputs::Input_info): Remove.
7212 (Incremental_inputs::lock_): Remove.
7213 (Incremental_inputs::inputs_): Change type.
7214 (Incremental_inputs::inputs_map_): Remove.
7215 (Incremental_inputs::current_object_entry_): New data member.
7216 (Incremental_inputs::inputs_section_): New data member.
7217 (Incremental_inputs::symtab_section_): New data member.
7218 (Incremental_inputs::relocs_section_): New data member.
7219 (Incremental_inputs::reloc_count_): New data member.
7220 (Incremental_inputs_reader): New class.
7221 (Incremental_symtab_reader): New class.
7222 (Incremental_relocs_reader): New class.
7223 * layout.cc (Layout::finalize): Move finalization of incremental info
7224 and creation of incremental info sections to follow finalization of
7225 symbol table. Set offsets for postprocessing sections.
7226 (Layout::create_incremental_info_sections): Call
7227 Incremental_inputs::create_data_sections. Add incremental symtab
7228 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7229 sections to layout after input sections.
7230 * layout.h (struct Timespec): Forward declaration.
7231 (Layout::incremental_inputs): Add const.
7232 (Layout::create_incremental_info_sections): Add parameter.
7233 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7234 * object.cc: Include incremental.h.
7235 (Relobj::finalize_incremental_relocs): New function.
7236 (Sized_relobj::do_layout): Record input sections in incremental info.
7237 * object.h (Object::output_section): New function.
7238 (Object::output_section_offset): Moved from Relobj.
7239 (Object::get_incremental_reloc_base): New function.
7240 (Object::get_incremental_reloc_count): New function.
7241 (Object::do_output_section): New function.
7242 (Object::do_output_section_offset): Moved from Relobj.
7243 (Object::do_get_incremental_reloc_base): New function.
7244 (Object::do_get_incremental_reloc_count): New function.
7245 (Object::Object): Initialize new data members.
7246 (Relobj::output_section): Renamed do_output_section and moved to
7247 protected.
7248 (Relobj::output_section_offset): Moved to Object.
7249 (Relobj::do_get_incremental_reloc_base): New function.
7250 (Relobj::do_get_incremental_reloc_count): New function.
7251 (Relobj::allocate_incremental_reloc_counts): New function.
7252 (Relobj::count_incremental_reloc): New function.
7253 (Relobj::finalize_incremental_relocs): New function.
7254 (Relobj::next_incremental_reloc_index): New function.
7255 (Relobj::reloc_counts_): New data member.
7256 (Relobj::reloc_bases_): New data member.
7257 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7258 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7259 (Sized_relobj::incremental_relocs_scan): New function.
7260 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7261 (Sized_relobj::incremental_relocs_write): New function.
7262 (Sized_relobj::incremental_relocs_write_reltype): New function.
7263 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7264 incremental link.
7265 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7266 archives and object files elsewhere.
7267 (Add_symbols::run): Report object files here.
7268 (Finish_group::run): Report end of archive at end of group.
7269 * reloc.cc: Include layout.h, incremental.h.
7270 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7271 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7272 (Sized_relobj::incremental_relocs_scan): New function.
7273 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7274 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7275 (Sized_relobj::incremental_relocs_write): New function.
7276 (Sized_relobj::incremental_relocs_write_reltype): New function.
7277 * script.cc (read_input_script): Rewrite test for incremental link.
7278 Change call to Incremental_inputs::report_script.
7279 * symtab.h (Symbol_table::first_global_index): New function.
7280 (Symbol_table::output_count): New function.
7281
ce0d1972
DK
72822010-08-12 Doug Kwan <dougkwan@google.com>
7283
7284 * arm.cc (Target_arm::merge_object_attributes): Check command line
7285 options --no-wchar-size-warning and --no-enum-size-warning.
7286 * options.h (General_options): Add ld-compatible options
7287 --no-enum-size-warning and --no-wchar-size-warning.
7288
6e5710ce
ILT
72892010-08-04 Ian Lance Taylor <iant@google.com>
7290
7291 * x86_64.cc (Target_x86_64::Scan::local): Use
7292 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7293 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7294 (Target_x86_64::Scan::global): Likewise.
7295 (Target_x86_64::Relocate::relocate): Likewise.
7296 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7297 Likewise.
7298
fef830db
CC
72992010-08-03 Cary Coutant <ccoutant@google.com>
7300
7301 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7302 to reserve space in merged_strings vector. Keep total input size
7303 for stats.
7304 (Output_merge_string::do_print_merge_stats): Print total input size.
7305 * merge.h (Output_merge_string): Add input_size_ field.
7306 * stringpool.cc (Stringpool_template::string_length): Move
7307 implementations out of Stringpool_template class and place in
7308 stringpool.h.
7309 * stringpool.h (string_length): Move out of Stringpool_template.
7310
1e3811b0
ILT
73112010-08-03 Ian Lance Taylor <iant@google.com>
7312
7313 PR 11712
7314 * layout.cc (relaxation_loop_body): If address of load segment is
7315 set, adjust address to include headers if possible.
7316
7af0c620
ILT
73172010-08-03 Ian Lance Taylor <iant@google.com>
7318
7319 * version.cc (version_string): Bump to 1.10.
7320
22f0da72
ILT
73212010-08-03 Ian Lance Taylor <iant@google.com>
7322
7323 PR 11805
7324 * layout.h (enum Output_section_order): Define.
7325 (class Layout): Update declarations.
7326 * layout.cc (Layout::get_output_section): Add order parameter.
7327 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7328 is_first_non_relro parameters. Change all callers.
7329 (Layout::choose_output_section): Likewise.
7330 (Layout::add_output_section_data): Likewise.
7331 (Layout::make_output_section): Likewise. Set order.
7332 (Layout::default_section_order): New function.
7333 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7334 * output.cc (Output_section::Output_section): Initialize order_.
7335 Don't initialize deleted fields.
7336 (Output_segment::Output_segment): Don't initialize deleted
7337 fields.
7338 (Output_segment::add_output_section_to_load): New function
7339 replacing add_output_section. Change all callers to call this or
7340 add_output_section_to_nonload.
7341 (Output_segment::add_output_section_to_nonload): New function.
7342 (Output_segment::remove_output_section): Rewrite.
7343 (Output_segment::add_initial_output_data): Likewise.
7344 (Output_segment::has_any_data_sections): Likewise.
7345 (Output_segment::is_first_section_relro): Likewise.
7346 (Output_segment::maximum_alignment): Likewise.
7347 (Output_segment::has_dynamic_reloc): New function replacing
7348 dynamic_reloc_count. Change all callers.
7349 (Output_segment::has_dynamic_reloc_list): New function replacing
7350 dynamic_reloc_count_list. Change all callers.
7351 (Output_segment::set_section_addresses): Rewrite.
7352 (Output_segment::set_offset): Rewrite.
7353 (Output_segment::find_first_and_last_list): Remove.
7354 (Output_segment::set_tls_offsets): Rewrite.
7355 (Output_segment::first_section_load_address): Likewise.
7356 (Output_segment::output_section_count): Likewise.
7357 (Output_segment::section_with_lowest_load_address): Likewise.
7358 (Output_segment::write_section_headers): Likewise.
7359 (Output_segment::print_sections_to_map): Likewise.
7360 * output.h (class Output_data): Remove dynamic_reloc_count_
7361 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7362 (Output_data::add_dynamic_reloc): Rewrite.
7363 (Output_data::has_dynamic_reloc): New function.
7364 (Output_data::dynamic_reloc_count): Remove.
7365 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7366 is_last_relro_, is_first_non_relro_, is_interp_,
7367 is_dynamic_linker_section_ fields. Add order and set_order
7368 functions. Remove is_relro_local, set_is_relro_local,
7369 is_last_relro, set_is_last_relro, is_first_non_relro,
7370 set_is_first_non_relro functions, is_interp, set_is_interp,
7371 is_dynamic_linker_section, and set_is_dynamic_linker_section
7372 functions.
7373 (class Output_segment): Change Output_data_list from std::list to
7374 std:;vector. Add output_lists_ field. Remove output_data_ and
7375 output_bss_ fields. Update declarations.
7376
3ff2ccb0
ILT
73772010-08-02 Ian Lance Taylor <iant@google.com>
7378
7379 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7380 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7381 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7382
88a4108b
ILT
73832010-08-02 Ian Lance Taylor <iant@google.com>
7384
7385 PR 11855
7386 * script.cc (Script_options::Script_options): Initialize
7387 symbol_definitions_ and symbol_references_.
7388 (Script_options::add_symbol_assignment): Update
7389 symbol_definitions_ and symbol_references_.
7390 (Script_options::add_symbol_reference): New function.
7391 (script_symbol): New function.
7392 * script.h (class Script_options): Add symbol_definitions_ and
7393 symbol_references_ fields.
7394 (Script_options::referenced_const_iterator): New type.
7395 (Script_options::referenced_begin): New function.
7396 (Script_options::referenced_end): New function.
7397 (Script_options::is_referenced): New function.
7398 (Script_options::any_unreferenced): New function.
7399 * script-c.h (script_symbol): Declare.
7400 * yyscript.y (exp): Call script_symbol.
7401 * symtab.cc: Include "script.h".
7402 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7403 Change all callers. Check symbols referenced by scripts.
7404 (Symbol_table::add_undefined_symbols_from_command_line): Add
7405 layout parameter. Change all callers.
7406 (Symbol_table::do_add_undefined_symbols_from_command_line):
7407 Likewise. Break out loop body. Check symbols referenced by
7408 scripts.
7409 (Symbol_table::add_undefined_symbol_from_command_line): New
7410 function broken out of
7411 do_add_undefined_symbols_from_command_line.
7412 * symtab.h (class Symbol_table): Update declarations.
7413 * archive.cc: Include "layout.h".
7414 (Archive::should_include_member): Add layout parameter. Change
7415 all callers. Check for symbol mentioned in expression.
7416 * archive.h (class Archive): Update declaration.
7417 * object.cc (Sized_relobj::do_should_include_member): Add layout
7418 parameter.
7419 * object.h (Object::should_include_member): Add layout parameter.
7420 Change all callers.
7421 (Object::do_should_include_member): Add layout parameter.
7422 (class Sized_relobj): Update declaration.
7423 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7424 parameter.
7425 * dynobj.h (class Sized_dynobj): Update declaration.
7426 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7427 layout parameter.
7428 * plugin.h (class Sized_pluginobj): Update declaration.
7429
5f1ab67a
ILT
74302010-08-02 Ian Lance Taylor <iant@google.com>
7431
7432 PR 11866
7433 * output.cc (Output_segment::set_offset): Search for the first and
7434 last sections rather than assuming that the list is in order.
7435 (Output_segment::find_first_and_last_list): New function.
7436 * output.h (class Output_segment): Update declarations.
7437 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7438 (relro_strip_test_SOURCES): New variable.
7439 (relro_strip_test_DEPENDENCIES): New variable.
7440 (relro_strip_test_LDFLAGS): New variable.
7441 (relro_strip_test_LDADD): New variable.
7442 (relro_strip_test.so): New target.
7443
a8df5856
ILT
74442010-08-02 Ian Lance Taylor <iant@google.com>
7445
7446 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7447 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7448 (Target_i386::got_tlsdesc_section): New function.
7449 (Target_i386::got_section): Create space for GOT entries for
7450 TLSDESC relocations.
7451 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7452 R_386_TLS_GOTDESC.
7453 (Target_i386::Scan::global): Likewise.
7454 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7455 using TLSDESC GOT.
7456 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7457 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7458 (Target_x86_64::got_tlsdesc_section): New function.
7459 (Target_x86_64::got_section): Create space for GOT entries for
7460 TLSDESC relocations.
7461 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7462 R_386_TLS_GOTDESC.
7463 (Target_x86_64::Scan::global): Likewise.
7464 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7465 using TLSDESC GOT.
7466
0c10a0a6
ILT
74672010-08-02 Ian Lance Taylor <iant@google.com>
7468
7469 * testsuite/final_layout.sh: Use dc to convert from hex to
7470 decimal.
7471
41cbeecc
ST
74722010-07-29 Sriraman Tallam <tmsriram@google.com>
7473
7474 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7475 paramter to the call to gold::gc_process_relocs.
7476 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7477 paramter to the call to gold::gc_process_relocs.
7478 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7479 parameter to the call to gold::gc_process_relocs.
7480 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7481 template parameter to the call to gold::gc_process_relocs.
7482 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7483 paramter to the call to gold::gc_process_relocs.
7484 * gc.h (get_embedded_addend_size): New function.
7485 (gc_process_relocs): Save the size of the reloc for use by ICF.
7486 * icf.cc (get_section_contents): Get the addend from the text section
7487 for SHT_REL relocation sections.
7488 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7489 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7490 * int_encoding.h (read_from_pointer): New overloaded function.
7491 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7492 * testsuite/icf_sht_rel_addend_test.sh: New file.
7493 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7494 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7495
6ea55b82
RW
74962010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7497
7498 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7499 * Makefile.in: Regenerate.
7500 * testsuite/Makefile.in: Regenerate.
7501
9691462b
ILT
75022010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7503
7504 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7505 * gold/testsuite/debug_msg.cc: Likewise.
7506 * gold/testsuite/odr_violation1.cc
7507 * gold/testsuite/odr_violation2.cc
7508
76897331
CC
75092010-07-21 Cary Coutant <ccoutant@google.com>
7510
7511 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7512 string, and length fields.
7513 (Output_merge_string::Merged_strings_list): New type.
7514 (Output_merge_string::Merged_strings_lists): New typedef.
7515 (Output_merge_string): Replace merged_strings_ with
7516 merged_strings_lists_.
7517 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7518 Merged_strings_list per input object and section. Don't store pointer
7519 to the string. Don't store length with each merged string entry.
7520 (Output_merge_string::finalize_merged_data): Loop over list of merged
7521 strings lists. Recompute length of each merged string.
7522
78384e8f
CC
75232010-07-15 Cary Coutant <ccoutant@google.com>
7524
7525 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7526 here.
7527
783659f9
ILT
75282010-07-14 Ian Lance Taylor <iant@google.com>
7529
7530 * descriptors.cc (Descriptors::open): Report correct name in error
7531 message.
7532
131687b4
DK
75332010-07-13 Doug Kwan <dougkwan@google.com>
7534
7535 * arm.cc (Arm_input_section::Arm_input_section): For a
7536 SHT_ARM_EXIDX section, always keeps the input sections.
7537 (Arm_input_section::set_exidx_section_link): New method.
7538 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7539 has_errors_ to false.
7540 (Arm_exidx_input_section::has_errors,
7541 Arm_exidx_input_section::set_has_errors): New methods.
7542 (Arm_exidx_input_section::has_errors_): New data member.
7543 (Arm_relobj::get_exidx_shndx_list): New method.
7544 (Arm_output_section::append_text_sections_to_list): Do not skip
7545 section without SHF_EXECINSTR.
7546 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7547 errors.
2e702c99 7548 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
7549 section header. Make error messages more verbose. Check for
7550 a non-executable section linked to an EXIDX section.
7551 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7552 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7553 check that there is no deferred EXIDX section if we exit early.
7554 Instead of not making an EXIDX section in case of an error, make one
7555 and set the has_errors flag of it.
7556 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7557 in a relocatable link.
7558 (Target_arm::do_relax): Look for the EXIDX output section instead of
7559 assuming that it is called .ARM.exidx.
2e702c99 7560 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
7561 section list. Do not check for SHF_EXECINSTR section flags but
7562 skip any input section with errors.
7563 * output.cc (Output_section::Output_section): Initialize
7564 always_keeps_input_sections_ to false.
7565 (Output_section::add_input_section): Check for
7566 always_keeps_input_sections_.
7567 * output.h (Output_section::always_keeps_input_sections,
7568 Output_section::set_always_keeps_input_sections): New methods.
7569 (Output_section::always_keeps_input_sections): New data member.
7570
69517287
RÁE
75712010-07-13 Rafael Espindola <espindola@google.com>
7572
7573 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7574 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7575
82742395
ILT
75762010-07-13 Philip Herron <herron.philip@googlemail.com>
7577 Ian Lance Taylor <iant@google.com>
7578
7579 * output.h (Output_section_lookup_maps::add_merge_section):
7580 Correct check of whether value was inserted.
7581 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7582 (Output_section_lookup_maps::add_relaxed_input_section):
7583 Likewise.
7584 * arm.cc (Target_arm::got_section): Remove used local os.
7585 * i386.cc (Target_i386::got_section): Likewise.
7586 * x86_64.cc (Target_x86_64::got_section): Likewise.
7587 * sparc.cc (Target_sparc::got_section): Likewise.
7588 (Target_sparc::relocate): Remove unused local have_got_offset.
7589 * powerpc.cc (Target_powerpc::relocate): Likewise.
7590
f2d707b5
ILT
75912010-07-13 Ian Lance Taylor <iant@google.com>
7592
241531d6
ILT
7593 * compressed_output.cc (zlib_decompress): Fix signature in
7594 !HAVE_ZLIB_H case.
7595
f2d707b5
ILT
7596 * archive.cc (Archive::include_member): Unlock an external member
7597 of a thin archive. Don't bother to delete an object we know is
7598 NULL.
7599
a2e47362
CC
76002010-07-12 Cary Coutant <ccoutant@google.com>
7601
7602 * compressed_output.cc (zlib_decompress): New function.
7603 (get_uncompressed_size): New function.
7604 (decompress_input_section): New function.
7605 * compressed_output.h (get_uncompressed_size): New function.
7606 (decompress_input_section): New function.
7607 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7608 Handle compressed debug sections.
7609 * layout.cc (is_compressed_debug_section): New function.
7610 (Layout::output_section_name): Map compressed section names to
7611 canonical names.
7612 * layout.h (is_compressed_debug_section): New function.
7613 (is_debug_info_section): Recognize compressed debug sections.
7614 * merge.cc: Include compressed_output.h.
7615 (Output_merge_data::do_add_input_section): Handle compressed
7616 debug sections.
7617 (Output_merge_string::do_add_input_section): Handle compressed
7618 debug sections.
7619 * object.cc: Include compressed_output.h.
7620 (Sized_relobj::Sized_relobj): Initialize new data members.
7621 (build_compressed_section_map): New function.
7622 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7623 * object.h (Object::section_is_compressed): New method.
7624 (Object::do_section_is_compressed): New method.
7625 (Sized_relobj::Compressed_section_map): New type.
7626 (Sized_relobj::do_section_is_compressed): New method.
7627 (Sized_relobj::compressed_sections_): New data member.
7628 * output.cc (Output_section::add_input_section): Handle compressed
7629 debug sections.
7630 * reloc.cc: Include compressed_output.h.
7631 (Sized_relobj::write_sections): Handle compressed debug sections.
7632
ce279a62
CC
76332010-07-08 Cary Coutant <ccoutant@google.com>
7634
7635 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7636 weak when resolving to a dynamic def.
7637 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7638 for weak undef/dynamic def cases. Adjust callers.
7639 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7640 undef_binding_weak_.
7641 (Symbol_table::sized_write_globals): Adjust symbol binding.
7642 (Symbol_table::sized_write_symbol): Add binding parameter.
7643 * symtab.h (Symbol::set_undef_binding): New method.
7644 (Symbol::is_undef_binding_weak): New method.
7645 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
7646 (Symbol_table::should_override): Add new parameter.
7647 (Symbol_table::sized_write_symbol): Add new parameter.
7648
7649 * testsuite/weak_undef_file1.cc: Add new test case.
7650 * testsuite/weak_undef_file2.cc: Fix header comment.
7651 * testsuite/weak_undef_test.cc: Add new test case.
7652
b2286c10
DK
76532010-06-29 Doug Kwan <dougkwan@google.com>
7654
7655 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
7656 Initialize USE_SYMBOL_.
7657 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
7658 definition.
7659 (Arm_reloc_property::uses_symbol_): New data member declaration.
7660 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
7661 uses symbol value and symbol is undefined but not weakly undefined.
7662
4802450a
RÁE
76632010-06-28 Rafael Espindola <espindola@google.com>
7664
7665 * plugin.cc (Plugin::load): Use dlerror.
7666
e5ca47ba
ILT
76672010-06-26 Jeffrey Yaskin <jyasskin@google.com>
7668
7669 * symtab.cc (detect_odr_violations): When reporting an ODR
7670 violation, report an object where the symbol is defined.
7671
8a75a161
DK
76722010-06-25 Doug Kwan <dougkwan@google.com>
7673
7674 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
7675 (Target_arm::section_may_have_icf_unsafe_pointers): New method
7676 definition.
7677 (Target_arm::Scan::local_reloc_may_be_function_pointer,
7678 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
7679 target hook to detect function points.
7680 (Target_arm::Scan::possible_function_pointer_reloc): New method.
7681 * icf.h (Icf::check_section_for_function_pointers): Change type of
7682 parameter SECTION_NAME to const reference to std::string. Use
7683 target hook to determine if section may have unsafe pointers.
7684 * target.h (Target::section_may_have_icf_unsafe_pointers): New
7685 method definition.
7686
42218b9f
RÁE
76872010-06-21 Rafael Espindola <espindola@google.com>
7688
7689 * fileread.cc (Input_file::find_fie): New
7690 (Input_file::open): Use Input_file::find_fie.
7691 * fileread.h (Input_file::find_fie): New
7692 * plugin.cc (set_extra_library_path): New.
7693 (Plugin::load): Add set_extra_library_path to the transfer vector.
7694 (Plugin_manager::set_extra_library_path): New.
7695 (Plugin_manager::add_input_file): Use the extra search path if set.
7696 (set_extra_library_path(): New.
7697 * plugin.h (Plugin_manager): Add set_extra_library_path and
7698 extra_search_path_.
7699
a0506cca
CC
77002010-06-19 Cary Coutant <ccoutant@google.com>
7701
7702 * layout.cc (gdb_sections): Add .debug_types.
7703 (lines_only_debug_sections): Likewise.
7704
6508b958
RÁE
77052010-06-18 Rafael Espindola <espindola@google.com>
7706
7707 * plugin.cc (add_input_file,add_input_library)
7708 (Plugin_manager::add_input_file): Make filename arguments const.
7709 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
7710 const.
7711
3e235302
DK
77122010-06-16 Doug Kwan <dougkwan@google.com>
7713
7714 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
7715 .ARM.attributes section if we have not merged any input
7716 attributes sections.
7717
106e8a6c
DK
77182010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7719
7720 * arm.cc: Allow combining objects with no EABI version
7721 information.
7722
91ff43fe
RÁE
77232010-06-15 Rafael Espindola <espindola@google.com>
7724
7725 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
7726
68ed838c
ILT
77272010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7728
7729 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
7730 (struct iovec): Correct !HAVE_READV definition.
7731
f3a2388f
CC
77322010-06-10 Cary Coutant <ccoutant@google.com>
7733
7734 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
7735 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
7736 reloc sections.
7737 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
7738
7739 PR 11683
7740 * symtab.h (Symbol::is_placeholder): New member function.
7741 * target-reloc.h (relocate_section): Check for placeholder symbols.
7742
7743 * testsuite/Makefile.am (plugin_test_8): New test.
7744 (plugin_test_9): New test.
7745 * testsuite/Makefile.in: Regenerate.
7746
e1df38aa
NC
77472010-06-09 Nick Clifton <nickc@redhat.com>
7748
7749 * yyscript.y (input_list_element): Allow strings prefixed with
7750 the '-' character. Treat these as libraries.
7751 * script.cc (script_add_library): New function. Adds a library
7752 specified by "-l<name>" found in an input script.
7753 * script-c.h: Add prototype for script_add_library.
7754
25bbe950
DK
77552010-06-07 Doug Kwan <dougkwan@google.com>
7756
7757 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
7758 Restrict stub-group size to be within long conditional branch
7759 range when working around cortex-A8 erratum.
7760
0f32ea4c
ILT
77612010-06-07 Damien Diederen <dd@crosstwine.com>
7762
7763 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
7764 #ifdef typo.
7765
8fe2a369
ST
77662010-06-03 Sriraman Tallam <tmsriram@google.com>
7767
7768 PR gold/11658
7769 * output.cc
7770 (Output_section::Input_section_sort_entry::compare_section_ordering):
7771 Change to return non-zero correctly.
7772 (Output_section::Input_section_sort_section_order_index_compare
7773 ::operator()): Change to fix ambiguity in comparisons.
7774
6e9ba2ca
ST
77752010-06-01 Sriraman Tallam <tmsriram@google.com>
7776
7777 * gold.h (is_wildcard_string): New function.
7778 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
7779 (Layout::layout_eh_frame): Ditto.
7780 (Layout::find_section_order_index): New method.
7781 (Layout::read_layout_from_file): New method.
7782 * layout.h (Layout::find_section_order_index): New method.
7783 (Layout::read_layout_from_file): New method.
7784 (Layout::input_section_position_): New private member.
7785 (Layout::input_section_glob_): New private member.
7786 * main.cc (main): Call read_layout_from_file here.
7787 * options.h (--section-ordering-file): New option.
7788 * output.cc (Output_section::input_section_order_specified_): New
7789 member.
7790 (Output_section::Output_section): Initialize new member.
7791 (Output_section::add_input_section): Add new parameter.
7792 Keep input sections when --section-ordering-file is used.
7793 (Output_section::set_final_data_size): Sort input sections when
7794 section ordering file is specified.
7795 (Output_section::Input_section_sort_entry): Add new parameter.
7796 Check sorting type.
7797 (Output_section::Input_section_sort_entry::compare_section_ordering):
7798 New method.
7799 (Output_section::Input_section_sort_compare::operator()): Change to
7800 consider section_order_index.
7801 (Output_section::Input_section_sort_init_fini_compare::operator()):
7802 Change to consider section_order_index.
7803 (Output_section::Input_section_sort_section_order_index_compare
7804 ::operator()): New method.
7805 (Output_section::sort_attached_input_sections): Change to sort
7806 according to section order when specified.
e1df38aa
NC
7807 (Output_section::add_input_section<32, true>): Add new parameter.
7808 (Output_section::add_input_section<64, true>): Add new parameter.
7809 (Output_section::add_input_section<32, false>): Add new parameter.
7810 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
7811 * output.h (Output_section::add_input_section): Add new parameter.
7812 (Output_section::input_section_order_specified): New
7813 method.
7814 (Output_section::set_input_section_order_specified): New method.
7815 (Input_section::Input_section): Initialize section_order_index_.
7816 (Input_section::section_order_index): New method.
7817 (Input_section::set_section_order_index): New method.
7818 (Input_section::section_order_index_): New member.
7819 (Input_section::Input_section_sort_section_order_index_compare): New
7820 struct.
7821 (Output_section::input_section_order_specified_): New member.
7822 * script-sections.cc (is_wildcard_string): Delete and move modified
7823 method to gold.h.
7824 (Output_section_element_input::Output_section_element_input): Modify
7825 call to is_wildcard_string.
7826 (Output_section_element_input::Input_section_pattern
7827 ::Input_section_pattern): Ditto.
7828 (Output_section_element_input::Output_section_element_input): Ditto.
7829 * testsuite/Makefile.am (final_layout): New test case.
7830 * testsuite/Makefile.in: Regenerate.
7831 * testsuite/final_layout.cc: New file.
7832 * testsuite/final_layout.sh: New file.
7833
3537c84b
RÁE
78342010-06-01 Rafael Espindola <espindola@google.com>
7835
7836 * plugin.cc (Plugin::load): Pass the output name to the plugin.
7837
105b6afd
RÁE
78382010-06-01 Rafael Espindola <espindola@google.com>
7839
7840 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
7841 visibility of symbols.
7842
29e11421
DK
78432010-05-27 Doug Kwan <dougkwan@google.com>
7844
7845 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
7846 from start of output section instead of address for a local symbol
7847 in a merged or relaxed section when doing a relocatable link.
7848
5e0f337e
RÁE
78492010-05-26 Rafael Espindola <espindola@google.com>
7850
703d02da 7851 PR 11604
5e0f337e
RÁE
7852 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7853 adding sections the garbage collector removed.
7854 * gold/testsuite/Makefile.am: Add test.
7855 * gold/testsuite/Makefile.in: Regenerate.
7856 * gold/testsuite/plugin_test_7.sh: New.
7857 * gold/testsuite/plugin_test_7_1.c: New.
7858 * gold/testsuite/plugin_test_7_2.c: New.
7859
f4187277
RÁE
78602010-05-26 Rafael Espindola <espindola@google.com>
7861
7862 * script-sections.cc (Output_section_definition::set_section_addresses):
7863 Check for --section-start.
7864
5c388529
DK
78652010-05-26 Doug Kwan <dougkwan@google.com>
7866
7867 * arm.cc (Arm_scan_relocatable_relocs): New class.
7868 (Target_arm::relocate_special_relocatable): New method.
7869 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7870 (Arm_relocate_functions::thumb_branch_common): Same.
7871 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7872 instead of Default_scan_relocatable_relocs.
7873 * target-reloc.h (relocate_for_relocatable): Let target handle
7874 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7875 * target.h (Sized_target::relocate_special_relocatable): New method.
7876
bca1c3ae
ILT
78772010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7878
7879 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7880
0439c796
DK
78812010-05-23 Doug Kwan <dougkwan@google.com>
7882
7883 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
7884 instead of a cast.
7885 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
7886 with a direct branch, not a conditional branch, to a stub.
7887 * merge.cc (Output_merge_base::record_input_section): New method
7888 defintion.
7889 (Output_merge_data::do_add_input_section): Record input section if
7890 keeps-input-sections flag is set.
7891 (Output_merge_string::do_add_input_section): Ditto.
7892 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
7893 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
7894 INPUT_SECTIONS_.
7895 (Output_merge_base::keeps_input_sections,
7896 Output_merge_base::set_keeps_input_sections,
7897 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
7898 method definitions.
7899 (Output_merge_base::Input_sections): New type declaration.
7900 (Output_merge_base::input_sections_begin,
7901 Output_merge_base::input_sections_end,
7902 Output_merge_base::do_set_keeps_input_sections): New method definitions.
7903 (Output_merge_base::bool keeps_input_sections_,
7904 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
7905 Output_merge_base::input_sections_): New data members.
7906 (Output_merge_data::do_set_keeps_input_sections): New method
7907 defintion.
7908 (Output_merge_string::do_set_keeps_input_sections): Ditto.
7909 * output.cc (Output_section::Input_section::relobj): Move method
7910 defintion from class declaration to here and handle merge sections.
7911 (Output_section::Input_section::shndx): Ditto.
7912 (Output_section::Output_section): Remove initializations of removed
7913 data members and initialize new data member LOOKUP_MAPS_.
7914 (Output_section::add_input_section): Set keeps-input-sections flag
7915 for a newly created merge output section as appropriate. Adjust code
7916 to use Output_section_lookup_maps class.
7917 (Output_section::add_relaxed_input_section): Adjst code for lookup
7918 maps code refactoring.
2e702c99 7919 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
7920 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
7921 class. If adding input section to a newly created merge output
7922 section fails, remove the new merge section.
7923 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 7924 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 7925 (Output_section::find_merge_section): Ditto.
0439c796 7926 (Output_section::build_lookup_maps): New method defintion.
2e702c99 7927 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
7928 Output_section_lookup_maps class.
7929 (Output_section::get_input_sections): Export merge sections. Adjust
7930 code to use Output_section_lookup_maps class.
7931 (Output_section:::add_script_input_section): Adjust code to use
7932 Output_section_lookup_maps class. Update lookup maps for merge
7933 sections also.
7934 (Output_section::discard_states): Use Output_section_lookup_maps.
7935 (Output_section::restore_states): Same.
7936 * output.h (Merge_section_properties): Move class defintion out of
7937 Output_section.
7938 (Output_section_lookup_maps): New class.
7939 (Output_section::Input_section::is_merge_section): New method
7940 defintion.
7941 (Output_section::Input_section::relobj): Move defintion out of class
7942 defintion. Declare method only.
7943 (Output_section::Input_section::shndx): Ditto.
7944 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 7945 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
7946 (Output_section::Merge_section_by_properties_map,
7947 Output_section::Output_section_data_by_input_section_map,
7948 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
7949 Remove types.
2e702c99 7950 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
7951 KEEPS_INPUT_SECTIONS.
7952 (Output_section::build_lookup_maps): New method declaration.
7953 (Output_section::merge_section_map_,
7954 Output_section::merge_section_by_properties_map_,
7955 Output_section::relaxed_input_section_map_,
7956 Output_section::is_relaxed_input_section_map_valid_): Remove data
7957 members.
7958 (Output_section::lookup_maps_): New data member.
7959
76295588
L
79602010-05-21 Doug Kwan <dougkwan@google.com>
7961
7962 PR gold/11619
7963 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
7964 avoid a compilation error.
7965
d103a984
RÁE
79662010-05-19 Rafael Espindola <espindola@google.com>
7967
7968 * script-sections.cc (Output_section_definition::allocate_to_segment):
7969 Update the phdrs_list even when the output section is NULL.
7970 * testsuite/Makefile.am: Add test.
7971 * testsuite/Makefile.in: Regenerate.
7972 * testsuite/script_test_9.cc: New.
7973 * testsuite/script_test_9.sh: New.
7974 * testsuite/script_test_9.t: New.
7975
6625d24e
DK
79762010-05-19 Doug Kwan <dougkwan@google.com>
7977
7978 * arm.cc (Arm_input_section::original_size): New method.
7979 (Arm_input_section::do_addralign): Add a cast.
7980 (Arm_input_section::do_output_offset): Remove static cast.
7981 (Arm_input_section::original_addralign,
7982 Arm_input_section::original_size_): Change type to uint32_t.
7983 (Arm_input_section::init): Add safe casts for section alignment
7984 and size.
7985 (Arm_input_section::set_final_data_size): Do not set address and
7986 offset of stub table.
7987 (Arm_output_section::fix_exidx_coverage): Change use of of
7988 Output_section::Simple_input_section to that of
7989 Output_section::Input_section.
7990 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
7991 except for the first pass.
7992 * output.cc (Output_section::get_input_sections): Change type of
7993 input_sections to std::list<Input_section>.
7994 (Output_section::add_script_input_section): Rename from
7995 Output_section::add_simple_input_section. Change type of SIS
7996 parameter from Simple_input_section to Input_section.
7997 * output.h (Output_section::Simple_input_section): Remove class.
7998 (Output_section::Input_section): Change class visibility to public.
7999 (Output_section::Input_section::addralign): Use stored alignments
8000 for special input sections if set.
8001 (Output_section::Input_section::set_addralign): New method.
8002 (Output_section::get_input_sections): Change parameter type from
8003 list of Simple_input_section to list of Input_section.
8004 (Output_section::add_script_input_section): Rename from
8005 Output_section::add_simple_input_section. Change first parameter's
8006 type from Simple_input_section to Input_section and remove the
8007 second and third parameters.
8008 * script-sections.cc (Input_section::Input_section_list): Change
8009 type to list of Output_section::Input_section/
8010 (Input_section_info::Input_section_info): Change parameter type of
8011 INPUT_SECTION to Output_section::Input_section.
8012 (Input_section_info::input_section): Change return type.
8013 (Input_section_info::input_section_): Change type to
8014 Output_section::Input_section.
8015 (Output_section_element_input::set_section_addresses): Adjust code
8016 to use Output_section::Input_section instead of
8017 Output_section::Simple_input_section. Adjust code for renaming
8018 of Output_section::add_simple_input_section.
8019 (Orphan_output_section::set_section_addresses): Ditto.
8020
e1e82ea4
RW
80212010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8022
8023 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8024 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8025
91e75c8a
RÁE
80262010-05-18 Rafael Espindola <espindola@google.com>
8027
8028 * options.cc (General_options::finalize): Handle -nostdlib.
8029 * options.h (nostdlib): New option.
8030 * script.cc (script_add_search_dir): Handle -nostdlib.
8031
da59ad79
DK
80322010-05-12 Doug Kwan <dougkwan@google.com>
8033
8034 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8035 attributes section only if there no attributes section after merging.
8036 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8037 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8038 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8039 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8040 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8041 and arm_attr_merge_7.stdout.
8042 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8043 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8044 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8045 arm_attr_merge_7b.o): New rules.
8046 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8047 arm_attr_merge_7
8048 * testsuite/Makefile.in: Regenerate.
8049 * testsuite/arm_attr_merge.sh: New file.
8050 * testsuite/arm_attr_merge_[67][ab].s: Same.
8051
3e01a7fd
NC
80522010-05-05 Nick Clifton <nickc@redhat.com>
8053
8054 * po/es.po: Updated Spanish translation.
8055
7ad2014a
L
80562010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8057
8058 * Makefile.am (install-exec-local): Properly install gold as
8059 default cross linker.
8060 * Makefile.in: Regenerated.
8061
4fda8867
NC
80622010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8063 Nick Clifton <nickc@redhat.com>
8064
8065 * configure.ac (install_as_default): Define and set to false
8066 unless --enable-gold or --enable-gold=both/gold has been
8067 specified.
8068 * configure: Regenerate.
8069
8070 * Makefile.am (install-exec-local): Install the executable as
8071 'ld.gold'. If install_as_default is true then also install it as
8072 'ld'.
8073 * Makefile.in: Regenerated.
8074
bd288ea2
ILT
80752010-04-24 Ian Lance Taylor <iant@google.com>
8076
8077 * layout.cc (Layout::layout_reloc): In relocatable link don't
8078 combine reloc sections for grouped sections.
8079
ef38fd8a
ST
80802010-04-23 Sriraman Tallam <tmsriram@google.com>
8081
8082 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8083 sections that are not ordinary to icf.
8084 * icf.cc (get_section_contents): Handle relocation pointing to section
8085 with no object or shndx information.
8086 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8087 * testsuite/Makefile.in: Regenerate.
8088 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8089 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8090
f6973bdc
ILT
80912010-04-22 Ian Lance Taylor <iant@google.com>
8092
8093 * expression.cc (Expression::Expression_eval_info): Add
8094 result_alignment_pointer field.
8095 (Expression::eval_with_dot): Add result_alignment_pointer
8096 parameter. Change all callers.
8097 (Expression::eval_maybe_dot): Likewise.
8098 (class Binary_expression): Add alignment_pointer parameter to
8099 left_value and right_value. Change all callers.
8100 (BINARY_EXPRESSION): Set result alignment.
8101 (class Trinary_expression): Add alignment_pointer parameter to
8102 arg2_value and arg3_value. Change all callers.
8103 (Trinary_cond::value): Set result alignment.
8104 (Max_expression::value, Min_expression::value): Likewise.
8105 (Align_expression::value): Likewise.
8106 * script-sections.cc (class Sections_element): Add dot_alignment
8107 parameter to set_section_addresses virtual function. Update
8108 instantiations.
8109 (class Output_section_element): Likewise.
8110 (Script_sections::create_segments): Add dot_alignment parameter.
8111 Change all callers.
8112 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8113 (Script_sections::set_phdrs_clause_addresses): Likewise.
8114 * script-sections.h: Update declarations.
8115 * script.h: Update declarations.
8116 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8117 min_p_align.
8118 * testsuite/script_test_3.t: Set large alignment.
8119 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8120 segment has expected alignment.
8121
9c9c98a5
NC
81222010-04-22 Nick Clifton <nickc@redhat.com>
8123
8124 * po/gold.pot: Updated by the Translation project.
8125 * po/vi.po: Updated Vietnamese translation.
8126
2253bfba
L
81272010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8128
8129 * testsuite/Makefile.am (check_PROGRAMS): Add
8130 icf_virtual_function_folding_test.
8131 * testsuite/Makefile.in: Regenerated.
8132
85fdf906
AH
81332010-04-15 Andrew Haley <aph@redhat.com>
8134
8135 * options.h (merge_exidx_entries): New option.
8136 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8137 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8138 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8139 (Target_arm::merge_exidx_entries): New function.
8140 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8141 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8142 to Arm_exidx_fixup constructor.
8143 Add new arg, merge_exidx_entries.
8144 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8145 Arm_output_section::fix_exidx_coverage.
8146
ce97fa81
ST
81472010-04-18 Sriraman Tallam <tmsriram@google.com>
8148
8149 * icf.cc (get_section_contents): Check for preemptible functions.
8150 Ignore addend when appropriate.
8151 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8152 section folded.
8153 (add_from_relobj): Check for section folded.
8154 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8155 * symtab.h (should_add_dynsym_entry): Add new parameter.
8156 * target-reloc.h (scan_relocs): Check for section folded.
8157 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8158 Check reloc types for function pointers in shared objects.
8159 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8160 case.
8161 (icf_preemptible_functions_test): New test case.
8162 (icf_string_merge_test): New test case.
8163 * testsuite.Makefile.in: Regenerate.
8164 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8165 bar_glob. Refactor code.
8166 * testsuite/icf_preemptible_functions_test.cc: New file.
8167 * testsuite/icf_preemptible_functions_test.sh: New file.
8168 * testsuite/icf_string_merge_test.cc: New file.
8169 * testsuite/icf_string_merge_test.sh: New file.
8170 * testsuite/icf_virtual_function_folding_test.cc: New file.
8171 * testsuite/icf_virtual_function_folding_test.sh: New file.
8172
04ceb17c
DK
81732010-04-14 Doug Kwan <dougkwan@google.com>
8174
8175 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8176 for local symbol recounting if we remove a section due to ICF.
8177 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8178 there are no regular objects in input.
8179
153e7da4
DK
81802010-04-13 Doug Kwan <dougkwan@google.com>
8181
8182 * arm.cc (Arm_input_section::set_final_data_size): Compute
8183 accurate final data size instead of using current data size.
8184
4dbd9faf
DK
81852010-04-09 Doug Kwan <dougkwan@google.com>
8186
8187 * layout.cc (Layout::choose_output_section): Handle script section
8188 types.
8189 (Layout::make_output_section_for_script): Add section type parameter.
8190 Handle script section types.
8191 * layout.h (Layout::make_output_section_for_script): Add section
8192 type parameter.
8193 * output.cc (Output_section::Output_section): Initialize data member
8194 is_noload_.
8195 (Output_section::do_reset_address_and_file_offset): Do not set address
8196 to 0 if section is a NOLOAD section.
8197 * output.h (Output_section::is_noload): New method.
8198 (Output_section::set_is_noload): Ditto.
8199 (Output_section::is_noload_): New data member.
8200 * script-c.h (Script_section_type): New enum type.
8201 (struct Parser_output_section_header): Add new file section_type.
8202 * script-sections.cc (Sections_element::output_section_name): Add
8203 parameter for returning script section type.
8204 (Output_section_definition::output_section_name): Ditto.
8205 (Output_section_definition::section_type)P; New method.
8206 (Output_section_definiton::script_section_type_name): Ditto.
8207 (Output_section_definition::script_section_type_): New data member.
8208 (Output_section_definition::Output_section_definition): Initialize
8209 data member Output_section_definition::script_section_type_.
8210 (Output_section_definition::create_sections): Pass script section type
8211 to Layout::make_output_section_for_script.
8212 (Output_section_definition::output_section_name): Return script
8213 section type to caller.
8214 (Output_section_definition::set_section_address): Do not advance
8215 dot value and load address if section type is NOLOAD. Set address
8216 of NOLOAD sections regardless of section flags.
8217 (Output_section_definition::print): Print section type if it is
8218 not SCRIPT_SECTION_TYPE_NONE.
8219 (Output_section_definition::section_type): New method.
8220 (Output_section_definition::script_section_type_name): Ditto.
8221 (Script_sections::output_section_name): Add new parameter
8222 PSECTION_TYPE for returning script section type. Pass it to
8223 section elements. Handle discard sections.
8224 (Sort_output_sections::operator()): Handle NOLOAD sections.
8225 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8226 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8227 returning script section type.
8228 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8229 INFO and NOLOAD.
8230 * yyscript.y (union): Add new field SECTION_TYPE.
8231 (COPY, DSECT, INFO, NOLOAD): New tokens.
8232 (opt_address_and_section_type): Change type to output_section_header.
8233 (section_type): New non-terminal
8234 (section_header): Handle section type.
2253bfba 8235 (opt_address_and_section_type): Return section type value.
4dbd9faf 8236
721ea635
L
82372010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8238
8239 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8240 * testsuite/plugin_common_test_2.c (foo): Likewise.
8241
6bf924b0
DK
82422010-04-08 Doug Kwan <dougkwan@google.com>
8243
8244 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8245 Output_merge_data.
8246 * output.cc (Output_section::add_merge_input_section): Simplify
8247 code and return status of Output_merge_base::add_input_section.
e1df38aa 8248 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8249 returns true.
8250
24af6f92
DK
82512010-04-07 Doug Kwan <dougkwan@google.com>
8252
8253 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8254 if section is marked as containing instructions but has no mapping
8255 symbols.
8256 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8257 correct section index.
8258 (Arm_relobj::find_linked_text_section): Ditto.
8259
00698fc5
CC
82602010-04-07 Cary Coutant <ccoutant@google.com>
8261
8262 * archive.cc (include_member): Destroy Read_symbols_data object before
8263 releasing file.
8264 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8265 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8266 (Read_symbols_data::~Read_symbols_data) New destructor.
8267 (Section_relocs::Section_relocs) New constructor.
8268 (Section_relocs::~Section_relocs) New destructor.
8269 (Read_relocs_data::Read_relocs_data) New constructor.
8270 (Read_relocs_data::~Read_relocs_data) New destructor.
8271 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8272 pointers to NULL after deleting.
8273
7296d933
DK
82742010-04-07 Doug Kwan <dougkwan@google.com>
8275
8276 * arm.cc: Replace "endianity" with "endianness" in comments.
8277 (Arm_exidx_cantunwind): Ditto.
8278 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8279 (Arm_relobj::merge_flags_and_attributes): New method.
8280 (Arm_relobj::merge_flags_and_attributes_): New data member.
8281 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8282 (Arm_relobj::scan_sections_for_stubs): Ditto.
8283 (Arm_relobj::do_read_symbols): Check to see if we really want to
8284 merge processor-specific flags and attributes. Exit early if
8285 an object is empty except for section names and the undefined symbol.
8286 (Target_arm::do_finalize_sections): Move check for ELF format to
8287 Arm_relobj::do_read_symbols. Merge processor specific flags and
8288 attributes from a regular object only when we have determined that
8289 it is aapropriate. Do not create an .ARM.attributes section in
8290 output if there is no regular input object.
8291 (Target_arm::merge_processor_specific_flags): Check
8292 --warn-mismatch before printing any error.
8293 (Target_arm::merge_object_attributes): Ditto.
8294 * gold.cc (queue_middle_tasks): Handle the case in which there is
8295 no regular object in input.
8296 * options.cc (General_options::parse_EB): New method.
8297 (General_options::parse_EL): Same.
8298 (General_options::General_options): Initialize endianness_.
8299 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8300 New options.
8301 (General_options::Endianness): New enum.
8302 (General_options::endianness): New method.
8303 (General_options::endianness_): New data member.
8304 * parameters.cc (Parameters::set_options): Check target endianness.
8305 (Parameters::set_target_once): Ditto.
8306 (Parameters::check_target_endianness): New method.
8307 (parameters_force_valid_target): If either -EL or -EB is specified,
8308 use it to define endianness of default target.
8309 * parameters.h (Parameters::check_target_endianness): New method
8310 declaration.
8311 * target.h (class Target): Change "endianity" to "endianness"
8312 in comments.
8313
efc8d4f2
RW
83142010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8315
8316 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8317 * configure: Regenerate.
8318 * Makefile.in: Regenerate.
8319 * testsuite/Makefile.in: Regenerate.
8320
be234d88
CC
83212010-04-06 Cary Coutant <ccoutant@google.com>
8322
8323 gcc PR lto/42757
8324 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8325 prevailing definitions of common symbols.
8326 * testsuite/plugin_test_6.sh: New test case.
8327 * testsuite/plugin_common_test_1.c: New test case.
8328 * testsuite/plugin_common_test_2.c: New test case.
8329 * testsuite/Makefile.am (plugin_test_6): New test case.
8330 * testsuite/Makefile.in: Regenerate.
8331
bd32c6bd
NC
83322010-04-06 Nick Clifton <nickc@redhat.com>
8333
8334 * po/vi.po: New Vietnamese translation.
8335
323c532f
DK
83362010-03-30 Doug Kwan <dougkwan@google.com>
8337
8338 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8339
4fcd97eb
DK
83402010-03-25 Doug Kwan <dougkwan@google.com>
8341
8342 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8343 to avoid a conversion warning on a 32-bit host.
8344
4ebf39db
ILT
83452010-03-24 Ian Lance Taylor <iant@google.com>
8346
8347 * testsuite/script_test_3.t: Add a TLS segment.
8348 * testsuite/Makefile.am (check_PROGRAMS): Add
8349 tls_phdrs_script_test.
8350 (tls_phdrs_script_test_SOURCES): Define.
8351 (tls_phdrs_script_test_DEPENDENCIES): Define.
8352 (tls_phdrs_script_test_LDFLAGS): Define.
8353 (tls_phdrs_script_test_LDADD): Define.
8354 * testsuite/Makefile.in: Rebuild.
8355
4a599bdd
CC
83562010-03-23 Cary Coutant <ccoutant@google.com>
8357
8358 * fileread.cc (find_or_make_view): Fix comment.
8359
6c93b22c
ILT
83602010-03-23 Ian Lance Taylor <iant@google.com>
8361
8362 * script-sections.cc (class Orphan_section_placement): Define
8363 PLACE_TLS and PLACE_TLS_BSS.
8364 (Orphan_section_placement::Orphan_section_placement): Initialize
8365 new places.
8366 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8367 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8368 (tls_script_test_SOURCES): Define.
8369 (tls_script_test_DEPENDENCIES): Define.
8370 (tls_script_test_LDFLAGS): Define.
8371 (tls_script_test_LDADD): Define.
8372 * testsuite/Makefile.in: Rebuild.
8373
a2c7281b
DK
83742010-03-22 Doug Kwan <dougkwan@google.com>
8375
8376 * arm.cc (Arm_relocate_functions::abs8,
8377 Arm_relocate_functions::abs16): Use correct check for overflow
8378 specified in the ARM ELF specs.
8379 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8380 target of a BLX instruction specially.
8381 (Reloc_stub::stub_type_for_reloc): Ditto.
8382 (Relocate::relocate): Use symbolic names instead of numeric relocation
8383 codes to report error.
8384 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8385 workaround.
8386 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8387 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8388 thumb2_blx_out_of_range.stdout
8389 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8390 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8391 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8392 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8393 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8394 thumb2_blx_in_range, thumb2_blx_in_range.o,
8395 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8396 thumb2_blx_out_of_range.o): New rules.
2e702c99 8397 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
8398 thumb2_blx_in_range and thumb2_blx_out_of_range.
8399 * testsuite/Makefile.in: Regenerate.
8400 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8401 * testsuite/thumb_blx_in_range.s: New file.
8402 * testsuite/thumb_blx_out_of_range.s: New file.
8403
b0193076
RÁE
84042010-03-22 Rafael Espindola <espindola@google.com>
8405
8406 * archive.cc (Should_include): Move to archive.h.
8407 (should_include_member): Make it a member of Archive.
8408 (Lib_group): New.
8409 (Add_lib_group_symbols): New.
8410 * archive.h: Include options.h.
8411 (Archive_member): Moved from Archive.
8412 (Should_include): Moved from archive.cc.
8413 (Lib_group): New.
8414 (Add_lib_group_symbols): New.
8415 * dynobj.cc (do_should_include_member): New.
8416 * dynobj.h (do_should_include_member): New.
8417 * gold.cc (queue_initial_tasks): Update call to queue.
8418 * main.cc (main): Print lib group stats.
8419 * object.cc (do_should_include_member): New.
8420 * object.h: Include archive.h.
8421 (Object::should_include_member): New.
8422 (Object::do_should_include_member): New.
8423 (Sized_relobj::do_should_include_member): New.
8424 * options.cc (General_options::parse_start_lib): New.
8425 (General_options::parse_end_lib): New.
8426 (Input_arguments::add_file): Handle lib groups.
8427 (Input_arguments::start_group): Check we are not in a lib.
8428 (Input_arguments::start_lib): New.
8429 (Input_arguments::end_lib): New.
8430 * options.h (General_options): Add start_lib and end_lib.
8431 (Input_argument::lib_): New.
8432 (Input_argument::lib): New.
8433 (Input_argument::is_lib): New.
8434 (Input_file_lib): New.
8435 (Input_arguments::in_lib_): New.
8436 (Input_arguments::in_lib): New.
8437 (Input_arguments::start_lib): New.
8438 (Input_arguments::end_lib_): New.
8439 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8440 in unused members as preempted.
8441 (Sized_pluginobj::do_should_include_member): New.
8442 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8443 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8444 return the blocker.
8445 (Read_symbols::do_whole_lib_group): New.
8446 (Read_symbols::do_lib_group): New.
8447 (Read_symbols::do_read_symbols): Handle lib groups.
8448 (Read_symbols::get_name): Handle lib groups.
8449 * readsyms.h (Read_symbols): Add an archive member pointer.
8450 (Read_symbols::do_whole_lib_group): New.
8451 (Read_symbols::do_lib_group): New.
8452 (Read_symbols::member_): New.
8453 * script.cc (read_input_script): Update call to queue_soon.
8454
d099120c
DK
84552010-03-19 Doug Kwan <dougkwan@google.com>
8456
8457 * arm.cc (Stub_table::Stub_table): Initialize new data members
8458 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8459 (Stub_table::add_reloc_stub): Assign stub offset and update
8460 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8461 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8462 New data members.
2e702c99 8463 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
8464 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8465 instead of going over all reloc stubs.
2e702c99 8466 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
8467 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8468 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 8469 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
8470 Stringpool_template::offset_.
8471 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8472 Stringpool_template::offset_ to zero.
8473
1aa37384
DK
84742010-03-15 Doug Kwan <dougkwan@google.com>
8475
8476 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8477 offset_.
8478 (Stringpool_template::new_key_offset): New method.
8479 (Stringpool_template::add_string): Assign offsets when adding new
8480 strings.
8481 (Stringpool_template::set_string_offsets): Do not set string offsets
8482 when not optimizing.
8483 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8484 member size_.
2e702c99
RM
8485 (Chunked_vector::clear): Clear size_.
8486 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8487 (Chunked_vector::size): Return size_.
8488 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 8489 (Chunked_vector::size_): New data member.
1aa37384
DK
8490 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8491 (Stringpool_template::new_key_offset): New method declaration.
8492 (Stringpool_template::offset_): New data member.
8493
b672b057
RÁE
84942010-03-15 Rafael Espindola <espindola@google.com>
8495
8496 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8497 Add_symbols' constructor.
8498 * readsyms.h (Add_symbols): Remove the input_group member.
8499
b6848d3c
ILT
85002010-03-10 Ian Lance Taylor <iant@google.com>
8501
8502 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8503 target to ask whether a reference to a symbol requires a stack
8504 split.
8505 * target.h (Target::is_call_to_non_split): New function.
8506 (Target::do_is_call_to_non_split): Declare virtual function.
8507 * target.cc: Include "symtab.h".
8508 (Target::do_is_call_to_non_split): New function.
8509 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8510
a2a5469e
CC
85112010-03-10 Cary Coutant <ccoutant@google.com>
8512
8513 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8514 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8515 (File_read::open[2]): Add whole_file_view_ to list of views.
8516 (File_read::make_view): Remove test of whole_file_view_.
8517 (File_read::find_or_make_view): Create whole_file_view_ if
8518 necessary.
8519 (File_read::clear_views): Replace bool parameter with enum;
8520 adjust all callers. Don't delete views with permanent data;
8521 do delete cached views and views from archives if
8522 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8523 if clearing the corresponding view.
8524 * fileread.h (File_read::Clear_views_mode): New enum.
8525 (File_read::View::is_permanent_view): New method.
8526 (File_read::clear_views): Replace bool parameter
8527 with enum; adjust all callers.
8528 * options.h (General_options): Change keep_files_mapped option;
8529 add map_whole_files.
8530 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8531 releasing the file.
8532 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8533 the file.
8534
8861f32b
DM
85352010-03-10 David S. Miller <davem@davemloft.net>
8536
8537 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8538
d62d0f5f
ST
85392010-03-09 Sriraman Tallam <tmsriram@google.com>
8540
8541 * icf.cc (get_section_contents): Add '@' marker after processing the
8542 merge reloc.
8543
9177756d
DK
85442010-03-08 Doug Kwan <dougkwan@google.com>
8545
8546 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8547 due to a conversion warning.
8548 (Arm_relobj::update_output_local_symbol_count): Check for local
8549 symbol with unset output index.
8550
9e9e071b
ILT
85512010-03-05 Ian Lance Taylor <iant@google.com>
8552
8553 * options.h (class General_options): Add --spare-dynamic-tags.
8554 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8555 --spare-dynamic-tags.
8556
a81ee015
ILT
85572010-03-05 Ian Lance Taylor <iant@google.com>
8558
8559 * incremental.cc: Include "libiberty.h".
8560
44ec90b9
RO
85612010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8562
8563 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8564 function, is_info_ member.
8565 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8566 (Versions::Versions): Update caller.
8567 (Versions::define_base_version): Likewise.
8568 (Versions::add_def): Likewise.
8569
0897ed3b
ST
85702010-03-03 Sriraman Tallam <tmsriram@google.com>
8571
8572 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8573 (Scan::possible_function_pointer_reloc): New function.
8574 (Scan::local_reloc_may_be_function_pointer): Change to call
8575 possible_function_pointer_reloc.
8576 (Scan::global_reloc_may_be_function_pointer): Ditto.
8577 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8578 relocations in ".data.rel.ro._ZTV" section.
8579 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8580 * testsuite/icf_safe_so_test.cc: Ditto.
8581 * testsuite/icf_safe_test.cc: Ditto.
8582 * testsuite/icf_safe_test.sh: Ditto.
8583
d3bbad62
ILT
85842010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8585 Ian Lance Taylor <iant@google.com>
8586
8587 * target-reloc.h (relocate_section): Check the symbol table index
8588 for -1U before setting the local symbol index.
8589 (scan_relocatable_relocs): If copying the relocation, record that
8590 the local symbol is required.
8591 * object.h (Symbol_value::is_output_symtab_index_set): New
8592 function.
8593 (Symbol_value::may_be_discarded_from_output_symtab): New
8594 function.
8595 (Symbol_value::has_output_symtab_entry): New function.
8596 (Symbol_value::needs_output_symtab_entry): Remove.
8597 (Symbol_value::output_symtab_index): Make sure the symbol index is
8598 set.
8599 (Symbol_value::set_output_symtab_index): Make sure the symbol
8600 index is not set. Make sure the new index is valid.
8601 (Symbol_value::set_must_have_output_symtab_entry): New function.
8602 (Symbol_value::has_output_dynsym_entry): New function.
8603 (Symbol_value::set_output_dynsym_index): Make sure the new index
8604 is valid.
8605 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8606 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8607 local symbol if permitted.
8608 (Sized_relobj::do_finalize_local_symbols): Call
8609 is_output_symtab_index_set rather than needs_output_symtab_entry.
8610 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8611 rather than needs_output_symtab_entry. Call
8612 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8613 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8614 is_output_symtab_index_set rather than needs_output_symtab_entry.
8615 * testsuite/discard_locals_relocatable_test.c: New file.
8616 * testsuite/discard_locals_test.sh: Test -r.
8617 * testsuite/Makefile.am (check_DATA): Add
8618 discard_locals_relocatable_test1.syms,
8619 discard_local_relocatable_test2.syms.
8620 (MOSTLYCLEANFILES): Likewise. Also add
8621 discard_locals_relocatable_test1.lout and
8622 discard_locals_relocatable_test2.out.
8623 (discard_locals_relocatable_test1.syms): New target.
8624 (discard_locals_relocatable_test.o): New target.
8625 (discard_locals_relocatable_test1.out): New target.
8626 (discard_locals_relocatable_test2.syms): New target.
8627 (discard_locals_relocatable_test2.out): New target.
8628 (various): Add missing ../ld-new dependencies.
8629 * testsuite/Makefile.in: Rebuild.
8630
7e8ccf26
NC
86312010-03-03 Nick Clifton <nickc@redhat.com>
8632
8633 * po/fi.po: New Finnish translation.
8634
2a0ff005
DK
86352010-03-01 Doug Kwan <dougkwan@google.com>
8636
8637 * layout.cc (Layout::Layout): Force section types of .init_array*,
8638 .preinit_array* and .fini_array* sections.
8639 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8640 Fix check of return value of std::string::find.().
8641 (Output_section::Input_section_sort_compare::operator()): Remove
8642 comment about .init_array.
8643 (Output_section::Input_section_sort_init_fini_compare::operator()):
8644 New method.
8645 (Output_section::sort_attached_input_sections): Handle .init_array
8646 and .fini_array specially.
8647 * output.h (Output_section::Inut_section_sort_compare): Update
8648 comment.
8649 (Output_section::Input_section_sort_init_fini_compare): New struct.
8650
c3e4ae29
DK
86512010-02-26 Doug Kwan <dougkwan@google.com>
8652
8653 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
8654 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
8655 * testsuite/debug_msg.sh: Avoid matching source line number for
8656 use of global variable undef_int.
8657
2fd9ae7a
DK
86582010-02-26 Doug Kwan <dougkwan@google.com>
8659
8660 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
8661 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
8662 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
8663 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
8664 * options.cc (General_options::General_options): Initialize member
8665 fix_v4bx_.
8666 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
8667 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
8668 and rm_no_fix_v4bx.stdout
8669 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
8670 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
8671 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
8672 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
8673 and arm_no_fix_v4bx.
8674 * Makefile.in: Regenerate.
8675 * testsuite/arm_fix_v4bx.s: New file.
8676 * testsuite/arm_fix_v4bx.sh: Ditto.
8677
67ec7d0b
DK
86782010-02-24 Doug Kwan <dougkwan@google.com>
8679
8680 * arm.cc (Target_arm::got_section): Make the .got section the first
8681 non RELRO section in the data segment.
8682 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
8683 suffixes of section names.
8684
10165461
DK
86852010-02-24 Doug Kwan <dougkwan@google.com>
8686
8687 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
8688 flags and attributes merging if an input file is a binary file.
8689 * fileread.cc (Input_file::open): Record format of original file.
8690 * fileread.h (Input_file::Format): New enum type.
2e702c99 8691 (Input_file::Input_file): Initialize data member format_.
10165461
DK
8692 (Input_file::format): New method definition.
8693 (Input_file::format_):: New data member.
8694
4a54abbb
DK
86952010-02-24 Doug Kwan <dougkwan@google.com>
8696
8697 * arm.cc (Arm_output_data_got): New class.
8698 (ARM_TCB_SIZE): New constant
8699 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
8700 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
8701 If user uses a script with a SECTIONS clause, issue only a warning
8702 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 8703 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
8704 garbage collection.
8705 (Target_arm::got_mode_index_entry): Handle static linking.
8706 (Target_arm::Scan::local): Ditto.
8707 (Target_arm::Scan::global): Ditto.
8708 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
8709 all incorrectly implemented relocations.
e1df38aa 8710 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
8711 Arm_output_section::fix_exidx_coverage.
8712 * layout.cc (Layout::section_name_mapping): Remove trailing dots
8713 from ".ARM.exidx." and ".ARM.extab.".
8714
ca419a6f
ILT
87152010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8716
8717 * arm.cc (Target_arm::do_finalize_sections): Create attribute
8718 section if it does not already exist.
8719 * attributes.cc (Attributes_section_data::Attributes_section_data):
8720 Don't crash if size is zero.
8721
135b9c78
ILT
87222010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8723 Ian Lance Taylor <iant@google.com>
8724
8725 * gold.cc (queue_middle_tasks): If no input files were opened,
8726 exit.
8727 * workqueue.h (Task_function::Task_function): Assert that there is
8728 a blocker.
8729
bb0bfe4f
DK
87302010-02-22 Doug Kwan <dougkwan@google.com>
8731
8732 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
8733 * icf.cc (get_section_contents): Cast snprintf arguments to long long
8734 types to avoid warnings due to different uint64_t implementations
8735 on different hosts.
8736
2a2b6d42
DK
87372010-02-21 Doug Kwan <dougkwan@google.com>
8738
8739 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
8740 handling of the maximum backward branch offset.
2e702c99 8741 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
8742 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
8743 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 8744 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
8745 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
8746 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
8747 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
8748 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
8749 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
8750 thumb_bl_out_of_range thumb_bl_out_of_range.o,
8751 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
8752 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
8753 thumb2_bl_out_of_range.o): New rules.
8754 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
8755 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
8756 thumb2_bl_out_of_range
8757 * testsuite/Makefile.in: Regenerate.
8758 * testsuite/arm_bl_in_range.s: New file.
8759 * testsuite/arm_bl_out_of_range.s: Ditto.
8760 * testsuite/arm_branch_in_range.sh: Ditto.
8761 * testsuite/arm_branch_range.t: Ditto.
8762 * testsuite/thumb2_branch_range.t: Ditto.
8763 * testsuite/thumb_bl_in_range.s: Ditto.
8764 * testsuite/thumb_bl_out_of_range.s: Ditto.
8765 * testsuite/thumb_branch_range.t: Ditto.
8766
b487ad64
ST
87672010-02-20 Sriraman Tallam <tmsriram@google.com>
8768
8769 * gc.h (gc_process_relocs): Change vectors to point to the new list.
8770 Add reloc offset information.
8771 * icf.cc (get_section_contents): Change iterators to point to the new
8772 vectors. Add reloc offset information to the contents.
8773 * icf.h (Icf::Sections_reachable_info): New typedef.
8774 (Icf::Sections_reachable_list): New typedef.
8775 (Icf::Offset_info): New typedef.
8776 (Icf::Reloc_info): New struct typedef.
8777 (Icf::Reloc_info_list): New typedef.
8778 (Icf::symbol_reloc_list): Delete method.
8779 (Icf::addend_reloc_list): Delete method.
8780 (Icf::section_reloc_list): Delete method.
8781 (Icf::reloc_info_list): New method.
8782 (Icf::reloc_info_list_): New member.
8783
f96accdf
DK
87842010-02-19 Doug Kwan <dougkwan@google.com>
8785
8786 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
8787 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
8788 * arm.cc (Arm_relocation_functions): New forward declaration.
8789 (Target_arm::Target_arm): Initialize new data members
8790 got_mod_index_offset_ and tls_base_symbol_defined_.
8791 (Target_arm::Relocate::relocate_tls): New method.
8792 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
8793 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
8794 New methods.
2e702c99 8795 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
8796 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
8797 (Target_arm::got_mod_index_offset_,
8798 Target_arm::tls_base_symbol_defined_): New data members.
8799 (Target_arm::Scan::local, Target::Scan::global,
8800 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
8801 relocations.
8802
c8761b9a
DK
88032010-02-18 Doug Kwan <dougkwan@google.com>
8804
8805 * arm.cc (Arm_relobj::find_linked_text_section): New method.
8806 (Arm_relobj::make_exidx_input_section): Pass section index of linked
8807 text section as a parameter becuase some broken tools may not set
8808 the link in section header.
8809 (Target_arm::has_got_section): New method.
8810 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
8811 without any mapping symbol as data only. Remove warning.
8812 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
8813 link in its section header, try to discover the link by inspecting the
8814 REL31 relocation at the beginning of the section.
8815 (Target_arm::Scan::check_non_pic): Report name of offending relocation
8816 in error message.
8817 (Target_arm::Scan::global): Treat any reference to the symbol
8818 _GLOBAL_OFFSET_TABLE_ as a GOT access.
8819
21bb3914
ST
88202010-02-12 Sriraman Tallam <tmsriram@google.com>
8821
8822 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
8823 (Scan::global_reloc_may_be_function_pointer): New function.
8824 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8825 (Scan::global_reloc_may_be_function_pointer): New function.
8826 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8827 (Scan::global_reloc_may_be_function_pointer): New function.
8828 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
8829 (Scan::global_reloc_may_be_function_pointer): New function.
8830 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
8831 (Scan::global_reloc_may_be_function_pointer): New function.
8832 (Scan::possible_function_pointer_reloc): New function.
8833 (Target_x86_64::can_check_for_function_pointers): New function.
8834 * gc.h (gc_process_relocs): Scan relocation types to determine if
8835 function pointers were taken for targets that support it.
8836 * icf.cc (Icf::find_identical_sections): Include functions for
8837 folding in safe ICF whose pointer is not taken.
8838 * icf.h (Secn_fptr_taken_set): New typedef.
8839 (fptr_section_id_): New member.
8840 (section_has_function_pointers): New function.
8841 (set_section_has_function_pointers): New function.
8842 (check_section_for_function_pointers): New function.
8843 * options.h: Fix comment for safe ICF option.
8844 * target.h (can_check_for_function_pointers): New function.
8845 * testsuite/Makefile.am: Add icf_safe_so_test test case.
8846 Modify icf_safe_test for X86-64.
8847 * testsuite/Makefile.in: Regenerate.
8848 * testsuite/icf_safe_so_test.cc: New file.
8849 * testsuite/icf_safe_so_test.sh: New file.
8850 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8851 (main): Change to take pointer to function kept_func_3.
8852 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8853 folding is done correctly for X86-64.
8854
0da6fa6c
DM
88552010-02-12 David S. Miller <davem@davemloft.net>
8856
8857 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8858 is_symbolless parameter.
8859 (Output_reloc<SHT_REL>::is_symbolless): New.
8860 (Output_reloc<SHT_REL>::is_symbolless_): New.
8861 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8862 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8863 (Output_reloc<SHT_RELA>::is_symbolless): New.
8864 (Output_data_reloc::add_global): Handle is_symbolless.
8865 (Output_data_reloc::add_global_relative): Likewise.
8866 (Output_data_reloc::add_local): Likewise.
8867 (Output_data_reloc::add_local_relative): Likewise.
8868 (Output_data_reloc::add_symbolless_global_addend): New.
8869 (Output_data_reloc::add_symbolless_local_addend): New.
8870 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8871 is_symbolless.
8872 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8873 instead of ->is_relative_
8874 (Output_reloc::write): Likewise.
8875 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8876 (Output_reloc::write_rel): Simplify.
8877
8878 * sparc.cc (Target_sparc::Scan::local): Use
8879 ->add_symbolless_local_addend as needed.
8880 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8881 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8882 based upon relocation offset.
8883
e4782e83
DK
88842010-02-11 Doug Kwan <dougkwan@google.com>
8885
8886 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
8887 (Target_arm::Scan::global): Ditto. Also remove a comment before the
8888 beginning of function.
8889 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
8890 and MOVT_ABS relocations. Those are non issued in scanning. Fix
8891 parameter is_32bit in calls to should_apply_static_reloc.
8892 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
8893 (check_DATA): Add arm_abs_global.stdout.
8894 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
8895 arm_abs_global.stdout): New rules.
8896 (MOSTLLYCLEANFILES): Add arm_abs_global
8897 * Makefile.in: Regenerate.
8898 * testsuite/arm_abs_global.s: New file.
8899 * testsuite/arm_abs_global.sh: Ditto.
8900 * testsuite/arm_abs_lib.s: Ditto.
8901
93ceb764
ILT
89022010-02-11 Ian Lance Taylor <iant@google.com>
8903
8904 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
8905 Read_relocs task.
8906 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
8907 Allocate_commons_task first.
8908 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
8909 task, rather than symtab_lock_.
8910 (Gc_process_relocs::~Gc_process_relocs): New function.
8911 (Gc_process_relocs::is_runnable): Check this_blocker_.
8912 (Gc_process_relocs::locks): Use next_blocker_ rather than
8913 blocker_.
8914 (Scan_relocs::~Scan_relocs): New function.
8915 (Scan_relocs::is_runnable): Check this_blocker_ rather than
8916 symtab_lock_.
8917 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
8918 next_blocker_.
8919 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
8920 fields. Add this_blocker_ and next_blocker_ fields. Adjust
8921 constructor accordingly.
8922 (class Gc_process_relocs): Likewise.
8923 (class Scan_relocs): Likewise.
8924 * common.h (class Allocate_commons_task): Remove symtab_lock_
8925 field, and corresponding constructor parameter.
8926 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
8927 symtab_lock_.
8928 (Allocate_commons_task::locks): Likewise.
8929
114dfbe1
ILT
89302010-02-11 Ian Lance Taylor <iant@google.com>
8931
8932 * gold-threads.h (class Once): Define.
8933 (class Initialize_lock): Rewrite as child of Once.
8934 * gold-threads.cc (class Once_initialize): Define.
8935 (once_pointer_control): New static variable.
8936 (once_pointer, once_arg): New static variables.
8937 (c_run_once): New static function.
8938 (Once::Once, Once::run_once, Once::internal_run): New functions.
8939 (class Initialize_lock_once): Remove.
8940 (initialize_lock_control): Remove.
8941 (initialize_lock_pointer): Remove.
8942 (initialize_lock_once): Remove.
8943 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
8944 (Initialize_lock::initialize): Rewrite.
8945 (Initialize_lock::do_run_once): New function.
8946 * archive.cc (Archive::interpret_header): Only clear name if it is
8947 not already empty.
8948 * fileread.cc: Include "gold-threads.h"
8949 (file_counts_lock): New static variable.
8950 (file_counts_initialize_lock): Likewise.
8951 (File_read::release): Only increment counts when using --stats.
8952 Use a lock around the increment.
8953 * parameters.cc (class Set_parameters_target_once): Define.
8954 (set_parameters_target_once): New static variable.
8955 (Parameters::Parameters): Move here from parameters.h.
8956 (Parameters::set_target): Rewrite.
8957 (Parameters::set_target_once): New function.
8958 (Parameters::clear_target): Move here and rewrite.
8959 * parameters.h (class Parameters): Update declarations. Add
8960 set_parameters_target_once_ field.
8961 (Parameters::Parameters): Move to parameters.cc.
8962 (Parameters::clear_target): Likewise.
8963 * readsyms.cc (Read_symbols::do_group): Create a Start_group
8964 task.
8965 (Start_group::~Start_group): New function.
8966 (Start_group::is_runnable): New function.
8967 (Start_group::locks, Start_group::run): New functions.
8968 (Finish_group::run): Change saw_undefined to size_t.
8969 * readsyms.h (class Start_group): Define.
8970 (class Finish_group): Change saw_undefined_ field to size_t.
8971 (Finish_group::Finish_group): Remove saw_undefined and
8972 this_blocker parameters. Change all callers.
8973 (Finish_group::set_saw_undefined): New function.
8974 (Finish_group::set_blocker): New function.
8975 * symtab.h (class Symbol_table): Change saw_undefined to return
8976 size_t. Change saw_undefined_ field to size_t.
8977 * target-select.cc (Set_target_once::do_run_once): New function.
8978 (Target_selector::Target_selector): Initialize set_target_once_
8979 field. Don't initialize lock_ and initialize_lock_ fields.
8980 (Target_selector::instantiate_target): Rewrite.
8981 (Target_selector::set_target): New function.
8982 * target-select.h (class Set_target_once): Define.
8983 (class Target_selector): Update declarations. Make
8984 Set_target_once a friend. Remove lock_ and initialize_lock_
8985 fields. Add set_target_once_ field.
8986
fa17a3f4
ILT
89872010-02-10 Ian Lance Taylor <iant@google.com>
8988
8989 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
8990 queueing any tasks.
8991 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
8992 (queue_middle_tasks): Add all blockers before queueing any tasks.
8993 (queue_final_tasks): Likewise.
8994 * token.h (Task_token::add_blockers): New function.
8995 * object.h (Input_objects::number_of_relobjs): New function.
8996
c7177d31
ILT
89972010-02-10 Ian Lance Taylor <iant@google.com>
8998
5de0e392
ILT
8999 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9000 shared, not if not position independent.
9001 * x86_64.cc (Relocate::relocate_tls): Likewise.
9002 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9003 (tls_pie_pic_test): New target.
9004 * testsuite/Makefile.in: Rebuild.
9005
c7177d31
ILT
9006 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9007 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9008 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9009 * testsuite/Makefile.in: Rebuild.
9010
684b268a
DM
90112010-02-09 David S. Miller <davem@davemloft.net>
9012
9013 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9014 R_SPARC_RELATIVE using ->add_local_relative().
9015 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9016
612a8d3d
DM
9017 * output.h (Output_data_dynamic::add_section_size): New method
9018 that takes two Output_data objects.
9019 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9020 entry param. Handle it in initializers.
9021 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9022 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9023 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9024 arg.
9025 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9026 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9027 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9028 for dynrel_includes_plt.
9029 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9030 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9031 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9032 before .rela.plt
9033 (Target_sparc::do_finalize_sections): Update to pass true for
9034 dynrel_includes_plt.
9035 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9036 output before .rela.plt
9037 (Target_powerpc::do_finalize_sections): Update to pass true for
9038 dynrel_includes_plt when 32-bit.
9039
cb1be87e
DK
90402010-02-08 Doug Kwan <dougkwan@google.com>
9041
9042 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9043 method.
9044 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9045 Arm_relobj::scan_section_for_cortex_a8_stubs,
9046 Arm_relobj::do_relocation_section): Instead of calling
9047 Output_section::output_address, use faster
9048 Arm_relobj::simple_input_section_output_address.
9049
705b5121
DM
90502010-02-08 David S. Miller <davem@davemloft.net>
9051
9052 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9053 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9054 relocation helper function.
9055
024c4466
DM
9056 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9057 just like R_SPARC_GOT{10,13,22}.
9058 (Target_sparc::Scan::local): Likewise.
9059 (Target_sparc::Relocate:relocate): Likewise.
9060
9109c078
ILT
90612010-02-06 Ian Lance Taylor <iant@google.com>
9062
9063 * configure.ac: Rewrite targetobjs duplicate removal code to use
9064 only shell constructs.
9065 * configure: Rebuild.
9066
cf846138
DK
90672010-02-05 Doug Kwan <dougkwan@google.com>
9068
9069 PR 11247
9070 * arm.cc (Arm_relobj::section_is_scannable): New method.
9071 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9072 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9073
6cfaf60b
DK
90742010-02-04 Doug Kwan <dougkwan@google.com>
9075
9076 PR 11247
9077 * arm-reloc-property.cc (cstdio): Include.
9078 * configure.ac (targetobjs): Remove duplicates.
9079 * configure: Regenerate.
9080 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9081 big and little endian version for a given address size.
9082
5c57f1be
DK
90832010-02-03 Doug Kwan <dougkwan@google.com>
9084
9085 * arm-reloc-property.cc
9086 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9087 definition.
9088 * arm-reloc-property.h
9089 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9090 New method definition.
9091 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9092 declaration.
9093 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9094 overflow to N.
9095 (GOT_PREL): Change implemented to Y.
9096 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9097 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9098 (Arm_relocate_functions::movw_abs_nc): Remove method.
9099 (Arm_relocate_functions::movt_abs): Ditto.
9100 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9101 (Arm_relocate_functions::thm_movt_abs): Ditto.
9102 (Arm_relocate_functions::movw_rel_nc): Ditto.
9103 (Arm_relocate_functions::movw_rel): Ditto.
9104 (Arm_relocate_functions::movt_rel): Ditto.
9105 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9106 (Arm_relocate_functions:thm_movw_rel): Ditto.
9107 (Arm_relocate_functions:thm_movt_rel): Ditto.
9108 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9109 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9110 New method definitions.
9111 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9112 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9113 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9114 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9115 (Target_arm::Relocate::relocate): Check for non-static or
9116 unimplemented relocation code and exit early. Change calls to
9117 Target_arm::reloc_uses_thumb_bit and
9118 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9119 instead. Refactor code to handle similar relocations to increase
9120 code sharing. Remove check for unsupported relocation code in switch
9121 statement.
9122 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9123 relocation property table to find out size. Change error message to
9124 print out the name of a relocation code instead of the numeric value.
9125 (Target_arm::scan_reloc_for_stub): Use relocation property table
9126 instead of calling Target_arm::reloc_uses_thumb_bit().
9127
218c5831
DK
91282010-02-02 Doug Kwan <dougkwan@google.com>
9129
9130 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9131 types of relaxed input section.
9132
0d31c79d
DK
91332010-02-02 Doug Kwan <dougkwan@google.com>
9134
9135 * Makefile.am (HFILES): Add arm-reloc-property.h.
9136 (DEFFILES): New.
2e702c99
RM
9137 (TARGETSOURCES): Add arm-reloc-property.cc
9138 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9139 (libgold_a_SOURCES): $(DEFFILES)
9140 * Makefile.in: Regenerate.
9141 * arm-reloc-property.cc: New file.
9142 * arm-reloc-property.h: New file.
9143 * arm-reloc.def: New file.
9144 * arm.cc: Update comments.
9145 (arm-reloc-property.h): New included header.
9146 (arm_reloc_property_table): New global variable.
9147 (Target_arm::do_select_as_default_target): New method definition.
9148 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9149 arm-reloc-property to targ_extra_obj.
9150 * parameters.cc (set_parameters_target): Call
9151 Target::select_as_default_target().
9152 * target.h (Target::select_as_default_target): New method definition.
9153 (Target::do_select_as_default_target): Same.
9154
546c7457
DK
91552010-02-01 Doug Kwan <dougkwan@google.com>
9156
9157 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9158 first_output_text_section_.
9159 (Arm_exidx_fixup::first_output_text_section): New method definition.
9160 (Arm_exidx_fixup::first_output_text_section_): New data member.
9161 (Arm_exidx_fixup::process_exidx_section): Record the first text
9162 output section seen.
9163 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9164 and entsize in output section header.
9165
11b861d5
DK
91662010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9167
9168 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9169 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9170 (Arm_relocate_functions::thm_alu11): New Method.
9171 (Arm_relocate_functions::thm_pc8): New Method.
9172 (Arm_relocate_functions::thm_pc12): New Method.
9173 (Target_arm::Scan::local): Handle the relocations.
9174 (Target_arm::Scan::global): Likewise.
9175 (Target_arm::Relocate::relocate): Likewise.
9176 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9177
c9a2c125
DK
91782010-01-29 Doug Kwan <dougkwan@google.com>
9179
9180 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9181 of relocation types as ld.
9182
1521477a
DK
91832010-01-29 Doug Kwan <dougkwan@google.com>
9184
9185 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9186 to public.
9187 (Arm_relocate_functions::thumb_branch_common): Ditto.
9188 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9189 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9190 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9191 Arm_relocate_functions::jump24): Remove.
9192 (Target_arm::Relocate::relocate): Adjust code to call
9193 Arm_relocation_functions::arm_branch_common and
9194 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9195 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9196
e7eca48c
DK
91972010-01-29 Doug Kwan <dougkwan@google.com>
9198
9199 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9200 output_local_symbol_count_needs_update_.
9201 (Arm_relobj::output_local_symbol_count_needs_update,
9202 Arm_relobj::set_output_local_symbol_count_needs_update,
9203 Arm_relobj::update_output_local_symbol_count): New methods.
9204 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9205 member.
9206 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9207 of pointed function as in a R_ARM_PREL31 relocation.
9208 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9209 for output local symbol count updating.
9210 (Target_arm::do_relax): Update output local symbol counts in objects
9211 if necessary.
9212 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9213
02961d7e
ILT
92142010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9215
9216 * arm.cc: Added support for the ARM relocations:
9217 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9218 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9219 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9220 movw_prel_nc).
9221 (Arm_relocate_functions::movw_rel): New method.
9222 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9223 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9224 thm_movw_prel_nc).
9225 (Arm_relocate_functions::thm_movw_rel): New method.
9226 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9227 thm_movt_prel).
9228 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9229 relocations.
9230 (Target_arm::Scan::global): Likewise.
9231 (Target_arm::Relocate::relocate): Likewise.
9232 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9233 Likewise.
9234
b10d2873
ILT
92352010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9236
9237 * arm.cc: Added support for ARM group relocations.
9238 (Target_arm::reloc_needs_sym_origin): New method.
9239 (Arm_relocate_functions::calc_grp_kn): New method.
9240 (Arm_relocate_functions::calc_grp_residual): New method.
9241 (Arm_relocate_functions::calc_grp_gn): New method.
9242 (Arm_relocate_functions::arm_grp_alu): New Method.
9243 (Arm_relocate_functions::arm_grp_ldr): New Method.
9244 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9245 (Arm_relocate_functions::arm_grp_ldc): New Method.
9246 (Target_arm::Scan::local): Handle the ARM group relocations.
9247 (Target_arm::Scan::global): Likewise.
9248 (Target_arm::Relocate::relocate): Likewise.
9249 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9250 Likewise.
9251
2b328d4e
DK
92522010-01-26 Doug Kwan <dougkwan@google.com>
9253
9254 * arm.cc (set): Include.
9255 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9256 pointer type.
2e702c99 9257 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9258 (Arm_output_section::append_text_sections_to_list): New method.
9259 (Arm_output_section::fix_exidx_coverage): Ditto.
9260 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9261 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9262 Relobj::set_section_offset() instead of
9263 Sized_relobj::invalidate_section_offset().
2e702c99 9264 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9265 parameter for section headers. Ignore relocation sections for
9266 unallocated sections and EXIDX sections.
9267 (Target_arm::fix_exidx_coverage): New method.
9268 (Target_arm::output_section_address_less_than): New type.
9269 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9270 linked text section instead of the EXIDX section.
9271 (Arm_output_section::create_stub_group): Add an assertion to check
9272 that this is not an EXIDX output section.
9273 (Arm_output_section::append_text_sections_to_list): New method.
9274 (Arm_output_section::fix_exidx_coverage): Ditto.
9275 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9276 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9277 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9278 first pass.
9279 (Target_arm::fix_exidx_coverage): New method.
9280 * object.h (Relobj::set_output_section): New method.
9281 (Sized_relobj::invalidate_section_offset): Remove method.
9282 (Sized_relobj::do_invalidate_section_offset): Remove method.
9283 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9284
c7f3c371
DK
92852010-01-25 Doug Kwan <dougkwan@google.com>
9286
9287 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9288 Fix warning due to signed and unsigned comparison on a 32-bit host.
9289
8923b24c
DK
92902010-01-22 Doug Kwan <dougkwan@google.com>
9291
9292 * arm.cc (Target_arm::do_relax): Record an output section for section
9293 offset adjustment it contains any stub table that has changed.
9294 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9295 offsets in an output section if necessary.
9296 * output.cc (Output_section::Output_section): Initialize
9297 section_offsets_need_adjustments_.
9298 (Output_section::add_input_section_for_script): Renamed to
9299 Output_section::add_simple_input_section.
9300 (Output_section::save_states): Add a comment.
9301 (Output_section::discard_states): New method defintion.
9302 (Output_section::adjust_section_offsets): Same.
9303 * output.h (Output_section::add_input_section_for_script): Renamed to
9304 Output_section::add_simple_input_section.
9305 (Output_section::discard_states): New method declaration.
9306 (Output_section::adjust_section_offsets): Same.
9307 (Output_section::section_offsets_need_adjustment,
9308 Output_section::set_section_offsets_need_adjustment): New method
9309 definitions.
9310 (Output_section::section_offsets_need_adjustment_): New data member.
9311 * script-sections.cc
9312 (Output_section_element_input::set_section_address): Adjust code for
9313 renaming of Output_section::add_input_section_for_script.
9314 (Orphan_output_section::set_section_address): Same.
9315
9b2fd367
DK
93162010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9317
9318 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9319 Fix_v4bx enum values .
9320 * gold/options.h (General_options): New option definitions.
9321 (General_options::fix_v4bx): New method.
9322 (General_options::Fix_v4bx): New enum.
9323 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9324 (General_options::parse_fix_v4bx_interworking): New method.
9325
80d0d023
DK
93262010-01-22 Doug Kwan <dougkwan@google.com>
9327
9328 * arm.cc (Arm_exidx_fixup): New class.
9329
af2cdeae
DK
93302010-01-21 Doug Kwan <dougkwan@google.com>
9331
9332 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9333 classes.
9334 (Arm_exidx_section_offset_map): New type.
9335
993d07c1
DK
93362010-01-21 Doug Kwan <dougkwan@google.com>
9337
9338 * arm.cc (Arm_exidx_input_section): New class.
9339 (Arm_relobj::exidx_input_section_by_link,
9340 Arm_relobj::exidx_input_section_by_shndx,
9341 Arm_relobj::make_exidx_input_section): New methods.
9342 (read_arm_attributes_section): Remove.
9343 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9344 information about them.
9345 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9346 to here.
9347
5ac169d4
DK
93482010-01-20 Doug Kwan <dougkwan@google.com>
9349
9350 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9351 Input_section_specifier to Section_id.
9352 (Target_arm::new_arm_input_section: Adjust code for change of key
9353 type.
9354 (Target_arm::find_arm_input_section): Ditto.
9355 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9356 (Section_id): Remove.
9357 (Garbage_collection::Section_id_hash): Remove.
9358 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9359 (Section_id): Remove.
9360 (Icf::Section_id_hash): Remove.
9361 * object.h (Section_id, Const_section_id, Section_id_hash,
9362 Const_section_id_hash): New type definitions.
9363 * output.cc (Output_section::add_relaxed_input_section): Change to
9364 use Const_section_id instead of Input_section_specifier as key type.
9365 (Output_section::add_merge_input_section): Ditto.
9366 (Output_section::build_relaxation_map): Change to use Section_id
9367 instead of Input_section_specifier as key type.
2e702c99 9368 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9369 Ditto.
9370 (Output_section::convert_input_sections_to_relaxed_sections): Change
9371 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9372 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9373 (Output_section::find_relaxed_input_section): Ditto.
9374 * output.h (Input_section_specifier): Remove class.
9375 (Output_section::Output_section_data_by_input_section_map): Change
9376 key type to Const_section_id.
9377 (Output_section::Output_relaxed_input_section_by_input_section_map):
9378 Ditto.
9379 (Output_section::Relaxation_map): Change key type to Section_id.
9380
a2162063
ILT
93812010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9382
9383 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9384 (class Arm_v4bx_stub): New class.
9385 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9386 (Stub_factory::make_arm_v4bx_stub): New method.
9387 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9388 (Stub_table::empty): Handle v4bx stubs.
9389 (Stub_table::add_arm_v4bx_stub): New method.
9390 (Stub_table::find_arm_v4bx_stub): New method.
9391 (Arm_relocate_functions::v4bx): New method.
9392 (Target_arm::fix_v4bx): New method.
9393 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9394 (Stub_table::relocate_stubs): Likewise.
9395 (Stub_table::do_write): Likewise.
9396 (Stub_table::update_data_size_and_addralign): Likewise.
9397 (Stub_table::finalize_stubs): Likewise.
9398 (Target_arm::Scan::local): Likewise.
9399 (Target_arm::Scan::global): Likewise.
9400 (Target_arm::do_finalize_sections): Likewise.
9401 (Target_arm::Relocate::relocate): Likewise.
9402 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9403 Likewise.
9404 (Target_arm::scan_reloc_for_stub): Likewise.
9405 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9406
5696ab0b
ILT
94072010-01-19 Ian Lance Taylor <iant@google.com>
9408
9409 * output.cc (Output_section_headers::do_sized_write): Write large
9410 segment count to sh_info field.
9411 (Output_file_header::do_sized_write): For large segment count,
9412 write PN_XNUM to e_phnum field.
9413
800d0f56
ILT
94142010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9415
9416 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9417 (Arm_relocate_functions::thm_jump8): New function.
9418 (Arm_relocate_functions::thm_jump11): New function.
9419 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9420 R_ARM_THM_JUMP11.
9421 (Target_arm::Scan::global): Likewise.
9422 (Target_arm::Relocate::relocate): Likewise.
9423 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9424 Likewise.
9425
41263c05
DK
94262010-01-14 Doug Kwan <dougkwan@google.com>
9427
9428 * arm.cc (map, utility): Include headers.
9429 (Target_arm::apply_cortex_a8_workaround): New method.
9430 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9431 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9432 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9433 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9434 the --[no-]fix-cortex-a8 command line options.
9435 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9436 (Target_arm::relocate_stub): Use addend in instruction template.
9437 * options.h (DEFINE_bool): Set the user-set flag.
9438 (General_options): Add --[no-]-fix-cortex options.
9439 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 9440 : Update fast look-up map after conversion.
41263c05 9441
459e9b03
ST
94422010-01-14 Sriraman Tallam <tmsriram@google.com>
9443
9444 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9445 in the first pass of do_layout.
9446
b521dfe4
DK
94472010-01-13 Doug Kwan <dougkwan@google.com>
9448
9449 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9450 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9451 apparent compiler problem of not folding static constant integral
9452 data members of elfcpp::Elf_sizes<32>.
9453
44272192
DK
94542010-01-13 Doug Kwan <dougkwan@google.com>
9455
9456 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9457 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9458 Arm_relobj::scan_section_for_cortex_a8_erratum,
9459 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9460 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9461 sections to scan for relocation stubs into a new method
9462 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9463 relocation and Cortex-A8 stub scanning.
9464 (Target_arm::do_relax): Force stubs to be after stubbed sections
9465 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 9466 the beginning of a new relaxation pass. Update a comment.
44272192
DK
9467 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9468
44b71ece
ILT
94692010-01-12 Ian Lance Taylor <iant@google.com>
9470
9471 * target-reloc.h (visibility_error): New inline function.
9472 (relocate_section): Call visibility_error.
9473 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9474 (MOSTLYCLEANFILES): Likewise.
9475 (protected_4_pic.o, protected_3.err): New targets.
9476 * testsuite/protected_4.cc: New file.
9477
a120bc7f
DK
94782010-01-12 Doug Kwan <dougkwan@google.com>
9479
9480 * arm.cc (Cortex_a8_reloc): New class.
9481 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9482 and cortex_a8_relocs_info_.
9483 (Target_arm::fix_cortex_a8): New method definition.
9484 (Target_arm::Cortex_a8_relocs_info): New type.
9485 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9486 New data member declarations.
9487 (Target_arm::scan_reloc_for_stub): Record information about
9488 relocations for THUMB branches that might be exempted from the
9489 Cortex-A8 workaround.
9490 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9491 at the beginning of a relaxation pass.
9492
20138696
DK
94932010-01-12 Doug Kwan <dougkwan@google.com>
9494
9495 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9496 (Arm_relobj::Mapping_symbol_position,
9497 Arm_reloj::Mapping_symbol_position_less,
9498 Arm_relobj::Mapping_symbols_info): New types.
9499 (Target_arm::is_mapping_symbol_name): New method definition.
9500 (Arm_relobj::do_count_local_symbols): Save information about mapping
9501 symbols.
9502
089d69dc
DK
95032010-01-11 Doug Kwan <dougkwan@google.com>
9504
9505 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9506 Arm_relocate_functions::thumb32_branch_upper,
9507 Arm_relocate_functions::thumb32_branch_lower,
9508 Arm_relocate_functions::thumb32_cond_branch_offset,
9509 Arm_relocate_functions::thumb32_cond_branch_upper,
9510 Arm_relocate_functions::thumb32_cond_branch_lower,
9511 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9512 branch offset encoding.
9513 (Arm_relocate_functions::thumb_branch_common): Use new branch
9514 offset encoding methods to avoid code duplication.
9515 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9516 (Stub_addend_reader::operator()): Use new branch encoding method
9517 to avoid code duplication.
9518
99e5bff2
DK
95192010-01-11 Doug Kwan <dougkwan@google.com>
9520
9521 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9522 (Target_arm::do_finalize_sections): Define special EXIDX section
9523 symbols only if referenced.
9524 * gc.h (Garbage_collection::add_reference): New method.
9525 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9526 code duplication.
9527
98e090bd
ILT
95282010-01-11 Ian Lance Taylor <iant@google.com>
9529
d0a91bd8
ILT
9530 * script.cc (Version_script_info::build_expression_list_lookup):
9531 Change complaing about duplicate wildcard match from error to
9532 warning.
9533
98e090bd
ILT
9534 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9535 of 2009-12-30.
9536 (Version_script_info::Version_script_info): Initialize globs_,
9537 default_version_, default_is_global_, and exact_. Don't
9538 initialize globals_ or locals_.
9539 (Version_script_info::build_lookup_tables): Build local symbols
9540 first.
9541 (Version_script_info::unquote): New function.
9542 (Version_script_info::add_exact_match): New function.
9543 (Version_script_info::build_expression_list_lookup): Remove lookup
9544 parameter. Add is_global parameter. Change all callers. Handle
9545 wildcard pattern specially. Unquote pattern. Call
9546 add_exact_match.
9547 (Version_script_info::get_name_to_match): New function.
9548 (Version_script_info::get_symbol_version): New function.
9549 (Version_script_info::get_symbol_version_helper): Remove.
9550 (Version_script_info::check_unmatched_names): Call unquote.
9551 * script.h (class Version_script_info): Change get_symbol_version
9552 to be non-inline and add is_global parameter; change all callers.
9553 Rewrite symbol_is_local. Update declarations. Define struct
9554 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9555 Remove globals_ and locals_ members. Add exact_, globs_,
9556 default_version_, is_global_.
9557 (Version_script_info::Glob): Remove pattern, add expression and
9558 is_global. Update constructor. Change all callers.
9559 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9560 default version.
9561 (Versions::symbol_section_contents): If a symbol is undefined, or
9562 defined in a dynamic object, set the version index to
9563 VER_NDX_LOCAL.
9564 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9565 symbol_is_local.
9566 (Symbol_table::add_from_pluginobj): Likewise.
9567 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9568
d56962d3
DK
95692010-01-11 Doug Kwan <dougkwan@google.com>
9570
9571 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9572 (incremental_dump_LDADD): Add linking option for libintl.
9573 * Makefile.in: Regenerate.
9574
94e6ee91
L
95752010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9576
9577 PR gold/11144
9578 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9579 instead of -Ds.
9580 * testsuite/Makefile.in: Regenerated.
9581
e96c574b
DK
95822010-01-10 Doug Kwan <dougkwan@google.com>
9583
9584 * options.h (DEFINE_var): Use parentheses around argument varname__
9585 in macro body to avoid any unintended subsequent substitutions.
9586
7198066b
ILT
95872010-01-10 Ian Lance Taylor <iant@google.com>
9588
ba4d53bf
ILT
9589 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9590 candidates before doing symbol resolution.
9591
7198066b
ILT
9592 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9593 ODR candidates if only one is weak.
9594
a2beed37
ILT
95952010-01-08 Ian Lance Taylor <iant@google.com>
9596
9597 * script.cc (Version_script_info::build_expression_list_lookup):
9598 Don't warn about ambiguous version, just record the ambiguity.
9599 (Version_script_info::get_symbol_version_helper): Give error if
9600 version is ambiguous.
9601
2fb7225c
DK
96022010-01-08 Doug Kwan <dougkwan@google.com>
9603
9604 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
9605 prev_data_size_ and prev_addralign_. Remove initializer for
9606 deleted data member has_been_changed_.
9607 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9608 to determine if the table is empty.
9609 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9610 Remove.
9611 (Stub_table::add_reloc_stub): Define method in class definition
9612 instead of just declaring it there.
9613 (Stub_table::add_cortex_a8_stub): New method definition.
9614 (Stub_table::update_data_size_and_addralign): Ditto.
9615 (Stub_table::finalize_stubs): Ditto.
9616 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9617 (Stub_table::do_addralign_): Return address alignment in the
9618 (Stub_table::do_reset_address_and_file_offset): Define method in
9619 class definition instead of declaring it there. Set current data
9620 size to be the data size of the previous pass.
9621 (Stub_table::set_final_data_size): Use current data size as the
9622 final data size.
9623 (Stub_table::relocate_stub): Change parameter type of stub from
9624 Reloc_stub pointer to Stub pointer.
9625 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9626 (Stub_table::Cortex_a8_stub_list): New typedef.
9627 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9628 Stub_table::prev_addralign_): New data member.
9629 (Arm_relobj::Arm_relobj): Initialize data member
9630 section_has_cortex_a8_workaround_.
9631 (Arm_relobj::section_has_cortex_a8_workaround,
9632 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9633 definitions.
9634 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9635 declarations.
9636 (Target_arm::relocate_stub): Change parameter type of stub from
9637 Reloc_stub pointer to Stub pointer.
9638 (Insn_template::size, Insn_template::alignment): Handle
9639 THUMB16_SPECIAL_TYPE.
9640 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9641 Stub_table::update_data_size_and_addralign,
9642 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
9643 definitions.
9644 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
9645 (Stub_table::do_write): Ditto.
9646 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 9647
880cd20d
ILT
96482010-01-08 Ian Lance Taylor <iant@google.com>
9649
9650 PR 11108
9651 * symtab.h (class Symbol): Remove fields is_target_special_ and
9652 has_plt_offset_. Add field is_defined_in_discarded_section_.
9653 (Symbol::is_defined_in_discarded_section): New function.
9654 (Symbol::set_is_defined_in_discarded_section): New function.
9655 (Symbol::has_plt_offset): Rewrite.
9656 (Symbol::set_plt_offset): Verify that new offset is not -1U.
9657 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
9658 Don't initialize is_target_special_ or has_plt_offset_.
9659 Initialize is_defined_in_discarded_section_.
9660 (Symbol_table::add_from_relobj): If appropriate, set
9661 is_defined_in_discarded_section.
9662 * resolve.cc (Symbol::override_base_with_special): Don't test
9663 is_target_special_. Change has_plt_offset_ to has_plt_offset().
9664 * target-reloc.h (relocate_section): Do special handling for
9665 symbols defined in discarded sections for global symbols as well
9666 as local symbols.
9667
2703e3eb
ILT
96682010-01-08 Ian Lance Taylor <iant@google.com>
9669
9670 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
9671 the SHT_SYMTAB case.
9672
339d40a3
ILT
96732010-01-08 Ian Lance Taylor <iant@google.com>
9674
9675 * object.cc (Sized_relobj::do_layout): Don't get confused if
9676 layout_eh_frame returns NULL.
9677
abecea76
ILT
96782010-01-08 Ian Lance Taylor <iant@google.com>
9679
9680 PR 11084
9681 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
9682 dynamic symbol table, use the normal symbol table.
9683 (Sized_dynobj::do_read_symbols): Remove assertion about type of
9684 symbol table.
9685
6b7dd3f3
ILT
96862010-01-08 Ian Lance Taylor <iant@google.com>
9687
9688 PR 11072
9689 * layout.cc (Layout::include_section): Remove .gnu_debuglink
9690 sections.
9691
36c50e63
L
96922010-01-08 H.J. Lu <hongjiu.lu@intel.com>
9693
9694 * version.cc (print_version): Change to "Copyright 2010".
9695
e291e7b9
ILT
96962010-01-08 Ian Lance Taylor <iant@google.com>
9697
9698 PR 10287
9699 PR 11063
9700 * i386.cc (class Target_i386): Change return type of plt_section
9701 to be non-const.
9702 (class Output_data_plt_i386): Add tls_desc_rel_ field.
9703 (Output_data_plt_i386::Output_data_plt_i386): Initialize
9704 tls_desc_rel_ field.
9705 (Output_data_plt_i386::rel_tls_desc): New function.
9706 (Target_i386::rel_tls_desc_section): New function.
9707 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
9708 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
9709 R_386_TLS_DESC reloc in rel_tls_desc_section.
9710 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
9711 Define struct Tlsdesc_info.
9712 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
9713 (Target_x86_64::do_reloc_symbol_index): New function.
9714 (Target_x86_64::add_tlsdesc_info): New function.
9715 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
9716 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
9717 tlsdesc_rel_ field.
9718 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
9719 all callers.
9720 (Output_data_plt_x86_64::rela_tlsdesc): New function.
9721 (Target_x86_64::rela_tlsdesc_section): New function.
9722 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
9723 handling.
9724 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
9725 (Target_x86_64::do_reloc_addend): New function.
9726 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
9727 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
9728 declarations. Define TARGET_CODE. Add arg field to u1_ union.
9729 (Output_reloc::type): New function.
9730 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
9731 (Output_reloc::is_target_specific): New function.
9732 (Output_reloc::target_arg): New function.
9733 (class Output_reloc) [SHT_RELA]: Add four new constructors for
9734 absolute relocs and target specific relocs.
9735 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
9736 add_target_specific.
9737 (class Output_data_reloc) [SHT_RELA]: Likewise.
9738 * output.cc (Output_reloc::Output_reloc): Add four new versions
9739 for absolute relocs and target specific relocs.
9740 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
9741 (Output_reloc::get_symbol_index): Likewise.
9742 (Output_reloc::local_section_offset): Check that local_sym_index_
9743 is not TARGET_CODE or 0.
9744 (Output_reloc::symbol_value): Likewise.
9745 (Output_reloc::write) [SHT_RELA]: Call target for target specific
9746 reloc.
9747 * target.h (class Target): Add reloc_symbol_index and reloc_addend
9748 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
9749 functions.
9750 * layout.cc (add_target_dynamic_tags): Use output section for
9751 DT_PLTRELSZ and DT_JMPREL.
9752
3a44184e
ILT
97532010-01-07 Ian Lance Taylor <iant@google.com>
9754
9755 PR 11061
9756 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
9757 function.
9758 (class Output_data_reloc_generic): Define.
9759 (class Output_data_reloc_base): Change base class to
9760 Output_data_reloc_generic. Change add() method to call
9761 bump_relative_reloc_count for a relative reloc. Remove
9762 sort_relocs_ field.
9763 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
9764 to sort_relocs().
9765 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
9766 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
9767 appropriate.
9768 * layout.h (class Layout): Update declaration.
9769
ea715a34
ILT
97702010-01-07 Ian Lance Taylor <iant@google.com>
9771
9772 * output.h (class Output_data): Add const version of
9773 output_section and do_output_section.
9774 (class Output_section_data): Add const version of
9775 do_output_section.
9776 (class Output_section): Likewise.
9777 * layout.cc (Layout::add_target_dynamic_tags): New function.
9778 * layout.h (class Layout): Update declarations.
9779 * arm.cc (Target_arm::do_finalize_sections): Use
9780 add_target_dynamic_tags.
9781 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9782 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9783 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9784 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9785
659948a4
ILT
97862010-01-07 Ian Lance Taylor <iant@google.com>
9787
9788 PR 11042
9789 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
9790 object as needed.
9791
9d3b86f6
ILT
97922010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
9793 Ian Lance Taylor <iant@google.com>
9794
9795 PR 11019
9796 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
9797 Xindex::read_symtab_xindex.
9798
bb0d3eb0
DK
97992010-01-07 Doug Kwan <dougkwan@google.com>
9800
9801 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
9802 (Insn_template::thumb16_bcond_insn): New method declaration.
9803 (Insn_template): Fix spelling.
9804 (Stub::thumb16_special): New method declaration.
9805 (Stub::do_write): Define virtual method which was previously pure
9806 virtual.
9807 (Stub::do_thumb16_special): New method declaration.
9808 (Stub::do_fixed_endian_write): New template member.
9809 (Reloc_stub::do_write): Remove.
9810 (Reloc_stub::do_fixed_endian_write): Remove.
9811 (Cortex_a8_stub): New class definition.
9812 (Stub_factory::make_cortex_a8_stub): New method definition.
9813 (Stub_factory::Stub_factory): Add missing static storage class
9814 qualifier for elf32_arm_stub_a8_veneer_blx.
9815
ffeef7df
ILT
98162010-01-07 Ian Lance Taylor <iant@google.com>
9817
dc3f80fe
ILT
9818 PR 10980
9819 * options.h (class General_options): Add --warn-unresolved-symbols
9820 and --error-unresolved-symbols.
9821 * errors.cc (Errors::undefined_symbol): Implement
9822 --warn-unresolved-symbols.
9823
ffeef7df
ILT
9824 * options.h (class General_options): Add -z text and -z textoff.
9825 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
9826
f1ec9ded
ST
98272010-01-06 Sriraman Tallam <tmsriram@google.com>
9828
9829 * gc.h (Garbage_collection::Cident_section_map): New typedef.
9830 (Garbage_collection::cident_sections): New function.
9831 (Garbage_collection::add_cident_section): New function.
9832 (Garbage_collection::cident_sections_): New member.
9833 (gc_process_relocs): Add references to sections whose names are C
9834 identifiers.
9835 * gold.h (cident_section_start_prefix): New constant.
9836 (cident_section_stop_prefix): New constant.
9837 (is_cident): New function.
9838 * layout.cc (Layout::define_section_symbols): Replace string constants
9839 with the newly defined constants.
9840 * object.cc (Sized_relobj::do_layout): Track sections whose names are
9841 C identifiers.
9842 * testsuite/Makefile.am: Add gc_orphan_section_test.
9843 * testsuite/Makefile.in: Regenerate.
9844 * testsuite/gc_orphan_section_test.cc: New file.
9845 * testsuite/gc_orphan_section_test.sh: New file.
9846
6eda8c29
ILT
98472010-01-06 Ian Lance Taylor <iant@google.com>
9848
b9674e17
ILT
9849 PR 10980
9850 * options.h (class General_options): Add --warn-shared-textrel.
9851 * layout.cc (Layout::finish_dynamic_section): Implement
9852 --warn-shared-textrel.
9853
6eda8c29
ILT
9854 PR 10980
9855 * options.h (class General_options): Add --warn-multiple-gp.
9856
32dcd44e
ILT
98572010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9858
9859 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9860 $(THREADSLIB) and $(LIBDL).
9861 * Makefile.in: Rebuild.
9862
a192ba05
ILT
98632010-01-06 Ian Lance Taylor <iant@google.com>
9864
9865 PR 10980
9866 * options.cc (General_options::parse_section_start): New function.
9867 (General_options::section_start): New function.
9868 (General_options::General_options): Initialize all members.
9869 * options.h: Include <map>
9870 (class General_options): Add --section-start. Add section_starts_
9871 member.
9872 * layout.cc (Layout::attach_allocated_section_to_segment): If
9873 --section-start was used, set the address of the segment. Remove
9874 local sort_sections.
9875 (Layout::relaxation_loop_body): If the address of the load segment
9876 has been set by --section-start, don't use it.
9877 * output.h (Output_segment::update_flags_for_output_section): New
9878 function.
9879 * output.cc (Output_segment::add_output_section): Call
9880 update_flags_for_output_section.
9881
dde3f402
ILT
98822010-01-05 Ian Lance Taylor <iant@google.com>
9883
62dfdd4d
ILT
9884 PR 10980
9885 * options.h (class General_options): Add --undefined-version.
9886 * script.cc (struct Version_expression): Add was_matched_by_symbol
9887 field.
9888 (Version_script_info::matched_symbol): New function.
9889 (Version_script_info::get_symbol_version_helper): Call
9890 matched_symbol.
9891 (Version_script_info::check_unmatched_names): New function.
9892 * script.h (class Version_script_info): Update declarations.
9893 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
9894
9c4ae156
ILT
9895 * options.h (class General_options): Use DEFINE_bool_alias for
9896 allow_multiple_definition.
9897 * resolve.cc (Symbol_table::should_override): Don't test
9898 allow_multiple_definition.
9899
dde3f402
ILT
9900 PR 10980
9901 * options.h (class General_options): Add --cref.
9902 * main.cc (main): Print cref table if --cref. Don't close mapfile
9903 until after printing cref table.
9904 * cref.cc: Include "symtab.h".
9905 (class Cref_inputs): Define Cref_table_compare and Cref_table.
9906 (Cref_table_compare::operator()): New function.
9907 (Cref_inputs::gather_cref): New function.
9908 (filecol): New static const.
9909 (Cref_inputs::print_cref): New function.
9910 (Cref::print_cref): New function.
9911 * cref.h: Include <cstdio>.
9912 (class Cref): Update declarations.
9913 * mapfile.h (Mapfile::file): New function.
9914 * object.h (class Object): Define Symbols. Declare virtual
9915 do_get_global_symbols.
9916 (Object::get_global_symbols): New function.
9917 * object.cc (Input_objects::add_object): Pass object to cref_ if
9918 --cref.
9919 (Input_objects::archive_start): Likewise.
9920 (Input_objects::archive_stop): Likewise.
9921 (Input_objects::print_cref): New function.
9922 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
9923 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
9924 --cref.
9925 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
9926 function.
9927 * plugin.h (class Sized_pluginobj): Update declarations.
9928
8781f709
ILT
99292010-01-05 Ian Lance Taylor <iant@google.com>
9930
9931 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
9932 to is_default_version. Rename insdef to insdefault.
9933 (Symbol_table::add_from_relobj): Rename def to is_default_version
9934 and local to is_forced_local.
9935 (Symbol_table::add_from_pluginobj): Likewise.
9936 (Symbol_table::add_from_dynobj): Likewise.
9937 (Symbol_table::define_special_symbol): Rename insdef to
9938 insdefault.
9939
fe35d28d
ILT
99402010-01-04 Ian Lance Taylor <iant@google.com>
9941
30bc8c46
ILT
9942 PR 10980
9943 * options.h (class General_options): Add
9944 --allow-multiple-definition and -z muldefs.
9945 * resolve.cc (Symbol_table::should_override): Don't warn about a
9946 multiple symbol definition if --allow-multiple-definition or -z
9947 muldefs.
9948
7eaea549
ILT
9949 PR 10980
9950 * options.h (class General_options): Add --add-needed and
9951 --copy-dt-needed-entries. Tweak --as-needed help entry.
9952 * object.cc (Input_objects::check_dynamic_dependencies): Give an
9953 error if --copy-dt-needed-entries aka --add-needed is used and
9954 would cause a change in behaviour.
9955
fe35d28d
ILT
9956 PR 10980
9957 * options.h (class General_options): Add -G as a short version of
9958 --shared. Add no-op options -assert, -g, and -i.
9959
55a2bb35
ST
99602010-01-04 Sriraman Tallam <tmsriram@google.com>
9961
9962 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
9963 check for .text or .gnu.linkonce.t sections.
9964 * icf.cc (Icf::find_identical_sections): Ditto.
9965 Change the detection for mangled function name within the section
9966 name.
9967 * icf.h (is_section_foldable_candidate): New function.
9968
719328e1
ILT
99692009-12-30 Ian Lance Taylor <iant@google.com>
9970
9971 PR 10980
9972 * options.h (class General_options): Permit two dashes with
9973 --retain-symbols-file.
9974
d7bb5745
ILT
99752009-12-30 Ian Lance Taylor <iant@google.com>
9976
403a15dd
ILT
9977 PR 10979
9978 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
9979 don't put the file header and segment headers in the text
9980 segment.
9981
eda294df
ILT
9982 PR 10979
9983 * common.cc (Sort_commons::operator()): Stabilize sort when both
9984 entries are NULL.
9985 (Symbol_table::do_allocate_commons_list): When allocating common
9986 symbols, skip a symbol which is no longer common.
9987 * symtab.h (Symbol::is_common): Test whether the symbol comes from
9988 an object before checking its type.
9989 * testsuite/common_test_2.c: New file.
9990 * testsuite/common_test_3.c: New file.
9991 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
9992 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
9993 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
9994 (common_test_2_pic.o, common_test_2.so): New targets.
9995 (common_test_3_pic.o, common_test_3.so): New targets.
9996 * testsuite/Makefile.in: Rebuild.
9997
d7bb5745
ILT
9998 PR 10979
9999 * script.cc (read_input_script): If we see a new SECTIONS clause,
10000 and we have added an input section, give an error.
10001 * layout.h (class Layout): Add have_added_input_section function.
10002 Add have_added_input_section_ field.
10003 * layout.cc (Layout::Layout): Initialize
10004 have_added_input_section_.
10005 (Layout::layout): Set have_added_input_section_.
10006 (Layout::layout_eh_frame): Likewise.
10007
fc59c572
ILT
100082009-12-30 Ian Lance Taylor <iant@google.com>
10009
10010 PR 10931
10011 * options.h (class General_options): Add --sort-common option.
10012 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10013 * common.cc (Sort_common): Add sort_order parameter to
10014 constructor. Add sort_order_ field.
10015 (Sort_commons::operator): Check sort_order_.
10016 (Symbol_table::allocate_commons): Determine the sort order.
10017 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10018 Change all callers.
10019 (Symbol_table::do_allocate_commons_list): Likewise.
10020
1c74fab0
ILT
100212009-12-30 Ian Lance Taylor <iant@google.com>
10022
10023 PR 10916
10024 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10025 symbols from this object, don't change the visibility of an
10026 undefined symbol.
10027 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10028
6affe781
ILT
100292009-12-30 Ian Lance Taylor <iant@google.com>
10030
10031 PR 10861
10032 * script.h (class Version_script_info): Define Language enum.
10033 Update declarations. Define Glob, Exact, and Lookup types. Add
10034 new fields globals_, locals_, and is_finalized_.
10035 * script.cc: Various formatting fixes.
10036 (class Parser_closure): Change language_stack_ from a vector of
10037 std::string to one of Version_script_info::Language. Adjust all
10038 uses accordingly.
10039 (class Lazy_demangler): Remove.
10040 (struct Version_expression): Change language from std::string to
10041 Version_script_info::Language.
10042 (Version_script_info::Version_script_info): New function.
10043 (Version_script_info::~Version_script_info): Don't call clear.
10044 (Version_script_info::finalize): New function.
10045 (Version_script_info::build_lookup_tables): New function.
10046 (Version_script_info::build_expression_list_lookup): New
10047 function.
10048 (Version_script_info::get_symbol_version_helper): Rewrite to use
10049 lookup tables.
10050 (Version_script_info::print_expression_list): Adjust to use
10051 Version_script_info::Language.
10052 (script_push_lex_into_version_mode): Check that the version script
10053 has not been finalized.
10054 (version_script_push_lang): Change language string to
10055 Version_script_info::Language.
10056 * options.cc (Command_line::version_script): New function.
10057 * options.h (class General_options): Add finalize_dynamic_list
10058 function. Change version_script from declaration to definition.
10059 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10060 * testsuite/version_script.map: Remove duplicate def of foo.
10061 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10062 version_script.map.
10063 * testsuite/Makefile.in: Rebuild.
10064
818bf354
ILT
100652009-12-30 Ian Lance Taylor <iant@google.com>
10066
10067 PR 10843
10068 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10069 if the input symbol index is 0, make the output symbol index 0.
10070
ebcc8304
ILT
100712009-12-30 Ian Lance Taylor <iant@google.com>
10072
10073 PR 10670
10074 * options.h (class General_options): Add -x/--discard-all.
10075 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10076 --discard-all. If the local symbol needs a dynamic entry, check
10077 that before handling --discard-locals.
10078
176fe33f
ILT
100792009-12-30 Ian Lance Taylor <iant@google.com>
10080
bb321bb1
ILT
10081 PR 10450
10082 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10083 flags to PF_R.
10084 (Output_segment::add_output_section): Don't change the flags if
10085 the type is PT_TLS.
10086
176fe33f
ILT
10087 PR 10450
10088 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10089 GNU hash table if they need a dynamic value. Otherwise, don't add
10090 them if they are defined in a dynamic object or are forced local.
10091
e8cd95c7
ILT
100922009-12-29 Ian Lance Taylor <iant@google.com>
10093
1b81fb71
ILT
10094 PR 10450
10095 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10096 .gnu.hash table for a 32-bit target.
10097
8d6d383d
ILT
10098 PR 10450
10099 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10100 regular and a dynamic object only needs a dynamic symbol table
10101 entry if it is externally visible.
10102
e785ec03
ILT
10103 PR 10450
10104 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10105 constructor. Add global_offset_table_ field.
10106 (Target_i386::got_section): Set global_offset_table_.
10107 (Target_i386::do_finalize_sections): Set global_offset_table_
10108 size.
10109 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10110 in constructor. Add global_offset_table_ field.
10111 (Target_x86_64::got_section): Set global_offset_table_.
10112 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10113 size.
10114
1a2dff53
ILT
10115 * layout.cc (Layout::Layout): Initialize increase_relro_.
10116 (Layout::get_output_section): Add is_relro, is_last_relro, and
10117 is_first_non_relro parameters. Change all callers.
10118 (Layout::choose_output_section): Likewise.
10119 (Layout::add_output_section_data): Likewise.
10120 (Layout::make_output_section): Likewise.
10121 (Layout::set_segment_offsets): Clear increase_relro when using a
10122 linker script.
10123 * layout.h (class Layout): Add increase_relro method. Add
10124 increase_relro_ field. Update declarations.
10125 * output.cc (Output_section::Output_section): Initialize
10126 is_last_relro_ and is_first_non_relro_.
10127 (Output_segment::add_output_section): Group relro sections is
10128 do_sort is true. Handle is_last_relro and is_first_non_relro.
10129 (Output_segment::maximum_alignment): Remove relro handling.
10130 (Output_segment::set_section_addresses): Add increase_relro
10131 parameter. Change all callers. Add initial alignment to align
10132 relro sections on separate page. Remove old relro handling.
10133 (Output_segment::set_section_list_addresses): Remove in_relro
10134 parameter. Change all callers.
10135 (Output_segment::set_offset): Add increase parameter. Change all
10136 callers. Remove old relro handling.
10137 * output.h (class Output_section): Add new methods: is_last_relro,
10138 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10139 Add is_last_relro_ and is_first_non_relro_ fields.
10140 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10141 Create separate .got.plt section. Call increase_relro.
10142 * x86_64.cc (Target_x86_64::got_section): Likewise.
10143 * testsuite/relro_script_test.t: Add .got.plt.
10144
f0ba79e2
ILT
10145 PR 10450
10146 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10147 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10148 (Layout::finalize): Call set_dynamic_symbol_size.
10149 (Layout::set_dynamic_symbol_size): New function.
10150 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10151 set_dynamic_symbol_size.
10152
e8cd95c7
ILT
10153 PR 10450
10154 * output.h (class Output_section): Add is_entsize_zero_ field.
10155 * output.cc (Output_section::Output_section): Initialize
10156 is_entsize_zero_.
10157 (Output_section::set_entsize): If two different entsizes are
10158 requested, force it to zero.
10159 (Output_section::add_input_section): Set flags for .debug_str
10160 before updating section flags. Set entsize.
10161 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10162 and SHF_STRING if all input sections have those flags.
10163
3e1b9a8a
RÁE
101642009-12-29 Rafael Espindola <espindola@google.com>
10165
10166 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10167 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10168 reporting.
3e1b9a8a 10169
3dcad376
ST
101702009-12-29 Sriraman Tallam <tmsriram@google.com>
10171
10172 * options.cc (General_options::parse_version): Allow -v to exit
10173 without an error if there is nothing to link.
10174
084e2665
ILT
101752009-12-29 Ian Lance Taylor <iant@google.com>
10176
10177 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10178 using a version of gcc before 4.1.
10179 * configure: Rebuild.
10180
250acde3
CD
101812009-12-28 Chris Demetriou <cgd@google.com>
10182
10183 * attributes.cc (Output_attributes_section_data::do_write): Use
10184 std::vector::front rather than std::vector::data.
10185
99fff23b
ILT
101862009-12-28 Ian Lance Taylor <iant@google.com>
10187
10188 * symtab.h (class Symbol_table): Add enum Defined.
10189 * resolve.cc (Symbol_table::should_override): Add defined
10190 parameter. Change all callers. Test whether object is NULL
10191 before calling a method on it.
10192 (Symbol_table::report_resolve_problem): Add defined parameter.
10193 Change all callers.
10194 (Symbol_table::should_override_with_special): Likewise.
10195 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10196 parameter. Change all callers.
10197 (Symbol_table::do_define_in_output_data): Likewise.
10198 (Symbol_table::define_in_output_segment): Likewise.
10199 (Symbol_table::do_define_in_output_segment): Likewise.
10200 (Symbol_table::define_as_constant): Likewise.
10201 (Symbol_table::do_define_as_constant): Likewise.
10202 * script.h (class Symbol_assignment): Add is_defsym parameter to
10203 constructor; change all callers.
10204 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10205 parameter. Change all callers. Add is_defsym_ field.
10206 (class Parser_closure): Add parsing_defsym parameter to
10207 constructor; change all callers. Add parsing_defsym accessor
10208 function. Add parsing_defsym_ field.
10209
556bd683
ILT
102102009-12-28 Ian Lance Taylor <iant@google.com>
10211
10212 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10213 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10214
1782c879
ILT
102152009-12-23 Ian Lance Taylor <iant@google.com>
10216
10217 * i386.cc (Target_i386::do_calls_non_split): Recognize
10218 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10219 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10220 -fsplit-stack prologue when using %r11.
1782c879 10221
329ca2b1
ST
102222009-12-21 Sriraman Tallam <tmsriram@google.com>
10223
10224 * options.cc (General_options::parse_version): Make -v continue and do
10225 the link like GNU ld does.
10226
d675ff46
RÁE
102272009-12-17 Rafael Avila de Espindola <espindola@google.com>
10228
10229 * Makefile.am (CCFILES): Add timer.cc.
10230 (HFILES): Add timer.h.
10231 * configure.ac: Check for sysconf and times.
10232 * main.cc: include timer.h.
10233 (main): Use Timer instead of get_run_time.
10234 * timer.cc: New.
10235 * timer.h: New.
10236 * workqueue.cc: include timer.h.
10237 (Workqueue::find_and_run_task):
10238 Report user, sys and wall time.
10239 * Makefile.in: Regenerate.
10240 * config.in: Regenerate.
10241 * configure: Regenerate.
10242
d6344fb5
DK
102432009-12-16 Doug Kwan <dougkwan@google.com>
10244
10245 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10246 sections.
10247 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10248 relaxed input sections.
10249 * output.cc (Output_section::find_relaxed_input_section): Change
10250 return type to Output_relaxed_input_section pointer. Adjust code
10251 for new type of relaxed_input_section_map_.
10252 * output.h (Output_section::find_relaxed_input_section): Change
10253 return type to Output_relaxed_input_section pointer.
10254 (Output_section::Output_relaxed_input_section_by_input_section_map):
10255 New type.
10256 (Output_section::relaxed_input_section_map_): Change type to
10257 Output_section::Output_relaxed_input_section_by_input_section_map.
10258 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10259 input section.
10260
0e0d5469
ILT
102612009-12-15 Ian Lance Taylor <iant@google.com>
10262
10263 * layout.cc (Layout::create_shstrtab): Only write out after input
10264 sections if we are compressing debug sections.
10265
0649a889
ILT
102662009-12-15 Ian Lance Taylor <iant@google.com>
10267
10268 * archive.cc (Archive::add_symbols): Only look up a symbol without
10269 a version if there is, in fact, a version.
10270
2ea97941
ILT
102712009-12-14 Ian Lance Taylor <iant@google.com>
10272
10273 Revert -Wshadow changes, all changes from:
10274 2009-12-11 Doug Kwan <dougkwan@google.com>
10275 2009-12-11 Nick Clifton <nickc@redhat.com>
10276 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10277
b0eec2cc
DK
102782009-12-11 Doug Kwan <dougkwan@google.com>
10279
10280 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10281 due to -Wshadow.
10282 * attributes.cc (Object_attribute::size): Ditto.
10283 (Attributes_section_data::size): Ditto.
10284 (Attributes_section_data::Attributes_section_data): Ditto.
10285 (Output_attributes_section_data::do_write): Ditto.
10286 * attributes.h (Object_attribute::set_type): Ditto.
10287 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10288
91d6fa6a
NC
102892009-12-11 Nick Clifton <nickc@redhat.com>
10290
10291 * archive.cc: Fix shadowed variable warnings.
10292 * arm.cc: Likewise.
10293 * compressed_output.cc: Likewise.
10294 * compressed_output.h: Likewise.
10295 * configure: Likewise.
10296 * dwarf_reader.cc: Likewise.
10297 * dynobj.cc: Likewise.
10298 * dynobj.h: Likewise.
10299 * ehframe.cc: Likewise.
10300 * ehframe.h: Likewise.
10301 * errors.cc: Likewise.
10302 * expression.cc: Likewise.
10303 * fileread.cc: Likewise.
10304 * fileread.h: Likewise.
10305 * freebsd.h: Likewise.
10306 * i386.cc: Likewise.
10307 * icf.cc: Likewise.
10308 * incremental.h: Likewise.
10309 * layout.cc: Likewise.
10310 * layout.h: Likewise.
10311 * mapfile.cc: Likewise.
10312 * merge.cc: Likewise.
10313 * merge.h: Likewise.
10314 * object.cc: Likewise.
10315 * object.h: Likewise.
10316 * options.h: Likewise.
10317 * output.cc: Likewise.
10318 * output.h: Likewise.
10319 * parameters.cc: Likewise.
10320 * plugin.cc: Likewise.
10321 * powerpc.cc: Likewise.
10322 * reduced_debug_output.cc: Likewise.
10323 * reduced_debug_output.h: Likewise.
10324 * reloc.cc: Likewise.
10325 * reloc.h: Likewise.
10326 * resolve.cc: Likewise.
10327 * script-sections.cc: Likewise.
10328 * script.cc: Likewise.
10329 * script.h: Likewise.
10330 * sparc.cc: Likewise.
10331 * symtab.cc: Likewise.
10332 * symtab.h: Likewise.
10333 * target-select.cc: Likewise.
10334 * target-select.h: Likewise.
10335 * token.h: Likewise.
10336 * workqueue.cc: Likewise.
10337 * workqueue.h: Likewise.
10338 * x86_64.cc: Likewise.
10339
a0351a69
DK
103402009-12-10 Doug Kwan <dougkwan@google.com>
10341
10342 * arm.cc (attributes.h): New include.
10343 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10344 (Arm_relobj::~Arm_relobj): Delete object pointed by
10345 attributes_section_data_.
10346 (Arm_relobj::attributes_section_data): New method definition.
10347 (Arm_relobj::attributes_section_data_): New data member declaration.
10348 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10349 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10350 attributes_section_data_.
10351 (Arm_dynobj::attributes_section_data): New method definition.
10352 (Arm_dynobj::attributes_section_data_): New data member declaration.
10353 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10354 initialization value of may_use_blx_ to false.
2e702c99 10355 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10356 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10357 object attributes to compute results instead of hard-coding.
10358 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10359 Target_arm::get_secondary_compatible_arch,
10360 Target_arm::set_secondary_compatible_arch
10361 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10362 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10363 New method declarations.
10364 (Target_arm::get_aeabi_object_attribute): New method definition.
10365 (Target_arm::attributes_section_data_): New data member declaration.
10366 (read_arm_attributes_section): New template definition.
10367 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10368 (Arm_dynobj::do_read_symbols): Ditto.
10369 (Target_arm::do_finalize_sections): Merge attributes sections from
10370 input. Check for BLX use after attributes section merging.
10371 Fix __exidx_start and __exidx_end visibility. Create an
10372 .ARM.attributes section if necessary.
10373 (Target_arm::get_secondary_compatible_arch,
10374 Target_arm::set_secondary_compatible_arch,
10375 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10376 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10377 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10378 New method definitions.
10379
b59befec
ILT
103802009-12-09 Ian Lance Taylor <iant@google.com>
10381
10382 * plugin.cc (Plugin::load): Don't cast from void* to a function
10383 pointer.
10384
1276bc89
ILT
103852009-12-09 Ian Lance Taylor <iant@google.com>
10386
10387 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10388 information fields.
10389
2f2de248
L
103902009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10391
10392 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10393 Replace two_file_shared_1.so with two_file_shared_2.so.
10394 * testsuite/Makefile.in: Regenerated.
10395
4f787271
DK
103962009-12-08 Doug Kwan <dougkwan@google.com>
10397
10398 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10399 (HFILES): Add attributes.h and int_encoding.h.
10400 * Makefile.in: Regenerate.
10401 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10402 function definitions to int_encoding.cc
10403 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10404 prototypes to int_encoding.h
10405 * reduced_debug_output.cc (int_encoding.h): New include.
10406 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10407 function definitions to int_encoding.cc
10408 (insert_into_vector, read_from_pointer): Move template definitions to
10409 int_encoding.h
10410 * attributes.cc: New file.
10411 * attributes.h: New file.
10412 * int_encoding.cc: New file.
10413 * int_encoding.h: New file.
10414
20b52f1a
RÁE
104152009-12-07 Rafael Avila de Espindola <espindola@google.com>
10416
10417 PR gold/11055
10418 * incremental-dump.cc (dump_incremental_inputs): New.
10419 (main): Use dump_incremental_inputs.
10420
53d7974c
L
104212009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10422
10423 PR gold/10893
10424 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10425 checking elfcpp::STT_FUNC.
10426 (Target_i386::Relocate::relocate): Likewise.
10427 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10428
10429 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10430 symbols from shared libraries into normal FUNC symbols.
10431
10432 * symtab.h (Symbol): Add is_func and use it.
10433
05a352e6
DK
104342009-12-05 Doug Kwan <dougkwan@google.com>
10435
10436 * arm.cc (Target_arm::arm_info): Initialize new fields
10437 attributes_section and attributes_vendor.
10438 * i386.cc (Target_i386::i386_info): Same.
10439 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10440 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10441 fields attributes_section and attributes_vendor.
53d7974c 10442 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
10443 * target.h (Target::attributes_section, Target::attributes_vendor,
10444 Target::is_attributes_section, Target::attribute_arg_type,
10445 Target::attributes_order): New method definitions.
10446 (Target::Target_info::attributes_section,
10447 Target::Target_info::attributes_vendor): New fields.
10448 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10449 virtual method definitions.
10450 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10451 attributes_section and attributes_vendor.
10452 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10453
f4e5969c
DK
104542009-12-05 Doug Kwan <dougkwan@google.com>
10455
10456 * arm.cc: Update comments about interworking and stub generation.
10457 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10458 considered as non-PIC.
10459 (Arm_relocate_functions::base_abs): Fix formatting.
10460 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10461 of function to use GOT entry address instead of offset.
10462 (Target_arm::Scan::global): Issue an error if a symbol would need a
10463 PLT does not get one because it is untyped. Remove code to create
10464 dynamic symbols for relative branches.
10465 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10466 takes unsigned integer instead of boolean.
10467
1abce4a6
L
104682009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10469
10470 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10471 (two_file_test_LDADD): Likewise.
10472 (common_test_1_LDADD): Likewise.
10473 (exception_test_LDADD) Likewise.
10474 (weak_test_LDADD): Likewise.
10475 (many_sections_test_LDADD): Likewise.
10476 (initpri1_LDADD): Likewise.
10477 (script_test_1_LDADD): Likewise.
10478 (script_test_2_LDADD): Likewise.
10479 (justsyms_LDADD): Likewise.
10480 (binary_test_LDADD): Likewise.
10481 (large_LDADD): Likewise.
10482 * testsuite/Makefile.in: Regenerated.
10483
adcf2816 104842009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 10485
adcf2816
L
10486 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10487 (Symbol_table::override_with_special): Likewise.
10488 (Symbol_table::add_from_object): Likewise.
10489
28e67f5d
RÁE
104902009-12-04 Rafael Avila de Espindola <espindola@google.com>
10491
10492 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10493 Don't set the data_offset twice.
10494
ae10a101
RÁE
104952009-12-04 Rafael Avila de Espindola <espindola@google.com>
10496
10497 * testsuite/Makefile.in: Regenerate.
10498
f59f41f3
DK
104992009-12-03 Doug Kwan <dougkwan@google.com>
10500
10501 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10502 (Target_arm::do_finalize_sections): Add parameter for symbol table
10503 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10504 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10505 parameter for symbol table pointer.
10506 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10507 an additional parameter for a pointer to symbol table.
10508 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10509 parameter for a symbol table pointer.
10510 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10511 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10512 Ditto.
10513 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10514 parameter for a symbol table pointer.
10515
ca55d848
RÁE
105162009-12-03 Rafael Avila de Espindola <espindola@google.com>
10517
10518 * incremental.cc (Incremental_inputs_header)
10519 (Incremental_inputs_header_write, Incremental_inputs_entry)
10520 (Incremental_inputs_entry_write): Move ...
10521 * incremental.h (Incremental_inputs_header)
10522 (Incremental_inputs_header_write, Incremental_inputs_entry)
10523 (Incremental_inputs_entry_write): here.
10524
3aec4f9c
RÁE
105252009-12-02 Rafael Avila de Espindola <espindola@google.com>
10526
10527 * incremental.cc (make_sized_incremental_binary): Set the target.
10528 Error if it is incompatible.
10529 * output.h (Output_file): Add filename method.
10530
9c0ae74d
RÁE
105312009-12-02 Rafael Avila de Espindola <espindola@google.com>
10532
10533 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10534 from the get_* methods.
10535
a45500ae
RÁE
105362009-12-02 Rafael Avila de Espindola <espindola@google.com>
10537
10538 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10539 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10540 Write 0 for the data_offset of scripts.
10541
325e6408
RÁE
105422009-12-02 Rafael Avila de Espindola <espindola@google.com>
10543
10544 * testsuite/Makefile.am: Add the incremental_test.sh test.
10545 * testsuite/incremental_test.sh: New.
10546 * testsuite/incremental_test_1.c: New.
10547 * testsuite/incremental_test_2.c: New.
10548
954c3e2e
RÁE
105492009-12-01 Rafael Avila de Espindola <espindola@google.com>
10550
703d02da 10551 * incremental-dump.cc (main): Fix typos.
954c3e2e 10552
f8086623
RÁE
105532009-11-27 Rafael Avila de Espindola <espindola@google.com>
10554
10555 PR gold/11025
10556 * incremental-dump.cc (main): Use llu to print 64 bit values.
10557
3b0dd6ac
L
105582009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10559 H.J. Lu <hongjiu.lu@intel.com>
10560
10561 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10562 $(LIBDL).
10563 (incremental_dump_LDADD): Likewise.
10564 * Makefile.in: Regenerated.
10565
a6d1ef57 105662009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 10567
a6d1ef57
DK
10568 Revert:
10569
10570 2009-11-25 Doug Kwan <dougkwan@google.com>
10571
10572 * arm.cc (Target_arm::Target_arm): Move method definition
10573 outside of class definition. Add code to handle
10574 --target1-rel, --target1-abs and --target2= options.
10575 (Target_arm::get_reloc_reloc_type): Change method to be
10576 non-static and const.
10577 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10578 New data member declaration.
10579 (Target_arm::Scan::local, Target_arm::Scan::global,
10580 Target_arm::Relocate::relocate,
10581 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10582 Adjust call to Target_arm::get_real_reloc_type.
10583 (Target_arm::get_real_reloc_type): Use command line options
10584 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10585 * options.h (--target1-rel, --target1-abs, --target2): New
10586 ARM-only options.
10587
50aeb7d4
DK
105882009-11-25 Doug Kwan <dougkwan@google.com>
10589
10590 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10591 class definition. Add code to handle --target1-rel, --target1-abs
10592 and --target2= options.
10593 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10594 and const.
10595 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10596 member declaration.
10597 (Target_arm::Scan::local, Target_arm::Scan::global,
10598 Target_arm::Relocate::relocate,
10599 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10600 call to Target_arm::get_real_reloc_type.
10601 (Target_arm::get_real_reloc_type): Use command line options to
10602 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10603 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10604 options.
10605
51938283
DK
106062009-11-25 Doug Kwan <dougkwan@google.com>
10607
10608 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10609 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10610 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10611 formatting.
10612 (Arm_relocate_functions::thm_call): Replace body with a call to
10613 Arm_relocate_functions::thumb_branch_common.
10614 (Arm_relocate_functions::thm_jump24,
10615 Arm_relocate_functions::thm_xpc22): New method definitions.
10616 (Arm_relocate_functions::thumb_branch_common): New method definition.
10617 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10618 operator.
10619 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10620 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10621
e2b8f3c4
RÁE
106222009-11-24 Rafael Avila de Espindola <espindola@google.com>
10623
10624 * Makefile.am: Build incremental-dump
10625 * Makefile.in: Regenerate.
10626 * incremental-dump.cc: New.
10627 * incremental.cc (Incremental_inputs_header_data,
10628 Incremental_inputs_entry_data): Move to incremental.h
10629 * incremental.h: (Incremental_inputs_header_data,
10630 Incremental_inputs_entry_data): Move from incremental.cc
10631
bcba9aec
RÁE
106322009-11-24 Rafael Avila de Espindola <espindola@google.com>
10633
10634 * incremental.cc (Incremental_inputs_header,
10635 Incremental_inputs_header_write, Incremental_inputs_entry,
10636 Incremental_inputs_entry_write): Add a typedef with the data type.
10637
7c3afe08
RÁE
106382009-11-24 Rafael Avila de Espindola <espindola@google.com>
10639
10640 * incremental.cc (Incremental_inputs_header,
10641 Incremental_inputs_header_write, Incremental_inputs_entry,
10642 Incremental_inputs_entry_write): Update comment about which
10643 type has the filed descriptions.
10644
d204b6e9
DK
106452009-11-15 Doug Kwan <dougkwan@google.com>
10646
10647 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
10648 (Arm_relocate_functions::arm_branch_common): Change method defintion
10649 in class definition to a method declaration and update list of formal
10650 parameters.
10651 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
10652 Arm_relocation_functions::jump24): Adjust call to
10653 Arm_relocate_functions::arm_branch_common. Update list of formal
10654 parameters.
10655 (Arm_relocate_functions::xpc25): New method definition.
10656 (Arm_relocate_functions::arm_branch_common): Move method defintion
10657 out from class definition. Use stubs for mode-switching and extending
10658 branch ranges.
10659 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
10660 specially. Change code to enable use of stubs in ARM branches.
10661
43d12afe
DK
106622009-11-10 Doug Kwan <dougkwan@google.com>
10663
10664 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
10665 in method declaration.
10666 (Target_arm::relocate_stub): New method declaration.
10667 (Target_arm::default_target): Change to return a pointer instead of
10668 a const reference.
10669 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
10670 Target_arm::default_target.
10671 (Arm_Relobj::do_relocate_sections): Remove options paramater in
10672 method definition.
10673 (Target_arm::relocate_section): Adjust view.
10674 (Target_arm::relocate_stub): New method definition.
10675
ac33a407
DK
106762009-11-10 Doug Kwan <dougkwan@google.com>
10677
10678 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
10679 a format warning.
10680 * incremental.cc (open_incremental_binary): Initialized local
10681 variables to avoid warnings.
10682 * object.cc (make_elf_object): Ditto.
10683 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
10684 a format warning.
e1df38aa 10685
88ee28e9
L
10686009-11-09 H.J. Lu <hongjiu.lu@intel.com>
10687
10688 PR gold/10930
10689 * testsuite/plugin_test.c: Include "config.h".
10690
2daedcd6
DK
106912009-11-09 Doug Kwan <dougkwan@google.com>
10692
10693 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
10694 (arm_symbol_value): Remove.
10695 (Arm_relocate_functions::arm_branch_common,
10696 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
10697 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
10698 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
10699 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
10700 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
10701 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
10702 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
10703 Arm_relocate_functions::thm_mobw_abs_nc,
10704 Arm_relocate_functions::thm_mov_abs,
10705 Arm_relocate_functions::movw_prel_nc,
10706 Arm_relocate_functions::thm_movt_abs,
10707 Arm_relocate_functions::movt_prel,
10708 Arm_relocate_functions::thm_movw_prel_nc,
10709 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
10710 (Target_arm::Relocate::relocate): Only decompose address into two
10711 parts if relocation type uses the thumb-bit and pass the actual
10712 bit instead of a flag indicating that the thumb-bit is used. Adjust
10713 calls to methods in Arm_relocate_functions for this change.
10714
1276bc89 107152009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
10716
10717 PR 10925
10718 * reloc.cc: Instantiate
10719 Sized_relobj::initialize_input_to_output_maps and
10720 Sized_relobj:free_input_to_output_maps.
10721
e53ad1b5
ILT
107222009-11-06 Ian Lance Taylor <iant@google.com>
10723
10724 PR 10876
10725 * defstd.cc (in_segment): Set only_if_ref true for "end".
10726
eb44217c
DK
107272009-11-06 Doug Kwan <dougkwan@google.com>
10728
10729 * arm.cc (class Reloc_stub): Correct a comment.
10730 (Target_arm::Target_arm): Initialize arm_input_section_map_.
10731 (Target_arm::scan_section_for_stubs): New method declaration.
10732 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
10733 Change methods from private to protected.
10734 (Target_arm::do_may_relax): New method definition.
10735 (Target_arm::do_relax, Target_arm::group_sections,
10736 Target_arm::scan_reloc_for_stub,
10737 Target_arm::scan_reloc_section_for_stubs): New method declarations.
10738 (Target_arm::arm_input_section_map_): New data member declaration.
10739 (Target_arm::scan_reloc_for_stub,
10740 Target_arm::scan_reloc_section_for_stubs,
10741 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
10742 Target_arm::do_relax): New method definitions.
10743
5d329b7d
ILT
107442009-11-06 Mikolaj Zalewski <mikolaj@google.com>
10745
10746 * configure.ac: Check for (struct stat)::st_mtim
10747 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
10748 * config.in: Regenerate.
10749 * configure: Regenerate.
10750
96a0d71b
ILT
107512009-11-05 Ian Lance Taylor <iant@google.com>
10752
10753 PR 10910
10754 * output.cc (Output_segment::add_output_section): Add missing
10755 return statement.
10756
594c8e5e
ILT
107572009-11-04 Ian Lance Taylor <iant@google.com>
10758
10759 PR 10880
10760 * object.h (class Object): Add is_needed and set_is_needed
10761 methods. Add is_needed_ field. Make bool fields into bitfields.
10762 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
10763 defined in a dynamic object and referenced by a regular object,
10764 set is_needed for the dynamic object.
10765 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
10766 if the file is marked with as_needed and it is not needed.
10767
22b127cc
ILT
107682009-11-04 Ian Lance Taylor <iant@google.com>
10769
10770 PR 10887
10771 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
10772 tags if data is discarded by linker script.
10773 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10774 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10775 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10776 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10777
f5c870d2
ILT
107782009-11-04 Ian Lance Taylor <iant@google.com>
10779
10780 * layout.cc (Layout::get_output_section): Add is_interp and
10781 is_dynamic_linker_section parameters. Change all callers.
10782 (Layout::choose_output_section): Likewise.
10783 (Layout::make_output_section): Likewise.
10784 (Layout::add_output_section_data): Add is_dynamic_linker_section
10785 parameter. Change all callers.
10786 * layout.h (class Layout): Update declarations.
10787 * output.h (class Output_section): Add is_interp, set_is_interp,
10788 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
10789 Add is_interp_, is_dynamic_linker_section_ fields. Change
10790 generate_code_fills_at_write_ to a bitfield.
10791 * output.cc (Output_section::Output_sections): Initialize new
10792 fields.
10793 (Output_segment::add_output_section): Add do_sort parameter.
10794 Change all callers.
10795
1ae4d23b
ILT
107962009-11-03 Ian Lance Taylor <iant@google.com>
10797
10798 PR 10860
10799 * options.h (class General_options): Add --warn-common.
10800 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
10801 merging two common symbols.
10802 (Symbol_table::should_override): Handle --warn-common when merging
10803 a common symbol with a defined symbol. Use report_resolve_problem
10804 for multiple definitions.
10805 (Symbol_table::report_resolve_problem): New function.
10806 * symtab.h (class Symbol_table): Declare report_resolve_problem.
10807
55da9579
DK
108082009-11-03 Doug Kwan <dougkwan@google.com>
10809
10810 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
10811 stub_factory_.
10812 (Target_arm::stub_factory): New method definition.
10813 (Target_arm::new_arm_input_section,
10814 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
10815 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 10816 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
10817 New type definitions.
10818 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
10819 member declarations.
10820 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
10821 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
10822 New method definitions.
10823
37a9ac43
ILT
108242009-11-03 Ian Lance Taylor <iant@google.com>
10825
10826 * options.h (class General_options): Add --warn_constructors.
10827
b3d6a3d4
ILT
108282009-11-03 Ian Lance Taylor <iant@google.com>
10829
10830 PR 10893
10831 * defstd.cc (in_section): Add entries for __rel_iplt_start,
10832 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
10833
934b01dd
ILT
108342009-11-03 Ian Lance Taylor <iant@google.com>
10835
10836 PR 10895
10837 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
10838 --msgid-bugs-address.
10839 (install-pdf): New target.
10840 (install-data_yes): Look up one directory to find mkinstalldirs.
10841
03c1939b
L
108422009-11-03 H.J. Lu <hongjiu.lu@intel.com>
10843
10844 * po/Make-in (.po.gmo): Don't generate .gmo files in source
10845 tree.
10846
ebd95253
DK
108472009-10-30 Doug Kwan <dougkwan@google.com>
10848
10849 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10850
e9bbb538
DK
108512009-10-30 Doug Kwan <dougkwan@google.com>
10852
10853 * arm.cc (Stub_addend_reader): New struct template definition
10854 and partial specializations.
10855 (Stub_addend_reader::operator()): New method definition for a
10856 partially specialized template.
10857
d5b40221
DK
108582009-10-30 Doug Kwan <dougkwan@google.com>
10859
10860 * arm.cc (Arm_relobj::processor_specific_flags): New method
10861 definition.
10862 (Arm_relobj::do_read_symbols): New method declaration.
10863 (Arm_relobj::processor_specific_flags_): New data member declaration.
10864 (Arm_dynobj): New class definition.
10865 (Target_arm::do_finalize_sections): Add input_objects parameter.
10866 (Target_arm::do_adjust_elf_header): New method declaration.
10867 (Target_arm::are_eabi_versions_compatible,
10868 (Target_arm::merge_processor_specific_flags): New method declaration.
10869 (Target_arm::do_make_elf_object): New overloaded method definitions
10870 and declaration.
10871 (Arm_relobj::do_read_symbols): New method definition.
10872 (Arm_dynobj::do_read_symbols): Ditto.
10873 (Target_arm::do_finalize_sections): Add input_objects parameters.
10874 Merge processor-specific flags from all input objects.
10875 (Target_arm::are_eabi_versions_compatible,
10876 Target_arm::merge_processor_specific_flags,
10877 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10878 New method definitions.
10879 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10880 Input_objects pointer type parameter.
10881 * layout.cc (Layout::finalize): Pass input objects to target's.
10882 finalize_sections function.
10883 * output.cc (Output_file_header::do_sized_write): Set ELF file
10884 header's processor-specific flags.
10885 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
10886 Input_objects pointer type parameter.
10887 * sparc.cc (Target_sparc::do_finalize_sections): Same.
10888 * target.h (Input_objects): New forward class declaration.
10889 (Target::processor_specific_flags,
10890 Target::are_processor_specific_flags_sect): New method definitions.
10891 (Target::finalize_sections): Add input_objects parameter.
10892 (Target::Target): Initialize processor_specific_flags_ and
10893 are_processor_specific_flags_set_.
10894 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
10895 parameter.
10896 (Target::set_processor_specific_flags): New method definition.
10897 (Target::processor_specific_flags_,
10898 Target::are_processor_specific_flags_set_): New data member
10899 declarations.
10900 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
10901 Input_objects pointer type parameter.
10902
ebabffbd
DK
109032009-10-30 Doug Kwan <dougkwan@google.com>
10904
10905 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
10906
ad0f2072
ILT
109072009-10-28 Ian Lance Taylor <iant@google.com>
10908
10909 * object.h (class Relobj): Drop options parameter from
10910 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
10911 do_scan_relocs, do_relocate. Change all callers.
10912 (class Sized_relobj): Drop options parameters from
10913 do_gc_process_relocs, do_scan_relocs, do_relocate,
10914 do_relocate_sections, relocate_sections, emit_relocs_scan,
10915 emit_relocs_scan_reltype. Change all callers.
10916 (struct Relocate_info): Remove options field and all references to
10917 it.
10918 * reloc.h (class Read_relocs): Remove options constructor
10919 parameter and options_ field. Change all callers.
10920 (class Gc_process_relocs, class Scan_relocs): Likewise.
10921 (class Relocate_task): Likewise.
10922 * target-reloc.h (scan_relocs): Remove options parameter. Change
10923 all callers.
10924 (scan_relocatable_relocs): Likewise.
10925 * target.h (class Sized_target): Remove options parameter from
10926 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
10927 all callers.
10928 * gc.h (gc_process_relocs): Remove options parameter. Change all
10929 callers.
10930 * arm.cc: Update functions to remove options parameters.
10931 * i386.cc: Likewise.
10932 * powerpc.cc: Likewise.
10933 * sparc.cc: Likewise.
10934 * x86_64.cc: Likewise.
10935 * testsuite/testfile.cc: Likewise.
10936
8ffa3667
DK
109372009-10-28 Doug Kwan <dougkwan@google.com>
10938
10939 * arm.cc (Arm_relobj): New class definition.
e1df38aa 10940 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
10941 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
10942 New method definitions.
10943
40f36857
CC
109442009-10-28 Cary Coutant <ccoutant@google.com>
10945
10946 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
10947 (Plugin::cleanup_done_): New member.
10948 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
10949 (Plugin_manager::cleanup_done_): Remove.
10950 (Plugin_manager::add_input_file): Edit error message.
10951 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
10952 (Plugin_manager::cleanup): Remove use of cleanup_done_.
10953
2c849493
ILT
109542009-10-27 Mikolaj Zalewski <mikolajz@google.com>
10955
10956 * fileread.cc: (File_read::View::~View): Use the new
10957 data_ownership_ filed.
10958 (File_read::~File_read): Dispose the new whole_file_view_.
10959 (File_read::open): Mmap the whole file if needed.
10960 (File_read::open): Use whole_file_view_ instead of contents_.
10961 (File_read::find_view): Use whole_file_view_ if applicable.
10962 (File_read::do_read): Use whole_file_view_ instead of contents_.
10963 (File_read::make_view): Use whole_file_view_ instead of contents_,
10964 update File_read::View::View call.
10965 (File_read::find_or_make_view): Update File_read::View::View
10966 call.
10967 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
10968 remove contents_
10969 (File_read::View::Data_ownership): New enum.
10970 (File_read::View::View): Replace bool mapped_ with Data_ownership
10971 argument.
10972 (File_read::View::mapped_): Remove (replaced by data_ownership_).
10973 (File_read::View::data_ownership_): New field.
10974 (File_read::contents_): Remove (replaced by whole_file_view_).
10975 (File_read::whole_file_view_): New field.
10976 * options.h (class General_options): Add --keep-files-mapped.
10977
24998053
CC
109782009-10-27 Cary Coutant <ccoutant@google.com>
10979
10980 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
10981 * testsuite/Makefile.am (plugin_test_5): New test case.
10982 * testsuite/Makefile.in: Regenerate.
10983
72adc4fa
DK
109842009-10-25 Doug Kwan <dougkwan@google.com>
10985
10986 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
10987 from private to protected to allow access by child class.
10988 (Sized_relobj::do_relocate_sections): New method declaration.
10989 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 10990 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
10991 Sized_relobj::relocate_sections. Instantiate template explicitly
10992 for different target sizes and endianity.
10993
07f508a2
DK
109942009-10-24 Doug Kwan <dougkwan@google.com>
10995
10996 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
10997 (Arm_input_section::as_arm_input_section): New method.
10998 (Arm_output_section): New class definition.
10999 (Arm_output_section::create_stub_group,
11000 Arm_output_section::group_sections): New method definitions.
11001
10ad9fe5
DK
110022009-10-22 Doug Kwan <dougkwan@google.com>
11003
11004 * arm.cc (Arm_input_section): New class definition.
11005 (Arm_input_section::init, Arm_input_section:do_write,
11006 Arm_input_section::set_final_data_size,
11007 Arm_input_section::do_reset_address_and_file_offset): New method
11008 definitions.
11009
56ee5e00
DK
110102009-10-21 Doug Kwan <dougkwan@google.com>
11011
11012 * arm.cc (Stub_table, Arm_input_section): New forward class
11013 declarations.
11014 (Stub_table): New class defintion.
11015 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11016 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11017 New method definition.
11018
b569affa
DK
110192009-10-21 Doug Kwan <dougkwan@google.com>
11020
11021 * arm.cc: Update copyright comments.
11022 (Target_arm): New forward class template declaration.
11023 (Arm_address): New type.
11024 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11025 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11026 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11027 constants.
11028 (Insn_template): Same.
11029 (DEF_STUBS): New macro.
11030 (Stub_type): New enum type.
11031 (Stub_template): New class definition.
11032 (Stub): Same.
11033 (Reloc_stub): Same.
11034 (Stub_factory): Same.
11035 (Target_arm::Target_arm): Initialize may_use_blx_ and
11036 should_force_pic_veneer_.
11037 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11038 Target_arm::should_force_pic_veneer,
11039 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11040 Target_arm::using_thumb_only, Target_arm:;default_target): New
11041 method defintions.
11042 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11043 New data member declarations.
11044 (Insn_template::size, Insn_template::alignment): New method defintions.
11045 (Stub_template::Stub_template): New method definition.
11046 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11047 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11048 (Stub_factory::Stub_factory): New method definition.
11049 * gold.h (string_hash): New template.
11050 * output.h (Input_section_specifier::hash_value): Use
11051 gold::string_hash.
11052 (Input_section_specifier::string_hash): Remove.
11053 * stringpool.cc (Stringpool_template::string_hash): Use
11054 gold::string_hash.
11055
6c172549
DK
110562009-10-20 Doug Kwan <dougkwan@google.com>
11057
11058 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11059 symbols of relaxed input sections.
11060 * output.h (Output_section::find_relaxed_input_section): Make
11061 method public.
11062
c5617f2f
DK
110632009-10-16 Doug Kwan <dougkwan@google.com>
11064
11065 * dynobj.cc (Versions::Versions): Initialize version_script_.
11066 Only insert base version symbol definition for a shared object
11067 if version script defines any version versions.
11068 (Versions::define_base_version): New method definition.
11069 (Versions::add_def): Check that base version is not needed.
11070 (Versions::add_need): Define base version lazily.
11071 * dynobj.h (Versions::define_base_version): New method declaration.
11072 (Versions::needs_base_version_): New data member declaration.
11073 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11074 (check_DATA): Add no_version_test.stdout.
11075 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11076 New make rules.
11077 * testsuite/Makefile.in: Regenerate.
11078 * testsuite/no_version_test.c: New file.
11079 * testsuite/no_version_test.sh: Ditto.
11080
3c12dcdb
DK
110812009-10-16 Doug Kwan <dougkwan@google.com>
11082
11083 * expression.cc (class Segment_start_expression): New class definition.
11084 (Segment_start_expression::value): New method definition.
11085 (script_exp_function_segment_start): Return a new
11086 Segment_start_expression.
11087 * gold/script-c.h (script_saw_segment_start_expression): New function
11088 prototype.
11089 * script-sections.cc (Script_sections::Script_sections): Initialize
11090 SAW_SEGMENT_START_EXPRESSION_ to false.
11091 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11092 and -Tbbs options to specify section addresses if given in
11093 command line and no SEGMENT_START expression is seen in a script.
11094 * script-sections.h (Script_sections::saw_segment_start_expression,
11095 Script_sections::set_saw_segment_start_expression): New method
11096 definition.
11097 (Script_sections::saw_segment_start_expression_): New data member
11098 declaration.
11099 * script.cc (script_saw_segment_start_expression): New function.
11100 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11101 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11102 script_test_7.sh and script_test_8.sh.
11103 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11104 script_test_8.stdout.
11105 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11106 (script_test_6, script_test_6.stdout, script_test_7,
11107 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11108 * Makefile.in: Regenerate.
11109 * testsuite/script_test_6.sh: New file.
11110 * testsuite/script_test_6.t: Same.
11111 * testsuite/script_test_7.sh: Same.
11112 * testsuite/script_test_7.t: Same.
11113 * testsuite/script_test_8.sh: Same.
11114
64b1ae37
DK
111152009-10-16 Doug Kwan <dougkwan@google.com>
11116
11117 * output.cc (Output_segment::set_section_list_address): Cast
11118 expressions to unsigned long long type to avoid format warnings.
11119
661be1e2
ILT
111202009-10-15 Ian Lance Taylor <iant@google.com>
11121
12edd763 11122 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11123 dot assignment to script_sections_.
12edd763
ILT
11124 * script-sections.cc (Script_sections::add_dot_assignment):
11125 Initialize if necessary.
11126
68b6574b
ILT
11127 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11128 program headers with no load segment if there is a linker script.
11129
661be1e2
ILT
11130 * layout.cc (Layout::set_segment_offsets): Align the file offset
11131 to the segment aligment for -N or -n with no load segment.
11132 * output.cc (Output_segment::add_output_section): Don't crash if
11133 the first section is a TLS section.
11134 (Output_segment::set_section_list_addresses): Print an error
11135 message if the address moves backward in a linker script.
11136 * script-sections.cc
11137 (Output_section_element_input::set_section_addresses): Don't
11138 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11139 (Orphan_output_section::set_section_addresses): Likewise.
11140
f15f61a7
DK
111412009-10-15 Doug Kwan <dougkwan@google.com>
11142
11143 * layout.cc (Layout::finish_dynamic_section): Generate tags
11144 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11145 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11146 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11147
82bb573a
ILT
111482009-10-14 Ian Lance Taylor <iant@google.com>
11149
11150 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11151 fields.
11152 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11153 data_shdr fields of relinfo.
11154 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11155 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11156 R_386_TLS_LDO_32, adjust based on section flags.
11157 (Target_i386::Relocate::fix_up_ldo): Remove.
11158
374ad285
ILT
111592009-10-13 Ian Lance Taylor <iant@google.com>
11160
11161 Add support for -pie.
11162 * options.h (class General_options): Add -pie and
11163 --pic-executable.
11164 (General_options::output_is_position_independent): Test -pie.
11165 (General_options::output_is_executable): Return true if not shared
11166 and not relocatable.
11167 (General_options::output_is_pie): Remove.
11168 * options.cc (General_options::finalize): Reject incompatible uses
11169 of -pie.
11170 * gold.cc (queue_middle_tasks): A -pie link is not static.
11171 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11172 * symtab.cc (Symbol::final_value_is_known): Return false if
11173 output_is_position_independent.
11174 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11175 output_is_position_independent.
11176 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11177 output_is_position_independent.
11178 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11179 output_is_position_independent.
11180 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11181 two_file_pie_test.
11182 (basic_pie_test.o, basic_pie_test): New targets.
11183 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11184 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11185 (two_file_pie_test): New target.
11186 * testsuite/Makefile.in: Rebuild.
11187 * README: Remove note saying that -pie is not supported.
11188
c6585162
ILT
111892009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11190
11191 * options.h (class General_options): Add -init and -fini.
11192 * layout.cc (Layout::finish_dynamic_section): Emit
11193 given init and fini functions.
11194
032ce4e9
ST
111952009-10-13 Sriraman Tallam <tmsriram@google.com>
11196
11197 * gc.h (gc_process_relocs): Check if icf is enabled using new
11198 function.
11199 * gold.cc (queue_initial_tasks): Likewise.
11200 (queue_middle_tasks): Likewise.
11201 * object.cc (do_layout): Likewise.
11202 * symtab.cc (is_section_folded): Likewise.
11203 * main.cc (main): Likewise.
11204 * reloc.cc (Read_relocs::run): Likewise.
11205 (Sized_relobj::do_scan_relocs): Likewise.
11206 * icf.cc (is_function_ctor_or_dtor): New function.
11207 (Icf::find_identical_sections): Check if function is ctor or dtor when
11208 safe icf is chosen.
11209 * options.h (General_options::icf): Change option to be an enum.
11210 (Icf_status): New enum.
11211 (icf_enabled): New method.
11212 (icf_safe_folding): New method.
11213 (set_icf_status): New method.
11214 (icf_status_): New variable.
11215 * (options.cc) (General_options::finalize): Set icf_status_.
11216 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11217 icf_test and icf_keep_unique_test to use the --icf enum flag.
11218 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11219 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11220
f345227a
ST
112212009-10-12 Sriraman Tallam <tmsriram@google.com>
11222
11223 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11224 includes to gc.h and icf.h.
11225 * arm.cc: Include gc.h.
11226 * gold.cc: Likewise.
11227 * i386.cc: Likewise.
11228 * powerpc.cc: Likewise.
11229 * sparc.cc: Likewise.
11230 * x86_64.cc: Likewise.
11231 * gc.h: Include icf.h.
11232
1c7814ed
ILT
112332009-10-11 Ian Lance Taylor <iant@google.com>
11234
11235 * plugin.cc: Include "gold.h" before other header files.
11236
ae3b5189
CD
112372009-10-10 Chris Demetriou <cgd@google.com>
11238
11239 * options.h (Input_file_argument::Input_file_type): New enum.
11240 (Input_file_argument::is_lib_): Replace with...
11241 (Input_file_argument::type_): New member.
11242 (Input_file_argument::Input_file_argument): Take Input_file_type
11243 'type' rather than boolean 'is_lib' as second argument.
11244 (Input_file_argument::is_lib): Use type_.
11245 (Input_file_argument::is_searched_file): New function.
11246 (Input_file_argument::may_need_search): Handle is_searched_file.
11247 * options.cc (General_options::parse_library): Support -l:filename.
11248 (General_options::parse_just_symbols): Update for Input_file_argument
11249 changes.
11250 (Command_line::process): Likewise.
11251 * archive.cc (Archive::get_file_and_offset): Likewise.
11252 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11253 * script.cc (read_script_file, script_add_file): Likewise.
11254 * fileread.cc (Input_file::Input_file): Likewise.
11255 (Input_file::will_search_for): Handle is_searched_file.
11256 (Input_file::open): Likewise.
11257 * readsyms.cc (Read_symbols::get_name): Likewise.
11258 * testsuite/Makefile.am (searched_file_test): New test.
11259 * testsuite/Makefile.in: Regenerate.
11260 * testsuite/searched_file_test.cc: New file.
11261 * testsuite/searched_file_test_lib.cc: New file.
11262
f3048a1d
ILT
112632009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11264 Ian Lance Taylor <iant@google.com>
11265
11266 * descriptor.cc: Include <cstdio> and "binary-io.h".
11267 (Descriptors::open): Open the files in binary mode always.
11268 * script.cc (Lex::get_token): Treat \r as whitespace.
11269
d4780e57
ILT
112702009-10-09 Ian Lance Taylor <iant@google.com>
11271
11272 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11273
d9a893b8
ILT
112742009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11275 Ian Lance Taylor <iant@google.com>
11276
11277 * configure.ac: Check for readv function also.
11278 * fileread.cc (readv): Define if not HAVE_READV.
11279 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11280 does not exist.
11281 * config.in: Regenerate.
11282 * configure: Regenerate.
11283
c0a62865
DK
112842009-10-09 Doug Kwan <dougkwan@google.com>
11285
11286 * layout.cc (Layout::make_output_section): Call target hook to make
11287 ordinary output section.
11288 (Layout::finalize): Adjust parameter list of call the
11289 Target::may_relax().
11290 * layout.h (class Layout::section_list): New method.
11291 * merge.h (Output_merge_base::entsize): Change visibility to public.
11292 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11293 New methods.
11294 (Output_merge_string::do_is_string): New method.
11295 * object.cc (Sized_relobj::do_setup): renamed from
11296 Sized_relobj::set_up.
11297 * object.h (Sized_relobj::adjust_shndx,
11298 Sized_relobj::initializ_input_to_output_maps,
11299 Sized_relobj::free_input_to_output_maps): Change visibilities to
11300 protected.
11301 (Sized_relobj::setup): Virtualize.
11302 (Sized_relobj::do_setup): New method declaration.
11303 (Sized_relobj::invalidate_section_offset,
11304 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11305 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11306 * options.cc (parse_int): New function.
11307 * options.h (parse_int): New declaration.
11308 (DEFINE_int): New macro.
11309 (stub_group_size): New option.
11310 * output.cc (Output_section::Output_section): Initialize memebers
11311 merge_section_map_, merge_section_by_properties_map_,
11312 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11313 (Output_section::add_input_section): Handled deferred code-fill
11314 generation and remove an old comment.
11315 (Output_section::add_relaxed_input_section): New method definition.
11316 (Output_section::add_merge_input_section): Use merge section by
11317 properties map to speed to search. Update merge section maps
11318 as appropriate.
11319 (Output_section::build_relaxation_map): New method definition.
11320 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11321 Same.
11322 (Output_section::relax_input_section): Renamed to
11323 Output_section::convert_input_sections_to_relaxed_sections and change
11324 interface to take a vector of pointers to relaxed sections.
11325 (Output_section::find_merge_section,
11326 Output_section::find_relaxed_input_section): New method definitions.
11327 (Output_section::is_input_address_mapped,
11328 Output_section::output_offset, Output_section::output_address):
11329 Use output section data maps to speed up searching.
11330 (Output_section::find_starting_output_address): Add comments.
11331 (Output_section::do_write,
11332 Output_section::write_to_postprocessing_buffer): Do code-fill
11333 generation as appropriate.
11334 (Output_section::get_input_sections): Invalidate relaxed input section
11335 map.
11336 (Output_section::restore_states): Adjust type of checkpoint .
11337 Invalidate relaxed input section map.
11338 * output.h (Output_merge_base): New class declaration.
11339 (Input_section_specifier): New class defintion.
11340 (class Output_relaxed_input_section) Change base class to
11341 Output_section_data_build.
11342 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11343 base class initializer.
11344 (Output_section::add_relaxed_input_section): New method declaration.
11345 (Output_section::Input_section): Change visibility to protected.
2e702c99 11346 (Output_section::Input_section::relobj,
c0a62865
DK
11347 Output_section::Input_section::shndx): Handle relaxed input sections.
11348 Output_section::input_sections) Change visibility to protected. Also
11349 define overload to return a non-const pointer.
11350 (Output_section::Merge_section_properties): New class defintion.
11351 (Output_section::Merge_section_by_properties_map,
11352 Output_section::Output_section_data_by_input_section_map,
11353 Output_section::Relaxation_map): New types.
11354 (Output_section::relax_input_section): Rename method to
11355 Output_section::convert_input_sections_to_relaxed_sections and change
11356 interface to take a vector of relaxed section pointers.
11357 (Output_section::find_merge_section,
11358 Output_section::find_relaxed_input_section,
11359 Output_section::build_relaxation_map,
11360 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11361 New method declarations.
11362 (Output_section::merge_section_map_
11363 Output_section::merge_section_by_properties_map_,
11364 Output_section::relaxed_input_section_map_,
11365 Output_section::is_relaxed_input_section_map_valid_,
11366 Output_section::generate_code_fills_at_write_): New data members.
11367 * script-sections.cc
11368 (Output_section_element_input::set_section_addresses): Call
11369 current_data_size and addralign methods of relaxed input sections.
11370 (Orphan_output_section::set_section_addresses): Call current_data_size
11371 and addralign methods of relaxed input sections.
11372 * symtab.cc (Symbol_table::compute_final_value): Extract template
11373 from the body of Symbol_table::sized_finalize_symbol.
11374 (Symbol_table::sized_finalized_symbol): Call
11375 Symbol_table::compute_final_value.
11376 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11377 (Symbol_table::compute_final_value): New templated method declaration.
11378 * target.cc (Target::do_make_output_section): New method defintion.
11379 * target.h (Target::make_output_section): New method declaration.
11380 (Target::relax): Add more parameters for input objects, symbol table
11381 and layout. Adjust call to do_relax.
11382 (Target::do_make_output_section): New method declaration.
11383 (Target::do_relax): Add parameters for input objects, symbol table
11384 and layout.
11385
d446d6c4
ILT
113862009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11387
11388 * pread.c: Include stdio.h.
11389
bc06c745
ILT
113902009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11391
11392 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11393 defined.
11394
75aea3d0
ILT
113952009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11396
11397 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11398 Change read_shndx type to unsigned int.
11399 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11400 int.
11401 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11402 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11403 Change read_shndx type to unsigned int.
11404 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11405 int.
11406 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11407 * layout.cc (Layout::create_symtab_sections): Cast the result of
11408 local_symcount * symsize to off_t in the gold_assert.
11409
be8fcb75
ILT
114102009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11411
11412 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11413 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11414 R_ARM_BASE_ABS.
11415 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11416 (Arm_relocate_functions::thm_abs5): New function.
11417 (Arm_relocate_functions::abs12): New function.
11418 (Arm_relocate_functions::abs16): New function.
11419 (Arm_relocate_functions::base_abs): New function.
11420 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11421 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11422 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11423 R_ARM_BASE_ABS.
11424 (Scan::global): Likewise.
11425 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11426 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11427 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11428 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11429 R_ARM_BASE_ABS.
11430
c2a122b6
ILT
114312009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11432
11433 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11434 (Arm_relocate_functions::movt_prel): New function.
11435 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11436 (Arm_relocate_functions::thm_movt_prel): New function.
11437 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11438 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11439 (Scan::global, Relocate::relocate): Likewise.
11440 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11441
c4aa1e2d
ILT
114422009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11443
11444 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11445 Incremental_checker.
11446 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11447 unsigned int.
11448 (class Incremental_inputs_header): New class.
11449 (Incremental_inputs_header_writer): Edit comment.
11450 (Incremental_inputs_entry): New class.
11451 (Incremental_inputs_entry_writer): Edit comment.
11452 (Sized_incremental_binary::do_find_incremental_inputs_section):
11453 Add *strtab_shndx parameter, fill it.
11454 (Sized_incremental_binary::do_check_inputs): New method.
11455 (Incremental_checker::can_incrementally_link_output_file): Use
11456 Sized_incremental_binary::check_inputs.
11457 (Incremental_inputs::report_command_line): Save command line in
11458 command_line_.
11459 * incremental.h:
11460 (Incremental_binary::find_incremental_inputs_section): New
11461 method.
11462 (Incremental_binary::do_find_incremental_inputs_section): Add
11463 strtab_shndx parameter.
11464 (Incremental_binary::do_check_inputs): New pure virtual method.
11465 (Sized_incremental_binary::do_check_inputs): Declare.
11466 (Incremental_checker::Incremental_checker): Add incremental_inputs
11467 parameter, use it to initialize incremental_inputs_.
11468 (Incremental_checker::incremental_inputs_): New field.
11469 (Incremental_checker::command_line): New method.
11470 (Incremental_checker::inputs): New method.
11471 (Incremental_checker::command_line_): New field.
11472
c549a694
ILT
114732009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11474
11475 * incremental.cc: Include <cstdarg> and "target-select.h".
11476 (vexplain_no_incremental): New function.
11477 (explain_no_incremental): New function.
11478 (Incremental_binary::error): New method.
11479 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11480 method.
11481 (make_sized_incremental_binary): New function.
11482 (open_incremental_binary): New function.
11483 (can_incrementally_link_file): Add checks if output is ELF and has
11484 inputs section.
11485 * incremental.h: Include "elfcpp_file.h" and "output.h".
11486 (Incremental_binary): New class.
11487 (Sized_incremental_binary): New class.
11488 (open_incremental_binary): Declare.
11489 * object.cc (is_elf_object): Use
11490 elfcpp::Elf_recognizer::is_elf_file.
11491 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11492 * output.h (Output_file::filesize): New method.
11493
fd3c5f0b
ILT
114942009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11495
11496 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11497 New function.
11498 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11499 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11500 function.
11501 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11502 function.
11503 (Arm_relocate_functions::movw_abs_nc): New function.
11504 (Arm_relocate_functions::movt_abs): New function.
11505 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11506 (Arm_relocate_functions::thm_movt_abs): New function.
11507 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11508 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11509 (Scan::global): Likewise.
11510 (Relocate::relocate): Likewise.
11511 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11512
7f5309a5
ILT
115132009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11514
11515 * arm.cc (Arm_relocate_functions::got_prel) New function.
11516 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11517 (Relocate::relocate): Likewise.
11518 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11519
364c7fa5
ILT
115202009-10-06 Ian Lance Taylor <iant@google.com>
11521
11522 * options.h (class General_options): Define
11523 split_stack_adjust_size parameter.
11524 * object.h (class Object): Add uses_split_stack_ and
11525 has_no_split_stack_ fields. Add uses_split_stack and
11526 has_no_split_stack accessor functions. Declare
11527 handle_split_stack_section.
11528 (class Reloc_symbol_changes): Define.
11529 (class Sized_relobj): Define Function_offsets. Declare
11530 split_stack_adjust, split_stack_adjust_reltype, and
11531 find_functions.
11532 * object.cc (Object::handle_split_stack_section): New function.
11533 (Sized_relobj::do_layout): Call handle_split_stack_section.
11534 * dynobj.cc (Sized_dynobj::do_layout): Call
11535 handle_split_stack_section.
11536 * reloc.cc (Sized_relobj::relocate_sections): Call
11537 split_stack_adjust for executable sections in split_stack
11538 objects. Pass reloc_map to relocate_section.
11539 (Sized_relobj::split_stack_adjust): New function.
11540 (Sized_relobj::split_stack_adjust_reltype): New function.
11541 (Sized_relobj::find_functions): New function.
11542 * target-reloc.h: Include "object.h".
11543 (relocate_section): Add reloc_symbol_changes parameter. Change
11544 all callers.
11545 * target.h (class Target): Add calls_non_split method. Declare
11546 do_calls_non_split virtual method. Declare match_view and
11547 set_view_to_nop.
11548 * target.cc: Include "elfcpp.h".
11549 (Target::do_calls_non_split): New function.
11550 (Target::match_view): New function.
11551 (Target::set_view_to_nop): New function.
11552 * gold.cc (queue_middle_tasks): Give an error if mixing
11553 split-stack and non-split-stack objects with -r.
11554 * i386.cc (Target_i386::relocate_section): Add
11555 reloc_symbol_changes parameter.
11556 (Target_i386::do_calls_non_split): New function.
11557 * x86_64.cc (Target_x86_64::relocate_section): Add
11558 reloc_symbol_changes parameter.
11559 (Target_x86_64::do_calls_non_split): New function.
11560 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11561 parameter.
11562 * powerpc.cc (Target_powerpc::relocate_section): Add
11563 reloc_symbol_changes parameter.
11564 * sparc.cc (Target_sparc::relocate_section): Add
11565 reloc_symbol_changes parameter.
11566 * configure.ac: Call AM_CONDITIONAL for the default target.
11567 * configure: Rebuild.
11568 * testsuite/Makefile.am (TEST_AS): New variable.
11569 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11570 (check_DATA): Add split_i386 and split_x86_64 files.
11571 (SPLIT_DEFSYMS): Define.
11572 (split_i386_[1234n].o): New targets.
11573 (split_i386_[124]): New targets.
11574 (split_i386_[1234r].stdout): New targets.
11575 (split_x86_64_[1234n].o): New targets.
11576 (split_x86_64_[124]): New targets.
11577 (split_x86_64_[1234r].stdout): New targets.
11578 (MOSTLYCLEANFILES): Add new executables.
11579 * testsuite/split_i386.sh: New file.
11580 * testsuite/split_x86_64.sh: New file.
11581 * testsuite/split_i386_1.s: New file.
11582 * testsuite/split_i386_2.s: New file.
11583 * testsuite/split_i386_3.s: New file.
11584 * testsuite/split_i386_4.s: New file.
11585 * testsuite/split_i386_n.s: New file.
11586 * testsuite/split_x86_64_1.s: New file.
11587 * testsuite/split_x86_64_2.s: New file.
11588 * testsuite/split_x86_64_3.s: New file.
11589 * testsuite/split_x86_64_4.s: New file.
11590 * testsuite/split_x86_64_n.s: New file.
11591 * testsuite/testfile.cc (Target_test): Update relocation_section
11592 function.
11593 * testsuite/Makefile.in: Rebuild.
11594
e8a9fcda
ILT
115952009-10-06 Ian Lance Taylor <iant@google.com>
11596
11597 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11598 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11599 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11600 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11601 the address on ldo_addrs_.
11602 (Target_i386::Relocate::fix_up_ldo): New function.
11603
e99daf92
ILT
116042009-10-06 Rafael Espindola <espindola@google.com>
11605
11606 * plugin.cc (add_input_library): New.
11607 (Plugin::load): Add add_input_library to tv.
11608 (Plugin_manager::add_input_file): Add the is_lib argument.
11609 (add_input_file): Update call to Plugin_manager::add_input_file.
11610 (add_input_library): New.
11611 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11612
966d4097
DK
116132009-09-30 Doug Kwan <dougkwan@google.com>
11614
11615 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11616 symbol and call Symbol::may_need_copy_reloc to determine if
11617 a copy reloc is needed.
11618 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11619 nocopyreloc is given in command line.
11620 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11621 given in command line.
11622 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11623 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11624 of the removed Target_i386::may_need_copy_reloc.
11625 * options.h (copyreloc): New option with default value false.
11626 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11627 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11628 instead of the removed Target_powerpc::may_need_copy_reloc.
11629 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11630 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11631 instead of the removed Target_sparc::may_need_copy_reloc.
11632 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11633 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11634 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11635 instead of the removed Target_x86_64::may_need_copy_reloc.
11636
029ba973
ILT
116372009-09-30 Ian Lance Taylor <iant@google.com>
11638
11639 * object.h (class Object): Remove target_ field, and target,
11640 sized_target, and set_target methods.
11641 (Object::sized_target): Remove.
11642 (class Sized_relobj): Update declarations. Remove sized_target.
11643 * object.cc (Sized_relobj::setup): Remove target parameter.
11644 Change all callers.
11645 (Input_objects::add_object): Don't do anything with the target.
11646 (make_elf_sized_object): Add punconfigured parameter. Change all
11647 callers. Set or test parameter target.
11648 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
11649 Change all callers.
11650 * parameters.cc (Parameters::set_target): Change parameter type to
11651 be non-const.
11652 (Parameters::default_target): Remove.
11653 (set_parameters_target): Change parameter type to be non-const.
11654 (parameters_force_valid_target): New function.
11655 (parameters_clear_target): New function.
11656 * parameters.h (class Parameters): Update declarations. Remove
11657 default_target method. Add sized_target and clear_target
11658 methods. Change target_ to be non-const.
11659 (set_parameters_target): Update declaration.
11660 (parameters_force_valid_target): Declare.
11661 (parameters_clear_target): Declare.
11662 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
11663 as NULL if we aren't searching.
11664 (Add_symbols::run): Don't check for compatible target.
11665 * fileread.cc (Input_file::open_binary): Call
11666 parameters_force_valid_target.
11667 * gold.cc (queue_middle_tasks): Likewise.
11668 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
11669 set_target on object.
11670 * dynobj.h (class Sized_dynobj): Update declarations.
11671 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
11672 make_elf_object returns NULL.
11673 (Archive::include_member): Don't check whether object target is
11674 compatible.
11675 * output.cc (Output_section::add_input_section): Get target from
11676 parameters.
11677 (Output_section::relax_input_section): Likewise.
11678 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
11679 parameters.
11680 (Sized_relobj::do_scan_relocs): Likewise.
11681 (Sized_relobj::relocate_sections): Likewise.
11682 * resolve.cc (Symbol_table::resolve): Likewise.
11683 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
11684 parameter. Change all callers.
11685 (Symbol_table::add_from_object): Get target from parameters.
11686 (Symbol_table::add_from_relobj): Don't check object target.
11687 (Symbol_table::add_from_dynobj): Likewise.
11688 (Symbol_table::define_special_symbol): Get target from
11689 parameters.
11690 * symtab.h (class Symbol_table): Update declaration.
11691 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
11692 parameter. Change all callers. Clear parameter target.
11693 (Binary_test): Test target here.
11694 * testsuite/object_unittest.cc (gold_testsuite): Remove
11695 target_test_pointer parameter. Change all callers.
11696 (Object_test): Test target here.
11697
a6a22b83
ILT
116982009-09-26 Ian Lance Taylor <iant@google.com>
11699
11700 * testsuite/initpri1.c: Don't try to use constructor priorities if
11701 compiling with gcc before 4.3.
11702
6a8f49fe
ILT
117032009-09-22 Mikolaj Zalewski <mikolajz@google.com>
11704
11705 * testsuite/retain_symbols_file_test.sh (check_present): Change
11706 output file name to retain_symbols_file_test.stdout.
11707 (check_absent): Likewise.
11708
8c604651
CS
117092009-09-18 Craig Silverstein <csilvers@google.com>
11710
11711 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
11712 * options.cc: Include <cerrno> and <fstream>.
11713 (General_options::finalize): Parse -retain-symbols-file tag.
11714 * options.h: New flag.
11715 (General_options): New method should_retain_symbol, new
11716 variable symbols_to_retain.
11717 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
11718 should_retain_symbol map.
11719 * testsuite/Makefile.am (retain_symbols_file_test): New test.
11720 * testsuite/Makefile.in: Regenerate.
11721 * testsuite/retain_symbols_file_test.sh: New file.
11722
ca58b19f
NC
117232009-09-18 Nick Clifton <nickc@redhat.com>
11724
11725 * po/es.po: Updated Spanish translation.
11726
20e6d0d6
DK
117272009-09-17 Doug Kwan <dougkwan@google.com>
11728
11729 * debug.h (DEBUG_RELAXATION): New constant.
11730 (DEBUG_ALL): Add DEBUG_RELAXATION.
11731 (debug_string_to_enum): Add relaxation debug option.
11732 * layout.cc
11733 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
11734 Layout::Relaxation_debug_check::read_sections,
11735 Layout::Relaxation_debug_check::read_sections): New method definitions.
11736 (Layout::Layout): Initialize data members
11737 record_output_section_data_from_scrips_,
11738 script_output_section_data_list_ and relaxation_debug_check_.
11739 (Layout::save_segments, Layout::restore_segments,
11740 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11741 Layout::relaxation_loop_body): New method definitions.
11742 (Layout::finalize): Support relaxation. Move section layout code to
11743 Layout::relaxation_loop_body.
11744 (Layout::set_asection_address_from_script): Move code for orphan
11745 section placement out.
11746 (Layout::place_orphan_sections_in_script): New method definition.
11747 * layout.h (Output_segment_headers, Output_file_header):
11748 New forward class declarations.
11749 (Layout::~Layout): Define.
11750 (Layout::new_output_section_data_from_script): New method definition.
11751 (Layout::place_orphan_sections_in_script): New method declaration.
11752 (Layout::Segment_states): New type declaration.
11753 (Layout::save_segments, Layout::restore_segments,
11754 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11755 Layout::relaxation_loop_body): New method declarations.
11756 (Layout::Output_section_data_list): New type declaration.
11757 (Layout::Relaxation_debug_check): New class definition.
11758 (Layout::record_output_section_data_from_script_,
11759 Layout::script_output_section_data_list_, Layout::segment_states_,
11760 Layout::relaxation_debug_check_): New data members.
11761 * output.cc: (Output_section_headers::do_size): New method definition.
11762 (Output_section_headers::Output_section_headers): Move size
11763 computation to Output_section_headers::do_size.
11764 (Output_segment_headers::do_size): New method definition.
e1df38aa 11765 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
11766 Output_file_header::do_size and call it.
11767 (Output_file_header::do_size): New method definition.
11768 (Output_data_group::Output_data_group): Adjust call to
11769 Output_section_data.
11770 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
11771 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 11772 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
11773 RELAXED_INPUT_SECTION_CODE.
11774 (Output_section::Output_section): Initialize data member checkpoint_.
11775 (Output_section::~Output_section): Delete checkpoint object pointed
11776 by checkpoint_.
11777 (Output_section::add_input_section): Always add an Input_section if
11778 relaxing.
11779 (Output_section::add_merge_input_section): Add assert.
11780 (Output_section::relax_input_section): New method definition.
11781 (Output_section::set_final_data_size): Set load address to zero for
11782 an unallocated section.
11783 (Output_section::do_address_and_file_offset_have_reset_values):
11784 New method definition.
11785 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
11786 Handle relaxed input section.
11787 (Output_section::sort_attached_input_sections): Checkpoint input
11788 section list lazily.
11789 (Output_section::get_input_sections): Change type of input_sections to
11790 list of Simple_input_section pointers. Checkpoint input section list
11791 lazily. Also handle relaxed input sections.
11792 (Output_section::add_input_section_for_script): Take a reference to
11793 a Simple_input_section object instead of Relobj pointer and section
11794 index as parameter. Handle relaxed input sections.
11795 (Output_section::save_states, Output_section::restore_states): New
11796 method definitions.
11797 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
11798 (Output_data::is_data_size_fixed): New method definition.
11799 (Output_data::reset_addresss_and_file_offset): Do not reset data size
11800 if it is fixed.
11801 (Output_data::address_and_file_offset_have_reset_values): New method
11802 definition.
11803 (Output_data::do_address_and_file_offset_have_reset_values): New method
11804 definition.
11805 (Output_data::set_data_size): Check that data size is not fixed.
11806 (Output_data::fix_data_size): New method definition.
11807 (Output_data::is_data_size_fixed_): New data member.
11808 (Output_section_headers::set_final_data_size): New method definition.
11809 (Output_section_headers::do_size): New method declaration.
11810 (Output_segment_headers::set_final_data_size): New method definition.
11811 (Output_segment_headers::do_size): New method declaration.
11812 (Output_file_header::set_final_data_size)::New method definition.
11813 (Output_file_header::do_size)::New method declaration.
11814 (Output_section_data::Output_section_data): Add new parameter
11815 is_data_size_fixed and use it to fix data size.
11816 (Output_data_const::Output_data_const): Adjust call to base class
11817 constructor and fix data size.
11818 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
11819 base class constructor and fix data size.
11820 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
11821 base class constructor and fix data size.
11822 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
11823 class constructor and fix data size.
11824 (Output_data_group::set_final_data_size): New method definition.
11825 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
11826 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
11827 class constructor and fix data size.
11828 (Output_relaxed_input_section): New class definition.
11829 (Output_section::Simple_input_section): New class definition.
11830 (Output_section::get_input_sections): Adjust parameter list.
11831 (Output_section::add_input_section_for_script): Same.
11832 (Output_section::save_states, Output_section::restore_states,
11833 Output_section::do_address_and_file_offset_have_reset_values,
11834 (Output_section::Input_section::Input_section): Handle
11835 RELAXED_INPUT_SECTION_CODE. Add new overload for
11836 Output_relaxed_input_section.
11837 (Output_section::Input_section::is_input_section,
11838 Output_section::Input_section::set_output_section): Handle relaxed
11839 input section.
11840 (Output_section::Input_section::is_relaxed_input_section,
11841 Output_section::Input_section::output_section_data,
11842 Output_section::Input_section::relaxed_input_section): New method
11843 definitions.
11844 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
11845 value.
11846 (Output_section::Input_section::u1_): Update comments.
11847 (Output_section::Input_section::u2_): Add new union member poris.
11848 (Output_section::Checkpoint_output_section): New classs definition.
11849 (Output_section::relax_input_section): New method declaration.
11850 (Output_section::checkpoint_): New data member.
11851 (Output_segment): Update comments.
11852 (Output_segment::Output_segment): Un-privatize copy constructor.
11853 (Output_segment::operator=): Un-privatize.
11854 * script-sections.cc (Output_section_element::Input_section_list):
11855 Change element type to Output_section::Simple_input_section.
11856 (Output_section_element_dot_assignment::set_section_addresses):
11857 Register output section data for relaxation clean up.
11858 (Output_data_exression::Output_data_expression): Adjust call to base
11859 constructor to fix data size.
11860 (Output_section_element_data::set_section_addresses): Register
11861 Output_data_expression object for relaxation clean up.
11862 (struct Input_section_info): Replace Relobj pointer and section index
11863 pair with Output_section::Simple_input_section and Convert struct to a
11864 class.
11865 (Input_section_sorter::operator()): Adjust access to
e1df38aa 11866 Input_section_info data member to use accessors.
20e6d0d6
DK
11867 (Output_section_element_input::set_section_addresses): Use layout
11868 parameter. Adjust code to use Output_section::Simple_input_section
11869 and Input_secction_info classes. Register filler for relaxation
11870 clean up.
11871 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11872 and section index pair with Output_section::Simple_input_section
11873 class. Adjust code accordingly.
11874 (Phdrs_element::release_segment): New method definition.
11875 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11876 segment list.
11877 (Script_sections::release_segments): New method definition.
11878 * gold/script-sections.h (Script_sections::release_segments): New
11879 method declaration.
11880 * gold/target.h (Target::may_relax, Target::relax,
11881 Target::do_may_relax, Target::do_relax): New method definitions.
11882
5e445df6
ILT
118832009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11884
11885 * arm.cc (has_signed_unsigned_overflow): New function.
11886 (Arm_relocate_functions::abs8): New function.
11887 (Target_arm::Scan::local): Handle R_ARM_ABS8.
11888 (Target_arm::Scan::global): Likewise.
11889 (Target_arm::relocate::relocate): Likewise.
11890 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11891 Likewise.
11892
8c604651 118932009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
11894
11895 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
11896 * testsuite/Makefile.in: Regenerate.
11897
1e9cc1c2
NC
118982009-09-11 Nick Clifton <nickc@redhat.com>
11899
11900 * po/gold.pot: Updated by the Translation project.
11901
6a89f575
CC
119022009-09-08 Cary Coutant <ccoutant@google.com>
11903
11904 * output.cc (Output_file::open): Add execute permission to empty file.
11905 * testsuite/Makefile.am (permission_test): New test.
11906 * testsuite/Makefile.in: Regenerate.
11907
fdcac5af
ILT
119082009-09-02 Ian Lance Taylor <iant@google.com>
11909
11910 * output.cc (Output_file::resize): Call map_no_anonymous rather
11911 than map.
11912
44453f85
ILT
119132009-09-01 Mikolaj Zalewski <mikolajz@google.com>
11914
11915 * gold.cc: Include "incremental.h".
11916 (queue_initial_tasks): Call Incremental_checker methods.
11917 * incremental.cc: Include "output.h".
11918 (Incremental_checker::can_incrementally_link_output_file): New
11919 method.
11920 * incremental.h (Incremental_checker): New class.
11921
11922 * output.cc (Output_file::open_for_modification): New method.
11923 (Output_file::map_anonymous): Changed return type to bool. Record
11924 map in base_ field.
11925 (Output_file::map_no_anonymous): New method, broken out of map.
11926 (Output_file::map): Use map_no_anonymous and map_anonymous.
11927 * output.h (class Output_file): Update declarations.
11928
293c1386
CC
119292009-08-24 Cary Coutant <ccoutant@google.com>
11930
11931 * options.h (Command_line::Pre_options): New class.
11932 (Command_line::pre_options): New member.
11933 * options.cc (gold::options::ready_to_register): New variable.
11934 (One_option::register_option): Do nothing if not registering options.
11935 Assert if same short option registered twice.
11936 (General_options::General_options): Turn off option registration when
11937 done constructing.
11938 (Command_line::Pre_options::Pre_options): New constructor.
11939
f773f3d2
CC
119402009-08-24 Cary Coutant <ccoutant@google.com>
11941
06a73cfe
CC
11942 * options.h (General_options::no_keep_memory): Remove incorrect
11943 short option.
f773f3d2 11944
a15af8e2
RW
119452009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11946
11947 * Makefile.am (am__skiplex, am__skipyacc): New.
11948 * Makefile.in: Regenerate.
11949
c462b41b
RW
119502009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11951
14ec8efd
RW
11952 * Makefile.am (AM_CPPFLAGS): Renamed from ...
11953 (INCLUDES): ... this.
11954 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
11955 (AM_CPPFLAGS): Renamed from ...
11956 (INCLUDE): ... this.
11957 * Makefile.in, testsuite/Makefile.in: Regenerate.
11958
81ecdfbb
RW
11959 * Makefile.in: Regenerate.
11960 * aclocal.m4: Likewise.
11961 * config.in: Likewise.
11962 * configure: Likewise.
11963 * testsuite/Makefile.in: Likewise.
11964
c462b41b
RW
11965 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11966 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11967 * Makefile.in: Regenerate.
11968 * testsuite/Makefile.in: Regenerate.
11969
2da73f13
CC
119702009-08-19 Cary Coutant <ccoutant@google.com>
11971
11972 * resolve.cc (Symbol_table::resolve): Don't complain about defined
11973 symbols in shared libraries overridden by hidden or internal symbols
11974 in the main program.
11975
2db70501
CD
119762009-08-19 Chris Demetriou <cgd@google.com>
11977
11978 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
11979 checking source file names in error messages.
11980
f733487b
DK
119812009-08-18 Doug Kwan <dougkwan@google.com>
11982
11983 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
11984 an elcpp::Ehdr as parameter. Adjust call to set_target.
11985 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
11986 an elfcpp::Ehdr as parameter.
11987 * object.cc (Object::set_target): Remove the version that looks up
11988 a target and sets it.
11989 (Sized_relobj::setup): Take a Target object instead of
11990 an elfcpp::Ehdr as parameter. Adjust call to set_target.
11991 (make_elf_sized_object): Find target and ask target to
11992 make an ELF object.
11993 * object.h: (Object::set_target): Remove the version that looks up
11994 a target and sets it.
11995 (Sized_relobj::setup): Take a Target object instead of
11996 an elfcpp:Ehdr as parameter.
11997 * target.cc: Include dynobj.h.
11998 (Target::do_make_elf_object_implementation): New.
2e702c99 11999 (Target::do_make_elf_object): New.
f733487b
DK
12000 * target.h (Target::make_elf_object): New template declaration.
12001 (Target::do_make_elf_object): New method declarations.
12002 (Target::do_make_elf_object_implementation): New template declaration.
12003
cc70f101
ILT
120042009-08-14 Ian Lance Taylor <iant@google.com>
12005
12006 * gold.h (FUNCTION_NAME): Define.
12007 (gold_unreachable): Use FUNCTION_NAME.
12008
ef5e0cb1
ST
120092009-08-12 Sriraman Tallam <tmsriram@google.com>
12010
12011 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12012 symbol in the --keep-unique list is not found.
12013
48c187ce
ST
120142009-08-12 Sriraman Tallam <tmsriram@google.com>
12015
12016 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12017 been maked as --keep-unique.
12018 (Icf::unfold_section): New function.
12019 * icf.h (Icf::unfold_section): New function.
12020 * options.h (General_options::keep_unique): New option.
12021 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12022 * testsuite/Makefile.in: Regenerate.
12023 * testsuite/icf_keep_unique_test.sh: New file.
12024 * testsuite/icf_keep_unique_test.cc: New file.
12025
645afe0c
CC
120262009-08-12 Cary Coutant <ccoutant@google.com>
12027
12028 PR 10471
12029 * resolve.cc (Symbol_table::resolve): Check for references from
12030 dynamic objects to hidden and internal symbols.
12031 * testsuite/Makefile.am (hidden_test.sh): New test.
12032 * testsuite/Makefile.in: Regenerate.
12033 * testsuite/hidden_test.sh: New script.
12034 * testsuite/hidden_test_1.c: New test source.
12035 * testsuite/hidden_test_main.c: New test source.
12036
11af873f
DK
120372009-08-11 Doug Kwan <dougkwan@google.com>
12038
12039 * arm.cc: Update comments.
12040 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12041 segment to locate the .ARM.exidx section if present.
12042
b9f7d72d
DK
120432009-08-09 Doug Kwan <dougkwan@google.com>
12044
12045 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12046 patch.
12047
ddd3c53c
ST
120482009-08-07 Sriraman Tallam <tmsriram@google.com>
12049 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12050 compiler warnings.
12051
27721062
ST
120522009-08-06 Sriraman Tallam <tmsriram@google.com>
12053
12054 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12055 valid tls_segment only for non-debug-section relocations.
12056 * testsuite/Makefile.am: Add gc_tls_test.
12057 * testsuite/Makefile.in: Regenerate.
12058 * testsuite/gc_tls_test.cc: New file.
12059 * testsuite/gc_tls_test.sh: New file.
12060
ef15dade 120612009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12062
ef15dade
ST
12063 * icf.cc: New file.
12064 * icf.h: New file.
12065 * Makefile.am (CCFILES): Add icf.cc.
12066 (HFILES): Add icf.h
12067 * Makefile.in: Regenerate.
12068 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12069 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12070 section, symbol and addend information for the relocs.
12071 * gold.cc (queue_middle_tasks): Call identical code folding.
12072 * gold.h: Add defines for multimap.
12073 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12074 to the call of finalize_local_symbols.
12075 * main.cc (main): Create object of class Icf.
12076 * object.cc (Sized_relobj::do_layout): Allow this function to be
12077 called twice during icf.
12078 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12079 to sections marked as identical by icf.
12080 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12081 when available.
12082 (Sized_relobj::do_section_entsize): New function.
12083 * object.h (Object::section_entsize): New function.
12084 (Object::do_section_entsize): New pure virtual function.
12085 (Relobj::finalize_local_symbols): Add new parameter.
12086 (Relobj::do_section_entsize): New function.
12087 * options.h (General_options::icf): New option.
12088 (General_options::icf_iterations): New option.
12089 (General_options::print_icf_sections): New option.
12090 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12091 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12092 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12093 icf.
12094 * symtab.cc (Symbol_table::is_section_folded): New function.
12095 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12096 to sections marked as identical by icf.
12097 * symtab.h (Symbol_table::set_icf): New function.
12098 (Symbol_table::icf): New function.
12099 (Symbol_table::is_section_folded): New function.
12100 (Symbol_table::icf_): New data member.
12101 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12102 * testsuite/Makefile.am: Add commands to build icf_test.
12103 * testsuite/Makefile.in: Regenerate.
12104 * testsuite/icf_test.sh: New file.
12105 * testsuite/icf_test.cc: New file.
12106
c3b65ac4
CD
121072009-07-24 Chris Demetriou <cgd@google.com>
12108
12109 * layout.cc (is_compressible_debug_section): Fix incorrect
12110 comment about compressed section names.
12111
1caf2c51
ILT
121122009-07-20 Ian Lance Taylor <ian@airs.com>
12113
12114 PR 10419
12115 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12116
1ef4d87f
ILT
121172009-07-16 Ian Lance Taylor <iant@google.com>
12118
12119 PR 10400
12120 * layout.h: #include <map>.
12121 (class Kept_section): Change from struct to class. Add accessors
12122 and setters. Add section size to Comdat_group mapping. Change
12123 Comdat_group to std::map. Add is_comdat_ field. Add
12124 linkonce_size field in union.
12125 (class Layout): Update declaration of find_or_add_kept_section.
12126 Don't declare find_kept_object.
12127 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12128 parameter. Add object, shndx, is_comdat, and is_group_name
12129 parameters. Change all callers. Adjust for new Kept_section.
12130 (Layout::find_kept_object): Remove.
12131 * object.cc (Sized_relobj::include_section_group): Update use of
12132 Kept_section. Rename secnum to shndx. Only record
12133 Kept_comdat_section if sections are the same size.
12134 (Sized_relobj::include_linkonce_section): Update use of
12135 Kept_section. Only record Kept_comdat_section if sections are the
12136 same size. Set size of linkonce section.
12137 (Sized_relobj::map_to_kept_section): Update call to
12138 get_kept_comdat_section.
12139 * object.h (class Sized_relobj): Rename fields in
12140 Kept_comdat_section to drop trailing underscores; change object
12141 field to Relobj*. Change Kept_comdat_section_table to store
12142 struct rather than pointer.
12143 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12144 Add kept_object and kept_shndx parameters. Change all callers.
12145 (Sized_relobj::get_kept_comdat_section): Change return type to
12146 bool. Add kept_object and kept_shndx parameters. Change all
12147 callers.
12148 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12149 Layout::find_or_add_kept_section.
12150
37c3b7b0
ILT
121512009-07-09 Ian Lance Taylor <iant@google.com>
12152
12153 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12154 Reserve space in the hash table.
12155
98fa85cb
ILT
121562009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12157
12158 * fileread.cc (File_read::get_mtime): New method.
12159 * fileread.h (Timespec): New structure.
12160 (File_read::get_mtime): New method.
12161 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12162 Renamed from timestamp_nsec.
12163 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12164 Elf_Xword.
e1df38aa 12165 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12166 timestamp_nsec.
e1df38aa 12167 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12168 (Incremental_inputs::report_obejct): Save mtime; style fix.
12169 (Incremental_inputs::report_script): Save mtime; style fix.
12170 (Incremental_inputs::finalize_inputs): Style fix.
12171 (Incremental_inputs::finalize): Style fix.
12172 (Incremental_inputs::create_input_section_data): Store inputs
12173 mtime.
12174 * incremental.h (Incremental_inputs::report_script): Add mtime
12175 argument.
12176 (Incremental_inputs::Input_info::Input_info): Intialize only one
12177 union member.
12178 (Incremental_inputs::Input_info::archive): Move to nameless
12179 union.
12180 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12181 (Incremental_inputs::Input_info::script): Move to nameless union.
12182 (Incremental_inputs::mtime): New field.
12183 * script.cc (read_input_script): Pass file mtime to
12184 Incremental_input.
12185 * script.h (Script_info::inputs): Style fix.
12186
c9d70757
ILT
121872009-07-01 Ian Lance Taylor <ian@airs.com>
12188
12189 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12190 instead of 32.
12191
9c547ec3
ILT
121922009-06-24 Ian Lance Taylor <iant@google.com>
12193
12194 PR 10156
12195 * layout.cc (Layout::choose_output_section): If we find an
12196 existing section, update the flags.
12197 (Layout::create_notes): New function, broken out of
12198 Layout::finalize.
12199 (Layout::finalize): Don't create note sections.
12200 (Layout::create_note): Don't crash if linker script discards
12201 section.
12202 (Layout::create_gold_note): Likewise.
12203 (Layout::create_build_id): Likewise. Don't set
12204 after_input_sections on the section.
12205 (Layout::create_executable_stack_info): Remove target parameter.
12206 Change caller.
12207 * layout.h (class Layout): Declare create_notes. Update
12208 declaration of create_executable_stack_info.
12209 * gold.cc (queue_middle_tasks): Call create_notes.
12210 * output.cc (Output_section::update_flags_for_input_section): Move
12211 here from output.h. If SHF_ALLOC flag is newly set, mark address
12212 invalid.
12213 * output.h (Output_data::mark_address_invalid): New function.
12214 (class Output_section): Only declare, not define,
12215 update_flags_for_input_section. Remove set_flags.
12216
55458500
ILT
122172009-06-24 Ian Lance Taylor <iant@google.com>
12218
12219 * script-sections.cc (Output_section_definition::
12220 set_section_addresses): Rename shadowing local load_address to
12221 laddr.
12222
1307d6cd
ILT
122232009-06-24 Ian Lance Taylor <iant@google.com>
12224
12225 PR 10244
12226 * reloc.cc (relocate_sections): Skip empty relocation sections.
12227
ec3f783e
ILT
122282009-06-23 Ian Lance Taylor <iant@google.com>
12229
12230 PR 10156
12231 * layout.cc (Layout::create_note): Use choose_output_section
12232 rather than make_output_section.
12233
459c9f1c
ILT
122342009-06-23 Ian Lance Taylor <iant@google.com>
12235
12236 PR 10237
12237 * options.cc (General_options::parse_V): Set printed_version_.
12238 (General_options::General_options): Initialize printed_version_.
12239 * options.h (class General_options): Add printed_version_ field.
12240 * gold.cc (queue_initial_tasks): If there are no input files,
12241 don't give a fatal error if we printed the version information.
12242 (queue_middle_tasks): If using -r with a shared object, give a
12243 fatal error rather than an ordinary error.
12244
1518dc8f
ILT
122452009-06-23 Ian Lance Taylor <iant@google.com>
12246
12247 PR 10219
12248 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12249 (Layout::make_output_section): Set have_stabstr_section_ if we see
12250 a .stab*str section.
12251 (Layout::finalize): Call link_stabs_sections.
12252 (Layout::link_stabs_sections): New file.
12253 * layout.h (class Layout): Add have_stabstr_section_ field.
12254 Declare link_stabs_sections.
12255
3d857b98
DK
122562009-06-23 Doug Kwan <dougkwan@google.com>
12257
12258 * Makefile.am (libgold_a_LIBADD): New.
12259 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12260 * Makefile.in: Regenerate.
3d857b98
DK
12261 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12262 * configure: Regenerate.
12263 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12264 * fileread.cc: Include sys/state.h
12265 * gold.h: Declare memmem and strndup if found missing.
12266 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12267
0639a6f6
ILT
122682009-06-23 Ian Lance Taylor <iant@google.com>
12269
12270 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12271 * configure: Rebuild.
12272
8d63875c
ILT
122732009-06-23 Ian Lance Taylor <iant@google.com>
12274
12275 PR 10147
12276 * object.cc (Object::section_contents): Don't try to get a view if
12277 the section has length zero.
12278 (Object::handle_gnu_warning_section): If the section is empty, use
12279 the name of the section as the warning.
12280
f7c8a183
ILT
122812009-06-23 Ian Lance Taylor <iant@google.com>
12282
12283 PR 10133
12284 * stringpool.h (class Stringpool_template): Add optimize_ field.
12285 (Stringpool_template::set_optimize): New function.
12286 * stringpool.cc (Stringpool_template::Stringpool_template):
12287 Initialize optimize_ field.
12288 (Stringpool_template::set_string_offsets): Test local optimize
12289 fild rather than parameter.
12290 * layout.cc (Layout::Layout): Call set_optimize on the section
12291 name stringpool.
12292
e6a307ba
ILT
122932009-06-22 Ian Lance Taylor <iant@google.com>
12294
12295 PR 10030
12296 * yyscript.y: Parse TARGET.
12297 * script.cc (script_set_target): New function.
12298 * script-c.h (script_set_target): Declare.
12299 * options.cc (General_options::string_to_object_format): Rename
12300 from string_to_object_format in anonymous namespace. Change
12301 callers.
12302 * options.h (class General_options): Declare
12303 string_to_object_format.
12304
3ee173de
ILT
123052009-06-22 Ian Lance Taylor <iant@google.com>
12306
12307 * script-sections.cc (Script_sections::create_segments): Don't put
12308 program headers in a PT_LOAD segment if -n or -N.
12309
123102009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12311
12312 PR 10141
12313 * options.h (class General_options): Add -z lazy and -z now. Sort
12314 -z options into alphabetical order.
12315 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12316
cd6739a1 123172009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12318
12319 * layout.cc (Layout::make_output_section): Call
12320 Target::new_output_section.
12321 (Layout::attach_allocated_section_to_segment): Put large section
12322 sections in a separate load segment with the large segment flag
12323 set.
12324 (Layout::segment_precedes): Sort large data segments after other
12325 load segments.
12326 (align_file_offset): New static function.
12327 (Layout::set_segment_offsets): Use align_file_offset.
12328 * output.h (class Output_section): Add is_small_section_ and
12329 is_large_section_ fields.
12330 (Output_section::is_small_section): New function.
12331 (Output_section::set_is_small_section): New function.
12332 (Output_section::is_large_section): New function.
12333 (Output_section::set_is_large_section): New function.
12334 (Output_section::is_large_data_section): New function.
12335 (class Output_segment): Add is_large_data_segment_ field.
12336 (Output_segment::is_large_data_segment): New function.
12337 (Output_segment::set_is_large_data_segment): New function.
12338 * output.cc (Output_section::Output_section): Initialize new
12339 fields.
12340 (Output_segment::Output_segment): Likewise.
12341 (Output_segment::add_output_section): Add assertion that large
12342 data sections always go in large data segments. Force small data
12343 sections to the end of the list of data sections. Force small BSS
12344 sections to the start of the list of BSS sections. For large BSS
12345 sections to the end of the list of BSS sections.
12346 * symtab.h (class Symbol): Declare is_common_shndx.
12347 (Symbol::is_defined): Check Symbol::is_common_shndx.
12348 (Symbol::is_common): Likewise.
12349 (class Symbol_table): Define enum Commons_section_type. Update
12350 declarations. Add small_commons_ and large_commons_ fields.
12351 * symtab.cc (Symbol::is_common_shndx): New function.
12352 (Symbol_table::Symbol_table): Initialize new fields.
12353 (Symbol_table::add_from_object): Put small and large common
12354 symbols in the right list.
12355 (Symbol_table::sized_finalized_symbol): Check
12356 Symbol::is_common_shndx.
12357 (Symbol_table::sized_write_globals): Likewise.
12358 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12359 common symbol lists. Don't call do_allocate_commons_list if the
12360 list is empty.
12361 (Symbol_table::do_allocate_commons_list): Remove is_tls
12362 parameter. Add comons_section_type parameter. Change all
12363 callers. Handle small and large common symbols.
12364 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12365 Symbol::is_common_shndx.
12366 * resolve.cc (symbol_to_bits): Likewise.
12367 * target.h (Target::small_common_shndx): New function.
12368 (Target::small_common_section_flags): New function.
12369 (Target::large_common_shndx): New function.
12370 (Target::large_common_section_flags): New function.
12371 (Target::new_output_section): New function.
12372 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12373 small_common_section_flags, and large_common_section_flags
12374 fields.
12375 (Target::do_new_output_section): New virtual function.
12376 * arm.cc (Target_arm::arm_info): Initialize new fields.
12377 * i386.cc (Target_i386::i386_info): Likewise.
12378 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12379 Likewise.
12380 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12381 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12382 (Target_x86_64::do_new_output_section): New function.
12383 * configure.ac: Define conditional MCMODEL_MEDIUM.
12384 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12385 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12386 (large_LDFLAGS): Define.
12387 * testsuite/large.c: New file.
12388 * testsuite/testfile.cc (Target_test::test_target_info):
12389 Initialize new fields.
12390 * configure, testsuite/Makefile.in: Rebuild.
12391
bb04269c
DK
123922009-06-05 Doug Kwan <dougkwan@google.com>
12393
12394 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 12395 * Makefile.in: Regenerate.
bb04269c
DK
12396 * i386.cc (class Target_i386): Define new virtual method to
12397 override do_is_local_label_name in parent.
12398 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12399 local symbols if --discard-locals or -X is given.
12400 * options.h (class General_options): Declare new options
12401 '--discard-locals' and '-X' for discarding locals.
12402 * target.h (class Target): Define new methods is_local_label_name.
12403 Declare new virtual method do_is_local_label_name.
12404 * target.cc: New file.
12405 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12406 (check_SCRIPTS): Add discard_locals_test.sh.
12407 (check_DATA): Add discard_local_tests.syms.
12408 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12409 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12410 * testsuite/Makefile.in: Regenerate.
12411 * testsuite/discard_locals_test.c: New file.
12412 * testsuite/discard_locals_test.sh: Same.
12413
805bb01c
DK
124142009-06-05 Doug Kwan <dougkwan@google.com>
12415
12416 * object.cc (Sized_relobj::Sized_relobj): Initialize
12417 discarded_eh_frame_shndx_ to -1U.
12418 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12419 section.
12420 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12421 a discarded .eh_frame section.
12422 (Sized_relobj::do_finalize_local_symbols): Ditto.
12423 * object.h (class Sized_relobj): Declare new member
12424 discarded_eh_frame_shndx_.
12425 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12426 (local_labels_test.o, local_labels_test): New rules.
12427 * testsuite/Makefile.in: Regenerate.
12428
1dcd334d
DK
124292009-06-04 Doug Kwan <dougkwan@google.com>
12430
12431 * layout.cc (Layout::section_name_mapping): Add mapping for
12432 special ARM sections.
12433
96d49306
DK
124342009-06-03 Doug Kwan <dougkwan@google.com>
12435
12436 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12437 (utils::has_overflow): Same.
12438
dff16297
ILT
124392009-06-03 Ian Lance Taylor <iant@google.com>
12440
12441 * layout.cc (Layout::section_name_mapping): New array, replacing
12442 Layout::linkonce_mapping.
12443 (Layout::section_name_mapping_count): New variable, replacing
12444 Layout::linkonce_mapping_count.
12445 (Layout::linkonce_output_name): Remove.
12446 (Layout::output_section_name): Rewrite.
12447 * layout.h (class Layout): Rename Linkonce_mapping to
12448 Section_name_mapping, linkonce_mapping to section_name_mapping,
12449 linkonce_mapping_count to section_name_mapping_count. Don't
12450 declare linkonce_output_name.
12451
c121c671
DK
124522009-06-03 Doug Kwan <dougkwan@google.com>
12453
12454 * gold/arm.cc (namespace utils): New.
12455 (Target_arm::reloc_is_non_pic): Define new method.
12456 (class Arm_relocate_functions): New.
12457 (Target_arm::Relocate::relocate): Handle relocation types used by
12458 Android.
12459
07800fab
ILT
124602009-06-03 Ian Lance Taylor <iant@google.com>
12461
12462 * arm.cc (Target_arm::scan::global): Use || instead of |.
12463
c121c671
DK
124642009-06-02 Doug Kwan <dougkwan@google.com>
12465
12466 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12467 issued_non_pic_error_.
12468 (class Target_arm::Scan): Declare new method check_non_pic.
12469 Define new method symbol_needs_plt_entry.
12470 Declare new data member issued_non_pic_error_.
12471 (class Target_arm::Relocate): Declare new method
12472 should_apply_static_reloc.
12473 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12474 (Target_arm::Scan::check_non_pic): Define new method.
12475 (Target_arm::Scan::local): Handle a small subset of reloc types used
12476 by Android.
12477 (Target_arm::Scan::local): Same.
12478 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12479
b19b0c6d
ILT
124802009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12481
12482 * incremental.cc (Incremental_inputs::report_command_line): Filter
12483 out --incremental-* options.
12484
94cdfcff
DK
124852009-05-29 Doug Kwan <dougkwan@google.com>
12486
12487 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12488 template class.
12489 (class Target_arm): Update comment.
12490 (Target_arm::Target_arm): Initialize new data members GOT_,
12491 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12492 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12493 and Target_arm::rel_dyn_section.
12494 Declare new_enum Target_arm::Got_type.
12495 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12496 and DYNBSS_.
12497 Update commments for member do_dynsym_value.
12498 (Target_arm::got_size, Target_arm::plt_section,
12499 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12500 new methods inside class defintion.
12501 (Target_arm::got_section): Define new method.
12502 (Target_arm::rel_dyn_section): Same.
12503 (Output_data_plt_arm): New template class.
12504 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12505 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12506 (Output_data_plt_arm::add_entry): Same.
12507 (Output_data_plt_arm::first_plt_entry): Define new
12508 static data member for PLT instruction template.
12509 (Output_data_plt_arm::plt_entry): Same.
12510 (Output_data_plt_arm::do_write): Define new method.
12511 (Target_arm::make_plt_entry): Same.
12512 (Target_arm::do_finalize_sections): Same.
12513 (Target_arm::do_dynsym_value): Same.
12514
4a657b0d
DK
125152009-05-28 Doug Kwan <dougkwan@google.com>
12516
12517 * Makefile.am (TARGETSOURCES): Add arm.cc.
12518 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12519 * Makefile.in: Regenerate.
12520 * arm.cc: New file.
12521 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12522
e7ae8c36
DK
125232009-05-26 Doug Kwan <dougkwan@google.com>
12524
12525 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12526 (General_options::check_excluded_libs): Strip off directories in
12527 archive name before matching like GNU ld does.
12528 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12529 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12530 (exclude_libs_test_LDFLAGS): Add linker option
12531 -Wl,--exclude-libs,libexclude_libs_test_3
12532 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12533 an explicit archive without using -l.
12534 (alt/libexclude_libs_test_3.a): New make rule.
12535 * testsuite/Makefile.in: Regenerate.
12536 * testsuite/exclude_libs_test.c : Declare lib3_default().
12537 (main): Call it.
12538 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12539 * exclude_libs_test_3.c: New file.
12540
f12e7348
NC
125412009-05-26 Nick Clifton <nickc@redhat.com>
12542
12543 * po/id.po: New Indonesian translation.
12544 * po/gold.pot: Updated template file.
12545
4daadc0d
ST
125462009-05-22 Sriraman Tallam <tmsriram@google.com>
12547
e1df38aa 12548 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
12549 gc_comdat_test files. Add -Wl,--gc-sections to build
12550 gc_comdat_test.
12551 * testsuite/Makefile.in: Regenerate.
12552 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12553
531813ad
ST
125542009-05-21 Sriraman Tallam <tmsriram@google.com>
12555
12556 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12557 kept comdat section was garbage collected.
12558 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12559 * testsuite/Makefile.in: Regenerate.
12560 * testsuite/gc_comdat_test.sh: New file.
12561 * testsuite/gc_comdat_test_1.cc: New file.
12562 * testsuite/gc_comdat_test_2.cc: New file.
12563
65514900
CC
125642009-05-19 Doug Kwan <dougkwan@google.com>
12565
12566 * archive.cc (Archive::Archive): Move constructor from archive.h
12567 to here. Initialize no_export_.
12568 (Archive::get_elf_object_for_member): Set no_export flag of object.
12569 * archive.h (Archive::Archive): Move constructor body to
12570 archive.cc.
12571 (Archive::no_export): New method.
12572 (Archive::no_export_): New field.
12573 * object.h (Object::Object): Initialize no_export_ to false.
12574 (Object::no_export, Object::set_no_export): New methods.
12575 (Object::no_export_): New field.
12576 * options.cc (General_options::parse_exclude_libs): New method.
12577 (General_options::check_excluded_libs) Same.
12578 * options.h (exclude_libs): New option.
12579 (General_options::check_excluded_libs): New method declaration.
12580 (General_options::excluded_libs_): New field.
12581 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12582 default or protected visibility if an object has no-export flag set.
12583 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12584 (check_SCRIPTS): Add exclude_libs_test.sh.
12585 (check_DATA): Add exclude_libs_test.syms.
12586 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12587 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12588 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12589 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12590 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12591 libexclude_libs_test_2.a): New rules.
12592 * testsuite/Makefile.in: Regenerate.
12593 * testsuite/exclude_libs_test.c: New file.
12594 * testsuite/exclude_libs_test.sh: Ditto.
12595 * testsuite/exclude_libs_test_1.c: Ditto.
12596 * testsuite/exclude_libs_test_2.c: Ditto.
12597
1b77ea50
ILT
125982009-05-15 Ian Lance Taylor <iant@google.com>
12599
12600 * configure.ac: Check for declarations for cases where libiberty.h
12601 checks HAVE_DECL_xxx.
12602 * configure, config.in: Rebuild.
12603
072fe7ce
ILT
126042009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12605
12606 * gold.h (Incremental_argument_list): Remove (invalid) forward
12607 declaration.
12608 * incremental.cc (Incremental_inputs::report_achive): New method.
12609 (Incremental_inputs::report_object): New method.
12610 (Incremental_inputs::report_script): New method.
12611 (Incremental_inputs::finalize_inputs): New method.
12612 (Incremental_inputs::finalize): Call finalize_inputs().
12613 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12614 Create inputs entries.
12615 * incremental.h (Incremental_input_type): New enum.
12616 (Incremental_inputs::Incremental_input): Initialize new fields.
12617 (Incremental_inputs::report_inputs): New method.
12618 (Incremental_inputs::report_achive): New method.
12619 (Incremental_inputs::report_object): New method.
12620 (Incremental_inputs::report_script): New method.
12621 (Incremental_inputs::finalize_inputs): New method.
12622 (Incremental_inputs::Input_info): New struct.
12623 (Incremental_inputs::Input_info_map): New typedef.
12624 (Incremental_inputs::lock_): New field.
12625 (Incremental_inputs::Inputs_): New field.
12626 (Incremental_inputs::Inputs_map): New field.
12627 * main.cc (main): Call Incremental_input::report_inputs.
12628 * options.h (Input_argument_list): Typedef moved from
12629 Input_arguments.
12630 (Input_file_group::Files): Remove, use ::Input_argument_list.
12631 (Input_file_group::Input_argument_list): Remove, use
12632 ::Input_argument_list.
12633 * plugin.cc (Plugin_manager::add_input_file): Add error in
12634 incremental build.
12635 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12636 functions.
12637 * script.cc (read_input_script): Call
12638 Incremental_input::report_script.
12639 * script.h (Script_info): New class.
12640
b0481b0b
ILT
126412009-04-27 Ian Lance Taylor <iant@google.com>
12642
12643 * x86_64.cc (do_adjust_output_section): Set entsize to
12644 plt_entry_size.
12645
b22a5a41 126462009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
12647
12648 * output.cc (Output_file::close): After short writes, continue
12649 writing from the correct offset in the buffer being written.
12650
40fde488
CD
126512009-04-23 Chris Demetriou <cgd@google.com>
12652
12653 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
12654 * configure: Regenerate.
12655 * config.in: Regenerate.
12656 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
12657 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
12658
3ce2c28e
ILT
126592009-04-21 Mikolaj Zalewski <mikolajz@google.com>
12660
12661 * incremental.cc (Incremental_inputs_header_data): Renamed from
12662 Incremental_input_header_data.
12663 (Incremental_inputs_header_data::data_size): New field.
12664 (Incremental_inputs_header_data::put_input_file_count): Renamed
12665 from input_file_count.
12666 (Incremental_inputs_header_data::put_command_line_offset): Renamed
12667 from command_line_offset.
12668 (Incremental_inputs_header_data::put_reserved): Renamed from
12669 put_reserved.
12670 (Incremental_inputs_entry_data): Renamed from
12671 Incremental_input_entry_data.
12672 (Incremental_inputs_entry_data::data_size): New field.
12673 (Incremental_inputs::report_command_line): New method.
12674 (Incremental_inputs::finalize): New method.
12675 (Incremental_inputs::create_incremental_inputs_data): New method.
12676 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
12677 * incremental.h: New file.
12678 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 12679 (Layout::finalize): Create incremental inputs section in
3ce2c28e 12680 incremental builds.
703d02da 12681 (Layout::create_incremental_info_sections): New method.
3ce2c28e 12682 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
12683 (Layout::create_incremental_info_sections): New method.
12684 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
12685 * main.cc (main): Notify Incremental_input of the command line.
12686
e55bde5e
ILT
126872009-04-01 Ian Lance Taylor <iant@google.com>
12688 Mikolaj Zalewski <mikolajz@google.com>
12689
12690 * gold.h (reserve_unordered_map): Define, three versions, one for
12691 each version of Unordered_map.
12692 * layout.cc (Layout::Layout): Remove options parameter. Add
12693 number_of_input_files parameter. Don't initialize options_.
12694 Initialize number_of_input_files_ and resized_signatures_. Move
12695 sections_are_attached_.
12696 (Layout::layout_group): Reserve space for group_signatures_.
12697 (Layout::find_or_add_kept_section): Change name parameter to be a
12698 reference. Resize signatures_ map when it gets large enough.
12699 (Layout::layout_eh_frame): Use parameters->options() instead of
12700 this->options_.
12701 (Layout::make_output_section): Likewise.
12702 (Layout::attach_allocated_section_to_segment): Likewise.
12703 (Layout::finalize, Layout::create_executable_stack): Likewise.
12704 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
12705 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
12706 * layout.h (class Layout): Update declarations. Remove options_
12707 field. Add number_of_input_files_ and resized_signatures_
12708 fields. Move sections_are_attached_ field.
12709 * main.cc (main): Pass number of input files to Layout
12710 constructor. Don't pass options.
12711
154b857c
ILT
127122009-03-30 Ian Lance Taylor <iant@google.com>
12713
12714 * ffsll.c (ffsll): Correct implementation.
12715
2f35ab9b
ILT
127162009-03-27 Ian Lance Taylor <iant@google.com>
12717
fd03461a
ILT
12718 * ffsll.c: New file.
12719 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
12720 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
12721 * ftruncate.c (ftruncate): Declare before definition.
12722 * mremap.c (mremap): Likewise.
12723 * pread.c (pread): Likewise.
12724 * configure, Makefile.in, config.in: Rebuild.
12725
2f35ab9b
ILT
12726 * mremap.c: New file.
12727 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
12728 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
12729 (mremap): Declare if HAVE_MREMAP is not defined.
12730 * configure, Makefile.in, config.in: Rebuild.
12731
33aea2fd
CC
127322009-03-27 Cary Coutant <ccoutant@google.com>
12733
12734 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
12735 position independent.
12736 * sparc.cc (Target_sparc::check_non_pic): Likewise.
12737 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
12738
6d479619
CC
127392009-03-24 Cary Coutant <ccoutant@google.com>
12740
12741 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
12742 an executable.
12743 (needs_dynamic_reloc): Likewise.
12744
afc06bb8
ILT
127452009-03-24 Ian Lance Taylor <iant@google.com>
12746
12747 * yyscript.y (file_cmd): Recognize EXTERN.
12748 (extern_name_list, extern_name_list_body): New nonterminals.
12749 * script.cc (script_add_extern): Define.
12750 * script-c.h (script_add_extern): Declare.
12751
f6060a4d
ILT
127522009-03-24 Rafael Avila de Espindola <espindola@google.com>
12753
12754 * object.cc (is_elf_object): Define.
12755 * object.h (is_elf_object): Declare.
12756 * archive.cc (Archive::get_elf_object_for_member): Call
12757 is_elf_object.
33aea2fd 12758 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 12759
26736d8e
ILT
127602009-03-24 Elliott Hughes <enh@google.com>
12761
12762 * output.cc (Output_file::map_anonymous): Define.
12763 (Output_file::map): Use map_anonymous. If the regular mmap fails,
12764 try an anonymous one. Report the size if the mmap fails.
12765 * output.h (class Output_file): Declare map_anonymous.
12766
22fd9730
ILT
127672009-03-24 Ian Lance Taylor <iant@google.com>
12768
12769 * target-select.cc (instantiate_target): Don't acquire the lock if
12770 the instantiated_target_ field has already been set.
12771
cb010894
ILT
127722009-03-23 Ian Lance Taylor <iant@google.com>
12773
7f055c20
ILT
12774 * gold-threads.h (class Initialize_lock): Define.
12775 * gold-threads.cc (class Initialize_lock_once): Define.
12776 (initialize_lock_control): New static variable.
12777 (initialize_lock_pointer): New static variable.
12778 (initialize_lock_once): New static function.
12779 (Initialize_lock::Initialize_lock): Define.
12780 (Initialize_lock::initialize): Define.
12781 * target-select.h: Include "gold-threads.h".
12782 (class Target_selector): Add lock_ and initialize_lock_ fields.
12783 Don't define instantiate_target, just declare it.
12784 * target-select.cc (Target_selector::Target_selector): Initialize
12785 new fields.
12786 (Target_selector::instantiate_target): Define.
12787 * descriptors.h: Include "gold-threads.h".
12788 (class Descriptors): Add initialize_lock_ field.
12789 * descriptors.cc (Descriptors::Descriptors): Initialize new
12790 field.
12791 (Descriptors::open): Use initialize_lock_ field
12792 * errors.h (class Errors): Add initialize_lock_ field.
12793 * errors.cc (Errors::Errors): Initialize new field.
12794 (Errors::initialize_lock): Use initialize_lock_ field.
12795 * powerpc.cc (class Target_selector_powerpc): Remove
12796 instantiated_target_ field. In do_recognize call
12797 instantiate_target rather than do_instantiate_target. In
12798 do_instantiate_target just allocate a new target.
12799 * sparc.cc (class Target_selector_sparc): Likewise.
12800
36959681
ILT
12801 * freebsd.h: New file.
12802 * i386.cc: Include "freebsd.h".
12803 (Target_i386): Derive from Target_freebsd rather than
12804 Sized_target.
12805 (Target_selector_i386): Derive from Target_selector_freebsd rather
12806 than Target_selector.
12807 * x86_64.cc: Include "freebsd.h".
12808 (Target_x86_64): Derive from Target_freebsd rather than
12809 Sized_target.
12810 (Target_selector_x86_64): Derive from Target_selector_freebsd
12811 rather than Target_selector.
12812 * target.h (class Target): Add adjust_elf_header and
12813 do_adjust_elf_header.
12814 * output.cc (Output_file_header:: do_sized_write): Call target
12815 adjust_elf_header routine.
12816 * configure.tgt: Set targ_osabi.
12817 * configure.ac: Define GOLD_DEFAULT_OSABI.
12818 * parameters.cc (Parameters::default_target): Pass
12819 GOLD_DEFAULT_OSABI to select_target.
12820 * target-select.h (class Target_selector): Make instantiate_target
12821 protected rather than private.
12822 * Makefile.am (HFILES): Add freebsd.h.
12823 * configure, Makefile.in, config.in: Rebuild.
12824
cb010894
ILT
12825 * merge.cc (do_add_input_section): Correct pend value. Change
12826 message about last entry not being null terminated from error to
12827 warning.
12828
0e879927
ILT
128292009-03-20 Mikolaj Zalewski <mikolajz@google.com>
12830
12831 * incremental.cc: New file.
12832 * Makefile.am (CCFILES): Add incremental.cc.
12833 * Makefile.in: Rebuild.
12834
41105937
PP
128352009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
12836
12837 * layout.cc (Layout::output_section_name): Preserve names
12838 of '.note.' sections.
e1df38aa 12839
60439920
ILT
128402009-03-19 Ian Lance Taylor <iant@google.com>
12841
12842 * descriptors.cc (Descriptors::open): Check that the options are
12843 valid before using them.
12844
0d371ad3
ILT
128452009-03-18 Ian Lance Taylor <iant@google.com>
12846
12847 * script-sections.h: Include <list>.
12848 (class Script_sections): Change Sections_elements from std::vector
12849 to std::list. Typedef public Elements_iterator. Add
12850 orphan_section_placement_, data_segment_align_start_, and
12851 saw_data_segment_align_ fields. Remove data_segment_align_index_
12852 field.
12853 * script-sections.cc (class Orphan_section_placement): New class.
12854 (class Sections_element): Add virtual functions is_relro and
12855 orphan_section_init. Remove virtual function place_orphan_here.
12856 (class Output_section_definition): Add is_relro and
12857 orphan_section_init. Remove place_orphan_here.
12858 (class Orphan_output_section): Likewise.
12859 (Script_sections::Script_sections): Update for field changes.
12860 (Script_sections::data_segment_align): Set saw_data_segment_align_
12861 and data_segment_align_start_, not data_segment_align_index.
12862 (Script_sections::data_segment_relro_end): Check
12863 saw_data_segment_align_. Use data_segment_align_start_ rather
12864 than data_segment_align_index_.
12865 (Script_sections::place_orphan): Rewrite to use
12866 Orphan_section_placement.
12867
9201d894
ILT
128682009-03-17 Ian Lance Taylor <iant@google.com>
12869
9c5b8369
ILT
12870 * archive.cc (Archive::add_symbols): Check for a version attached
12871 to the symbol name in the archive map.
12872 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12873 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12874 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12875 (ver_test_11.a): New target.
12876 * testsuite/Makefile.in: Rebuild.
12877
9201d894
ILT
12878 * configure.ac: Check for chsize and posix_fallocate. Replace
12879 ftruncate.
12880 * ftruncate.c: New file, from gnulib.
12881 * output.cc (posix_fallocate): Define dummy version if not
12882 HAVE_POSIX_FALLOCATE.
12883 (Output_file::map): Call posix_fallocate rather than lseek and
12884 write.
12885 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
12886 * configure, Makefile.in, config.in: Rebuild.
12887
ef4ab7a8 128882009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 12889
ef4ab7a8
PP
12890 * layout.h (Layout::create_note): Add section_name parameter.
12891 * layout.cc (Layout::create_note): Likewise.
12892 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 12893
8c500701
ILT
128942009-03-17 Ian Lance Taylor <iant@google.com>
12895
e85b18e1
ILT
12896 * descriptors.cc: Include "options.h".
12897 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
12898 (Descriptors::open): Always use O_CLOEXEC when opening a new
12899 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
12900 then set FD_CLOEXEC.
12901
9efe6174
ILT
12902 * sparc.cc (class Target_sparc): Add has_got_section.
12903 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
12904 make sure we have a GOT section.
12905
12906 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
12907 (Target_sparc::Scan::local): Likewise.
12908 (Target_sparc::Scan::global): Likewise.
12909 (Target_sparc::Relocate::relocate): Likewise.
12910 (Target_sparc::Relocate::relocate_tls): Likewise.
12911
8c500701
ILT
12912 * symtab.cc (Symbol_table::define_default_version): New function,
12913 broken out of add_from_object.
12914 (Symbol_table::add_from_object): Call define_default_version.
12915 (Symbol_table::define_special_symbol): Add resolve_oldsym
12916 parameter. Change all callers. If the version for a symbol comes
12917 from a version script, resolve it with the symbol with the same
12918 name with no version. Also add the symbol without a version if
12919 appropriate.
12920 (do_define_in_output_data): If resolving with oldsym, don't delete
12921 sym.
12922 (do_define_in_output_segment): Likewise.
12923 (do_define_as_constant): Likewise.
12924 * symtab.h (class Symbol_table): Update declarations.
12925
f1ed28fb
ILT
129262009-03-13 Ian Lance Taylor <iant@google.com>
12927
15f8229b
ILT
12928 * readsyms.cc (Read_symbols::incompatible_warning): New function.
12929 (Read_symbols::requeue): New function.
12930 (Read_symbols::do_read_symbols): If make_elf_object fails because
12931 the target type is not configured, and the file was searched for,
12932 issue a warning and retry with the next directory.
12933 (Add_symbols::run): If the file has an incompatible format, and
12934 it was searched for, requeue the Read_symbols task. On error,
12935 release the object.
12936 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
12937 dirindex parameter to constructor. Change all callers. Declare
12938 incompatible_warning and requeue.
12939 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
12940 input_argument_ and input_group_ fields. Add them to
12941 constructor. Change all callers.
12942 (class Read_script): Add dirindex_ field. Add it to constructor.
12943 Change all callers.
12944 * archive.cc (Archive::setup): Remove input_objects parameter.
12945 Change all callers.
12946 (Archive::get_file_and_offset): Likewise.
12947 (Archive::read_all_symbols): Likewise.
12948 (Archive::read_symbols): Likewise.
12949 (Archive::get_elf_object_for_member): Remove input_objects
12950 parameter. Add punconfigured parameter. Change all callers.
12951 (Archive::add_symbols): Change return type to bool. Check return
12952 value of include_member.
12953 (Archive::include_all_members): Likewise.
12954 (Archive::include_member): Change return type to bool. Return
12955 false if first included object has incompatible target. Set
12956 included_member_ field.
12957 (Add_archive_symbols::run): If add_symbols returns false, requeue
12958 Read_symbols task.
12959 * archive.h (class Archive): Add included_member_ field.
12960 Initialize it in constructor. Add input_file and searched_for
12961 methods. Update declarations.
12962 (class Add_archive_symbols): Add dirpath_, dirindex_, and
12963 input_argument_ fields. Add them to constructor. Change all
12964 callers.
12965 * script.cc: Include "target-select.h".
12966 (class Parser_closure): Add skip_on_incompatible_target_ and
12967 found_incompatible_target_ fields. Add
12968 skip_on_incompatible_target parameter to constructor. Change all
12969 callers. Add methods skip_on_incompatible_target,
12970 clear_skip_on_incompatible_target, found_incompatible_target, and
12971 set_found_incompatible_target.
12972 (read_input_script): Add dirindex parameter. Change all callers.
12973 If parser finds an incompatible target, requeue Read_symbols
12974 task.
12975 (script_set_symbol): Clear skip_on_incompatible_target in
12976 closure.
12977 (script_add_assertion, script_parse_option): Likewise.
12978 (script_start_sections, script_add_phdr): Likewise.
12979 (script_check_output_format): New function.
12980 * script.h (read_input_script): Update declaration.
12981 * script-c.h (script_check_output_format): Declare.
12982 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
12983 (ignore_cmd): Remove OUTPUT_FORMAT.
12984 * fileread.cc (Input_file::Input_file): Add explicit this.
12985 (Input_file::will_search_for): New function.
12986 (Input_file::open): Add pindex parameter. Change all callers.
12987 * fileread.h (class Input_file): Add input_file_argument method.
12988 Declare will_search_for. Update declarations.
12989 * object.cc (make_elf_object): Add punconfigured parameter.
12990 Change all callers.
12991 * object.h (class Object): Make input_file public. Add
12992 searched_for method.
12993 (make_elf_object): Update declaration.
12994 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
12995 restart search.
12996 * dirsearch.h (class Dirsearch): Update declaration.
12997 * options.h (class General_options): Add --warn-search-mismatch.
12998 * parameters.cc (Parameters::is_compatible_target): New function.
12999 * parameters.h (class Parameters): Declare is_compatible_target.
13000 * workqueue.cc (Workqueue::add_blocker): New function.
13001 * workqueue.h (class Workqueue): Declare add_blocker.
13002
f1ed28fb
ILT
13003 * fileread.cc (Input_file::open): Remove options parameter.
13004 Change all callers.
13005 (Input_file::open_binary): Likewise.
13006 * script.cc (read_input_script): Likewise.
13007 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13008 options parameter from constructor. Change all callers.
13009 (class Read_script): Likewise.
13010 * fileread.h (class Input_file): Update declarations.
13011 * script.h (read_input_script): Update declaration.
13012
34dd024a
NC
130132009-03-10 Nick Clifton <nickc@redhat.com>
13014
13015 * po/es.po: New Spanish translation.
13016
6d71b17c
CC
130172009-03-06 Cary Coutant <ccoutant@google.com>
13018
13019 * options.cc (parse_short_option): Keep dash_z from registering itself.
13020
031cdbed
ILT
130212009-03-03 Ian Lance Taylor <iant@google.com>
13022
13023 PR 9918
13024 * target-reloc.h (relocate_section): Pass output_section to
13025 relocate.
13026 * i386.cc (Target_i386::should_apply_static_reloc): Add
13027 output_section parameter. Change all callers.
13028 (Target_i386::Relocate::relocate): Add output_section parameter.
13029 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13030 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13031 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13032 * testsuite/two_file_shared.sh: New script.
13033 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13034 (check_DATA): Add two_file_shared.dbg.
13035 (two_file_shared.dbg): New target.
13036 * testsuite/Makefile.in: Rebuild.
13037
15d5fa16
ILT
130382009-03-01 Ian Lance Taylor <iant@google.com>
13039
13040 * configure.ac: Check for byteswap.h.
13041 * configure: Rebuild.
13042 * config.in: Rebuild.
13043
8a4c0b0d
ILT
130442009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13045
13046 * layout.cc (Layout::find_or_add_kept_section): New function.
13047 (Layout::add_comdat): Removed.
13048 * layout.h (struct Kept_section): Move out of class Layout.
13049 Remove trailing underscores from field names. Add group_sections
13050 field. Rename group_ field to is_group. Change all uses.
13051 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13052 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13053 comdat_groups_ field.
13054 (Sized_relobj::include_section_group): Use
13055 find_or_add_kept_section and Kept_section::group_sections.
13056 (Sized_relobj::include_linkonce_section): Likewise.
13057 * object.cc (class Sized_relobj): Don't define Comdat_group or
13058 Comdat_group_table. Remove find_comdat_group and
13059 add_comdat_group. Remove comdat_groups_ field.
13060 * plugin.cc (include_comdat_group): Use
13061 Layout::find_or_add_kept_section.
13062
b4ecf66b
ILT
130632009-02-28 Ian Lance Taylor <iant@google.com>
13064
14359ca0
ILT
13065 * README: --gc-sections and map files are now supported. Document
13066 some build requirements.
13067
b4ecf66b
ILT
13068 PR 6992
13069 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13070 relocatable link set the value of the section symbol to zero.
13071 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13072 relocatable link don't include the section address in the local
13073 symbol value.
13074
0602e05a
ILT
130752009-02-27 Ian Lance Taylor <iant@google.com>
13076
fd9d194f
ILT
13077 PR 6811
13078 * options.h (class Search_directory): Add is_system_directory.
13079 (class General_options): Declare is_in_system_directory.
13080 * options.cc (get_relative_sysroot): Make static.
13081 (get_default_sysroot): Make static.
13082 (General_optoins::is_in_system_directory): New function.
13083 * fileread.cc (Input_file::is_in_system_directory): New function.
13084 * fileread.h (class Input_file): Declare is_in_system_directory.
13085 * object.h (class Object): Add is_in_system_directory.
13086 (class Input_objects): Remove system_library_directory_ field.
13087 * object.cc (Input_objects::add_object): Don't set
13088 system_library_directory_.
13089 (input_objects::found_in_system_library_directory): Remove.
13090 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13091 parameter. Change all callers.
13092 (Symbol_table::sized_write_globals): Likewise.
13093 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13094 Call Object::is_in_system_directory.
13095 * symtab.h (class Symbol_table): Update declarations.
13096
61edd21f
ILT
13097 PR 5990
13098 * descriptors.h (Open_descriptor): Add is_on_stack field.
13099 * descriptors.cc (Descriptors::open): If the descriptor is on the
13100 top of the stack, remove it. Initialize is_on_stack field.
13101 (Descriptors::release): Only add pod to stack if it is not on the
13102 stack already.
13103 (Descriptors::close_some_descriptor): Clear stack_next and
13104 is_on_stack fields.
13105
e29e076a
ILT
13106 PR 7091
13107 * output.cc (Output_section::find_starting_output_address): Rename
13108 from starting_output_address; add PADDR parameter; change return
13109 type.
13110 * output.h (class Output_section): Declare
13111 find_starting_output_address instead of starting_output_address.
13112 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13113 section symbol for which we can't find a merge section.
13114
0602e05a
ILT
13115 PR 9836
13116 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13117 hidden or internal, force the symbol to be local.
13118 * resolve.cc (Symbol::override_visibility): Define.
13119 (Symbol::override_base): Use override_visibility.
13120 (Symbol_table::resolve): Likewise.
13121 (Symbol::override_base_with_special): Likewise.
13122 (Symbol_table::override_with_special): If the visibility is hidden
13123 or internal, force the symbol to be local.
13124 * symtab.h (class Symbol): Add set_visibility and
13125 override_visibility.
13126 * testsuite/ver_test_1.sh: New file.
13127 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13128 (check_DATA): Add ver_test_1.syms.
13129 (ver_test_1.syms): New target.
13130 * testsuite/Makefile.in: Rebuild.
13131
401a9a73
CC
131322009-02-25 Cary Coutant <ccoutant@google.com>
13133
13134 * layout.cc (Layout::choose_output_section): Don't rename sections
13135 when using a linker script that has a SECTIONS clause.
13136 * Makefile.in: Regenerate.
13137
13138 * testsuite/Makefile.am (script_test_5.sh): New test case.
13139 * testsuite/Makefile.in: Regenerate.
13140 * testsuite/script_test_5.cc: New file.
13141 * testsuite/script_test_5.sh: New file.
13142 * testsuite/script_test_5.t: New file.
13143
f488e4b0
CC
131442009-02-13 Rafael Avila de Espindola <espindola@google.com>
13145
13146 * archive.cc (Archive::include_member): Update calls to add_symbols.
13147 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13148 the Layout argument.
13149 * dynobj.h (do_add_symbols): Add the Layout argument.
13150 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13151 Layout argument.
13152 * object.h (Object::add_symbols): Add the Layout argument.
13153 (Object::do_add_symbols): Add the Layout argument.
13154 (Sized_relobj::do_add_symbols): Add the Layout argument.
13155 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13156 Unify the two versions.
13157 (Add_plugin_symbols): Remove.
13158 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13159 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13160 (Add_plugin_symbols): Remove.
13161 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13162 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13163 (Add_symbols::run): Make it work with Pulginobj.
13164
89dd1680
ILT
131652009-02-06 Ian Lance Taylor <iant@google.com>
13166
13167 * object.cc (Sized_relobj::do_layout): Make info message start
13168 with lower case letter.
13169
266d0a74
ILT
131702009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13171
602b464e
ILT
13172 * binary.cc: Fix file comment.
13173
266d0a74
ILT
13174 * options.h (enum Incremental_disposition): Define.
13175 (class General_options): Add new options: --incremental,
13176 --incremental_changed, --incremental_unchanged,
13177 --incremental_unknown. Add incremental_disposition_ and
13178 implicit_incremental_ fields.
13179 (General_options::incremental_disposition): New function.
13180 (class Position_dependent_options): Add incremental_disposition
13181 option.
13182 (Position_dependent_options::copy_from_options): Set incremental
13183 dispositions.
13184 * options.cc (General_options::parse_incremental_changed): New
13185 function.
2e702c99
RM
13186 (General_options::parse_incremental_unchanged): New function.
13187 (General_options::parse_incremental_unknown): New function.
13188 (General_options::General_options): Initialize new fields
266d0a74 13189 incremental_disposition_ and implicit_incremental_.
2e702c99 13190 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13191 without --incremental.
13192
f073bbf7
CD
131932009-02-06 Chris Demetriou <cgd@google.com>
13194
13195 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13196 pointer and to report location as the file name associated with
13197 the symbol.
13198 (gold_undefined_symbol_at_location): New function to replace the
13199 old gold_undefined_symbol functionality.
13200 * target-reloc.h (relocate_section): Update to use
13201 gold_undefined_symbol_at_location.
13202 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13203 Call gold_undefined_symbol function rather than gold_error.
13204 * errors.h (Errors::undefined_symbol): Take location as a
13205 string, rather than calculating it from a relocation.
13206 * errors.cc (Errors::fatal): Print "fatal error:" before the
13207 formatted message.
13208 (Errors::error, Errors::error_at_location): Print "error: "
13209 before the formatted message.
13210 (Errors::undefined_symbol): Take location as a string, rather
13211 than calculating it from a relocation.
13212 (gold_undefined_symbol_at_location): New function akin to
13213 old gold_undefined_symbol, calculates location from relocation.
13214 (gold_undefined_symbol): Change to take only a Symbol pointer
13215 and to report location as the file name associated with the symbol.
13216 * testsuite/debug_msg.sh: Update for changed error messages.
13217 * testsuite/undef_symbol.sh: Likewise.
13218
8e94a90c
ILT
132192009-02-04 Duncan Sands <baldrick@free.fr>
13220
13221 PR 9812
13222 * reduced_debug_output.h
13223 (Output_reduced_debug_abbrev_section::failed): Use format for
13224 gold_warning.
13225 (Output_reduced_debug_info_section::faild): Likewise.
13226
88a0e15b
ILT
132272009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13228
13229 * script.cc (Lazy_demangler): New class.
2e702c99 13230 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13231 symbol only once.
13232
5efc7cd2
CC
132332009-01-29 Cary Coutant <ccoutant@google.com>
13234
13235 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13236 to __tls_get_addr.
13237 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13238
e0ebcf42
ILT
132392009-01-28 Ian Lance Taylor <iant@google.com>
13240
5efc7cd2 13241 * version.cc (version_string): Bump to 1.9.
75fe7426 13242
e0ebcf42
ILT
13243 * gold.h: Include <cstring> and <stdint.h>.
13244 * version.cc: Include <cstdio>.
13245 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13246 warning.
13247 * reduced_debug_output.cc (insert_into_vector): Rename from
13248 Insert_into_vector; change all callers. Use Swap_unaligned to
13249 avoid aliasing issue; remove union since it is unnecessary.
13250
8e2813be 132512009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13252
13253 * Makefile.am (CCFILES): Add gc.cc.
13254 (HFILES): Add gc.h.
13255 * Makefile.in: Regenerate.
13256 * gold.cc (Gc_runner): New class.
13257 (queue_initial_tasks): Call garbage collection related tasks
13258 when corresponding options are invoked.
13259 (queue_middle_gc_tasks): New function.
13260 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13261 processed early before laying out sections during garbage collection.
13262 * gold.h (queue_middle_gc_tasks): New function.
13263 (is_prefix_of): Move from "layout.cc".
13264 * i386.cc (Target_i386::gc_process_relocs): New function.
13265 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13266 * main.cc (main): Create object of class "Garbage_collection".
13267 * object.cc (Relobj::copy_symbols_data): New function.
13268 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13269 (Sized_relobj::do_layout): Allow this function to be called twice
13270 during garbage collection and defer layout of section during the
6d03d481
ST
13271 first call.
13272 * object.h (Relobj::get_symbols_data): New function.
13273 (Relobj::is_section_name_included): New function.
13274 (Relobj::copy_symbols_data): New function.
13275 (Relobj::set_symbols_data): New function.
13276 (Relobj::get_relocs_data): New function.
13277 (Relobj::set_relocs_data): New function.
13278 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13279 (Relobj::gc_process_relocs): New function.
13280 (Relobj::do_gc_process_relocs): New pure virtual function.
13281 (Relobj::sd_): New data member.
13282 (Sized_relobj::is_output_section_offset_invalid): New function.
13283 (Sized_relobj::do_gc_process_relocs): New function.
13284 * options.h (General_options::gc_sections): Modify to not be a no-op.
13285 (General_options::print_gc_sections): New option.
13286 * plugin.cc (Plugin_finish::run): Remove function call to
13287 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13288 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13289 * reloc.cc (Read_relocs::run): Add task to process relocs and
13290 determine unreferenced sections when doing garbage collection.
13291 (Gc_process_relocs): New class.
13292 (Sized_relobj::do_gc_process_relocs): New function.
13293 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13294 sections that are garbage collected.
13295 * reloc.h (Gc_process_relocs): New class.
13296 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13297 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13298 symbols whose corresponding sections are garbage collected.
13299 (Symbol_table::Symbol_table): Add new parameter for the garbage
13300 collection object.
13301 (Symbol_table::gc_mark_undef_symbols): New function.
13302 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13303 (Symbol_table::gc_mark_dyn_syms): New function.
13304 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13305 as garbage.
13306 (Symbol_table::add_from_object): Likewise.
13307 (Symbol_table::add_from_relobj): When building shared objects, do not
13308 treat externally visible symbols as garbage.
13309 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13310 table information for static and relocatable links.
13311 * symtab.h (Symbol_table::set_gc): New function.
13312 (Symbol_table::gc): New function.
13313 (Symbol_table::gc_mark_undef_symbols): New function.
13314 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13315 (Symbol_table::gc_mark_dyn_syms): New function.
13316 (Symbol_table::gc_): New data member.
e1df38aa 13317 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13318 function.
13319 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13320 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13321
3b293544
CF
133222009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13323
13324 * options.h (General_options::gc_sections): Define as a no-op for now.
13325 (General_options::no_keep_memory): Ditto.
13326 (General_options::Bshareable): Define.
13327 * options.cc (General_options::finalize): Honor -Bshareable.
13328
83d22aa8
AS
133292009-01-20 Andreas Schwab <schwab@suse.de>
13330
13331 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13332 read the value in the contents, since we don't use it. Use the
13333 template endianness when writing.
13334 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13335
cd536b21
AS
133362009-01-19 Andreas Schwab <schwab@suse.de>
13337
13338 * configure.tgt (powerpc64-*): Fix targ_obj.
13339
99e9a495
ILT
133402009-01-15 Ian Lance Taylor <iant@google.com>
13341
13342 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13343 local symbols when stripping all symbols.
13344
bbbfea06
CC
133452009-01-14 Cary Coutant <ccoutant@google.com>
13346
99e9a495 13347 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13348
0f7c0701
CC
133492009-01-14 Cary Coutant <ccoutant@google.com>
13350
13351 * archive.cc (Archive::get_elf_object_for_member): Remove call
13352 to File_read::claim_for_plugin.
13353 * descriptors.cc (Descriptors::open): Remove reference to
13354 is_claimed.
13355 (Descriptors::claim_for_plugin): Remove.
13356 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13357 (Descriptors::is_claimed): Remove.
13358 (claim_descriptor_for_plugin): Remove.
13359 * fileread.cc (File_read::claim_for_plugin): Remove.
13360 * fileread.h (File_read::claim_for_plugin): Remove.
13361 (File_read::descriptor): Reopen descriptor if necessary.
13362 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13363 (Plugin_manager::all_symbols_read): Add task parameter. Change
13364 all callers.
13365 (Plugin_manager::get_input_file): New function.
13366 (Plugin_manager::release_input_file): New function.
13367 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13368 corresponding data member.
13369 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13370 and pass to base constructor. Change all callers.
13371 (get_input_file, release_input_file): New functions.
13372 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13373 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13374 (Plugin_manager::all_symbols_read): Add task parameter.
13375 (Plugin_manager::get_input_file): New function.
13376 (Plugin_manager::release_input_file): New function.
13377 (Plugin_manager::task_): New data member.
13378 (Pluginobj::Pluginobj): Add filesize parameter.
13379 (Pluginobj::filename): New function.
13380 (Pluginobj::descriptor): New function.
13381 (Pluginobj::filesize): New function.
13382 (Pluginobj::filesize_): New data member.
13383 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13384 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13385 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13386
13387 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13388 with archive libraries.
13389 * testsuite/Makefile.in: Regenerate.
13390 * testsuite/plugin_test.c (struct sym_info): New type.
13391 (get_input_file, release_input_file): New static variables.
13392 (onload): Capture new transfer vector entries.
13393 (claim_file_hook): Stop reading at end of file according to filesize.
13394 Factor out parsing of readelf output into separate function.
13395 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13396 APIs and get the source file name from the symbol table. Convert
13397 source file name to corresponding object file name. Print info
13398 message when adding new input files.
13399 (parse_readelf_line): New function.
13400 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13401 * testsuite/plugin_test_2.sh: Likewise.
13402 * testsuite/plugin_test_3.sh: Likewise.
13403 * testsuite/plugin_test_4.sh: New test case.
13404
62a6d109
ILT
134052009-01-07 Ian Lance Taylor <iant@google.com>
13406
13407 * version.cc (version_string): Bump to 1.8.
13408
483620e8
CC
134092008-12-23 Cary Coutant <ccoutant@google.com>
13410
13411 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13412 * plugin.cc (Plugin_manager::finish): Rename as
13413 layout_deferred_objects. Move cleanup to separate function.
13414 (Plugin_manager::cleanup): New function.
13415 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13416 separately.
13417 * plugin.h (Plugin_manager::finish): Rename as
13418 layout_deferred_objects.
13419 (Plugin_manager::cleanup): New function.
13420 (Plugin_manager::cleanup_done): New field.
13421
d66a9eb3
CC
134222008-12-23 Cary Coutant <ccoutant@google.com>
13423
13424 * plugin.cc (is_visible_from_outside): New function.
13425 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13426 so we don't return "IR only" status for exported symbols or -r links.
13427
13428 * testsuite/Makefile.am (plugin_test_3): New test case.
13429 * testsuite/Makefile.in: Regenerate.
13430 * testsuite/plugin_test_3.sh: New file.
13431
5995b570
CC
134322008-12-22 Cary Coutant <ccoutant@google.com>
13433
13434 * object.cc (Sized_relobj::layout_section): New function.
13435 (Sized_relobj::do_layout): Defer layout of input sections until after
13436 plugin has provided replacement files.
13437 (Sized_relobj::do_layout_deferred_sections): New function.
13438 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13439 (Relobj::layout_deferred_sections): New function.
13440 (Relobj::do_layout_deferred_sections): New function.
13441 (Sized_relobj::do_layout_deferred_sections): New function.
13442 (Sized_relobj::layout_section): New function.
13443 (Sized_relobj::Deferred_layout): New structure.
13444 (Sized_relobj::deferred_layout_): New field.
13445 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13446 Change all callers. Layout deferred sections.
13447 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13448 references.
13449 (Plugin_hook::run): Move code from do_plugin_hook inline.
13450 (Plugin_hook::do_plugin_hook): Remove.
13451 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13452 (Plugin_manager::finish): Renamed, was cleanup.
13453 (Plugin_manager::should_defer_layout): New function.
13454 (Plugin_manager::add_deferred_layout_object): New function.
13455 (Plugin_manager::Deferred_layout_list): New type.
13456 (Plugin_manager::deferred_layout_objects_): New field.
13457 (Plugin_hook::do_plugin_hook): Remove.
13458
ee769c88
ILT
134592008-12-17 Ian Lance Taylor <iant@google.com>
13460
13461 * options.h (class General_options): Add --no case for
13462 --export-dynamic.
13463
abc8dcba
CC
134642008-12-16 Cary Coutant <ccoutant@google.com>
13465
13466 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13467 vector.
13468 (Plugin_manager::claim_file): Create plugin object even if
13469 plugin did not call the add_symbols callback.
13470 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13471 asking for more symbols than were added.
13472 * testsuite/Makefile.am (plugin_test_1): Add test case with
13473 no global symbols.
13474 (empty.syms): New target.
13475 * testsuite/Makefile.in: Regenerate.
13476 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13477 message. Don't call add_symbols if no globals.
13478 (all_symbols_read_hook): Don't provide replacement for empty
13479 claimed file.
13480
b0074644
ILT
134812008-12-12 Ian Lance Taylor <iant@google.com>
13482
68943102
ILT
13483 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13484 r_type == 0 for a local symbol with r_sym == 0.
13485 (scan_relocatable_relocs): Pass r_sym to
13486 local_non_section_strategy.
13487 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13488 r_sym parameter.
13489
b0074644
ILT
13490 * configure.ac: Update test for TLS descriptors: they are
13491 supported as of glibc 2.9.
13492 * configure: Rebuild.
13493
c2508178
ILT
134942008-12-11 Ian Lance Taylor <iant@google.com>
13495
13496 PR 7091
13497 * target-reloc.h (Default_scan_relocatable_relocs): For each
13498 function, map r_type == 0 to RELOC_DISCARD.
13499
2756a258
CC
135002008-12-10 Cary Coutant <ccoutant@google.com>
13501
13502 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13503 object to override a kept COMDAT group from a plugin object.
13504
bb6f53d3
ILT
135052008-12-09 Ian Lance Taylor <iant@google.com>
13506
fbc558e1
ILT
13507 PR 7088
13508 * yyscript.y (file_cmd): Handle INPUT.
13509
bb6f53d3
ILT
13510 * testsuite/initpri1.c: Change all declarations to be full
13511 prototypes by adding void, to avoid compiler warnings.
13512
4674ecfc
CC
135132008-12-05 Rafael Avila de Espindola <espindola@google.com>
13514
13515 * options.cc (General_options::parse_plugin_opt): New.
13516 (General_options::add_plugin): The argument now is just the filename.
13517 (General_options::add_plugin_option): New.
13518 * options.h (plugin_opt): New.
13519 (add_plugin): Change argument name.
13520 (add_plugin_option): New.
13521 * plugin.cc (Plugin::load): Don't parse the plugin option.
13522 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13523 (Plugin::add_option): New.
13524 (Plugin::args_): Change type.
13525 (Plugin::filename_): New.
13526 (Plugin_manager::add_plugin_option): New.
13527 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13528 * testsuite/Makefile.in: Regenerate.
13529
fd06b4aa
CC
135302008-12-05 Cary Coutant <ccoutant@google.com>
13531
13532 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13533 Handle --strip-lto-sections option.
13534 * options.h (strip_lto_sections): New option.
13535
6c52134c
CC
135362008-12-01 Cary Coutant <ccoutant@google.com>
13537
13538 * plugin.cc (ld_plugin_message): Change format parameter to const.
13539 Fix mismatch between new[] and delete.
13540
a45248e0
CC
135412008-11-14 Cary Coutant <ccoutant@google.com>
13542
13543 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13544 instead of -1U.
13545
c82fbeee
CS
135462008-11-05 Craig Silverstein <csilvers@google.com>
13547
13548 * options.cc (General_options::parse_dynamic_list): New function.
13549 * options.h (General_options): New flags dynamic_list,
13550 dynamic_list_data, dynamic_list_cpp_new, and
13551 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13552 (General_options::in_dynamic_list): New function.
13553 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13554 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13555 (Lex::can_continue_name): Likewise.
13556 (yylex): Likewise.
13557 (read_script_file): New parameter script_options.
13558 (read_dynamic_list): New function.
13559 (Script_options::define_dynamic_list): New function.
13560 (dynamic_list_keyword_parsecodes): New variable.
13561 (dynamic_list_keywords): New variable.
13562 * script.h (Script_options::define_dynamic_list): New function
13563 prototype.
13564 (read_dynamic_list): New function prototype.
13565 * symtab.cc (strprefix): New macro.
13566 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13567 dynamic_list_data, dynamic_list_cpp_new, and
13568 dynamic_list_cpp_typeinfo.
13569 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13570 (dynamic_list_expr): New rule.
13571 (dynamic_list_nodes): Likewise.
13572 (dynamic_list_node): Likewise.
13573 * testsuite/Makefile.am (dynamic_list): New test.
13574 * testsuite/Makefile.in: Regenerated.
13575 * testsuite/dynamic_list.t: New file.
13576 * testsuite/dynamic_list.sh: New file.
13577
e0bb29a5
CS
135782008-11-05 Craig Silverstein <csilvers@google.com>
13579
13580 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13581 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13582 (t11_last): Likewise.
13583 * testsuite/ver_test_6.c (main): Likewise.
13584
4e1e25e0
CC
135852008-10-07 Cary Coutant <ccoutant@google.com>
13586
13587 * options.c (General_options::finalize): Add check for -static and
13588 -shared.
13589 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13590 is not empty.
13591
92f03fcb
CC
135922008-10-02 Cary Coutant <ccoutant@google.com>
13593
13594 * plugin.cc (make_sized_plugin_object): Fix conditional
13595 compilation to work when not all targets are enabled.
13596
fbd8a257
CC
135972008-09-29 Cary Coutant <ccoutant@google.com>
13598
13599 * archive.cc (Archive::get_file_and_offset): Use filename instead
13600 of name to get library path.
13601 (Archive::include_member): Unlock external member of a thin archive.
13602
13603 * testsuite/Makefile.am (TEST_AR): New variable.
13604 (thin_archive_test_1): New test.
13605 (thin_archive_test_2): New test.
81636b3f
CC
13606 * testsuite/Makefile.in: Regenerate.
13607 * testsuite/thin_archive_main.cc: New file.
13608 * testsuite/thin_archive_test_1.cc: New file.
13609 * testsuite/thin_archive_test_2.cc: New file.
13610 * testsuite/thin_archive_test_3.cc: New file.
13611 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 13612
eff45813
CC
136132008-09-29 Cary Coutant <ccoutant@google.com>
13614
13615 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13616 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13617 instead of -1U.
13618 (Sized_relobj::do_finalize_local_symbols): Likewise.
13619 (Sized_relobj::map_to_kept_section): Likewise.
13620 * object.h (Sized_relobj::invalid_address): New constant.
13621 (Sized_relobj::do_output_section_offset): Check for invalid_address
13622 and return -1ULL.
13623 * output.cc (Output_reloc::local_section_offset): Use constant
13624 invalid_address instead of -1U.
13625 (Output_reloc::get_address): Likewise.
13626 (Output_section::output_address): Change -1U to -1ULL.
13627 * output.h (Output_reloc::invalid_address): New constant.
13628 * reloc.cc (Sized_relobj::write_sections): Use constant
13629 invalid_address instead of -1U.
13630 (Sized_relobj::relocate_sections): Likewise.
13631 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13632 values for merge sections.
13633 * target-reloc.h (relocate_for_relocatable): Use constant
13634 invalid_address instead of -1U.
13635
89fc3421
CC
136362008-09-19 Cary Coutant <ccoutant@google.com>
13637
13638 Add plugin functionality for link-time optimization (LTO).
13639 * configure.ac (plugins): Add --enable-plugins option.
13640 * configure: Regenerate.
13641 * config.in: Regenerate.
13642 * Makefile.am (LIBDL): New variable.
13643 (CCFILES): Add plugin.cc.
13644 (HFILES): Add plugin.h.
13645 (ldadd_var): Add LIBDL.
13646 * Makefile.in: Regenerate.
13647
13648 * archive.cc: Include "plugin.h".
13649 (Archive::setup): Don't preread archive symbols when using a plugin.
13650 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
13651 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
13652 files.
13653 (Archive::include_member): Add symbols from plugin objects.
13654 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
13655 * descriptors.cc (Descriptors::open): Check for file descriptors
13656 abandoned by plugins.
13657 (Descriptors::claim_for_plugin): New function.
13658 * descriptors.h (Descriptors::claim_for_plugin): New function.
13659 (Open_descriptor::is_claimed): New field.
13660 (claim_descriptor_for_plugin): New function.
13661 * fileread.cc (File_read::claim_for_plugin): New function.
13662 * fileread.h (File_read::claim_for_plugin): New function.
13663 (File_read::descriptor): New function.
13664 * gold.cc: Include "plugin.h".
13665 (queue_initial_tasks): Add task to call plugin hooks for generating
13666 new object files.
13667 * main.cc: Include "plugin.h".
13668 (main): Load plugin libraries.
13669 * object.h (Pluginobj): Declare.
13670 (Object::pluginobj): New function.
13671 (Object::do_pluginobj): New function.
13672 (Object::set_target): New function.
13673 * options.cc: Include "plugin.h".
13674 (General_options::parse_plugin): New function.
13675 (General_options::General_options): Initialize plugins_ field.
13676 (General_options::add_plugin): New function.
13677 * options.h (Plugin_manager): Declare.
13678 (General_options): Add --plugin option.
13679 (General_options::has_plugins): New function.
13680 (General_options::plugins): New function.
13681 (General_options::add_plugin): New function.
13682 (General_options::plugins_): New field.
13683 * plugin.cc: New file.
13684 * plugin.h: New file.
13685 * readsyms.cc: Include "plugin.h".
13686 (Read_symbols::do_read_symbols): Check for archive before checking
13687 for ELF file. Call plugin hooks to claim files.
13688 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
13689 from a real object file; force override when processing replacement
13690 files.
13691 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
13692 (Symbol::init_base_object): Likewise.
13693 (Symbol::init_base_output_data): Likewise.
13694 (Symbol::init_base_output_segment): Likewise.
13695 (Symbol::init_base_constant): Likewise.
13696 (Symbol::init_base_undefined): Likewise.
13697 (Symbol::output_section): Assert that object is not a plugin.
13698 (Symbol_table::add_from_pluginobj): New function.
13699 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
13700 undefined.
13701 (Symbol_table::sized_write_globals): Likewise.
13702 (Symbol_table::add_from_pluginobj): Instantiate template.
13703 * symtab.h (Sized_pluginobj): Declare.
13704 (Symbol::in_real_elf): New function.
13705 (Symbol::set_in_real_elf): New function.
13706 (Symbol::in_real_elf_): New field.
13707 (Symbol_table::add_from_pluginobj): New function.
13708
13709 * testsuite/Makefile.am (AM_CFLAGS): New variable.
13710 (LIBDL): New variable.
13711 (LDADD): Add LIBDL.
13712 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
13713 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
13714 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
13715 (MOSTLYCLEANFILES): Likewise.
13716 * testsuite/Makefile.in: Regenerate.
13717 * testsuite/plugin_test.c: New file.
13718 * testsuite/plugin_test_1.sh: New file.
13719 * testsuite/plugin_test_2.sh: New file.
13720
de31bda5
ILT
137212008-09-16 Ian Lance Taylor <iant@google.com>
13722
9c2d0ef9
ILT
13723 * target-reloc.h (relocate_section): Check whether a symbol is
13724 defined by the ABI before reporting an undefined symbol error.
13725 * target.h (Target::is_defined_by_abi): Make parameter const.
13726 (Target::do_is_defined_by_abi): Likewise.
13727 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
13728 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
13729 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
13730 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
13731 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
13732 * testsuite/Makefile.in: Rebuild.
13733
de31bda5
ILT
13734 * fileread.cc (make_view): Add casts to avoid warning.
13735
9fa33bee
AO
137362008-09-16 Alexandre Oliva <aoliva@redhat.com>
13737
13738 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
13739 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13740
183fd0e3
AO
137412008-09-16 Alexandre Oliva <aoliva@redhat.com>
13742
13743 * options.h (General_options::output_is_executable): New.
13744 (General_options::output_is_pie): New.
13745 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
13746 for shared libraries.
13747 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13748
7be8330a
CD
137492008-09-11 Chris Demetriou <cgd@google.com>
13750
13751 * options.h (origin): New -z option.
13752 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
13753 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
13754 in DT_FLAGS_1.
13755
a9caad02
CC
137562008-09-05 Cary Coutant <ccoutant@google.com>
13757
13758 * fileread.cc (File_read::make_view): Add check for attempt to map
13759 beyond end of file.
13760
ae6dce4d
CC
137612008-09-05 Cary Coutant <ccoutant@google.com>
13762
13763 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
13764 explicit instantiations.
13765
d7ab2a47
KVH
137662008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
13767
13768 PR gold/6858
13769 * options.cc (General_options::finalize): Allow undefined symbols
13770 in shlibs if linking -shared.
13771
13772 PR gold/6859
13773 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
13774 symbols as not needing a dynsym entry.
13775
1e52a9c1
CS
137762008-08-20 Craig Silverstein <csilvers@google.com>
13777
13778 * fileread.cc (File_read::open): Do not lock the file unless it
13779 was successfully opened.
13780
d85c80a3
CC
137812008-08-14 Cary Coutant <ccoutant@google.com>
13782
13783 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
13784 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
13785 * testsuite/tls_test.cc (struct int128): 128-bit struct
13786 for testing TLS relocs with non-zero addend.
13787 (v12): New TLS variable.
13788 (t12): New test.
13789 (t_last): Add check for v12.
13790 * testsuite/tls_test.h (t12): New function.
13791 * testsuite/tls_test_main.cc (thread_routine): Call new test.
13792
2d924fd9
ILT
137932008-08-13 Ian Lance Taylor <iant@google.com>
13794
13795 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
13796 set tls_segment_ or relro_segment_.
13797 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
13798 when appropriate.
13799 * output.h (Output_section::clear_is_relro): New function.
13800 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
13801 sections specially even when output_data_ is empty.
13802 (Output_segment::maximum_alignment): When first section is relro,
13803 only force alignment for PT_LOAD segments.
13804 * script.cc (script_data_segment_align): New function.
13805 (script_data_segment_relro_end): New function.
13806 * script-c.h (script_data_segment_align): Declare.
13807 (script_data_segment_relro_end): Declare.
13808 * script-sections.h (class Script_sections): Declare
13809 data_segment_align and data_segment_relro_end. Add fields
13810 segment_align_index_ and saw_relro_end_.
13811 * script-sections.cc (class Sections_element): Add set_is_relro
13812 virtual function. Add new bool* parameter to place_orphan_here.
13813 Add get_output_section virtual function.
13814 (class Output_section_definition): Add set_is_relro. Add new
13815 bool* parameter to place_orphan_here. Add get_output_section.
13816 Add is_relro_ field.
13817 (Output_section_definition::Output_section_definition): Initialize
13818 evaluated_address_, evaluated_load_address, evaluated_addralign_,
13819 and is_relro_ fields.
13820 (Output_section_definition::place_orphan_here): Add is_relro
13821 parameter.
13822 (Output_section_definition::set_section_addresses): Set relro for
13823 output section.
13824 (Output_section_definition::alternate_constraint): Likewise.
13825 (class Orphan_output_section): Add new bool* parameter to
13826 place_orphan_here. Add get_output_section.
13827 (Orphan_output_section::place_orphan_here): Add is_relro
13828 parameter.
13829 (Script_sections::Script_sections): Initialize
13830 data_segment_align_index_ and saw_relro_end_.
13831 (Script_sections::data_segment_align): New function.
13832 (Script_sections::data_segment_relro_end): New function.
13833 (Script_sections::place_orphan): Set or clear is_relro.
13834 (Script_sections::set_section_addresses): Force alignment of first
13835 TLS section.
13836 * yyscript.y (exp): Call script_data_segment_align and
13837 script_data_segment_relro_end.
13838 * testsuite/relro_script_test.t: New file.
13839 * testsuite/relro_test.cc (using_script): Declare.
13840 (t1, t2): Test using_script.
13841 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
13842 (relro_script_test_SOURCES): Define.
13843 (relro_script_test_DEPENDENCIES): Define.
13844 (relro_script_test_LDFLAGS): Define.
13845 (relro_script_test_LDADD): Define.
13846 (relro_script_test.so): New target.
13847 * testsuite/Makefile.in: Rebuild.
13848
f827c9a9
CC
138492008-08-06 Cary Coutant <ccoutant@google.com>
13850
13851 * archive.cc (Archive::total_archives, Archive::total_members)
13852 (Archive::total_members_loaded): New variables.
13853 (Archive::setup): Add parameter. Add option to preread
13854 archive symbols.
13855 (Archive::read_armap): Add counter.
13856 (Archive::get_file_and_offset): New function.
13857 (Archive::get_elf_object_for_member): New function.
13858 (Archive::read_all_symbols): New function.
13859 (Archive::read_symbols): New function.
13860 (Archive::add_symbols): Add counters.
13861 (Archive::include_all_members): Use armap to find members if it's
13862 already built.
13863 (Archive::include_member): Skip reading symbols if already read.
13864 Factored code into Archive::get_file_and_offset and
13865 Archive::get_elf_object_for_member. Changed call to
13866 Mapfile::report_include_archive_member.
13867 (Archive::print_stats): New function.
13868 * archive.h: Declare Object and Read_symbols_data classes.
13869 (Archive::Archive): Add initializers for new members.
13870 (Archive::setup): Add parameter.
13871 (Archive::print_stats): New function.
13872 (Archive::total_archives, Archive::total_members)
13873 (Archive::total_members_loaded): New variables.
13874 (Archive::get_file_and_offset): New function.
13875 (Archive::get_elf_object_for_member): New function.
13876 (Archive::read_all_symbols): New function.
13877 (Archive::read_symbols): New function.
13878 (Archive::Archive_member): New class.
13879 (Archive::members_): New member.
13880 (Archive::num_members_): New member.
13881 * main.cc: Include archive.h.
13882 (main): Call Archive::print_stats.
13883 * mapfile.cc (Mapfile::report_include_archive_member): Delete
13884 archive parameter; member_name is now the fully-decorated name.
13885 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
13886 * options.h: (General_options): Add --preread-archive-symbols option.
13887 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
13888 Archive::setup.
13889
de4c45bd
ILT
138902008-08-04 Ian Lance Taylor <iant@google.com>
13891
13892 * symtab.h (Symbol::use_plt_offset): New function.
13893 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
13894 * powerpc.cc (Relocate::relocate): Likewise.
13895 * sparc.cc (Relocate::relocate): Likewise.
13896 * x86_64.cc (Relocate::relocate): Likewise.
13897 * testsuite/weak_plt.sh: New test.
13898 * testsuite/weak_plt_main.cc: New test.
13899 * testsuite/weak_plt_shared.cc: New test.
13900 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
13901 (check_PROGRAMS): Add weak_plt.
13902 (check_DATA): Add weak_plt_shared.so.
13903 (weak_plt_main_pic.o, weak_plt): New targets.
13904 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
13905 * testsuite/Makefile.in: Rebuild.
13906
13907 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
13908 gcctestdir/ld.
13909 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
13910 * testsuite/Makefile.in: Rebuild.
13911
323ee3f4
AM
139122008-08-04 Alan Modra <amodra@bigpond.net.au>
13913
13914 * Makefile.am (POTFILES.in): Set LC_ALL=C.
13915 * Makefile.in: Regenerate.
13916 * po/POTFILES.in: Regenerate.
13917
7c07ecec
ILT
139182008-07-29 Ian Lance Taylor <iant@google.com>
13919
13920 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
13921 symbols before other symbols.
13922 * testsuite/script_test_2.cc (test_addr): Declare.
13923 (test_addr_alias): Declare.
13924 (main): Check that test_addr and test_addr_alias have the right
cd536b21 13925 values.
7c07ecec
ILT
13926 * testsuite/script_test_2.t: Define test_addr_alias and
13927 test_addr.
13928
5778530e
ILT
139292008-07-24 Ian Lance Taylor <iant@google.com>
13930
2a00e4fb
ILT
13931 PR 5990
13932 * descriptors.cc: New file.
13933 * descriptors.h: New file.
13934 * gold-threads.h (class Hold_optional_lock): New class.
13935 * fileread.cc: Include "descriptors.h".
13936 (File_read::~File_read): Release descriptor rather than closing
13937 it.
13938 (File_read::open) [file]: Call open_descriptor rather than open.
13939 Set is_descriptor_opened_.
13940 (File_read::open) [memory]: Assert that descriptor is not open.
13941 (File_read::reopen_descriptor): New function.
13942 (File_read::release): Release descriptor.
13943 (File_read::do_read): Make non-const. Reopen descriptor.
13944 (File_read::read): Make non-const.
13945 (File_read::make_view): Reopen descriptor.
13946 (File_read::do_readv): Likewise.
13947 * fileread.h (class File_read): Add is_descriptor_opened_ field.
13948 Update declarations.
13949 * layout.cc: Include "descriptors.h".
13950 (Layout::create_build_id): Use open_descriptor rather than open.
13951 * output.cc: Include "descriptors.h".
13952 (Output_file::open): Use open_descriptor rather than open.
13953 * archive.cc (Archive::const_iterator): Change Archive to be
13954 non-const.
13955 (Archive::begin, Archive::end): Make non-const.
13956 (Archive::count_members): Likewise.
13957 * archive.h (class Archive): Update declarations.
13958 * object.h (Object::read): Make non-const.
13959 * Makefile.am (CCFILES): Add descriptors.cc.
13960 (HFILES): Add descriptors.h.
13961 * Makefile.in: Rebuild.
13962
801647d1
ILT
13963 PR 6716
13964 * gold.h: Always include <clocale>. Add Solaris workarounds
13965 following code in binutils/sysdep.h.
13966
5edd166e
ILT
13967 PR 6048
13968 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
13969 this->eh_frame_hdr_ is NULL before using it.
13970
c89ad728
ILT
13971 * dynobj.cc (Versions::Versions): Update comment.
13972
aa86f06b
ILT
13973 * dynobj.cc (Versions::Versions): If there is an soname, use it as
13974 the base version name.
13975
5778530e
ILT
13976 * stringpool.cc (Stringpool_template::add_with_length): Set key to
13977 array size plus one.
13978 (Stringpool_template::set_string_offsets): Subtract one from key
13979 before using it as an array index.
13980 (Stringpool_template::get_offset_with_length): Likewise.
13981 (Stringpool_template::write_to_buffer): Likewise.
13982 * stringpool.h (Stringpool_template::get_offset_from_key):
13983 Likewise.
13984
057ead22
ILT
139852008-07-23 Ian Lance Taylor <iant@google.com>
13986
7f649c59
ILT
13987 PR 6658
13988 * object.h (Merged_symbol_value::value): Do our best to handle a
13989 negative addend.
13990
057ead22
ILT
13991 PR 6647
13992 * script.cc (Version_script_info::get_versions): Don't add empty
13993 version tag to return value.
13994 (Version_script_info::get_symbol_version_helper): Change return
13995 type to bool. Add pversion parameter. Change all callers.
13996 (script_register_vers_node): Don't require a non-NULL tag.
13997 * script.h (class Version_script_info): Update declarations.
13998 (Version_script_info::get_symbol_version): Change return type to
13999 bool. Add version parameter. Change all callers.
14000 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14001 handling. Handle an empty version from a version script.
14002 (Symbol_table::define_special_symbol): Likewise.
14003 * testsuite/ver_test_10.script: New file.
14004 * testsuite/ver_test_10.sh: New file.
14005 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14006 (check_DATA): Add ver_test_10.syms.
14007 (ver_test_10.syms, ver_test_10.so): New target.
14008 * testsuite/Makefile.in: Rebuild.
14009
58e54ac2
CD
140102008-07-23 Simon Baldwin <simonb@google.com>
14011
14012 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14013 to zero for undefined symbols from dynamic libraries.
14014
95d14cd3
ILT
140152008-07-23 Ian Lance Taylor <iant@google.com>
14016
14017 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14018 Change all callers.
14019 * symtab.h (class Symbol_table): Update declaration.
14020 * testsuite/ver_test_9.cc: New file.
14021 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14022 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14023 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14024 (ver_test_9.so, ver_test_9.o): New targets.
14025 * testsuite/Makefile.in: Rebuild.
14026
92de84a6
ILT
140272008-07-22 Ian Lance Taylor <iant@google.com>
14028
34810851
ILT
14029 * options.h (class General_options): Define --check-sections.
14030 * layout.cc (Layout::set_segment_offsets): Handle
14031 --check-sections.
14032
af6156ef
ILT
14033 * options.h (class General_options): Define -n/--nmagic and
14034 -N/--omagic.
14035 * options.cc (General_options::finalize): For -n/--nmagic or
14036 -N/--omagic, set -static.
14037 * layout.cc (Layout::attach_allocated_section_to_segment): If
14038 -N/--omagic, don't put read-only and read-write sections in
14039 different segments.
14040 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14041 finding a read-only segment.
14042 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14043 don't set the minimum segment alignment to the common page size,
14044 and don't set the file offset to the address modulo the page size.
14045 * script-sections.cc (Script_sections::create_segments): If
14046 -n/--omagic, don't put read-only and read-write sections in
14047 different segments.
14048
92de84a6
ILT
14049 * cref.cc: New file.
14050 * cref.h: New file.
14051 * options.h (class General_options): Add --print-symbol-counts.
14052 * main.cc (main): Issue defined symbol report if requested.
14053 * archive.cc (Archive::interpret_header): Make into a const member
14054 function.
14055 (Archive::add_symbols): Call Input_objects::archive_start and
14056 archive_stop.
14057 (Archive::const_iterator): Define new class.
14058 (Archive::begin, Archive::end): New functions.
14059 (Archive::include_all_members): Rewrite to use iterator.
14060 (Archive::count_members): New function.
14061 * archive.h (class Archive): Update declarations.
14062 (Archive::filename): New function.
14063 * object.cc: Include "cref.h".
14064 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14065 (Sized_relobj::do_get_global_symbol_counts): New function.
14066 (Input_objects::add_object): Add object to cross-referencer.
14067 (Input_objects::archive_start): New function.
14068 (Input_objects::archive_stop): New function.
14069 (Input_objects::print_symbol_counts): New function.
14070 * object.h: Declare Cref and Archive.
14071 (Object::get_global_symbol_counts): New function.
14072 (Object::do_get_global_symbol_counts): New pure virtual function.
14073 (class Sized_relobj): Add defined_count_ field. Update
14074 declarations.
14075 (class Input_objects): Add cref_ field. Update constructor.
14076 Update declarations.
14077 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14078 defined_count_.
14079 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14080 symbol counts.
14081 (Sized_dynobj::do_get_global_symbol_counts): New function.
14082 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14083 defined_count_. Update declarations. Define Symbols typedef.
14084 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14085 parameter. Change all callers.
14086 (Symbol_table::add_from_dynobj): Add sympointers and defined
14087 parameters. Change all callers.
14088 * symtab.h (class Symbol_table): Update declarations.
14089 * Makefile.am (CCFILES): Add cref.cc.
14090 (HFILES): Add cref.h.
14091 * Makefile.in: Rebuild.
14092
3f7c5e1d
CD
140932008-07-22 Simon Baldwin <simonb@google.com>
14094
14095 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14096 to zero when writing undefined symbols.
14097
e0b64032
ILT
140982008-07-22 Ian Lance Taylor <iant@google.com>
14099
14100 * output.cc (Output_section::add_input_section): Don't try to
14101 merge empty merge sections.
14102
096b02cf
CS
141032008-07-21 Craig Silverstein <csilvers@google.com>
14104
14105 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14106 Include symbol version in error message.
cd536b21 14107
1d1f116d
CD
141082008-07-20 Chris Demetriou <cgd@google.com>
14109
cd536b21 14110 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14111 (RANDOM_SEED_CFLAGS): New substituted variable.
14112 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14113 * configure: Rebuild.
14114 * Makefile.in: Likewise.
14115 * testsuite/Makefile.in: Likewise.
14116
a18f591e
ILT
141172008-07-18 Ian Lance Taylor <iant@google.com>
14118
14119 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14120 where we see NAME/NULL and NAME/VERSION as separate symbols.
14121 * testsuite/ver_test_main.cc (main): Call t4.
14122 (t4, t4_2a): Define.
14123 * testsuite/ver_test_2.cc (t4_2): Define.
14124 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14125 * testsuite/ver_test_4.cc (t4_2a): Define.
14126 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14127 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14128
c6e3f6ed
ILT
141292008-07-17 Ian Lance Taylor <iant@google.com>
14130
14131 * dynobj.cc (Versions::add_def): If we give an error about a
14132 missing version, go ahead and create the version anyhow.
14133
ef9beddf
ILT
141342008-07-10 Ian Lance Taylor <iant@google.com>
14135
14136 Handle output sections with more than 0x7fffffff bytes.
14137 * object.h (class Relobj): Change map_to_output_ to
14138 output_sections_, and just keep a section pointer. Change all
14139 uses. Move comdat group support to Sized_relobj.
14140 (Relobj::is_section_specially_mapped): Remove.
14141 (Relobj::output_section): Remove poff parameter. Change all
14142 callers.
14143 (Relobj::output_section_offset): New function.
14144 (Relobj::set_section_offset): Rewrite.
14145 (Relobj::map_to_output): Remove.
14146 (Relobj::output_sections): New function.
14147 (Relobj::do_output_section_offset): New pure virtual function.
14148 (Relobj::do_set_section_offset): Likewise.
14149 (class Sized_relobj): Add section_offsets_ field. Add comdat
14150 group support from Relobj. Update declarations.
14151 (Sized_relobj::get_output_section_offset): New function.
14152 (Sized_relobj::do_output_section_offset): New function.
14153 (Sized_relobj::do_set_section_offset): New function.
14154 * object.cc (Relobj::output_section_address): Remove.
14155 (Sized_relobj::Sized_relobj): Initialize new fields.
14156 (Sized_relobj::include_section_group): Cast find_kept_object to
14157 Sized_relobj.
14158 (Sized_relobj::include_linkonce_section): Likewise.
14159 (Sized_relobj::do_layout): Use separate arrays for output section
14160 and output offset.
14161 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14162 output_sections.
14163 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14164 output_sections and section_offsets.
14165 (Sized_relobj::write_local_symbols): Likewise.
14166 (map_to_kept_section): Compute output address directly.
14167 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14168 output_sections and section_offsets.
14169 (Sized_relobj::write_sections): Likewise.
14170 (Sized_relobj::relocate_sections): Likewise.
14171 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14172 * output.h (class Output_reloc): Update declarations. Change
14173 u2_.relobj to Sized_relobj*.
14174 (class Output_data_reloc): Change add functions to use
14175 Sized_relobj*.
14176 * output.cc (Output_reloc::Output_reloc): Change relobj to
14177 Sized_relobj*.
14178 (Output_reloc::local_section_offset): Change return type to
14179 Elf_Addr. Use get_output_section_offset.
14180 (Output_reloc::get_address): Likewise.
14181 (Output_section::is_input_address_mapped): Don't call
14182 is_section_specially_mapped.
14183 (Output_section::output_offset): Likewise.
14184 (Output_section::output_address): Likewise.
14185 (Output_section::starting_output_address): Likewise.
14186 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14187 parameter to Sized_relobj*.
14188 (Copy_relocs::need_copy_reloc): Likewise.
14189 (Copy_relocs::save): Likewise.
14190 * copy-relocs.h (class Copy_relocs): Update declarations.
14191 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14192 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14193 * target-reloc.h (relocate_for_relocatable): Change
14194 offset_in_output_section type to Elf_Addr. Change code that uses
14195 it as well.
14196 * layout.cc (Layout::layout): Always set *off.
14197 * mapfile.cc (Mapfile::print_input_section): Use
14198 output_section_offset.
14199 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14200 Sized_relobj*.
14201 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14202 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14203 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14204
5cb66f97
ILT
142052008-07-03 Ian Lance Taylor <iant@google.com>
14206
14207 * layout.cc (Layout::include_section): Do not discard unrecognized
14208 SHT_STRTAB sections.
14209
afe47622
CS
142102008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14211
14212 * script.cc (Lex::can_continue_name): Make '?' allowable in
14213 version-script names.
14214 * testsuite/version_script.map: Change glob pattern to use '?'
14215
5adf9721
ILT
142162008-06-30 Manish Singh <yosh@gimp.org>
14217
14218 PR 6585
14219 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14220 Correct typo.
14221
e6fde208
ILT
142222008-06-30 Ian Lance Taylor <iant@google.com>
14223
14224 PR 6660
14225 PR 6682
14226 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14227 versions]: Don't try to read the value in the contents, since we
14228 don't use it. Use the template endianness when writing.
14229
3f2e6a2d
CC
142302008-06-25 Cary Coutant <ccoutant@google.com>
14231
14232 * fileread.cc (File_read::make_view): Assert on zero-length view.
14233 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14234 symbol table when there are no symbols to read.
14235
c43d3a48
CS
142362008-06-23 Craig Silverstein <csilvers@google.com>
14237
14238 * version.cc (version_string): Bump to 1.7
14239
5f494ea0
CS
142402008-06-18 Craig Silverstein <csilvers@google.com>
14241
14242 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14243 constant 0xFFFF to type Valtype.
14244 (Powerpc_relocate_functions::rel16_ha): Likewise.
14245
c42e122e
ILT
142462008-06-17 Ian Lance Taylor <iant@google.com>
14247
f34787f8
ILT
14248 * output.h (Output_section::Input_section): Initialize p2align_ to
14249 zero for Output_section_data constructors.
14250 (Output_section::Input_section::addralign): If not an input
14251 section, return the alignment of the Output_section_data.
14252 * testsuite/copy_test.cc: New file.
14253 * testsuite/copy_test_1.cc: New file.
14254 * testsuite/copy_test_2.cc: New file.
14255 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14256 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14257 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14258 (copy_test_1_pic.o, copy_test_1.so): New targets.
14259 (copy_test_2_pic.o, copy_test_2.so): New targets.
14260 * testsuite/Makefile.in: Rebuild.
14261
c42e122e
ILT
14262 * script-sections.cc (Script_sections::place_orphan): Initialize
14263 local variable exact.
14264
ce3ac18a
DE
142652008-06-13 David Edelsohn <edelsohn@gnu.org>
14266
14267 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14268
42cacb20
DE
142692008-06-12 David Edelsohn <edelsohn@gnu.org>
14270 David S. Miller <davem@davemloft.net>
14271
14272 * powerpc.cc: New file.
14273 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14274 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14275 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14276 * Makefile.in: Rebuild.
14277
7b308235
ILT
142782008-06-09 Ian Lance Taylor <iant@google.com>
14279
14280 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14281 <exception>.
14282 (throwing, orig_terminate): New static variables.
14283 (terminate_handler): New static function.
14284 (t2): Set terminate handler.
14285
f0b886e3
ILT
142862008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14287
14288 PR 6584
cd536b21 14289 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14290 alignment.
14291
3e90f135
CC
142922008-05-30 Cary Coutant <ccoutant@google.com>
14293
14294 * archive.cc (Archive::include_all_members) Correct to step
14295 over symbol table and extended name table in thin archives.
14296
e09ad04a
ILT
142972008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14298
14299 PR 6407
14300 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14301 calculation.
14302
62b01cb5
ILT
143032008-05-28 Caleb Howe <cshowe@google.com>
14304
14305 * reduced_debug_output.cc: New file.
14306 * reduced_debug_output.h: New file.
92de84a6 14307 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14308 * options.cc (General_options::finalize): Add strip_debug_non_line
14309 to the strip heirarchy.
14310 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14311 fields.
14312 * layout.cc: Include "reduced_debug_output.h".
14313 (Layout::Layout): Initialize new fields.
14314 (line_only_debug_sections): New static array.
14315 (is_lines_only_debug_sections): New static inline function.
14316 (Layout::include_section): Handle --strip-debug-non-line.
14317 (Layout::make_output_section): If --strip-debug-non-line, build
14318 new output sections for .debug_abbrev and .debug_info.
14319 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14320 gold. Warn about possible overflow.
14321 (read_signed_LEB_128): Likewise.
14322 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14323 (read_signed_LEB_128): Declare.
14324 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14325 (HFILES): Add reduced_debug_output.h.
14326 * Makefile.in: Rebuild.
14327
7d9e3d98
ILT
143282008-05-21 Ian Lance Taylor <iant@google.com>
14329
14330 * mapfile.cc: New file.
14331 * mapfile.h: New file.
14332 * options.h (class General_options): Add -M/--print-map and -Map.
14333 * options.cc (General_options::finalize): Make -M equivalent to
14334 -Map -.
14335 * main.cc: Include <cstdio> and "mapfile.h".
14336 (main): Open mapfile if requested.
14337 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14338 constructor. Change caller.
14339 (queue_initial_tasks): Add mapfile parameter. Change caller.
14340 (queue_middle_tasks): Likewise.
14341 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14342 declarations.
14343 * archive.cc: Include "mapfile.h".
14344 (Archive::add_symbols): Add mapfile parameter. Change all
14345 callers. Pass mapfile, symbol, and reason to include_member.
14346 (Archive::include_all_members): Add mapfile parameter. Change all
14347 callers.
14348 (Archive::include_member): Add mapfile, sym, and why parameters.
14349 Change all callers. Report inclusion to map file.
14350 * archive.h: Include "fileread.h".
14351 (class Archive): Update declarations.
14352 (Archive::file): New const method.
14353 (class Add_archive_symbols): Add mapfile_ field. Update
14354 constructor. Change all callers.
14355 * readsyms.h (class Read_symbols): Likewise.
14356 (class Finish_group): Likewise.
14357 (class Read_script): Likewise.
14358 * common.cc: Include "mapfile.h".
14359 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14360 all callers.
14361 (Symbol_table::do_allocate_commons): Likewise.
14362 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14363 symbol allocation to mapfile.
14364 * common.h (class Allocate_commons_task): Add mapfile_ field.
14365 Update constructor. Change all callers.
14366 * symtab.h (class Symbol_table): Update declarations.
14367 * layout.cc: Include "mapfile.h".
14368 (Layout_task_runner::run): Print information to mapfile.
14369 (Layout::create_gold_note): Change Output_data_fixed_space to
14370 Output_data_zero_fill.
14371 (Layout::create_build_id): Likewise.
14372 (Layout::print_to_mapfile): New function.
14373 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14374 constructor. Change caller.
14375 (class Layout): Declare print_to_mapfile.
14376 * output.cc (Output_section::Input_section::print_to_mapfile): New
14377 function.
14378 (Output_section::add_input_section): If producing a map, always
14379 add to input_sections_ list.
14380 (Output_section::do_print_to_mapfile): New function.
14381 (Output_segment::print_sections_to_mapfile): New function.
14382 (Output_segment::print_section_list_to_mapfile): New function.
14383 * output.h: Include "mapfile.h".
14384 (Output_data::print_to_mapfile): New function.
14385 (Output_data::do_print_to_mapfile): New virtual function.
14386 (Output_segment_headers::do_print_to_mapfile): New function.
14387 (Output_file_header::do_print_to_mapfile): New function.
14388 (Output_data_const::do_print_to_mapfile): New function.
14389 (class Output_data_const_buffer): Add map_name_ field. Update
14390 constructor. Change all callers. Add do_print_to_mapfile
14391 function.
14392 (class Output_data_fixed_space): Likewise.
14393 (class Output_data_space): Likewise.
14394 (class Output_data_zero_fill): New class.
14395 (Output_data_strtab::do_print_to_mapfile): New function.
14396 (Output_data_reloc_base::do_print_to_mapfile): New function.
14397 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14398 (Output_data_group::do_print_to_mapfile): New function.
14399 (Output_data_got::do_print_to_mapfile): New function.
14400 (Output_data_dynamic::do_print_to_mapfile): New function.
14401 (Output_symtab_xindex::do_print_to_mapfile): New function.
14402 (class Output_section): Declare do_print_to_mapflie. Declare
14403 print_to_mapfile in Input_section.
14404 (class Output_segment): Declare new functions.
14405 * object.h (Sized_relobj::symbol_count): New function.
14406 * script-sections.cc
14407 (Output_section_element_dot_assignment::set_section_addresses):
14408 Change Output_data_fixed_space to Output_data_zero_fill.
14409 (Output_data_expression::do_print_to_mapfile): New function.
14410 * script.cc (read_input_script): Add mapfile parameter. Change
14411 all callers.
14412 * script.h (read_input_script): Update declaration.
14413 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14414 (Eh_frame::do_print_to_mapfile): New function.
14415 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14416 (Output_merge_string::do_print_to_mapfile): New function.
14417 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14418 function.
14419 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14420 function.
14421 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14422 function.
14423 * Makefile.am (CCFILES): Add mapfile.cc.
14424 (HFILES): Add mapfile.h.
14425 * Makefile.in: Rebuild.
14426
9f1d377b
ILT
144272008-05-19 Ian Lance Taylor <iant@google.com>
14428
14429 * options.h (class General_options): Add -z relro.
14430 * layout.cc (Layout::Layout): Initialize relro_segment_.
14431 (Layout::add_output_section_data): Return the output section.
14432 (Layout::make_output_section): Rcognize relro sections and mark
14433 them appropriately.
14434 (Layout::attach_allocated_section_to_segment): Put relro sections
14435 in a PT_GNU_RELRO segment.
14436 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14437 section as relro.
14438 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14439 PT_TLS segments.
14440 (Layout::linkonce_mapping): Map d.rel.ro.local to
14441 .data.rel.ro.local.
14442 (Layout::output_section_name): Us .data.rel.ro.local for any
14443 section which begins with that.
14444 * layout.h (class Layout): Update add_output_section_data
14445 declaration. Add relro_segment_ field.
14446 * output.cc (Output_section::Output_section): Initialize is_relro_
14447 and is_relro_local_ fields.
14448 (Output_segment::add_output_section): Group relro sections.
14449 (Output_segment::is_first_section_relro): New function.
14450 (Output_segment::maximum_alignment): If there is a relro section,
14451 align the segment to the common page size.
14452 (Output_segment::set_section_addresses): Track whether we are
14453 looking at relro sections. If the last section is a relro
14454 section, align to the common page size.
14455 (Output_segment::set_section_list_addresses): Add in_relro
14456 parameter. Change all callers. Align to the page size when
14457 moving from relro to non-relro section.
14458 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14459 segment.
14460 * output.h (class Output_section): Add is_relro_ and
14461 is_relro_local_ fields.
14462 (Output_section::is_relro): New function.
14463 (Output_section::set_is_relro): New function.
14464 (Output_section::is_relro_local): New function.
14465 (Output_section::set_is_relro_local): New function.
14466 (class Output_segment): Update declarations.
14467 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14468 * sparc.cc (Target_sparc::got_section): Likewise.
14469 * x86_64.cc (Target_x86_64::got_section): Likewise.
14470 * testsuite/relro_test_main.cc: New file.
14471 * testsuite/relro_test.cc: New file.
14472 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14473 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14474 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14475 (relro_test.so, relro_test_pic.o): New targets.
14476 * testsuite/Makefile.in: Rebuild.
14477
a984ee1d
ILT
144782008-05-16 Ian Lance Taylor <iant@google.com>
14479
01676dcd
ILT
14480 * output.cc (Output_segment::add_output_section): Remove front
14481 parameter.
14482 * output.h (class Output_segment): Remove
14483 add_initial_output_section and overloaded add_output_section.
14484 Update declaration of remaining add_output_section.
14485 * layout.cc (Layout::create_interp): Call add_output_section
14486 rather than add_initial_output_section.
14487 (Layout::finish_dynamic_section): Likewise.
14488
497897f9
ILT
14489 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14490 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14491 know the dynamic type.
14492 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14493 field. Initialize it in constructor.
14494 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14495 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14496 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14497 reloc.
14498
a984ee1d
ILT
14499 * output.cc (Output_reloc::get_address): Change return type to
14500 Elf_Addr.
14501 * output.h (class Output_reloc): Update get_address declaration.
14502 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14503 for section addresses.
14504
55ba0940
ILT
145052008-05-09 Ian Lance Taylor <iant@google.com>
14506
14507 PR 6493
14508 * gold.cc (gold_nomem): Use return value of write.
14509
75517b77
ILT
145102008-05-08 Ian Lance Taylor <iant@google.com>
14511
14512 * symtab.c (Symbol::init_base_output_data): Add version
14513 parameter. Change all callers.
14514 (Symbol::init_base_output_segment): Likewise.
14515 (Symbol::init_base_constant): Likewise.
14516 (Symbol::init_base_undefined): Likewise.
14517 (Sized_symbol::init_output_data): Likewise.
14518 (Sized_symbol::init_output_segment): Likewise.
14519 (Sized_symbol::init_constant): Likewise.
14520 (Sized_symbol::init_undefined): Likewise.
14521 (Symbol_table::do_define_in_output_data): If the new symbol has a
14522 version, mark it as the default.
14523 (Symbol_table::do_define_in_output_segment): Likewise.
14524 (Symbol_table::do_define_as_constant): Likewise.
14525 * symtab.h (class Symbol): Update declarations.
14526 (class Sized_symbol): Likewise.
14527 * resolve.cc (Symbol::override_version): New function.
c42e122e 14528 (Symbol::override_base): Call override_version.
75517b77
ILT
14529 (Symbol::override_base_with_special): Likewise.
14530 * testsuite/ver_script_8.script: New file.
14531 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14532 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14533 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14534 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14535
f1f70eae
ILT
145362008-05-06 Ian Lance Taylor <iant@google.com>
14537
f3e9c5c5
ILT
14538 PR 6049
14539 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14540 functions.
14541 (class General_options): Remove existing --undefined, and add
14542 --no-undefined instead. Add new --undefined as synonym for -u.
14543 * archive.cc (Archive::add_symbols): Check whether symbol was
14544 named with -u.
14545 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14546 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14547 all uses. Add IS_UNDEFINED. Update declarations to split
14548 different versions of init_base. Declare init_base_undefined.
14549 (Symbol::is_defined): Handle IS_UNDEFINED.
14550 (Symbol::is_undefined): Likewise.
14551 (Symbol::is_weak_undefined): Call is_undefined.
14552 (Symbol::is_absolute): Handle IS_CONSTANT.
14553 (class Sized_symbol): Update declarations to split different
14554 versions of init. Declare init_undefined.
14555 (class Symbol_table): Declare new functions.
14556 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14557 Change all callers.
14558 (Symbol::init_base_output_data): Likewise.
14559 (Symbol::init_base_output_segment): Likewise.
14560 (Symbol::init_base_constant): Likewise.
14561 (Symbol::init_base_undefined): New function.
14562 (Sized_symbol::init_object): Rename from init. Change all
14563 callers.
14564 (Sized_symbol::init_output_data): Likewise.
14565 (Sized_symbol::init_output_segment): Likewise.
14566 (Sized_symbol::init_constant): Likewise.
14567 (Sized_symbol::init_undefined): New function.
14568 (Symbol_table::add_undefined_symbols_from_command_line): New
14569 function.
14570 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14571 function.
14572 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14573 (Symbol::output_section): Likewise.
14574 (Symbol::set_output_section): Likewise.
14575 (Symbol_table::sized_finalize_symbol): Likewise.
14576 (Symbol_table::sized_write_globals): Likewise.
14577 * resolve.cc (Symbol_table::should_override): Likewise.
14578 (Symbol::override_base_with_special): Likewise.
14579
8bdcdf2c
ILT
14580 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14581 symbol, change it to have default visibility.
14582 * testsuite/protected_1.cc: New file.
14583 * testsuite/protected_2.cc: New file.
14584 * testsuite/protected_3.cc: New file.
14585 * testsuite/protected_main_1.cc: New file.
14586 * testsuite/protected_main_2.cc: New file.
14587 * testsuite/protected_main_3.cc: New file.
14588 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14589 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14590 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14591 (protected_1.so): New target.
14592 (protected_1_pic.o, protected_2_pic.o): New targets.
14593 (protected_3_pic.o): New target.
14594 (check_PROGRAMS): Add protected_2.
14595 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14596 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14597 * testsuite/Makefile.in: Rebuild.
14598
2b706932
ILT
14599 * options.h (DEFINE_var): Add set_user_set_##varname__.
14600 (DEFINE_bool_alias): New macro.
14601 (class General_options): Define -Bstatic using DEFINE_bool_alias
14602 rather than DEFINE_special. Add --undefined as an alias for -z
14603 defs.
14604 * options.cc (General_options::parse_Bstatic): Remove.
14605
d82a5bcc
ILT
14606 * options.h (class General_options): Add --fatal-warnings.
14607 * main.cc (main): Implement --fatal-warnings.
14608 * errors.h (Errors::warning_count): New function.
14609
f1f70eae
ILT
14610 * options.h (class General_options): Add -Bsymbolic-functions.
14611 * symtab.h (Symbol::is_preemptible): Check for
14612 -Bsymbolic-functions.
14613
8825ac63
ILT
146142008-05-05 Ian Lance Taylor <iant@google.com>
14615
d98bc257
ILT
14616 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14617 as noVARNAME rather than no-VARNAME.
14618 (class General_options): Add option -z combreloc.
14619 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14620 get_address.
14621 (Output_reloc::sort_before) [SHT_REL]: New function.
14622 (Output_reloc::sort_before) [SHT_RELA]: New function.
14623 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14624 Sort_relocs_comparison.
14625 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14626 parameter. Change all callers.
14627 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14628 sort_relocs parameter. Change all callers.
14629 * output.cc (Output_reloc::get_address): New function, broken out
14630 of write_rel.
14631 (Output_reloc::write_rel): Call it.
14632 (Output_reloc::compare): New function.
14633 (Output_data_reloc_base::do_write): Optionally sort relocs.
14634
60b2b4e7
ILT
14635 * configure.ac: If targ_extra_obj is set, link it in.
14636 * configure.tgt: Initialize all variables.
14637 (x86_64*): Set targ_extra_obj and targ_extra_size.
14638 * configure: Rebuild.
14639
8825ac63
ILT
14640 * object.cc (Sized_relobj::include_section_group): Adjust section
14641 indexes read from group data. Build vector to pass to
14642 layout_group.
14643 * layout.cc (Layout::layout_group): Add flags and shndxes
14644 parameters. Remove contents parameter. Change caller. Update
14645 explicit instantiations.
14646 * layout.h (class Layout): Update layout_group declaration.
14647 * output.cc (Output_data_group::Output_data_group): Add flags and
14648 input_shndxes parameters. Remove contents parameter. Change
14649 caller.
14650 (Output_data_group::do_write): Change input_sections_ to
14651 input_shndxes_.
14652 * output.h (class Output_data_group): Update constructor
14653 declaration. Rename input_sections_ to input_shndxes_.
14654 * testsuite/many_sections_test.cc: Add template.
14655
e94cf127
CC
146562008-04-30 Cary Coutant <ccoutant@google.com>
14657
4418b2d5
CC
14658 * target-reloc.h (relocate_section): Fix dead-pointer bug.
14659
e94cf127
CC
14660 * layout.cc (Layout::include_section): Refactored check for debug
14661 info section.
14662 (Layout::add_comdat): Add new parameters. Change type
14663 of signature parameter. Add object and shndx to signatures table.
14664 (Layout::find_kept_object): New function.
14665 * layout.h: Include <cstring>.
14666 (Layout::is_debug_info_section): New function.
14667 (Layout::add_comdat): Add new parameters.
14668 (Layout::find_kept_object): New function.
14669 (Layout::Kept_section): New struct.
14670 (Layout::Signatures): Change type of map range.
14671 * object.cc (Relobj::output_section_address): New function.
14672 (Sized_relobj::include_section_group): Add new parameters. Change
14673 calls to Layout::add_comdat. Change to build table of kept comdat
14674 groups and table mapping discarded sections to kept sections.
14675 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
14676 (Sized_relobj::do_layout): Change calls to include_section_group and
14677 include_linkonce_section.
14678 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
14679 value to zero when section is discarded.
14680 (Sized_relobj::map_to_kept_section): New function.
14681 * object.h (Relobj::output_section_address): New function.
14682 (Relobj::Comdat_group): New type.
14683 (Relobj::find_comdat_group): New function.
14684 (Relobj::Comdat_group_table): New type.
14685 (Relobj::Kept_comdat_section): New type.
14686 (Relobj::Kept_comdat_section_table): New type.
14687 (Relobj::add_comdat_group): New function.
14688 (Relobj::set_kept_comdat_section): New function.
14689 (Relobj::get_kept_comdat_section): New function.
14690 (Relobj::comdat_groups_): New field.
14691 (Relobj::kept_comdat_sections_): New field.
14692 (Symbol_value::input_value): Update comment.
14693 (Sized_relobj::map_to_kept_section) New function.
14694 (Sized_relobj::include_linkonce_section): Add new parameter.
14695 * target-reloc.h (Comdat_behavior): New type.
14696 (get_comdat_behavior): New function.
14697 (relocate_section): Add code to map a discarded section to the
14698 corresponding kept section when applying a relocation.
14699
e4e5049b
CS
147002008-04-30 Craig Silverstein <csilvers@google.com>
14701
14702 * dwarf_reader.cc (next_generation_count): New static var.
14703 (Addr2line_cache_entry): New struct.
14704 (addr2line_cache): New static var.
14705 (Dwarf_line_info::one_addr2line): Added caching.
14706 (Dwarf_line_info::clear_addr2line_cache): New function.
14707 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
14708 cache-size parameter.
14709 (Dwarf_line_info::one_addr2line_cache): New function.
14710 * symtab.cc (Symbol_table::detect_odr_violations): Pass
14711 new cache-size argument to one_addr2line(), and clear cache.
14712
d09e9154
CC
147132008-04-28 Cary Coutant <ccoutant@google.com>
14714
14715 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
14716 R_386_PC8 relocations.
14717
7ef73768
ILT
147182008-04-23 Ian Lance Taylor <iant@google.com>
14719
55438702
ILT
14720 * object.cc (Sized_relobj::include_section_group): Check for
14721 invalid section group.
14722
c165fb93
ILT
14723 * object.cc (make_elf_object): Correct test for 64-bit ELF file
14724 header size.
14725
7ef73768
ILT
14726 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
14727 than read for file header.
14728 * archive.cc (Archive::include_member): Likewise.
14729
6194aaab
L
147302008-04-23 Paolo Bonzini <bonzini@gnu.org>
14731
14732 * aclocal.m4: Regenerate.
14733 * configure: Regenerate.
14734
d491d34e
ILT
147352008-04-19 Ian Lance Taylor <iant@google.com>
14736
5ea2bac6
ILT
14737 * version.cc (version_string): Bump to 1.6.
14738
7bc3e21a
ILT
14739 * testsuite/Makefile.am (many_sections_r_test): New target.
14740 (many_sections_r_test_SOURCES): Remove.
14741 (many_sections_r_test_DEPENDENCIES): Remove.
14742 (many_sections_r_test_LDFLAGS): Remove.
14743 (many_sections_r_test_LDADD): Remove.
14744
7fcd3aa9
ILT
14745 * object.cc (Sized_relobj::do_add_symbols): Always pass
14746 local_symbol_count_ to add_from_relobj.
14747
4c94d6ae
ILT
14748 * testsuite/Makefile.am (many_sections_check.h): Only check one in
14749 every thousand variables.
14750 * testsuite/Makefile.in: Rebuild.
14751
d491d34e
ILT
14752 * object.cc (Xindex::initialize_symtab_xindex): New function.
14753 (Xindex::read_symtab_xindex): New function.
14754 (Xindex::sym_xindex_to_shndx): New function.
14755 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
14756 available.
14757 (Sized_relobj::do_initialize_xindex): New function.
14758 (Sized_relobj::do_read_symbols): Adjust section links.
14759 (Sized_relobj::symbol_section_and_value): Add is_ordinary
14760 parameter. Change all callers.
14761 (Sized_relobj::include_section_group): Adjust section links and
14762 symbol section indexes.
14763 (Sized_relobj::do_layout): Adjust section links.
14764 (Sized_relobj::do_count_local_symbols): Adjust section links and
14765 symbol section indexes.
14766 (Sized_relobj::do_finalize_local_symbols): Distinguish between
14767 ordinary and special symbols.
14768 (Sized_relobj::write_local_symbols): Add symtab_xindex and
14769 dynsym_xindex parameters. Change all callers. Adjust section
14770 links. Use SHN_XINDEX when needed.
14771 (Sized_relobj::get_symbol_location_info): Adjust section links.
14772 Don't get fooled by special symbols.
14773 * object.h (class Xindex): Define.
14774 (class Object): Add xindex_ parameter. Declare virtual functoin
14775 do_initialize_xindex.
14776 (Object::adjust_sym_shndx): New function.
14777 (Object::set_xindex): New protected function.
14778 (class Symbol_value): Add is_ordinary_shndx_ field.
14779 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
14780 (Symbol_value::value): Assert ordinary section.
14781 (Symbol_value::initialize_input_to_output_map): Likewise.
14782 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
14783 Change all callers.
14784 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
14785 all callers.
14786 (class Sized_relobj): Update declarations.
14787 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
14788 parameter. Change all callers.
14789 (Sized_relobj::adjust_shndx): New function.
14790 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
14791 field.
14792 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
14793 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
14794 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
14795 (Sized_dynobj::read_dynsym_section): Adjust section links.
14796 (Sized_dynobj::read_dynamic): Likewise.
14797 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
14798 section links.
14799 (Sized_dynobj::do_initialize_xindex): New function.
14800 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
14801 do_initialize_xindex.
14802 (Sized_dynobj::adjust_shndx): New function.
14803 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
14804 dynsym_xindex_ fields.
14805 (Layout::finalize): Add a call to set_section_indexes before
14806 creating the symtab sections.
14807 (Layout::set_section_indexes): Don't do anything if the section
14808 already has a section index.
14809 (Layout::create_symtab_sections): Add shnum parameter. Change
14810 caller. Create .symtab_shndx section if needed.
14811 (Layout::create_shdrs): Add shstrtab_section parameter. Change
14812 caller.
14813 (Layout::allocated_output_section_count): New function.
14814 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
14815 needed.
14816 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
14817 fields. Update declarations.
14818 (Layout::symtab_xindex): New function.
14819 (Layout::dynsym_xindex): New function.
14820 (class Write_symbols_task): Add layout_ field.
14821 (Write_symbols_task::Write_symbols_task): Add layout parameter.
14822 Change caller.
14823 * output.cc (Output_section_headers::Output_section_headers): Add
14824 shstrtab_section parameter. Change all callers.
14825 (Output_section_headers::do_sized_write): Store overflow values
14826 for section count and section string table section index in
14827 section header zero.
14828 (Output_file_header::do_sized_write): Check for overflow of
14829 section count and section string table section index.
14830 (Output_symtab_xindex::do_write): New function.
14831 (Output_symtab_xindex::endian_do_write): New function.
14832 * output.h (class Output_section_headers): Add shstrtab_section_.
14833 Update declarations.
14834 (class Output_symtab_xindex): Define.
14835 (Output_section::has_out_shndx): New function.
14836 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
14837 field.
14838 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
14839 Change all callers.
14840 (Sized_symbol::init): Likewise.
14841 (Symbol::output_section): Check for ordinary symbol.
14842 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
14843 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
14844 callers.
14845 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
14846 Change all callers. Simplify handling of symbols from sections
14847 not included in the link.
14848 (Symbol_table::add_from_dynobj): Handle ordinary symbol
14849 distinction.
14850 (Weak_alias_sorter::operator()): Assert that symbols are
14851 ordinary.
14852 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14853 distinction.
14854 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14855 parameters. Change all callers.
14856 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14857 symbol distinction. Use SHN_XINDEX when needed.
14858 (Symbol_table::write_section_symbol): Add symtab_xindex
14859 parameter. Change all callers.
14860 (Symbol_table::sized_write_section_symbol): Likewise. Use
14861 SHN_XINDEX when needed.
14862 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14863 declarations.
14864 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14865 (Symbol::is_defined): Check is_ordinary.
14866 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14867 (Symbol::is_absolute, Symbol::is_common): Likewise.
14868 (class Sized_symbol): Update declarations.
14869 (class Symbol_table): Update declarations.
14870 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14871 parameters. Change all callers.
14872 (Sized_symbol::override): Likewise.
14873 (Symbol_table::override): Likewise.
14874 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14875 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14876 is_ordinary, and orig_st_shndx parameters. Change all callers.
14877 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14878 to be in an ordinary section.
14879 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14880 object and is_ordinary parameters. Change all callers.
14881 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14882 Change all callers. Don't add undefined or non-ordinary symbols
14883 to reloc_map_.
14884 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
14885 Change all callers.
14886 * dwarf_reader.h (class Sized_dwarf_line_info): Update
14887 declarations.
14888 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
14889 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
14890 (Sized_relobj::relocate_sections): Likewise.
14891 * target-reloc.h (scan_relocs): Adjust section symbol index.
14892 (scan_relocatable_relocs): Likewise.
14893 * i386.cc (Scan::local): Check for ordinary symbols.
14894 * sparc.cc (Scan::local): Likewise.
14895 * x86_64.cc (Scan::local): Likewise.
14896 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
14897 to symbol_section_and_value.
14898 * testsuite/many_sections_test.cc: New file.
14899 * testsuite/Makefile.am (BUILT_SOURCES): Define.
14900 (check_PROGRAMS): Add many_sections_test.
14901 (many_sections_test_SOURCES): Define.
14902 (many_sections_test_DEPENDENCIES): Define.
14903 (many_sections_test_LDFLAGS): Define.
14904 (BUILT_SOURCES): Add many_sections_define.h.
14905 (many_sections_define.h): New target.
14906 (BUILT_SOURCES): Add many_sections_check.h.
14907 (many_sections_check.h): New target.
14908 (check_PROGRAMS): Add many_sections_r_test.
14909 (many_sections_r_test_SOURCES): Define.
14910 (many_sections_r_test_DEPENDENCIES): Define.
14911 (many_sections_r_test_LDFLAGS): Define.
14912 (many_sections_r_test_LDADD): Define.
14913 (many_sections_r_test.o): New target.
14914 * testsuite/Makefile.in: Rebuild.
14915
c5818ff1
CC
149162008-04-17 Cary Coutant <ccoutant@google.com>
14917
14918 * errors.cc (Errors::info): New function.
14919 (gold_info): New function.
14920 * errors.h (Errors::info): New function.
14921 * gold.h (gold_info): New function.
14922 * object.cc (Input_objects::add_object): Print trace output.
14923 * options.cc (options::parse_set): New function.
14924 (General_options::parse_wrap): Deleted.
14925 (General_options::General_options): Deleted initializer.
14926 * options.h (options::String_set): New typedef.
14927 (options::parse_set): New function.
14928 (DEFINE_set): New macro.
14929 (General_options::wrap): Changed to use DEFINE_set. Changed
14930 callers of any_wrap_symbols and is_wrap_symbol.
14931 (General_options::trace, General_options::trace_symbol):
14932 New options.
14933 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
14934 (General_options::wrap_symbols_): Deleted.
14935 * symtab.cc (Symbol_table::add_from_object): Print trace output.
14936
b5be4a7c
DM
149372008-04-17 David S. Miller <davem@davemloft.net>
14938
14939 * options.cc (General_options::parse_V): New function.
14940 * options.h: Add entries for -V and -Qy.
14941
155a0dd7
ILT
149422008-04-17 Ian Lance Taylor <iant@google.com>
14943
14944 * common.cc (Symbol_table::allocate_commons): Remove options
14945 parameter. Change caller.
14946 (Symbol_table::do_allocate_commons): Remove options parameter.
14947 Change caller. Just call do_allocate_commons_list twice.
14948 (Symbol_table::do_allocate_commons_list): New function, broken out
14949 of do_allocate_commons.
14950 * common.h (class Allocate_commons_task): Remove options_ field.
14951 Update constructor.
14952 * symtab.cc (Symbol_table::Symbol_table): Initialize
14953 tls_commons_.
14954 (Symbol_table::add_from_object): Put TLS common symbols on
14955 tls_commons_ list.
14956 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
14957 which are IN_OUTPUT_DATA.
14958 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
14959 allocate_commons and do_allocate_commons declarations. Declare
14960 do_allocate_commons_list.
14961 * gold.cc (queue_middle_tasks): Update creation of
14962 Allocate_commons_task to not pass options.
14963 * testsuite/Makefile.am (INCLUDES): Add -I.. .
14964 (TLS_TEST_C_FLAGS): New variable.
14965 (tls_test_c_pic.o): New target.
14966 (tls_test_shared.so): Link in tls_test_c_pic.o.
14967 (tls_test_c_pic_ie.o): New target.
14968 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
14969 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
14970 (tls_test_c.o): New target.
14971 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
14972 (tls_pic_test_LDADD): Likewise.
14973 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
14974 (tls_shared_gd_to_ie_test_LDADD): Likewise.
14975 (tls_test_c_gnu2.o): New target.
14976 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
14977 tls_test_c_gnu2.o.
14978 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
14979 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
14980 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
14981 * testsuite/tls_test.cc: Include "config.h".
14982 (t_last): Call t11_last.
14983 * testsuite/tls_test.h (t11, t11_last): Declare.
14984 * testsuite/tls_test_c.c: New file.
14985 * testsuite/tls_test_main.cc (thread_routine): Call t11.
14986 * configure.ac: Check for OpenMP support.
14987 * configure, config.in, Makefile.in: Rebuild.
14988 * testsuite/Makefile.in: Rebuild.
14989
edfbb029
CC
149902008-04-16 Cary Coutant <ccoutant@google.com>
14991
14992 * i386.cc (Target_i386::define_tls_base_symbol): New function.
14993 (Target_i386::tls_base_symbol_defined_): New field.
14994 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14995 (Target_i386::Scan::global): Likewise.
14996 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
14997 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
14998 (Target_x86_64::tls_base_symbol_defined_): New field.
14999 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15000 (Target_x86_64::Scan::global): Likewise.
15001
f3c69fca
CC
150022008-04-16 Cary Coutant <ccoutant@google.com>
15003
15004 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15005 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15006 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15007 building shared libraries.
15008 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15009 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15010 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15011 * testsuite/Makefile.in: Rebuild.
15012 * testsuite/weak_undef.h: New file.
15013 * testsuite/weak_undef_file1.cc: Add extra test cases.
15014 * testsuite/weak_undef_file2.cc: Likewise.
15015 * testsuite/weak_undef_test.cc: Likewise.
15016
7c414435
DM
150172008-04-16 David S. Miller <davem@davemloft.net>
15018
32b769e1
DM
15019 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15020 Add issued_non_pic_error_ field. Declare check_non_pic.
15021 (Target_sparc::Scan::check_non_pic): New function.
15022 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15023 (Target_sparc::Scan::global): Likewise.
15024
11936fb1
DM
15025 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15026 * configure: Rebuild.
15027
7c414435
DM
15028 * options.h (DEFINE_enable): New macro.
15029 (new_dtags): New enable option.
15030 (initfirst, interpose, loadfltr, nodefaultlib,
15031 nodelete, nodlopen, nodump): New -z options.
15032 * layout.cc (Layout:finish_dynamic_section): If new
15033 dtags enabled, emit DT_RUNPATH. Also, emit a
15034 DT_FLAGS_1 containing any specified -z flags.
15035
85c7bf8b
ILT
150362008-04-16 Ian Lance Taylor <iant@google.com>
15037
12c0daef
ILT
15038 * copy-relocs.cc: New file.
15039 * copy-relocs.h: New file.
15040 * reloc.cc: Remove Copy_relocs code.
15041 * reloc.h: Likewise.
15042 * reloc-types.h (struct Reloc_types) [both versions]: Add
15043 get_reloc_addend_noerror.
15044 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15045 variants of add_global which take an addend which must be zero.
15046 * i386.cc: Include "copy-relocs.h".
15047 (class Target_i386): Change type of copy_relocs_ to variable,
15048 update initializer.
15049 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15050 Change all callers.
15051 (Target_i386::do_finalize_sections): Change handling of
15052 copy_relocs_.
15053 * sparc.cc: Include "copy-relocs.h".
15054 (class Target_sparc): Change type of copy_relocs_ to variable,
15055 update initializer.
15056 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15057 Change all callers.
15058 (Target_sparc::do_finalize_sections): Change handling of
15059 copy_relocs_.
15060 * x86_64.cc: Include "copy-relocs.h".
15061 (class Target_x86_64): Change type of copy_relocs_ to variable,
15062 update initializer.
15063 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15064 class. Change all callers.
15065 (Target_x86_64::do_finalize_sections): Change handling of
15066 copy_relocs_.
15067 * Makefile.am (CCFILES): Add copy-relocs.cc.
15068 (HFILES): Add copy-relocs.h.
15069
4f4995b6
ILT
15070 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15071
85c7bf8b
ILT
15072 * testsuite/script_test_4.sh: Permit leading zeroes.
15073
4f2a9edd
ILT
150742008-04-15 Ian Lance Taylor <iant@google.com>
15075
e6188289
ILT
15076 * script-sections.cc (Script_sections::create_segments): Use
15077 header_size_adjustment even when there is enough room for the
15078 headers.
15079 * testsuite/script_test_4.sh: New file.
15080 * testsuite/script_test_4.t: New file.
15081 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15082 (check_DATA): Add script_test_4.stdout.
15083 (MOSTLYCLEANFILES): Likewise.
15084 (script_test_4): New target.
15085 (script_test_4.stdout): New target.
15086 * testsuite/Makefile.in: Rebuild.
15087
4f2a9edd
ILT
15088 * sparc.cc: Add definitions for Output_data_plt_sparc class
15089 constants.
15090
f5314dd5
DM
150912008-04-14 David S. Miller <davem@davemloft.net>
15092
15093 * sparc.cc: New file.
15094 * Makefile.am (TARGETSOURCES): Add sparc.cc
15095 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15096 * configure.tgt: Document targ_extra_size and
15097 targ_extra_big_endian. Add entries for sparc-* and
15098 sparc64-*.
15099 * configure.ac: Handle targ_extra_size and
15100 targ_extra_big_endian.
15101 * Makefile.in: Rebuild.
15102 * configure: Likewise.
15103 * po/POTFILES.in: Likewise.
15104 * po/gold.pot: Likewise.
15105
154e0e9a
ILT
151062008-04-14 Ian Lance Taylor <iant@google.com>
15107
15108 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15109 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15110 in the name/type/flags to section mapping. Don't call
15111 allocate_output_section.
15112 (Layout::choose_output_section): Change parameter from adjust_name
15113 to is_input_section. Don't permit input sections after sections
15114 are attached to segments. Don't call allocate_output_section.
15115 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15116 not write_enable_output_section.
15117 (Layout::make_output_section): Don't push to
15118 unattached_section_list_ nor call attach_to_segment. Call
15119 attach_section_to_segment if sections are attached.
15120 (Layout::attach_sections_to_segments): New function.
15121 (Layout::attach_section_to_segment): New function.
15122 (Layout::attach_allocated_section_to_segment): Rename from
15123 attach_to_segment. Remove flags parameter.
15124 (Layout::allocate_output_section): Remove function.
15125 (Layout::write_enable_output_section): Remove function.
15126 * layout.h (class Layout): Update for above changes. Add new
15127 field sections_are_attached_.
15128 * output.h (Output_section::update_flags_for_input_section): New
15129 function.
15130 * output.cc (Output_section::add_input_section): Call
15131 update_flags_for_input_section.
15132 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15133
009a67a2
CC
151342008-04-11 Cary Coutant <ccoutant@google.com>
15135
15136 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15137 thought unnecessary.
15138 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15139
759b1a24
ILT
151402008-04-11 Ian Lance Taylor <iant@google.com>
15141
15142 * output.h (class Output_section_data): Remove inline definition
15143 of set_addralign.
15144 * output.cc (Output_section_data::set_addralign): New function.
15145
c2b45e22
CC
151462008-04-11 Cary Coutant <ccoutant@google.com>
15147
15148 Add support for TLS descriptors for i386 and x86_64.
15149 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15150 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15151 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15152 GOT_TYPE_TLS_DESC.
15153 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15154 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15155 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15156 relocations.
15157 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15158 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15159 Fix problem with initial-exec relocations.
15160 (Target_i386::Relocate::relocate_tls): Likewise.
15161 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15162 relaxation.
15163 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15164 support for section-plus-offset dynamic table entries.
15165 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15166 (Output_data_dynamic::Dynamic_entry): Add support for
15167 section-plus-offset dynamic table entries.
15168 (Output_data_dynamic::Classification): Likewise.
15169 (Output_data_dynamic::classification_): Renamed offset_.
15170 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15171 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15172 (Target_x86_64::make_plt_section): New function.
15173 (Target_x86_64::reserve_tlsdesc_entries): New function.
15174 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15175 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15176 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15177 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15178 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15179 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15180 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15181 add extra PLT entry for TLS descriptors.
15182 (Output_data_plt_x86_64::got_): New field.
15183 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15184 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15185 fields.
15186 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15187 descriptors.
15188 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15189 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15190 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15191 R_386_TLS_DESC_CALL relocations.
15192 (Target_x86_64::Scan::global): Likewise.
15193 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15194 for TLS descriptors.
15195 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15196 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15197 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15198 GD-to-IE relaxation.
15199 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15200 and TLS_DESCRIPTORS.
15201 * Makefile.in: Rebuild.
15202 * configure: Rebuild.
15203 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15204 (tls_test_shared2.so): New target.
15205 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15206 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15207 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15208 (tls_shared_gd_to_ie_test_LDADD): New variable.
15209 (tls_shared_gnu2_gd_to_ie_test): New target.
15210 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15211 New targets.
15212 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15213 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15214 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15215 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15216 (tls_shared_gnu2_test): New target.
15217 (tls_test_gnu2_shared.so): New target.
15218 (tls_shared_gnu2_test_SOURCES): New variable.
15219 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15220 (tls_shared_gnu2_test_LDFLAGS): New variable.
15221 (tls_shared_gnu2_test_LDADD): New variable.
15222 * testsuite/Makefile.in: Rebuild.
15223 * testsuite/Makefile.
15224
83bfb6b7
ILT
152252008-04-11 Ian Lance Taylor <iant@google.com>
15226
15227 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15228 justsyms.t.
15229 * testsuite/Makefile.in: Rebuild.
15230
15231 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15232 long.
15233 * testsuite/script_test_2.cc (main): Adjust test.
15234
706e1f5e
ILT
152352008-04-11 David S. Miller <davem@davemloft.net>
15236 Ian Lance Taylor <iant@google.com>
15237
15238 * options.h (General_options): Add entries for '-Y' and
15239 '-relax'.
15240 * options.cc (General_options:finalize): If -Y was used, add those
15241 entries to the library path instead of the default "/lib" and
15242 "/usr/lib".
15243
7c98e6bb
DM
152442008-04-11 David S. Miller <davem@davemloft.net>
15245
15246 * testsuite/justsyms.t: Start at 0x100.
15247 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15248 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15249 long.
15250 * testsuite/script_test_2.cc: Adjust string and section length
15251 checks.
7c98e6bb 15252
99a37bfd
ILT
152532008-04-09 Ian Lance Taylor <iant@google.com>
15254
2cefc357
ILT
15255 PR gold/5996
15256 * script-sections.cc (Sections_element::allocate_to_segment): Add
15257 orphan parameter.
15258 (Output_section_definition::allocate_to_segment): Likewise.
15259 (Orphan_output_section::allocate_to_segment): Likewise.
15260 (Script_sections::attach_sections_using_phdrs_clause): Don't
15261 propagate non-PT_LOAD segments to orphan sections.
15262 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15263 readelf rather than objdump.
15264 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15265 .interp section and PT_INTERP segment are the same size.
15266 * testsuite/Makefile.in: Rebuild.
15267
99a37bfd
ILT
15268 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15269 aliases for symbols defined in the same object.
15270 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15271 (weak_alias_test_SOURCES): New variable.
15272 (weak_alias_test_DEPENDENCIES): New variable.
15273 (weak_alias_test_LDFLAGS): New variable.
15274 (weak_alias_test_LDADD): New variable.
15275 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15276 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15277 (weak_alias_test_3.o): New target.
15278 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15279 * testsuite/weak_alias_test_main.cc: New file.
15280 * testsuite/weak_alias_test_1.cc: New file.
15281 * testsuite/weak_alias_test_2.cc: New file.
15282 * testsuite/weak_alias_test_3.cc: New file.
15283
780e49c5
ILT
152842008-04-08 Ian Lance Taylor <iant@google.com>
15285
cdb0b8f5
ILT
15286 * options.h (class General_options): Add --noinhibit-exec option.
15287 * main.cc (main): Check --noinhibit-exec.
15288
0864d551
ILT
15289 * options.h (class General_options): Define --wrap as a special
15290 option. Add wrap_symbols_ field.
15291 (General_options::any_wrap_symbols): New function.
15292 (General_options::is_wrap_symbol): New function.
15293 * options.cc (General_options::parse_wrap): New function.
15294 (General_options::General_options): Initialize wrap_symbols_.
15295 * symtab.cc (Symbol_table::wrap_symbol): New function.
15296 (Symbol_table::add_from_object): Handle --wrap.
15297 * symtab.h (class Symbol_table): Declare wrap_symbol.
15298 * target.h (Target::wrap_char): New function.
15299 (Target::Target_info): Add wrap_char field.
15300 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15301 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15302 * testsuite/testfile.cc (Target_test::test_target_info):
15303 Likewise.
15304
789aa6de
ILT
15305 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15306 there is one.
15307
2c38906f
ILT
15308 * layout.h (class Layout): Add added_eh_frame_data_ field.
15309 * layout.cc (Layout::Layout): Initialize new field.
15310 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15311 output section until we find a section we merged successfully.
15312 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15313 that the size be non-zero.
15314
780e49c5
ILT
15315 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15316 qualifier.
15317
7fcd0256
ILT
153182008-04-08 Craig Silverstein <csilvers@google.com>
15319
15320 * configure.ac: Export new conditional variable HAVE_ZLIB.
15321 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15322 on HAVE_ZLIB.
15323 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15324 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15325
6835af53
ILT
153262008-04-07 Ian Lance Taylor <iant@google.com>
15327
e24f324c
ILT
15328 * version.cc (version_string): Set to "1.5".
15329
a036edd8
ILT
15330 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15331 Add issued_non_pic_error_ field. Declare check_non_pic.
15332 (Target_x86_64::Scan::check_non_pic): New function.
15333 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15334 (Target_x86_64::Scan::global): Likewise.
15335
624f8810
ILT
15336 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15337 addend parameter. Change caller. Handle merge sections.
15338 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15339 Address to Addend. Don't add in the result of
15340 local_section_offset, pass down the addend and use the returned
15341 value.
15342 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15343 Update declarations of local_section_offset and symbol_value.
15344 * testsuite/two_file_test_1.cc (t18): New function.
15345 * testsuite/two_file_test_2.cc (f18): New function.
15346 * testsuite/two_file_test_main.cc (main): Call t18.
15347 * testsuite/two_file_test.h (t18, f18): Declare.
15348
6835af53
ILT
15349 * configure.ac: Don't test for objdump, c++filt, or readelf.
15350 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15351 conditionals.
15352 (TEST_READELF): New variable.
15353 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15354 (check_PROGRAMS): Add two_file_strip_test.
15355 (two_file_strip_test): New target.
15356 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15357 (two_file_same_shared_strip_test_SOURCES): New variable.
15358 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15359 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15360 (two_file_same_shared_strip_test_LDADD): New variable.
15361 (two_file_shared_strip.so): New target.
15362 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15363 (ver_test_5.syms, ver_test_7.syms): Likewise.
15364 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15365 (strip_test_3.stdout): Use TEST_OBJDUMP.
15366 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15367
86925eef
CC
153682008-04-04 Cary Coutant <ccoutant@google.com>
15369
15370 * symtab.h (Symbol::is_weak_undefined): New function.
15371 (Symbol::is_strong_undefined): New function.
15372 (Symbol::is_absolute): New function.
15373 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15374 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15375 absolute symbols.
15376 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15377 (weak_undef_test): New target.
15378 * testsuite/Makefile.in: Rebuild.
15379 * testsuite/weak_undef_file1.cc: New file.
15380 * testsuite/weak_undef_file2.cc: New file.
15381 * testsuite/weak_undef_test.cc: New file.
15382
126f3ece
ILT
153832008-04-03 Craig Silverstein <csilvers@google.com>
15384
15385 * compressed_output.h (class Output_compressed_section): Use
15386 unsigned buffer.
15387 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15388 add zlib header.
15389 (zlib_compressed_suffix): Removed.
15390 (Output_compressed_section::set_final_data_size): Use unsigned
15391 buffers.
15392 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15393 Fix linker invocation.
15394 (flagstest_o_specialfile_and_compress_debug_sections):
15395 Likewise.
15396 * testsuite/Makefile.in: Regenerated.
15397
deae2a14
DM
153982008-04-02 David S. Miller <davem@davemloft.net>
15399
15400 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15401 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15402
70752818
ILT
154032008-04-02 Craig Silverstein <csilvers@google.com>
15404
15405 * TODO: New file.
15406
39d0cb0e
ILT
154072008-04-02 Ian Lance Taylor <iant@google.com>
15408
15409 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15410 parameters. Update for new key type to views_. Change all
15411 callers.
15412 (File_read::read): Adjust for byteshift in returned view.
15413 (File_read::add_view): New function, broken out of
15414 find_and_make_view.
15415 (File_read::make_view): New function, broken out of
15416 find_and_make_view.
15417 (File_read::find_or_make_view): Add offset and aligned
15418 parameters. Rewrite accordingly. Change all callers.
15419 (File_read::get_view): Add offset and aligned parameters. Adjust
15420 for byteshift in return value.
15421 (File_read::get_lasting_view): Likewise.
15422 * fileread.h (class File_read): Update declarations.
15423 (class File_read::View): Add byteshift_ field. Add byteshift to
15424 constructor. Add byteshift method.
15425 * archive.h (Archive::clear_uncached_views): New function.
15426 (Archive::get_view): Add aligned parameter. Change all callers.
15427 * object.h (Object::get_view): Add aligned parameter. Change all
15428 callers.
15429 (Object::get_lasting_view): Likewise.
15430
15431 * fileread.cc (File_read::release): Don't call clear_views if
15432 there are multiple objects.
15433 * fileread.h (File_read::clear_uncached_views): New function.
15434 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15435 on the archive.
15436
a1207466
CC
154372008-03-31 Cary Coutant <ccoutant@google.com>
15438
15439 Add thin archive support.
15440 * archive.cc (Archive::armagt): New const.
15441 (Archive::setup): Remove task parameter and calls to unlock.
15442 (Archive::unlock_nested_archives): New function.
15443 (Archive::read_header): Add nested_off parameter. Change
15444 all callers.
15445 (Archive::interpret_header): Likewise.
15446 (Archive::include_all_members): Change to handle thin
15447 archives.
15448 (Archive::include_member): Likewise.
15449 * archive.h (Archive::Archive): Add new parameters and
15450 initializers.
15451 (Archive::armagt): New const.
15452 (Archive::setup): Remove task parameter.
15453 (Archive::unlock_nested_archives): New function.
15454 (Archive::read_header): Add nested_off parameter.
15455 (Archive::interpret_header): Likewise.
15456 (Archive::Nested_archive_table): New typedef.
15457 (Archive::is_thin_archive_): New field.
15458 (Archive::nested_archives_): New field.
15459 (Archive::options_): New field.
15460 (Archive::dirpath_): New field.
15461 (Archive::task_): New field.
15462 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15463 for thin archives. Pass additional parameters to
15464 Archive::Archive. Unlock the archive file after calling
15465 Archive::setup.
cd536b21 15466
479f6503
ILT
154672008-03-29 Ian Lance Taylor <iant@google.com>
15468
686c8caf
ILT
15469 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15470 version symbol to be local.
15471 * testsuite/ver_test_4.sh: New file.
15472 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15473 (check_DATA): Add ver_test_4.syms.
15474 (ver_test_4.syms): New target.
15475 * testsuite/Makefile.in: Rebuild.
15476
ab794b6b
ILT
15477 * output.cc
15478 (Output_section::Input_section_sort_entry::has_priority): New
15479 function.
15480 (Output_section::Input_section_sort_entry::match_file_name): New
15481 function.
15482 (Output_section::Input_section_sort_entry::match_section_name):
15483 Remove.
15484 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15485 Remove.
15486 (Output_section::Input_section_sort_entry::match_section_file):
15487 Remove.
15488 (Output_section::Input_section_sort_compare::operator()): Rewrite
15489 using new Input_section_sort_entry functions. Sort crtbegin and
15490 crtend first. Sort sections with no priority before sections with
15491 a priority.
15492 * testsuite/initpri1.c (d3): Check j != 4.
15493 (cd5): New constructor/destructor function.
15494 (main): Check j != 2.
15495
479f6503
ILT
15496 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15497 new symbol when resolving, don't call set_is_default.
15498 * testsuite/ver_test_7.cc: New file.
15499 * testsuite/ver_test_7.sh: New file.
15500 * testsuite/Makefile.am (ver_test_7.so): New target.
15501 (ver_test_7.o): New target.
15502 (check_SCRIPTS): Add ver_test_7.sh.
15503 (check_DATA): Add ver_test_7.syms.
15504 (ver_test_7.syms): New target.
15505
2fd32231
ILT
155062008-03-28 Ian Lance Taylor <iant@google.com>
15507
15508 * layout.cc (Layout::layout): If we see an input section with a
15509 name that needs sorting, set the must_sort flag for the output
15510 section.
15511 (Layout::make_output_section): If the name of the output section
15512 indicates that it might require sorting, set the may_sort flag.
15513 * output.h (Output_section::may_sort_attached_input_sections): New
15514 function.
15515 (Output_section::set_may_sort_attached_input_sections): New
15516 function.
15517 (Output_section::must_sort_attached_input_sections): New
15518 function.
15519 (Output_section::set_must_sort_attached_input_sections): New
15520 function.
15521 (class Output_section): Declare Input_section_sort_entry. Define
15522 Input_section_sort_compare. Declare
15523 sort_attached_input_sections. Add new fields:
15524 may_sort_attached_input_sections_,
15525 must_sort_attached_input_sections_,
15526 attached_input_sections_are_sorted_.
15527 * output.cc (Output_section::Output_section): Initialize new
15528 fields.
15529 (Output_section::add_input_section): Add an entry to
15530 input_sections_ if may_sort or must_sort are true.
15531 (Output_section::set_final_data_size): Call
15532 sort_attached_input_sections if necessary.
15533 (Output_section::Input_section_sort_entry): Define new class.
15534 (Output_section::Input_section_sort_compare::operator()): New
15535 function.
15536 (Output_section::sort_attached_input_sections): New function.
15537 * configure.ac: Check whether the compiler supports constructor
15538 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15539 * testsuite/initpri1.c: New file.
15540 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15541 CONSTRUCTOR_PRIORITY.
15542 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15543 (initpri1_LDFLAGS): New variable.
15544 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15545
18e6b24e
ILT
155462008-03-27 Ian Lance Taylor <iant@google.com>
15547
49bdd526
ILT
15548 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15549 * testsuite/common_test_1.c: New file.
15550 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15551 (common_test_1_SOURCES): New variable.
15552 (common_test_1_DEPENDENCIES): New variable.
15553 (common_test_1_LDFLAGS): New variable.
15554
18e6b24e
ILT
15555 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15556 and commons_ correctly when NAME/VERSION does not override
15557 NAME/NULL.
15558 * testsuite/ver_test_6.c: New file.
15559 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15560 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15561 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15562
04bf7072
ILT
155632008-03-26 Ian Lance Taylor <iant@google.com>
15564
5871526f
ILT
15565 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15566 of an undefined symbol from a version script.
15567 * testsuite/Makefile.am (ver_test_5.so): New target.
15568 (ver_test_5.o): New target.
15569 (check_SCRIPTS): Add ver_test_5.sh.
15570 (check_DATA): Add ver_test_5.syms.
15571 (ver_test_5.syms): New target.
15572 * testsuite/ver_test_5.cc: New file.
15573 * testsuite/ver_test_5.script: New file.
15574 * testsuite/ver_test_5.sh: New file.
15575 * Makefile.in, testsuite/Makefile.in: Rebuild.
15576
04bf7072
ILT
15577 PR gold/5986
15578 Fix problems building gold with gcc 4.3.0.
15579 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15580 (gold_error_at_location, gold_warning_at_location): Use it.
15581 * configure.ac: Check whether we can compile and use a template
15582 function with a printf attribute.
15583 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15584 when jumping over bytes.
15585 * object.cc: Instantiate Object::read_section_data.
15586 * debug.h: Include <cstring>
15587 * dwarf_reader.cc: Include <algorithm>
15588 * main.cc: Include <cstring>.
15589 * options.cc: Include <cstring>.
15590 * output.cc: Include <cstring>.
15591 * script.cc: Include <cstring>.
15592 * script.h: Include <string>.
15593 * symtab.cc: Include <cstring> and <algorithm>.
15594 * target-select.cc: Include <cstring>.
15595 * version.cc: Include <string>.
15596 * testsuite/testmain.cc: Include <cstdlib>.
15597 * configure, config.in: Rebuild.
15598
874c5b28
ILT
155992008-03-25 Ian Lance Taylor <iant@google.com>
15600
819d6c3a
ILT
15601 * options.cc: Include "../bfd/bfdver.h".
15602 (options::help): Print bug reporting address.
15603
f4b2c6f5
ILT
15604 * version.cc (print_version): Adjust output for current value of
15605 BFD_VERSION_STRING.
15606
15607 * NEWS: New file.
15608
e96caa79
ILT
15609 * options.cc (options::help): Print list of supported targets.
15610 * target-select.h: Include <vector>.
15611 (class Target_selector): Make machine_, size_, and is_big_endian_
15612 fields const. Add bfd_name_ and instantiated_target_ fields.
15613 (Target_selector::Target_selector): Add bfd_name parameter.
15614 (Target_selector::recognize): Make non-virtual, call
15615 do_recognize.
15616 (Target_selector::recognize_by_name): Make non-virtual, call
15617 do_recognize_by_name.
15618 (Target_selector::supported_names): New function.
15619 (Target_selector::bfd_name): New function.
15620 (Target_selector::do_instantiate_target): New pure virtual
15621 function.
15622 (Target_selector::do_recognize): New virtual function.
15623 (Target_selector::do_recognize_by_name): New virtual function.
15624 (Target_selector::instantiate_target): New private function.
15625 (supported_target_names): Declare.
15626 * target-select.cc (Target_selector::Target_selector): Update for
15627 new parameter and fields.
15628 (select_target_by_name): Check that the name matches before
15629 calling recognize_by_name.
15630 (supported_target_names): New function.
15631 * i386.cc (class Target_selector_i386): Update Target_selector
15632 constructor call. Remove recognize and recognize_by_name. Add
15633 do_instantiate_target.
15634 * x86_64.cc (class Target_selector_x86_64): Likewise.
15635 * testsuite/testfile.cc (class Target_selector_test): Update for
15636 changes to Target_selector.
15637
874c5b28
ILT
15638 * README: Rewrite, with some notes on unsupported features.
15639
0a65a3a7
CC
156402008-03-24 Cary Coutant <ccoutant@google.com>
15641
15642 * i386.cc (Target_i386::Got_type): New enum declaration.
15643 (Target_i386::Scan::local): Updated callers of Output_data_got
15644 member functions.
15645 (Target_i386::Scan::global): Likewise.
15646 (Target_i386::Relocate::relocate): Likewise.
15647 (Target_i386::Relocate::relocate_tls): Likewise.
15648 * object.h (Got_offset_list): New class.
15649 (Sized_relobj::local_has_got_offset): Added got_type parameter.
15650 (Sized_relobj::local_got_offset): Likewise.
15651 (Sized_relobj::set_local_got_offset): Likewise.
15652 (Sized_relobj::local_has_tls_got_offset): Removed.
15653 (Sized_relobj::local_tls_got_offset): Removed.
15654 (Sized_relobj::set_local_tls_got_offset): Removed.
15655 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
15656 * output.cc (Output_data_got::add_global): Added got_type parameter.
15657 (Output_data_got::add_global_with_rel): Likewise.
15658 (Output_data_got::add_global_with_rela): Likewise.
15659 (Output_data_got::add_global_pair_with_rel): New function.
15660 (Output_data_got::add_global_pair_with_rela): New function.
15661 (Output_data_got::add_local): Added got_type parameter.
15662 (Output_data_got::add_local_with_rel): Likewise.
15663 (Output_data_got::add_local_with_rela): Likewise.
15664 (Output_data_got::add_local_pair_with_rel): New function.
15665 (Output_data_got::add_local_pair_with_rela): New function.
15666 (Output_data_got::add_global_tls): Removed.
15667 (Output_data_got::add_global_tls_with_rel): Removed.
15668 (Output_data_got::add_global_tls_with_rela): Removed.
15669 (Output_data_got::add_local_tls): Removed.
15670 (Output_data_got::add_local_tls_with_rel): Removed.
15671 (Output_data_got::add_local_tls_with_rela): Removed.
15672 * output.h (Output_data_got::add_global): Added got_type parameter.
15673 (Output_data_got::add_global_with_rel): Likewise.
15674 (Output_data_got::add_global_with_rela): Likewise.
15675 (Output_data_got::add_global_pair_with_rel): New function.
15676 (Output_data_got::add_global_pair_with_rela): New function.
15677 (Output_data_got::add_local): Added got_type parameter.
15678 (Output_data_got::add_local_with_rel): Likewise.
15679 (Output_data_got::add_local_with_rela): Likewise.
15680 (Output_data_got::add_local_pair_with_rel): New function.
15681 (Output_data_got::add_local_pair_with_rela): New function.
15682 (Output_data_got::add_global_tls): Removed.
15683 (Output_data_got::add_global_tls_with_rel): Removed.
15684 (Output_data_got::add_global_tls_with_rela): Removed.
15685 (Output_data_got::add_local_tls): Removed.
15686 (Output_data_got::add_local_tls_with_rel): Removed.
15687 (Output_data_got::add_local_tls_with_rela): Removed.
15688 * resolve.cc (Symbol::override_base_with_special): Removed
15689 reference to has_got_offset_ field.
15690 * symtab.cc (Symbol::init_fields): Replaced initialization
15691 of got_offset_ with got_offsets_. Removed initialization
15692 of has_got_offset_
53fcba31 15693 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
15694 (Symbol::got_offset): Likewise.
15695 (Symbol::set_got_offset): Likewise.
15696 (Symbol::has_tls_got_offset): Removed.
15697 (Symbol::tls_got_offset): Removed.
15698 (Symbol::set_tls_got_offset): Removed.
15699 (Symbol::got_offset_): Removed.
15700 (Symbol::tls_mod_got_offset_): Removed.
15701 (Symbol::tls_pair_got_offset_): Removed.
15702 (Symbol::got_offsets_): New field.
15703 (Symbol::has_got_offset): Removed.
15704 (Symbol::has_tls_mod_got_offset): Removed.
15705 (Symbol::has_tls_pair_got_offset): Removed.
15706 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
15707 (Target_x86_64::Scan::local): Updated callers of Output_data_got
15708 member functions.
15709 (Target_x86_64::Scan::global): Likewise.
15710 (Target_x86_64::Relocate::relocate): Likewise.
15711 (Target_x86_64::Relocate::relocate_tls): Likewise.
15712
bd52eafb
BE
157132008-03-25 Ben Elliston <bje@au.ibm.com>
15714
15715 * yyscript.y: Fix spelling error in comment.
15716
8b105e34
ILT
157172008-03-24 Ian Lance Taylor <iant@google.com>
15718
8ed814a9
ILT
15719 * options.h (class General_options): Define build_id option.
15720 * layout.h (class Layout): Declare write_build_id, create_note,
15721 create_build_id. Add build_id_note_ member.
15722 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
15723 "libiberty.h", "md5.h", "sha1.h".
15724 (Layout::Layout): Initialize eh_frame_data_,
15725 eh_frame_hdr_section_, and build_id_note_.
15726 (Layout::finalize): Call create_build_id.
15727 (Layout::create_note): New function, broken out of
15728 Layout::create_gold_note.
15729 (Layout::create_gold_note): Call create_note.
15730 (Layout::create_build_id): New function.
15731 (Layout::write_build_id): New function.
15732 (Close_task_runner::run): Call write_build_id.
15733
8b105e34
ILT
15734 * x86_64.cc: Correct license to GPLv3.
15735
086a1841
ILT
157362008-03-23 Ian Lance Taylor <iant@google.com>
15737
15738 * options.cc: Include "demangle.h".
15739 (parse_optional_string): New function.
15740 (parse_long_option): Handle takes_optional_argument.
15741 (parse_short_option): Update dash_z initializer. Handle
15742 takes_optional_argument.
15743 (General_options::General_options): Initialize do_demangle_.
15744 (General_options::finalize): Set do_demangle_. Handle demangling
15745 style.
15746 * options.h (parse_optional_string): Declare.
15747 (struct One_option): Add optional_arg field. Update constructor.
15748 Update call constructor calls. Add takes_optional_argument
15749 function.
15750 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
15751 (DEFINE_optional_string): Define.
15752 (General_options::demangle): Change from DEFINE_bool to
15753 DEFINE_optional_string.
15754 (General_options::no_demangle): New function.
15755 (General_options::do_demangle): New function.
15756 (General_options::set_do_demangle): New function.
15757 (General_options::execstack_status_): Move definition to end of
15758 class definition.
15759 (General_options::static_): Likewise.
15760 (General_options::do_demangle_): New field.
15761 * object.cc (big_endian>::get_symbol_location_info): Call
15762 Options::do_demangle, not Options::demangle.
15763 * symtab.cc (demangle): Likewise.
15764
cbb93e63
ILT
157652008-03-22 Ian Lance Taylor <iant@google.com>
15766
15767 * gold.h: Include <cstddef> and <sys/types.h>
15768 * options.h: Include <cstring>.
15769
ec531623
ILT
157702008-03-21 Ian Lance Taylor <iant@google.com>
15771
15772 * Added source code to GNU binutils.
752937aa 15773\f
4b95cf5c 15774Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
15775
15776Copying and distribution of this file, with or without modification,
15777are permitted in any medium without royalty provided the copyright
15778notice and this notice are preserved.
15779
15780Local Variables:
15781mode: change-log
15782left-margin: 8
15783fill-column: 74
15784version-control: never
15785End:
This page took 0.98212 seconds and 4 git commands to generate.