Add myself as write-after-approval maintainer.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
9baa787b
CC
12014-06-09 Cary Coutant <ccoutant@google.com>
2
3 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
4 unit_length is within section bounds.
5
8f89af0a
CC
62014-06-09 Cary Coutant <ccoutant@google.com>
7
8 PR gold/16980
9 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
10 map.
11
a47622ac
AM
122014-06-07 Alan Modra <amodra@gmail.com>
13
14 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
15
4320c691
CC
162014-06-06 Cary Coutant <ccoutant@google.com>
17
18 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
19 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
20 (Dwarf_pubnames_table::read_header): Likewise.
21 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
22 .debug_gnu_pubtypes.
23
270c9937
JB
242014-06-05 Joel Brobecker <brobecker@adacore.com>
25
26 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
27 * Makefile.in, configure: Regenerate.
28
397998fc
AM
292014-06-03 Alan Modra <amodra@gmail.com>
30
31 * powerpc.cc (addis_12_2): Define.
32 (Stub_table::do_write): Support fusion on ELFv2 stubs.
33
61f5c66f
AM
342014-06-03 Alan Modra <amodra@gmail.com>
35
36 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
37 st_other output.
38
f6971787
AM
392014-06-02 Alan Modra <amodra@gmail.com>
40
41 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
42 Only ignore relocs on ELFv1.
43 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
44
f6fb8322
CC
452014-05-30 Cary Coutant <ccoutant@google.com>
46
47 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
48 * testsuite/Makefile.in: Regenerate.
49 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
50
c23dd342
L
512014-05-27 H.J. Lu <hongjiu.lu@intel.com>
52
53 PR gold/16945
54 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
55 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
56
5fe7ffdc
AM
572014-05-15 Alan Modra <amodra@gmail.com>
58
59 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
60 Compare FDE contents with DW_CFA_nop rather than 0.
61
a82bef93
ST
622014-05-13 Sriraman Tallam <tmsriram@google.com>
63
64 * symtab.h (may_need_copy_reloc): Remove check for position independent
65 code.
66 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
67 position independence before pc absolute may_need_copy_reloc call.
68 Add check for executable output befor pc relative may_need_copy_reloc
69 call.
70 * i386.cc: Ditto.
71 * arm.cc: Ditto.
72 * sparc.cc: Ditto.
73 * tilegx.cc: Ditto.
74 * powerpc.cc: Add check for no position independence before
75 may_need_copy_reloc calls.
76 * testsuite/pie_copyrelocs_test.cc: New file.
77 * testsuite/pie_copyrelocs_shared_test.cc: New file.
78 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 79 * Makefile.in: Regenerate.
a82bef93 80
53c66605
ML
812014-05-08 Martin Liška <mliska@suse.cz>
82
83 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
84
57b2284c
CC
852014-05-06 Cary Coutant <ccoutant@google.com>
86
87 PR gold/16900
88 * i386.cc (Output_data_got_plt_i386): New class.
89 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
90 parameter. Change all callers.
91 (Output_data_plt_i386::layout_): Remove.
92 (Output_data_plt_i386::got_plt_): Change type.
93 (Target_i386::got_plt_): Change type. Change all references.
94 (Target_i386::got_section): Create instance of new class.
95 (Output_data_got_plt_i386::do_write): New function.
96 * x86_64.cc (Output_data_got_plt_x86_64): New class.
97 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
98 parameter. Change all callers.
99 (Output_data_plt_x86_64::layout_): Remove.
100 (Output_data_plt_x86_64::got_plt_): Change type.
101 (Target_x86_64::got_plt_): Change type. Change all references.
102 (Target_x86_64::got_section): Create instance of new class.
103 (Output_data_got_plt_x86_64::do_write): New function.
104 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
105 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
106 class.
107
6b97515d 1082014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 109
6b97515d
CC
110 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
111 if we have pubnames/pubtypes.
112
d1bddd3c
CC
1132014-05-02 Cary Coutant <ccoutant@google.com>
114
5fe7ffdc
AM
115 * defstd.cc (in_segment): Define __ehdr_start here...
116 * layout.cc (Layout::finalize): ...Instead of here. Set the
117 output segment when known.
118 * resolve.cc (Symbol::override_base_with_special): Remember
119 the original binding.
120 * symtab.cc (Symbol::set_output_segment): New function.
121 (Symbol::set_undefined): New function.
122 * symtab.h (Symbol::is_weak_undefined): Check original undef
123 binding.
124 (Symbol::is_strong_undefined): New function.
125 (Symbol::set_output_segment): New function.
126 (Symbol::set_undefined): New function.
127 * target-reloc.h (is_strong_undefined): Remove.
128 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
129 Check for hidden undefs.
130 (relocate_section): Call Symbol::is_strong_undefined.
131
132 * testsuite/Makefile.am (ehdr_start_test_1)
133 (ehdr_start_test_2, ehdr_start_test_3)
134 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
135 * testsuite/Makefile.in: Regenerate.
136 * testsuite/ehdr_start_def.cc: New source file.
137 * testsuite/ehdr_start_test.cc: New source file.
138 * testsuite/ehdr_start_test.t: New linker script.
139 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 140
7849f6d8
CC
1412014-04-23 Cary Coutant <ccoutant@google.com>
142
bf2cc635 143 PR gold/16870
7849f6d8
CC
144 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
145
99fd8cff
CC
1462014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
147
148 * layout.cc (Layout::include_section): Allow a target to decide
149 whether to include a section.
150 * target.h (Target::should_include_section): New function.
151 (Target::do_should_include_section): New function.
152
91f43acd
CC
1532014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
154
155 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
156 inline into ...
157 (Copy_relocs::emit): ... here.
158 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
159 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
160 (Copy_reloc_entry::entries_): Change from private to protected.
161
c4eb27e1
ST
1622014-04-02 Sriraman Tallam <tmsriram@google.com>
163
164 * icf.cc (get_section_contents): Replace copies of reloc
165 vectors with const references.
166
ae447ddd
CC
1672014-04-02 Cary Coutant <ccoutant@google.com>
168
169 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
170 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
171 * configure: Regenerate.
172 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
173 -fno-use-linker-plugin.
174 (LINK1, CXXLINK1): Add it to the link command.
175 * testsuite/Makefile.in: Regenerate.
176
fa47fa92
AM
1772014-03-12 Alan Modra <amodra@gmail.com>
178
179 * Makefile.in: Regenerate.
180
9b12c500
CC
1812014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
182
183 * symtab.h (Symbol::set_nonvis): New function.
184
beacaa96
CC
1852014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
186
187 * symtab.cc (Sized_symbol<32>::init_output_data):
188 Instantiate the template.
189 (Sized_symbol<64>::init_output_data): Likewise.
190
800d9823
CC
1912014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
192
193 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
194 adjust dynamic symbol value.
195 * target.h (Target::adjust_dyn_symbol): New function.
196 (Target::do_adjust_dyn_symbol): New function.
197
918fc1f8 1982014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 199
918fc1f8
CC
200 * output.cc (Output_data_dynamic::Dynamic_entry::write):
201 Get the value of DYNAMIC_CUSTOM dynamic entry.
202 * output.h (Output_data_dynamic::add_custom): New function.
203 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
204 dynamic entry.
205 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
206 * target.h (Target::dynamic_tag_custom_value): New function.
207 (Target::do_dynamic_tag_custom_value): New function.
208
98ff9231
CC
2092014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
210
211 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
212 dynsym indexes.
213 * target.h (Target::has_custom_set_dynsym_indexes): New function.
214 (Target::do_has_custom_set_dynsym_indexes): New function.
215 (Target::set_dynsym_indexes): New function.
216 (Target::do_set_dynsym_indexes): New function.
217
b80eed39
AM
2182014-03-07 Alan Modra <amodra@gmail.com>
219
220 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
221 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
222 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
223 (Powerpc_relocate_functions::has_overflow_bitfield,
224 overflowed): Use the above.
225 (Target_powerpc::Relocate::relocate): Correct overflow checking
226 for a number of relocations. Modify overflow test for 16-bit
227 fields in instructions to signed/unsigned according to whether
228 the field takes a signed or unsigned value.
229
4b95cf5c
AM
2302014-03-05 Alan Modra <amodra@gmail.com>
231
232 Update copyright years.
233
45965137
AM
2342014-03-05 Alan Modra <amodra@gmail.com>
235
236 * powerpc.cc (Target_powerpc::Scan::local, global): Support
237 R_PPC64_ADDR64_LOCAL.
238 (Target_powerpc::Relocate::relocate): Likewise.
239
2c80b753
AM
2402014-03-03 Alan Modra <amodra@gmail.com>
241
242 * dwp.cc (print_version): Update copyright year to current.
243
c1c69e83
AM
2442014-02-10 Alan Modra <amodra@gmail.com>
245
246 * po/gold.pot: Regenerate.
247
dd0c4e70
CC
2482014-02-06 Cary Coutant <ccoutant@google.com>
249
250 Fix problem where -u is ignored when a weak undef is seen.
251
252 * archive.cc (Library_base::should_include_member): Reorder
253 code to check for -u option if a weak undef has already been seen.
254 * testsuite/Makefile.am (weak_undef_test_2): New test case.
255 * testsuite/Makefile.in: Regenerate.
256 * testsuite/weak_undef_file3.cc: New file.
257 * testsuite/weak_undef_file4.cc: New file.
258 * testsuite/weak_undef_test_2.cc: New file.
259
1a221d3d
CC
2602014-02-05 Cary Coutant <ccoutant@google.com>
261
262 Fix issues with gold undefined symbol diagnostics.
263
264 PR binutils/15435
265 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
266 check to here.
267 * target-reloc.h (is_strong_undefined): New function.
268 (relocate_section): Move undef vtable symbol check from here.
269 Check for is_strong_undefined.
270
e889f0a4 2712014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 272
e889f0a4
CC
273 Fix problems with the --dynamic-list option.
274
275 PR gold/13577
276 * options.cc (General_options::parse_dynamic_list):
277 Set have_dynamic_list_.
278 (General_options::General_options): Initialize have_dynamic_list_.
279 (General_options::finalize): Turn off -Bsymbolic and
280 -Bsymbolic-functions if --dynamic-list provided.
281 * options.h (General_options::have_dynamic_list): New function.
282 (General_options::have_dynamic_list_): New data member.
283 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
284 correctly.
5fe7ffdc 285
e889f0a4
CC
286 PR gold/16530
287 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
288 in --dynamic-list, mark it.
5fe7ffdc 289
e889f0a4
CC
290 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
291 (dynamic_list_2): New test case.
292 * testsuite/Makefile.in: Regenerate.
293 * testsuite/dynamic_list_2.cc: New file.
294 * testsuite/dynamic_list_2.t: New file.
295 * testsuite/dynamic_list_lib1.cc: New file.
296 * testsuite/dynamic_list_lib2.cc: New file.
297 * testsuite/gc_dynamic_list_test.c: New file.
298 * testsuite/gc_dynamic_list_test.sh: New file.
299 * testsuite/gc_dynamic_list_test.t: New file.
300
ec673e64
CC
3012014-01-28 Cary Coutant <ccoutant@google.com>
302
303 Add .gdb_index version 7 support.
304
305 * gold/dwarf_reader.cc: include <utility> (for make_pair).
306 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
307 debug sections.
308 (Dwarf_ranges_table::read_ranges_table): Likewise.
309 (Dwarf_pubnames_table::read_section): Check for GNU-style
310 sections, and for compressed debug sections.
311 (Dwarf_pubnames_table::read_header): Compute end address of table.
312 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
313 for end of list by offset, not by offset == 0.
314 (Dwarf_info_reader::do_read_string_table): Check for compressed
315 debug sections.
316 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
317 Initialize new data members.
318 (Dwarf_pubnames_table::next_name): return flag_byte.
319 (Dwarf_pubnames_table::end_of_table_): New data member.
320 (Dwarf_pubnames_table::is_gnu_style_): New data member.
321 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
322 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
323 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
324 read skeleton type unit DIEs.
325 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
326 (Gdb_index::do_write): Write flag_byte.
327 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
328 (Gdb_index::Cu_vector): Store flags along with cu indexes.
329 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
330 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
331
221fd5d5
L
3322014-01-08 H.J. Lu <hongjiu.lu@intel.com>
333
334 * version.cc (print_version): Update copyright year to 2014.
335
6c09fb0b
ILT
3362013-12-19 Dimitry Andric <dimitry@andric.com>
337
338 * stringpool.cc (Stringpool_template::reserve): Add
339 HAVE_UNORDERED_MAP case.
340 * stringpool.cc (Stringpool_template::print_stats): Likewise.
341
8356f2d0
CC
3422013-12-18 Cary Coutant <ccoutant@google.com>
343
344 * configure.ac: Check for <unordered_set> and <unordered_map>.
345 * config.in: Regenerate.
346 * configure: Regenerate.
347 * system.h: Use <unordered_set> and <unordered_map> if available.
348
f2c7d7ee
RM
3492013-12-10 Roland McGrath <mcgrathr@google.com>
350
351 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
352 with $(INSTALL_PROGRAM_ENV).
353 * Makefile.in: Regenerate.
354
6632e8cc
CC
3552013-11-22 Cary Coutant <ccoutant@google.com>
356
357 * configure.ac: Add check for which library is needed for
358 dlopen.
359 * configure: Regenerate.
360
0c075858
CC
3612013-11-22 Cary Coutant <ccoutant@google.com>
362
363 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
364 assembler.
365 * testsuite/Makefile.in: Regenerate.
366
f49fe902
L
3672013-11-17 H.J. Lu <hongjiu.lu@intel.com>
368
369 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
370 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
371 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
372 (Target_x86_64<size>::Scan::local): Likewise.
373 (Target_x86_64<size>::Scan::global): Likewise.
374 (Target_x86_64<size>::Relocate::relocate): Likewise.
375 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
376 Likewise.
377 (Target_x86_64<size>::Scan::check_non_pic(): Handle
378 R_X86_64_PC32_BND.
379
380 * testsuite/Makefile.am (check_PROGRAMS): Add
381 exception_x86_64_bnd_test.
382 (exception_x86_64_bnd_test_SOURCES): New macro.
383 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
384 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
385 (exception_x86_64_bnd_test_LDADD): Likewise.
386 (exception_x86_64_bnd_1.o): New rule.
387 (exception_x86_64_bnd_2.o): Likewise.
388 * testsuite/Makefile.in: Regenerated.
389
9055360d
AM
3902013-11-15 Alan Modra <amodra@gmail.com>
391
392 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
393 accessor.
394 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
395 Only call ppc64_local_entry_offset for 64-bit. Restrict
396 symval_for_branch lookup to ELFv1.
397 (Stub_table::add_plt_call_entry): Use unsigned int off.
398 (Output_data_glink::Address, invalid_address): New.
399 (Output_data_glink::add_eh_frame): Move out of line. Add
400 support for ELFv2.
401 (Output_data_glink::add_global_entry, find_global_entry,
402 global_entry_address): New functions.
403 (Output_data_glink::global_entry_stubs_, end_branch_table_,
404 ge_size): New variables.
405 (Output_data_glink::set_final_data_size): Add global entry
406 stub sizing.
407 (Output_data_glink::do_write): Write global entry stubs.
408 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
409 parameter. Return true for ELFv2. Adjust callers.
410 (Target_powerpc::Scan::local, global): Restrict opd lookup to
411 ELFv1. Similarly for ifunc and dynamic relocation processing
412 specific to ELFv1. Recognize that symbols are defined on
413 their plt entries for ELFv2.
414 (Target_powerpc::symval_for_branch): Assert if called for
415 ELFv2 or ppc32.
416 (Target_powerpc::Relocate::relocate): Use global entry plt
417 stub for symbol value if such exists on ELFv2.
418 (Target_powerpc::Relocate::relocate): Don't call
419 symval_for_branch when ELFv2. Do adjust for local entry
420 offset when ELFv2.
421 (Target_powerpc::do_dynsym_value): Set symbols to global entry
422 plt stub for ELFv2.
423 (Target_powerpc::do_plt_address_for_global): Similarly.
424
cafdd569
CC
4252013-11-14 Cary Coutant <ccoutant@google.com>
426
427 Revert patch -- this did not fix the problem, and there is
428 no race there.
429
430 2013-11-14 Cary Coutant <ccoutant@google.com>
431
432 PR gold/14860
433 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
434 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
435 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
436 updating fde_offsets_.
437 (Eh_frame_hdr::lock_): New data member.
438
94e49e16
CC
4392013-11-14 Cary Coutant <ccoutant@google.com>
440
441 * dwp.cc (Dwo_file_entry): New type.
442 (File_list): Use Dwo_file_entry.
443 (Dwo_file::verify): New function.
444 (Dwo_file::verify_dwo_list): New function.
445 (Dwo_file::sized_verify_dwo_list): New function.
446 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
447 list.
448 (Dwp_options): New enum type.
449 (dwp_options): Add --verify-only.
450 (usage): Likewise.
451 (main): Likewise.
452 * dwp.h (gold_info): Add declaration.
453
7cdd7d57
CC
4542013-11-14 Cary Coutant <ccoutant@google.com>
455
456 PR gold/14860
457 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
458 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
459 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
460 updating fde_offsets_.
461 (Eh_frame_hdr::lock_): New data member.
462
1d946cb3
CC
4632013-11-06 Cary Coutant <ccoutant@google.com>
464
465 PR gold/15758
466 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
467 before reloc sections.
468
4f65b40e
AM
4692013-11-04 Alan Modra <amodra@gmail.com>
470
471 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
472 (Symbol::needs_dynamic_reloc): Test new flag.
473 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
474 (Target_powerpc::Scan::get_reference_flags): Add target param.
475 Return FUNC_DESC_ABI for 64-bit ELFv1.
476 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
477 call.
478 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
479 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
480
908794a9
CC
4812013-10-31 Cary Coutant <ccoutant@google.com>
482
483 Restore support for dwp v2 DWARF package file format.
484
485 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
486 tu_length parameter. Adjust all callers.
487 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
488 * dwp.cc: Include dwarf.h.
489 (Section_bounds): New struct type.
490 (Unit_set): New struct type.
491 (Dwo_file::Dwo_file): Initialize new data member.
492 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
493 Combine and rename to...
494 (Dwo_file::read_unit_index): ...this.
495 (Dwo_file::sized_read_compunit_index)
496 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
497 (Dwo_file::sized_read_unit_index): ...this.
498 (Dwo_file::copy_section): Remove section_name, is_str_offsets
499 parameters; add section_id parameter.
500 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
501 (Dwo_file::add_unit_set): ...this.
502 (Dwo_file::shndx_map_): Remove.
503 (Dwo_file::sect_offsets_): New data member.
504 (Dwp_output_file::Dwp_output_file): Initialize new data members.
505 (Dwp_output_file::add_section): Rename to...
506 (Dwp_output_file::add_contribution): ...this.
507 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
508 (Dwp_output_file::add_tu_set): Likewise.
509 (Dwp_output_file::Contribution): New type.
510 (Dwp_output_file::Section::contributions): New data member.
511 (Dwp_output_file::Cu_or_tu_set): Remove.
512 (Dwp_output_file::Section::Section): New ctor.
513 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
514 (Dwp_output_file::Dwp_index::Section_table): New type.
515 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
516 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
517 parameter.
518 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
519 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
520 (Dwp_output_file::Dwp_index::section_table): New member function.
521 (Dwp_output_file::Dwp_index::section_table_end): New member function.
522 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
523 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
524 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
525 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
526 (Dwp_output_file::Dwp_index::section_table_): New data member.
527 (Dwp_output_file::Dwp_index::section_mask_): New data member.
528 (Dwp_output_file::add_output_section): New member function.
529 (Dwp_output_file::write_new_section): New member function.
530 (Dwp_output_file::write_contributions): New member function.
531 (Dwp_output_file::section_id_map_): New data member.
532 (class Dwo_id_info_reader): Remove.
533 (class Unit_reader): New class.
534 (get_dwarf_section_name): New function.
535 (Dwo_file::read_executable): Adjust initializations of class data.
536 (Dwo_file::read): Add support for v2 package file format.
537 (Dwo_file::read_unit_index): Likewise.
538 (Dwo_file::sized_read_unit_index): Likewise.
539 (Dwo_file::copy_section): Likewise.
540 (Dwo_file::add_unit_set): Likewise.
541 (Dwp_output_file::add_output_section): Likewise.
542 (Dwp_output_file::add_contribution): Likewise.
543 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
544 for empty slot.
545 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
546 file format.
547 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
548 slot.
549 (Dwp_output_file::initialize): Remove unused function.
550 (Dwp_output_file::finalize): Add support for v2 package file format.
551 (Dwp_output_file::write_index): Likewise.
552 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
553 function prototype.
554
2500c017
CC
5552013-10-31 Cary Coutant <ccoutant@google.com>
556
557 * configure.ac: Fix check for -fmerge-constants.
558 * configure.ac: Regenerate.
559
dd0845d7
RM
5602013-10-30 Roland McGrath <mcgrathr@google.com>
561
562 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
563 Correct 9-byte nop sequence to match what the assembler generates.
564
b4f7960d
AM
5652013-10-30 Alan Modra <amodra@gmail.com>
566
567 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
568 ppc64_local_entry_offset, ppc64_local_entry_offset,
569 do_read_symbols): New functions.
570 (Powerpc_relobj::e_flags_, st_other_): New vars.
571 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
572 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
573 (Powerpc_relobj::e_flags_): New var.
574 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
575 and adjust for ELFv2.
576 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
577 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
578 (Powerpc_dynobj::do_find_special_sections): Likewise.
579 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
580 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
581 to ELFv2 local entry.
582 (Target_powerpc::do_relax): No thread safe barriers needed for
583 ELFv2.
584 (Output_data_plt_powerpc::initial_plt_entry_size_,
585 plt_entry_size): Delete. Replace all uses with
586 first_plt_entry_offset() and plt_entry_size().
587 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
588 reserved_size parm. Update callers.
589 (Output_data_plt_powerpc::entry_count): Update.
590 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
591 and use Target_powerpc::first_plt_entry_offset().
592 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
593 rename to plt_entry_size.
594 (Output_data_plt_powerpc::add_ifunc_entry,
595 add_local_ifunc_entry): Adjust reloc for ELFv2.
596 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
597 (glink_eh_frame_fde_64v2): New.
598 (Stub_table::plt_call_size): Support ELFv2 sizing.
599 (Output_data_glink::add_eh_frame): Use the new FDE.
600 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
601 (Stub_table::do_write): Write ELFv2 stubs and glink.
602 (Target_powerpc::Relocate::relocate): Replaces nop after call
603 with ld 2,24(1) and adjust local offset destination for ELFv2.
604
f9c6b907
AM
6052013-10-30 Alan Modra <amodra@gmail.com>
606
607 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
608 (Target_powerpc::Scan::global, local): Likewise.
609 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
610 on all ppc64 @h and @ha relocs.
611
e84fe78f
AM
6122013-10-14 Alan Modra <amodra@gmail.com>
613
614 * output.h (Output_data_got::add_constant): Tidy.
615 (Output_data_got::add_constant_pair): New function.
616 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
617 methods used so as to first call reserve_ent().
618
679e4abf
RM
6192013-10-11 Roland McGrath <mcgrathr@google.com>
620
44dcb735
RM
621 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
622 add_got_entry and add_got_entry_pair.
623
13323c49
RM
624 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
625 (HAVE_PUBNAMES): Likewise.
626 * configure: Regenerate.
627
1496b446
RM
628 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
629 * testsuite/Makefile.in: Regenerate.
630
cc84c10b
RM
631 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
632 Remove const from declaration.
633 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
634 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
635 * output.h (Output_file_header): Remove const from member target_
636 and corresponding constructor argument.
637 * output.cc (Output_file_header::Output_file_header): Update prototype.
638 (Output_file_header::do_sized_write): Use this->target_ in place
639 of parameters()->target().
640
52f66a2c
RM
641 * testsuite/undef_symbol.cc (Foo::get_a): New method.
642
2b64b551
RM
643 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
644 * configure: Regenerate.
645 * Makefile.in: Regenerate.
646 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
647 * testsuite/merge_string_literals_2.c: Likewise.
648 * testsuite/Makefile.am
649 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
650 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
651 literal -fmerge-constants.
652 * testsuite/Makefile.in: Regenerate.
653
43819297
RM
654 * i386.cc (Target_i386): Remove unused member dynbss_.
655 * arm.cc (Target_arm): Likewise.
656 * powerpc.cc (Target_powerpc): Likewise.
657 * sparc.cc (Target_sparc): Likewise.
658 * tilegx.cc (Target_tilegx): Likewise.
659 * x86_64.cc (Target_x86_64): Likewise.
660 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
661 type_signature_, type_offset_.
662 * plugin.h (Plugin_hook): Remove unused member layout_.
663 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
664 mapfile_.
665 (Read_member): Remove unused members input_objects_, symtab_,
666 mapfile_, layout_.
667 (Check_library): Remove unused member symtab_.
668 * archive.h (Lib_group): Remove unused member lib_.
669 * archive.cc (Lib_group::Lib_group): Update initializer.
670 * incremental.h (Incremental_binary): Remove unused member target_.
671 (Incremental_script_entry): Removed unused member script_.
672 * layout.h (Write_symbols_task): Remove unused member input_objects_.
673 * icf.h (Icf): Remove unused member num_tracked_relocs.
674
39d9ead7
RM
675 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
676 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
677 its only use.
678 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
679
679e4abf
RM
680 * archive.h: Use struct rather than class for forward declaration
681 of Read_symbols_data.
682
54de2ea6
CC
6832013-10-07 Cary Coutant <ccoutant@google.com>
684
685 PR gold/16010
686 * testsuite/Makefile.am (icf_test): Fix dependencies.
687 (icf_safe_test): Likewise.
688 (icf_safe_so_test): Likewise.
689 (large_symbol_alignment): Add empty _LDADD rule.
690 * testsuite/Makefile.in: Regenerate.
691
b14016f0
L
6922013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
693
694 PR gold/15927
695 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
696 relocation for R_X86_64_32 on x32.
697
eb426534
RM
6982013-08-27 Roland McGrath <mcgrathr@google.com>
699
700 * output.cc (Output_segment::set_section_addresses): Take new
701 Target* argument. If target->isolate_execinstr() and the segment
702 is executable and starts at a target->abi_pagesize() boundary,
703 pad its end out to a target->abi_pagesize() boundary with code fill.
704 * output.h (Output_segment::set_section_addresses): Update decl.
705 * layout.h (Layout::check_output_data_for_reset_values): Take new
706 argument RELAX_OUTPUTS.
707 (Layout): New member relax_output_list_.
708 (Layout::add_relax_output): New method.
709 * layout.cc (Layout::Layout): Update constructor.
710 (Layout::reset_relax_output): New method.
711 (Layout::clean_up_after_relaxation): Call it.
712 (Layout::prepare_for_relaxation): Update caller.
713 (Layout::set_segment_offsets): Update callers of set_section_addresses.
714 Call reset_relax_output before re-processing segments for
715 isolate_execinstr case.
716 (Layout::write_data): Handle relax_output_list_.
717 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
718 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
719
9aff4b7a
NC
7202013-08-23 Yuri Chornoivan <yurchor@ukr.net>
721
722 PR binutils/15834
723 * object.h: Fix typos.
724
93f8221c
RM
7252013-08-16 Roland McGrath <mcgrathr@google.com>
726
727 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
728 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
729
e44c3715
CC
7302013-08-07 Cary Coutant <ccoutant@google.com>
731
732 Revert support for v2 DWP files:
733
734 2013-03-01 Cary Coutant <ccoutant@google.com>
735
736 Add dwp support for v2 DWARF package file format.
737 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
738 tu_length parameter. Adjust all callers.
739 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
740 * dwp.cc: Include dwarf.h.
741 (Section_bounds): New struct type.
742 (Unit_set): New struct type.
743 (Dwo_file::Dwo_file): Initialize new data member.
744 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
745 Combine and rename to...
746 (Dwo_file::read_unit_index): ...this.
747 (Dwo_file::sized_read_compunit_index)
748 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
749 (Dwo_file::sized_read_unit_index): ...this.
750 (Dwo_file::copy_section): Remove section_name, is_str_offsets
751 parameters; add section_id parameter.
752 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
753 (Dwo_file::add_unit_set): ...this.
754 (Dwo_file::shndx_map_): Remove.
755 (Dwo_file::sect_offsets_): New data member.
756 (Dwp_output_file::Dwp_output_file): Initialize new data members.
757 (Dwp_output_file::add_section): Rename to...
758 (Dwp_output_file::add_contribution): ...this.
759 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
760 (Dwp_output_file::add_tu_set): Likewise.
761 (Dwp_output_file::Contribution): New type.
762 (Dwp_output_file::Section::contributions): New data member.
763 (Dwp_output_file::Cu_or_tu_set): Remove.
764 (Dwp_output_file::Section::Section): New ctor.
765 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
766 (Dwp_output_file::Dwp_index::Section_table): New type.
767 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
768 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
769 parameter.
770 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
771 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
772 (Dwp_output_file::Dwp_index::section_table): New member function.
773 (Dwp_output_file::Dwp_index::section_table_end): New member function.
774 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
775 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
776 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
777 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
778 (Dwp_output_file::Dwp_index::section_table_): New data member.
779 (Dwp_output_file::Dwp_index::section_mask_): New data member.
780 (Dwp_output_file::add_output_section): New member function.
781 (Dwp_output_file::write_new_section): New member function.
782 (Dwp_output_file::write_contributions): New member function.
783 (Dwp_output_file::section_id_map_): New data member.
784 (class Dwo_id_info_reader): Remove.
785 (class Unit_reader): New class.
786 (get_dwarf_section_name): New function.
787 (Dwo_file::read_executable): Adjust initializations of class data.
788 (Dwo_file::read): Add support for v2 package file format.
789 (Dwo_file::read_unit_index): Likewise.
790 (Dwo_file::sized_read_unit_index): Likewise.
791 (Dwo_file::copy_section): Likewise.
792 (Dwo_file::add_unit_set): Likewise.
793 (Dwp_output_file::add_output_section): Likewise.
794 (Dwp_output_file::add_contribution): Likewise.
795 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
796 for empty slot.
797 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
798 file format.
799 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
800 slot.
801 (Dwp_output_file::initialize): Remove unused function.
802 (Dwp_output_file::finalize): Add support for v2 package file format.
803 (Dwp_output_file::write_index): Likewise.
804 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
805 function prototype.
806
c6905c28
CC
8072013-07-31 Cary Coutant <ccoutant@google.com>
808
809 * object.cc (Sized_relobj::do_output_section_address): New function.
810 (Sized_relobj): Instantiate explicitly.
811 * object.h (Object::output_section_address): New function.
812 (Object::do_output_section_address): New function.
813 (Sized_relobj::do_output_section_address): New function.
814 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
815
8162013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 817 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
818
819 * parameters.cc (Parameters::entry): Return target-specific entry
820 symbol name.
821 * target.h (Target::entry_symbol_name): New function.
822 (Target_info::entry_symbol_name): New data member.
823
824 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
825 * i386.cc (Target_i386::i386_info): Likewise.
826 (Target_i386_nacl::i386_nacl_info): Likewise.
827 * sparc.cc (Target_sparc::sparc_info): Likewise.
828 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
829 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
830 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
831 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
832
234d4ab8
SA
8332013-07-22 Sterling Augustine <saugustine@google.com>
834
835 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
836 Convert parameter shndx to local variable. Add parameters symtab
837 and symtab_size. Scan over section names. Find relocation
838 section corresponding to current section. Create and initialize
839 reloc_mapper_ and reloc_type_.
840 (Dwarf_pubnames_table::read_header): Add assertion. Change
841 unit_length to off_t. Initialize member unit_length_. Fill in field
842 cu_offset_.
843 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
844 Initialize new fields unit_length_ and cu_offset_.
845 (Dwarf_pubnames_table::read_section): Update prototype.
846 (Dwarf_pubnames_table::cu_offset): New member function.
847 (Dwarf_pubnames_table::subsection_size): Likewise.
848 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
849 New fields.
850 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
851 member functions public.
852 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
853 Update comment. Rework logic. Move repeated parts to...
854 (Gdb_index_info_reader::read_pubtable): ...here. New function.
855 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
856 pubtypes_table_, and stmt_list_offset.
857 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
858 Gdb_index::find_pubtype_offset,
859 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
860 (Gdb_index::pubnames_read): Update prototype and rework logic.
861 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
862 Forward declare.
863 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
864 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
865 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
866 Gdb_index::map_pubtable_to_dies):
867 Declare functions.
868 (Gdb_index::pubnames_read): Update declaration.
869 (Gdb_index::Pubname_offset_map): New type.
870 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
871 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
872 Gdb_index::stmt_list_offset): Declare.
873 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
874 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
875 Gdb_index::pubtypes_offset_): Remove.
876
a3ed37d8
RM
8772013-07-19 Roland McGrath <mcgrathr@google.com>
878
879 * options.h (General_options): Add -Trodata-segment option.
880 * parameters.cc (Parameters::check_rodata_segment): New function.
881 (Parameters::set_target_once): Call it.
882 * parameters.h (Parameters): Declare it (private member function).
883 * layout.cc (load_seg_unusable_for_headers): New function, broken
884 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
885 then validate rodata segment rather than text segment.
886 (relaxation_loop_body): Call that.
887 (is_text_segment): New function. Don't admit a non-executable
888 segment if TARGET->isolate_execinstr().
889 (set_segment_offsets): Call it. Honor -Trodata-segment option.
890
eb5b4ded
CC
8912013-07-15 Shawn Landden <shawnlandden@gmail.com>
892
893 PR gold/15070
894 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
895 * nacl.h (Sniff_file::View::View): Request aligned view.
896
4d5effb9
CC
8972013-07-11 Cary Coutant <ccoutant@google.com>
898
899 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
900 correct BRLT entry size.
901
ba8ca3e7
AM
9022013-07-03 Alan Modra <amodra@gmail.com>
903
904 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
905 comment.
906
267257d2
CC
9072013-07-01 Cary Coutant <ccoutant@google.com>
908
909 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
910 reloc_type_.
911 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
912 (Dwarf_ranges_table::lookup_reloc): New function.
913 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
914 reloc_type_.
915 (Dwarf_ranges_table::lookup_reloc): New function.
916 (Dwarf_ranges_table::reloc_type_): New data member.
917
06f30c9d
CC
9182013-06-27 Jing Yu <jingyu@google.com>
919
920 PR gold/15662
921 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
922 function.
923 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
924 (Target_powerpc::do_relax): Call the above.
925
a2d7bf59
AM
9262013-06-27 Cary Coutant <ccoutant@google.com>
927
928 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
929 on garbage collected .opd section.
930
9312013-06-27 Alan Modra <amodra@gmail.com>
932
933 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
934 is non-zero.
935 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
936 (Target_powerpc::do_function_location): Likewise for loc->shndx.
937
32364e50
CC
9382013-06-14 Cary Coutant <ccoutant@google.com>
939
940 * resolve.cc (Symbol::override_base): Don't override st_type
941 from plugin placeholder symbols.
942 (Symbol_table::resolve): Likewise.
943 (Symbol_table::should_override): Don't complain about TLS mismatch
944 if the TO symbol is a plugin placeholder.
945 * testsuite/Makefile.am (plugin_test_tls): New test.
946 * testsuite/Makefile.in: Regenerate.
947 * testsuite/plugin_test_tls.sh: New test script.
948 * testsuite/two_file_test_2_tls.cc: New test source.
949 * testsuite/two_file_test_tls.cc: New test source.
950
7fb47cc9
CC
9512013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
952
953 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
954 the maximum segment alignment is larger than the page size.
955 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
956 correctly aligns the symbols with large alignemnt.
957 * testsuite/Makefile.in: Regenerate.
958 * testsuite/large_symbol_alignment.cc: New file.
959
6934001a
CC
9602013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
961 Sriraman Tallam <tmsriram@google.com>
962
963 * options.h (sort_section): New option.
964 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
965 Rename from Input_section_sort_section_name_special_ordering_compare.
966 (Input_section_sort_section_name_compare): New struct.
967 * output.cc (Output_section::Input_section_sort_section_name_compare::
968 operator()): New function.
969 (Output_section::sort_attached_input_sections): Use new sort function
970 for .text if --sort-section=name is specified.
971 * layout.cc (Layout::make_output_section):
972 Add sorting by name when --sort-section=name is specified.
973 * testsuite/Makefile.am (text_section_grouping): Test option
974 --sort-section=name.
975 * testsuite/Makefile.in: Regenerate.
976 * testsuite/section_sorting_name.cc: New file.
977 * testsuite/section_sorting_name.sh: New file.
978
93acabad
CC
9792013-05-21 Cary Coutant <ccoutant@google.com>
980
981 * symtab.h (Symbol::is_cxx_vtable): New function.
982 * target-reloc.h (relocate_section): Check for vtable symbol.
983 * testsuite/Makefile.am (missing_key_func.sh): New test case.
984 * testsuite/Makefile.in: Regenerate.
985 * testsuite/missing_key_func.cc: New test source.
986 * testsuite/missing_key_func.sh: New test script.
987
60e8b3fc
CC
9882013-05-21 Cary Coutant <ccoutant@google.com>
989
2b64b551
RM
990 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
991 type of enclosing symbol.
992 (Relocate_info::location): Check symbol type when describing symbol.
993 * object.h (Symbol_location_info): Remove unused line_number;
994 add enclosing_symbol_type.
995 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 996
9df9de2c
CC
9972013-05-13 Cary Coutant <ccoutant@google.com>
998
2b64b551
RM
999 * configure.ac: Export DEFAULT_TARGET.
1000 * configure: Regenerate.
1001 * Makefile.in: Regenerate.
1002 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1003 * testsuite/Makefile.in: Regenerate.
1004 * testsuite/debug_msg.sh: Delete duplicate tests.
1005 Don't check undef_int error message match for powerpc where the
1006 source file and line number aren't available.
9df9de2c 1007
bbc5ae17
RM
10082013-05-10 Roland McGrath <mcgrathr@google.com>
1009
1010 * options.h (General_options): Add --rosegment-gap option.
1011 * options.cc (finalize): --rosegment-gap implies --rosegment.
1012 * layout.cc (set_segment_offsets): Let user option override
1013 target->rosegment_gap().
1014
0c6e6c39
RM
10152013-05-10 Roland McGrath <mcgrathr@google.com>
1016
1017 * options.h (General_options): Remove leading space from help
1018 messages for -nostdlib and --rosegment.
1019
cde7cb01
MR
10202013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1021
1022 PR ld/15365
1023 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1024
f31ae5b8
AM
10252013-05-03 Alan Modra <amodra@gmail.com>
1026
1027 * merge.cc (Output_merge_string::do_add_input_section): Correct
1028 scan for number of strings. Rename vars to avoid shadowing.
1029 Include missing terminator in input_size_.
1030
d3a7cd45
L
10312013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1032
1033 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1034 Restore empty string handling.
1035
6ad3daba
CC
10362013-05-01 Cary Coutant <ccoutant@google.com>
1037
1038 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1039 uninitialized warning.
1040
e31908b6
CC
10412013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1042
1043 * output.cc (Output_section::add_merge_input_section): Allow
1044 to merge sections if the alignment is more than character size.
1045 * merge.h (Output_merge_string::Output_merge_string): Remove
1046 assert.
1047 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1048 only not-null strings. Check the alignment of strings.
1049 * stringpool.h
1050 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1051 alignment as the argument.
1052 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1053 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1054 Align non-zero length strings according to the addralign_.
1055 (Stringpool_template<Stringpool_char>::set_string_offsets):
1056 Updating offsets according to the given alignment.
1057 * testsuite/Makefile.am (text_section_grouping): Test if string
1058 literals are getting merged.
1059 * testsuite/Makefile.in: Regenerate.
1060 * testsuite/merge_string_literals_1.c: New file.
1061 * testsuite/merge_string_literals_2.c: Ditto.
1062 * testsuite/merge_string_literals.sh: Ditto.
1063
0e804863
ILT
10642013-04-26 Ian Lance Taylor <iant@google.com>
1065
1066 * target-reloc.h (relocate_section): If the reloc offset is out of
1067 range, pass VIEW as NULL to relocate.relocate.
1068 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1069 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1070 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1071 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1072 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1073 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1074
e7c5ea40
CC
10752013-04-26 Geoff Pike <gpike@chromium.org>
1076
1077 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1078 * layout.cc (Hash_task): New class.
1079 (Layout::queue_build_id_tasks): New function.
1080 (Layout::write_build_id): Handle single-thread portion of build ID
1081 computation. (In some cases, all of it is single-threaded.) Replace
1082 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1083 functionality in fewer lines of code.
1084 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1085 * options.h (General_options): make "--build-id" default to tree
1086 rather than sha1. Add two new options related to --build-id=tree:
1087 --build-id-chunk-size-for-treehash and
1088 --build-id-min-file-size-for-treehash.
1089 * Makefile.am: add testing of --build-id=tree and related new options
1090 (these tests will be invoked by "make check").
1091 * Makefile.in: Regenerate.
1092
49926cd0
AM
10932013-04-25 Alan Modra <amodra@gmail.com>
1094
1095 * configure.tgt: Add powerpcle and powerpc64le.
1096
a4034750
AM
10972013-04-22 Alan Modra <amodra@gmail.com>
1098
1099 PR gold/15355
1100 * layout.cc (Layout::segment_precedes): Allow more than one
1101 segment with the same type and flags.
1102
e79c84aa
CC
11032013-04-15 Cary Coutant <ccoutant@google.com>
1104
1105 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1106 allocate space in file for BSS sections.
1107
2199fbe7
CC
11082013-04-15 Cary Coutant <ccoutant@google.com>
1109
1110 * script-sections.cc (Orphan_output_section): Reset address
1111 to zero after each orphaned section for relocatable links.
1112
502e8a84
CC
11132013-04-15 Cary Coutant <ccoutant@google.com>
1114
a4034750
AM
1115 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1116 section starting address for relocatable link.
1117 * testsuite/Makefile.am (script_test_11): New test.
1118 * testsuite/Makefile.in: Regenerate.
1119 * testsuite/script_test_11.c: New source file.
1120 * testsuite/script_test_11.t: New linker script.
502e8a84 1121
0cfdc767
AM
11222013-04-13 Alan Modra <amodra@gmail.com>
1123
1124 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1125 owner when sections are not adjacent and exceed group size.
1126 (Target_powerpc::group_sections): Handle corner case.
1127 (Target_powerpc::Branch_info::make_stub): Handle case where
1128 stub table doesn't exist due to branches in non-exec sections.
1129 (Target_powerpc::Relocate::relocate): Likewise.
1130
6830ee24
AM
11312013-04-11 Alan Modra <amodra@gmail.com>
1132
1133 PR gold/15354
1134 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1135 .branch_lt to match bfd ld. Adjust comments throughout file.
1136
54a3d865
ILT
11372013-04-04 Ian Lance Taylor <iant@google.com>
1138
1139 GCC PR c++/56840
1140 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1141 sections before checking whether they are included in the link.
1142
9993ba11
ST
11432013-03-29 Sriraman Tallam <tmsriram@google.com>
1144
1145 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1146 object before calling the plugin claim_file handler. Pass the elf
1147 object of the archive to the plugin. Delete the elf object if the
1148 plugin claims the file.
1149
ebacd51e
AM
11502013-03-21 Alan Modra <amodra@gmail.com>
1151
1152 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1153 segment when omagic.
1154
117be58f
AM
11552013-03-21 Alan Modra <amodra@gmail.com>
1156
1157 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1158 comparison warning.
1159 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1160 uninitialized" warning.
1161
32e2b61d
AM
11622013-03-20 Alan Modra <amodra@gmail.com>
1163
1164 * symtab.h (Symbol::clear_version): New function.
1165 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1166 is_needed by weak references. Clear version for symbols defined
1167 in as-needed objects that are not needed.
1168
b3ccdeb5
AM
11692013-03-15 Alan Modra <amodra@gmail.com>
1170
1171 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1172 static and public. Add report_err param. Return false for data refs.
1173 (Target_powerpc::rela_dyn_section): New overloaded function.
1174 (Target_powerpc::plt_, iplt_): Elucidate.
1175 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1176 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1177 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1178 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1179 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1180 push_branch and make_plt_entry for ifunc syms when
1181 reloc_needs_plt_for_ifunc.
1182 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1183 for ifunc unless reloc_needs_plt_for_ifunc.
1184
ad3d8a2f
AM
11852013-03-15 Alan Modra <amodra@gmail.com>
1186
1187 * gc.h (gc_process_relocs): Don't look through function descriptors.
1188 * icf.cc (get_section_contents): Do so here instead.
1189
4d9aa155
AM
11902013-03-13 Alan Modra <amodra@gmail.com>
1191
1192 * powerpc.cc (is_branch_reloc): Forward declare.
1193 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1194 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1195 false for 64-bit, true for 32-bit non-branch relocs.
1196 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1197 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1198 nm output.
1199 (icf_safe_test): Generate linker map file as well as nm output.
1200 (icf_safe_so_test): Likewise.
1201 * testsuite/Makefile.in: Regenerate.
1202 * testsuite/icf_test.sh: Parse linker map file to determine
1203 section folding.
1204 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1205 * testsuite/icf_safe_so_test.sh: Likewise.
1206 (X86_32_or_ARM_specific_safe_fold): Merge into..
1207 (arch_specific_safe_fold): ..this.
1208 (X86_64_specific_safe_fold): Delete unused function.
1209
57420c20
AM
12102013-03-12 Alan Modra <amodra@gmail.com>
1211
1212 * gc.h (gc_process_relocs): Look through function descriptors
1213 to determine shndx, symvalue and addend used by ICF. Tidy
1214 variable duplication.
1215
dc3714f3
AM
12162013-03-11 Alan Modra <amodra@gmail.com>
1217
1218 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1219 * layout.cc (Layout_task_runner::run): ..to here.
1220 * symtab.h (struct Symbol_location): Extract from..
1221 (class Symbol_table): ..here.
1222 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1223 * target.h (class Target): Add function_location and
1224 do_function_location functions.
1225 (class Sized_target): Add do_function_location.
1226 * object.h (class Sized_relobj_file): Move find_shdr..
1227 (class Object): ..to here.
1228 * object.cc: Likewise. Update to suit. Instantiate.
1229 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1230 * powerpc.cc (class Powerpc_dynobj): New.
1231 (Target_powerpc::do_function_location): New function.
1232 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1233 (Powerpc_dynobj::do_read_symbols): New function.
1234 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1235
956b03bb
ILT
12362013-03-08 Ian Lance Taylor <iant@google.com>
1237
1238 * options.cc (General_options::string_to_object_format): Accept
1239 "default".
1240
4bead2d5
AM
12412013-03-08 Alan Modra <amodra@gmail.com>
1242
1243 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1244 pointer to Post_fde.
1245 (struct Post_fde): Move definition to here..
1246 * ehframe.cc (struct Post_fde): ..from here.
1247 (Cie::write): Don't alloc Post_fde.
1248 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1249
02e60bf7
AM
12502013-03-07 Alan Modra <amodra@gmail.com>
1251
1252 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1253 relocation referencing .LC0.
1254 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1255
8343f03a
AM
12562013-03-07 Alan Modra <amodra@gmail.com>
1257
1258 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1259 always_inline. Add assembly for powerpc to avoid GOT.
1260
3366d57c
AM
12612013-03-07 Alan Modra <amodra@gmail.com>
1262
1263 * testsuite/script_test_10.sh: Don't test .bss section
1264 header number.
1265
6c77229c
AM
12662013-03-06 Alan Modra <amodra@gmail.com>
1267
1268 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1269 (Target_powerpc::symval_for_branch): Add symtab param. Update
1270 all callers. Handle folded sections.
1271 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1272 to Powerpc_relobj.
1273 (Global_symbol_visitor_opd::operator()): Likewise.
1274
a39e4af6
AM
12752013-03-04 Alan Modra <amodra@gmail.com>
1276
1277 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1278 * testsuite/Makefile.in: Regenerate.
1279
d5834edb
CC
12802013-03-01 Cary Coutant <ccoutant@google.com>
1281
1282 Add dwp support for v2 DWARF package file format.
1283 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1284 tu_length parameter. Adjust all callers.
1285 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1286 * dwp.cc: Include dwarf.h.
1287 (Section_bounds): New struct type.
1288 (Unit_set): New struct type.
1289 (Dwo_file::Dwo_file): Initialize new data member.
1290 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1291 Combine and rename to...
1292 (Dwo_file::read_unit_index): ...this.
1293 (Dwo_file::sized_read_compunit_index)
1294 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1295 (Dwo_file::sized_read_unit_index): ...this.
1296 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1297 parameters; add section_id parameter.
1298 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1299 (Dwo_file::add_unit_set): ...this.
1300 (Dwo_file::shndx_map_): Remove.
1301 (Dwo_file::sect_offsets_): New data member.
1302 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1303 (Dwp_output_file::add_section): Rename to...
1304 (Dwp_output_file::add_contribution): ...this.
1305 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1306 (Dwp_output_file::add_tu_set): Likewise.
1307 (Dwp_output_file::Contribution): New type.
1308 (Dwp_output_file::Section::contributions): New data member.
1309 (Dwp_output_file::Cu_or_tu_set): Remove.
1310 (Dwp_output_file::Section::Section): New ctor.
1311 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1312 (Dwp_output_file::Dwp_index::Section_table): New type.
1313 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1314 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1315 parameter.
1316 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1317 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1318 (Dwp_output_file::Dwp_index::section_table): New member function.
1319 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1320 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1321 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1322 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1323 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1324 (Dwp_output_file::Dwp_index::section_table_): New data member.
1325 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1326 (Dwp_output_file::add_output_section): New member function.
1327 (Dwp_output_file::write_new_section): New member function.
1328 (Dwp_output_file::write_contributions): New member function.
1329 (Dwp_output_file::section_id_map_): New data member.
1330 (class Dwo_id_info_reader): Remove.
1331 (class Unit_reader): New class.
1332 (get_dwarf_section_name): New function.
1333 (Dwo_file::read_executable): Adjust initializations of class data.
1334 (Dwo_file::read): Add support for v2 package file format.
1335 (Dwo_file::read_unit_index): Likewise.
1336 (Dwo_file::sized_read_unit_index): Likewise.
1337 (Dwo_file::copy_section): Likewise.
1338 (Dwo_file::add_unit_set): Likewise.
1339 (Dwp_output_file::add_output_section): Likewise.
1340 (Dwp_output_file::add_contribution): Likewise.
1341 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1342 for empty slot.
1343 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1344 file format.
1345 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1346 slot.
1347 (Dwp_output_file::initialize): Remove unused function.
1348 (Dwp_output_file::finalize): Add support for v2 package file format.
1349 (Dwp_output_file::write_index): Likewise.
1350 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1351 function prototype.
1352
a68a081d
CC
13532013-03-01 Cary Coutant <ccoutant@google.com>
1354
1355 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1356 function into class definition in header file.
1357 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1358 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1359 New function.
1360 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1361
9d5781f8
AM
13622013-02-28 Alan Modra <amodra@gmail.com>
1363
1364 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1365 * target.cc (Target::do_plt_fde_location): New function.
1366 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1367 accessor function, and constructor param.
1368 (struct Post_fde, Post_fdes): Declare.
1369 (Cie::write): Add post_fdes param.
1370 * ehframe.cc (Fde::write): Use plt_fde_location.
1371 (struct Post_fde): Define.
1372 (Cie::write): Stash FDEs added post merge mapping.
1373 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1374 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1375 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1376 other FDEs.
1377 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1378 (Target_powerpc::has_glink): New function.
1379 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1380 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1381 glink_eh_frame_fde_32, default_fde): New data.
1382 (Stub_table::eh_frame_added_): New var.
1383 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1384 Make const.
1385 (Stub_table::add_eh_frame): New function.
1386 (Output_data_glink::add_eh_frame): New function.
1387 (Target_powerpc::make_glink_section): Call add_eh_frame.
1388
214383dd
ILT
13892013-02-15 Ian Lance Taylor <iant@google.com>
1390
1391 * options.h (DEFINE_uint64_alias): Define.
1392 (class General_options): Add -Ttext-segment as an alias for
1393 -Ttext.
1394
91c2b899
AM
13952013-02-15 Alan Modra <amodra@gmail.com>
1396
1397 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1398 (Stub_table::do_write): ..here, two places.
1399 (Stub_table::plt_call_size): Use it here too.
1400
20e2a8aa
ILT
14012013-02-11 Ian Lance Taylor <iant@google.com>
1402
1403 * descriptors.cc (Descriptors::close_all): New function.
1404 * descriptors.h (class Descriptors): Declare close_all.
1405 (close_all_descriptors): New inline function.
1406 * plugin.cc: Include "descriptors.h".
1407 (Plugin_manager::cleanup): Call close_all_descriptors.
1408
8952bc69
AM
14092013-02-06 Alan Modra <amodra@gmail.com>
1410
1411 * README: Update coding style link.
1412
29bd8b6b
CC
14132013-01-28 Cary Coutant <ccoutant@google.com>
1414
a4034750
AM
1415 * dwp.cc (File_list): New typedef.
1416 (Dwo_name_info_reader): New class.
1417 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1418 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1419 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1420 (Dwo_file::read_executable): New function.
1421 (Dwo_file::read): Move common setup code to ...
1422 (Dwo_file::make_object): ... here.
1423 (dwp_options): Add --exec/-e.
1424 (usage): Likewise.
1425 (main): Likewise.
29bd8b6b 1426
c6ac678d
ST
14272013-01-24 Sriraman Tallam <tmsriram@google.com>
1428
1429 * layout.cc (Layout::layout): Check for option text_reorder.
1430 (Layout::make_output_section): Ditto.
1431 * options.h (text_reorder): New option.
1432 * output.cc (Input_section_sort_compare): Remove special ordering
1433 of section names.
1434 (Output_section::
1435 Input_section_sort_section_name_special_ordering_compare::
1436 operator()): New function.
1437 (Output_section::sort_attached_input_sections): Use new sort function
1438 for .text.
1439 * output.h (Input_section_sort_section_name_special_ordering_compare):
1440 New struct.
1441 * testsuite/Makefile.am (text_section_grouping): Test option
1442 --no-text-reorder
1443 * testsuite/Makefile.in: Regenerate.
1444 * testsuite/text_section_grouping.sh: Check order of functions without
1445 default text reordering.
1446
50701cc1
MF
14472013-01-18 Mike Frysinger <vapier@gentoo.org>
1448
1449 * options.h (General_options): Change default to true for new_dtags.
1450
b1b00fcc
MF
14512013-01-18 Mike Frysinger <vapier@gentoo.org>
1452
1453 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1454 when enable_new_dtags is false. Only add DT_RUNPATH when
1455 enable_new_dtags is true.
1456
ec5b8187
AM
14572013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1458
1459 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1460 used in declaration and definition consistent.
1461 (Target_powerpc::symval_for_branch): Ditto.
1462
a880d4c4
ST
14632013-01-16 Sriraman Tallam <tmsriram@google.com>
1464
1465 * testsuite/plugin_final_layout.cc: Fix comment.
1466
7c381248
ST
14672013-01-16 Sriraman Tallam <tmsriram@google.com>
1468
1469 * layout.cc (Layout::layout): Do not do default sorting for
1470 text sections when section ordering is specified.
1471 (make_output_section): Ditto.
1472 * testsuite/plugin_final_layout.cc: Name the function sections
1473 to catch reordering issues.
1474
e2458743
AM
14752013-01-15 Alan Modra <amodra@gmail.com>
1476
1477 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1478 plt-thread-safe.
1479
431ed302
AM
14802013-01-15 Alan Modra <amodra@gmail.com>
1481
1482 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1483 * testsuite/Makefile.in: Regenerate.
1484
0ec6429b
AM
14852013-01-14 Alan Modra <amodra@gmail.com>
1486
1487 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1488 * testsuite/Makefile.in: Regenerate.
1489
0bf402d5
ILT
14902013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1491
36af3926 1492 PR bfd/14430
0bf402d5
ILT
1493 Fix mingw gold build with plugins enabled
1494 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1495 * configure.ac: Export DLOPEN_LIBS and add headers check.
1496 * plugin.cc: Handle non-dlfcn case.
1497 * Makefile.in: Regenerate.
1498 * config.in: Regenerate.
1499 * configure: Regenerate.
1500 * testsuite/Makefile.in: Regenerate.
1501
9e9143bc
ST
15022013-01-09 Sriraman Tallam <tmsriram@google.com>
1503
1504 * output.h (sort_attached_input_sections): Change to be public.
1505 * script-sections.cc
1506 (Output_section_definition::set_section_addresses): Sort
1507 attached input sections according to section order before linker
1508 script assigns section addresses.
1509 (Orphan_output_section::set_section_addresses): Sort
1510 attached input sections according to section order before linker
1511 script assigns section addresses.
1512 * Makefile.am (final_layout.sh): Use a simple linker script to
1513 check if section ordering still works.
1514 * Makefile.in: Regenerate.
1515
679af368
ILT
15162013-01-09 Ben Cheng <bccheng@google.com>
1517
1518 * arm.cc (Target_arm::attributes_accept_div): New function.
1519 (Target_arm::attributes_forbid_div): New function.
1520 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1521 attribute using the same new functions as what bfd/elf32_arm.c
1522 does.
1523
3136a00e
CC
15242013-01-07 Cary Coutant <ccoutant@google.com>
1525
1526 PR gold/14993
1527 * output.cc (Output_section::add_input_section): For incremental
1528 updates, don't track input sections that are allocated from patch
1529 space.
1530
f2a6224b
L
15312013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1532 Ian Lance Taylor <iant@google.com>
1533
1534 PR gold/14897
1535 * configure.ac (--enable-ld): Removed.
1536 (install_as_default): Set to yes only for --enable-gold=default
1537 or --disable-ld.
1538 * configure: Regenerated.
1539
4f46f626
L
15402013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1541
1542 * options.h (General_options): Add -fuse-ld= for GCC linker
1543 option compatibility.
1544
26e4ef59
CC
15452013-01-04 Cary Coutant <ccoutant@google.com>
1546
1547 * configure.ac: Fix typo restoring CXXFLAGS.
1548 * configure: Regenerate.
1549
3d587466
CC
15502013-01-04 Cary Coutant <ccoutant@google.com>
1551
4f46f626
L
1552 * testsuite/Makefile.am (CXXLINK_S): New macro.
1553 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1554 * testsuite/Makefile.in: Regenerate.
3d587466 1555
44db6695
L
15562013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1557
1558 * version.cc (print_version): Update copyright year to 2013.
1559
edcac0c1
ILT
15602012-12-20 Ian Lance Taylor <iant@google.com>
1561
1562 * layout.cc (Layout::special_ordering_of_input_section): New
1563 function.
1564 (Layout::layout): If input section requires special ordering, must
1565 sort input sections.
1566 (Layout::make_output_section): May sort .text input sections.
1567 (Layout::is_section_name_prefix_grouped): Remove.
1568 * layout.h (class Layout): Declare
1569 special_ordering_of_input_section. Don't declare
1570 is_section_name_prefix_grouped.
1571 * output.cc (Output_section::add_input_section): Revert last
1572 change.
1573 (Output_section::Input_section_sort::match_file_name): Don't crash
1574 if called on output section data.
1575 (Output_section::Input_section_sort_compare): Sort based on
1576 special ordering.
1577 (Output_section::Input_section_sort_section_order_index_compare):
1578 Revert last patch.
1579 (Output_section::sort_attached_input_sections): Likewise.
1580
28f2a4ac
ST
15812012-12-18 Sriraman Tallam <tmsriram@google.com>
1582
edcac0c1 1583 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
1584 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1585 * output.cc (Output_section::add_input_section): Check if section
1586 name contains special prefix. Keep input sections to sort such
1587 sections.
1588 (Output_section::Input_section_sort_section_order_index_compare
1589 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
1590 (Output_section::sort_attached_input_sections): Add condition to
1591 Input_section_entry constructor call.
28f2a4ac
ST
1592 * testsuite/Makefile.am (text_section_grouping): New test.
1593 * testsuite/Makefile.in: Regenerate.
1594 * testsuite/text_section_grouping.cc: New file.
1595 * testsuite/text_section_grouping.sh: New file.
1596
5bf135a7
NC
15972012-12-17 Nick Clifton <nickc@redhat.com>
1598
1599 * Makefile.am: Add copyright notice.
1600 * NEWS: Likewise.
1601 * README: Likewise.
1602 * configure.ac: Likewise.
1603 * ftruncate.c: Likewise.
1604 * Makefile.in: Regenerate.
1605
59965708
CC
16062012-12-14 Cary Coutant <ccoutant@google.com>
1607
a4034750
AM
1608 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1609 --no-as-needed flag.
1610 (exception_separate_shared_12_test): Likewise.
1611 (incremental_copy_test): Likewise.
1612 * testsuite/Makefile.in: Regenerate.
59965708 1613
2a77e2ab
CC
16142012-12-14 Cary Coutant <ccoutant@google.com>
1615
1616 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1617 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1618
e3deeb9c
AM
16192012-12-12 Alan Modra <amodra@gmail.com>
1620
1621 * powerpc.cc (class Track_tls): New.
1622 (class Relocate, class Scan): Inherit Track_tls.
1623 (Target_powerpc::Scan::local, global): Track tls optimization
1624 and avoid creating plt entry for __tls_get_addr if all uses
1625 are optimized away.
1626 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1627
d8f5a274
AM
16282012-12-12 Alan Modra <amodra@gmail.com>
1629
1630 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1631 Replace no_toc_optimize with toc_optimize.
1632 * output.h (Output_section::input_sections): Provide non-const variant.
1633 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1634 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1635 accessors.
1636 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1637 (class Sort_toc_sections): New.
1638 (Target_powerpc::do_finalize_sections): Sort toc sections.
1639 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1640
4c8a1de1
RM
16412012-12-10 Roland McGrath <mcgrathr@google.com>
1642
1643 * testsuite/binary_unittest.cc (read_all): New function.
1644 (Sized_binary_test): Use it instead of ::read.
1645 * fileread.cc (do_read): Don't assume pread always reads the whole
1646 amount in a single call.
1647
edc27beb
AM
16482012-12-10 Alan Modra <amodra@gmail.com>
1649
1650 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1651 Set EM_PPC64 or EM_PPC here.
1652 (Target_selector_powerpc::do_recognize): Delete.
1653
906b9150
AM
16542012-12-10 Alan Modra <amodra@gmail.com>
1655
1656 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1657 stub_table_.
1658 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1659
418c15ae
RM
16602012-12-07 Roland McGrath <mcgrathr@google.com>
1661
1662 * testsuite/binary_unittest.cc (Sized_binary_test):
1663 Use open_descriptor rather than ::open.
1664
decdd3bc
AM
16652012-12-07 Alan Modra <amodra@gmail.com>
1666
1667 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1668 typedef and invalid_address constant.
1669 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1670 instantiate constants.
1671
db399005
ILT
16722012-12-06 Roland McGrath <mcgrathr@google.com>
1673
1674 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1675 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1676 * aclocal.m4: Regenerate.
1677 * configure: Regenerate.
1678 * Makefile.in: Regenerate.
1679 * testsuite/Makefile.in: Regenerate.
1680
aba6bc71
AM
16812012-12-07 Alan Modra <amodra@gmail.com>
1682
1683 * options.h (General_options): Add no_toc_optimize.
1684 * powerpc.cc (ok_lo_toc_insn): New function.
1685 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1686
9e69ed50
AM
16872012-12-06 Alan Modra <amodra@gmail.com>
1688
1689 * options.h (General_options): Add plt_align, plt_static_chain,
1690 plt_thread_safe. Update stub_group_size help text.
1691 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1692 for new plt_thread_safe_ var.
1693 (use_plt_offset): Correct comments.
1694 (Target_powerpc::do_relax): Look for thread creation symbols to
1695 determine default plt_thread_safe value. Clear plt call stubs
1696 as well as branch stubs each iteration.
1697 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
1698 insn constants.
1699 (l, hi, ha, write_insn): Move earlier.
1700 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
1701 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
1702 plt stubs too.
1703 (Stub_table::update_size): Adjust.
1704 (Stub_table::prev_size, set_prev_size): Delete.
1705 (Stub_table::stub_align): Let --plt-align affect result.
1706 (Stub_table::plt_call_size): Calculate sizes for various stubs.
1707 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
1708 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
1709 (Stub_table::do_write): Support more stub variants.
1710
f43ba157
AM
17112012-12-04 Alan Modra <amodra@gmail.com>
1712
1713 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
1714 (Target_powerpc::do_define_standard_symbols): New function.
1715
34171bc5
AM
17162012-12-03 Alan Modra <amodra@gmail.com>
1717
1718 * output.h: Formatting, whitespace.
1719
dc9589e9 17202012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
1721
1722 * layout.h (Layout::get_executable_sections): Declare.
1723 * layout.cc (Layout::get_executable_sections): New function.
1724 * arm.cc (Target_arm::group_sections): Use it.
1725 (Arm_output_section::group_sections): Delete now redundant test.
1726 * output.cc (Output_reloc::Output_reloc): Add is_relative.
1727 param to handle relative relocs.
1728 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
1729 (Output_data_reloc::add_absolute): Adjust.
1730 (Output_data_reloc::add_relative): New function.
1731 (Output_data::reset_data_size): New function.
1732 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
1733 (Output_section::set_addralign): New function.
1734 (Output_section::checkpoint_set_addralign): New function.
1735 (Output_section::clear_section_offsets_need_adjustment): New function.
1736 (Output_section::input_sections): Make public.
1737 * powerpc.cc (class Output_data_brlt_powerpc): New.
1738 (class Stub_table, class Stub_control): New.
1739 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
1740 stub_table_, set_stub_table, stub_table): New vectors and accessor
1741 functions.
1742 (Target_powerpc::do_may_relax, do_relax, push_branch,
1743 new_stub_table, stub_tables, brlt_section, group_sections,
1744 add_branch_lookup_table, find_branch_lookup_table,
1745 write_branch_lookup_table, make_brlt_section): New functions.
1746 (Target_powerpc::struct Sort_sections, class Branch_info): New.
1747 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
1748 branch_info_): New vars.
1749 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
1750 make call stubs here.
1751 (Output_data_glink): Remove all call stub handling from this class.
1752 (Target_powerpc::Scan::local, global): Save interesting branch
1753 relocs and relocs for ifunc. Adjust calls to plt entry functions.
1754 (Target_powerpc::do_finalize_sections): Only make reg save/restore
1755 functions on final link.
1756 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
1757 Handle long branch destinations too.
1758 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
1759 do_plt_address_for_local): Adjust lookup of plt call stubs.
1760
627b30b7
AM
17612012-11-30 Alan Modra <amodra@gmail.com>
1762
1763 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
1764 relocs against protected symbols when building 32-bit shared libs.
1765
40b469d7
AM
17662012-11-30 Alan Modra <amodra@gmail.com>
1767
1768 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
1769 param. Call got_section() to make .got. Update all callers
1770 and their callers and so on.
1771
bb66a627
AM
17722012-11-30 Alan Modra <amodra@gmail.com>
1773
1774 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
1775 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
1776 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
1777 value if it already exists.
1778
d2cf1c6c
L
17792012-11-19 H.J. Lu <hongjiu.lu@intel.com>
1780
1781 PR gold/14858
1782 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
1783
edccdf7c
RM
17842012-11-14 Roland McGrath <mcgrathr@google.com>
1785
1786 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
1787 than bfc instruction for data sandboxing.
1788
6febeb74
AM
17892012-11-08 Alan Modra <amodra@gmail.com>
1790
1791 * po/POTFILES.in: Regenerate.
1792
0a6f1bf2
AM
17932012-11-05 Alan Modra <amodra@gmail.com>
1794
1795 * configure.ac: Apply 2012-09-10 change to config.in here.
1796 * configure: Regenerate.
1797
26a4e9cb
AM
17982012-11-05 Alan Modra <amodra@gmail.com>
1799
1800 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
1801 (struct Opd_ent): Use "Address" rather than "Offset".
1802 (Output_data_got_powerpc::got_base_offset): Return Valtype.
1803 (Target_powerpc::got_section): Make public.
1804 (Target_powerpc::scan_relocs): Move code setting symbols..
1805 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
1806 Create _SDA_BASE_ only when referenced.
1807
cc928013
RM
18082012-11-02 Roland McGrath <mcgrathr@google.com>
1809
1810 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
1811 from last change.
1812
50ed5eb1
RM
18132012-11-01 Roland McGrath <mcgrathr@google.com>
1814
62fe925a
RM
1815 * target.h (Sized_target::relocate_relocs): Use Elf_Off
1816 for offset_in_output_section parameter.
1817 (Sized_target::relocate_special_relocatable): Likewise.
1818 * arm.cc (Target_arm::relocate_relocs): Likewise.
1819 (Target_arm::relocate_special_relocatable): Likewise.
1820 * i386.cc (Target_i386::relocate_relocs): Likewise.
1821 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
1822 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
1823 * target-reloc.h (relocate_relocs): Likewise.
1824 * testsuite/testfile.cc (Target_test): Likewise.
1825 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
1826 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
1827
1828 * system.h: Move inclusion of <clocale> to after <libintl.h> in
1829 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
1830
1831 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
1832 parameter, which is unused in the [!F_SETFD] case.
1833
50ed5eb1
RM
1834 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
1835 SYMNDX to off_t before comparing it to this->data_size().
1836 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
1837 * incremental.cc (Output_section_incremental_inputs::do_write):
1838 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
1839
2cadc0bf
RM
1840 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
1841
3bfcb652
NC
18422012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
1843
1844 * gold.cc (Target_arm::do_adjust_elf_header): Add the
1845 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
1846 in EABI_VER5.
1847
c1a8d56e
CC
18482012-10-29 Cary Coutant <ccoutant@google.com>
1849
1850 * dwp.cc (usage): Add file and exit status parameters;
1851 add --help and --version options.
1852 (print_version): New function.
1853 (main): Add --help and --version options.
1854
b2490a7b
L
18552012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1856
1857 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
1858 final_layout_sequence.txt.
1859 * testsuite/Makefile.in: Regenerated.
1860
aa543512
L
18612012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1862
1863 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
1864 COMPILE generated by automake.
1865 (LINK1): Likewise.
1866 (CXXCOMPILE1): Likewise.
1867 (CXXLINK1): Likewise.
1868 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
1869 (LINK): Likewise.
1870 (CXXCOMPILE): Likewise.
1871 (CXXLINK): Likewise.
1872 * testsuite/Makefile.in: Regenerated.
1873
d361fafb
L
18742012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1875
1876 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
1877 on bad fwrite return.
1878
598c7410
L
18792012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1880
1881 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
1882 on val.
1883
35c813e2
CC
18842012-10-23 Cary Coutant <ccoutant@google.com>
1885
1886 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
1887 * testsuite/Makefile.in: Regenerate.
1888 * testsuite/dwp_test.h: New source file.
1889 * testsuite/dwp_test_1.cc: New source file.
1890 * testsuite/dwp_test_1.s: New source file.
1891 * testsuite/dwp_test_1.sh: New source file.
1892 * testsuite/dwp_test_1b.cc: New source file.
1893 * testsuite/dwp_test_1b.s: New source file.
1894 * testsuite/dwp_test_2.cc: New source file.
1895 * testsuite/dwp_test_2.s: New source file.
1896 * testsuite/dwp_test_2.sh: New source file.
1897 * testsuite/dwp_test_main.cc: New source file.
1898 * testsuite/dwp_test_main.s: New source file.
1899
77429909
CC
19002012-10-23 Cary Coutant <ccoutant@google.com>
1901
1902 * dwp.h: New header file.
1903 * dwp.cc: New source file.
1904 * gold.h: Move shared declarations to system.h.
1905 * system.h: New header file.
1906 * Makefile.am: Add dwp.
1907 * Makefile.in: Regenerate.
1908
ed5d6712
CC
19092012-10-23 Cary Coutant <ccoutant@google.com>
1910
1911 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1912 Dwarf_info_reader::read_from_pointer.
1913 (Dwarf_pubnames_table::read_header): Likewise.
1914 (Dwarf_pubnames_table::next_name): Likewise.
1915 (Dwarf_die::read_attributes): Likewise.
1916 (Dwarf_die::skip_attributes): Likewise.
1917 (Dwarf_info_reader::read_from_pointer): New function template.
1918 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1919 (Dwarf_pubnames_table): Likewise.
1920 (Dwarf_info_reader::read_from_pointer): New function template.
1921 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1922 Dwarf_pubnames_table ctor.
1923
8787852d
CC
19242012-10-23 Cary Coutant <ccoutant@google.com>
1925
1926 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1927 abbrev_shndx.
1928 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1929 abbrev_shndx_.
1930 (Dwarf_info_reader::set_abbrev_shndx): New method.
1931 (Dwarf_info_reader::abbrev_shndx_): New data member.
1932
9fc236f3
CC
19332012-10-23 Cary Coutant <ccoutant@google.com>
1934
1935 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
1936 from object, not parameters.
1937 (Dwarf_info_reader::parse): Likewise.
1938 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
1939 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
1940 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
1941 methods.
1942
effe8365
CC
19432012-10-23 Cary Coutant <ccoutant@google.com>
1944
1945 * fileread.cc (Input_file::Input_file): New constructor.
1946 * fileread.h (class Input_file): Add new constructor.
1947
1698990d
AM
19482012-10-18 Alan Modra <amodra@gmail.com>
1949
1950 PR gold/14727
1951 * object.cc (Relobj::is_section_name_included): Also match
1952 .sdata personality section.
1953
168a4726
AM
19542012-10-18 Alan Modra <amodra@gmail.com>
1955
1956 * target-reloc.h (class Default_comdat_behavior): New, package up..
1957 (get_comdat_behaviour): ..this.
1958 (relocate_section): Add Relocate_comdat_behavior template arg,
1959 adjust code to suit.
1960 * arm.cc (Target_arm::relocate_section): Adjust to suit.
1961 (Target_arm::scan_reloc_section): Likewise.
1962 * i386.cc (Target_i386::relocate_section): Likewise.
1963 * sparc.cc (Target_sparc::relocate_section): Likewise.
1964 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
1965 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
1966 * powerpc.cc (class Relocate_comdat_behavior): New.
1967 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
1968 gold::relocate_section with new template arg.
1969
acc276d8
AM
19702012-10-18 Alan Modra <amodra@gmail.com>
1971
1972 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
1973 dynamic relocs for GOT_TPREL got entries, without symbol if
1974 resolving locally.
1975 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
1976 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
1977 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
1978
e10f9870
AM
19792012-10-17 Alan Modra <amodra@gmail.com>
1980
1981 PR gold/14726
1982 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
1983
ae034989
ST
19842012-10-16 Sriraman Tallam <tmsriram@google.com>
1985
1986 * layout.cc (Layout::include_section): Keep sections marked
1987 SHF_EXCLUDE when doing relocatable links.
1988
f3a0ed29
AM
19892012-10-16 Alan Modra <amodra@gmail.com>
1990
1991 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
1992 (Target_powerpc::do_finalize_sections): Call it.
1993 (Output_data_save_res): New class and supporting functions.
1994 (Target_powerpc::symval_for_branch): Only look up .opd entry for
1995 normal symbols defined in object files.
1996
c6de8ed4
AM
19972012-10-12 Alan Modra <amodra@gmail.com>
1998
1999 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2000 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2001 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2002 section if scan_opd_relocs not yet called.
2003 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2004
03e25981
AM
20052012-10-12 Alan Modra <amodra@gmail.com>
2006
2007 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2008 add_local_ifunc_entry): Revert last change.
2009 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2010
c9824451
AM
20112012-10-05 Alan Modra <amodra@gmail.com>
2012
2013 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2014 do_plt_address_for_global): New functions.
2015 (Output_data_got_powerpc::do_write): Don't segfault when linking
2016 statically.
2017 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2018 add_local_ifunc_entry): Return true on adding entry..
2019 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2020 glink->add_entry call. Remove unused symtab param. Adjust calls.
2021 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2022 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2023 set up symbols here.
2024 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2025 syms here. Do so even when no .iplt. Don't segfault when linking
2026 statically.
2027 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2028 new variants without reloc param.
2029 (Glink_sym_ent::Glink_sym_ent): Likewise.
2030 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2031 reloc when refs will resolve to plt call stub.
2032 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2033 R_PPC_PLTREL24 to resolve locally.
2034 (Target_powerpc::Scan::global): Correct ifunc handling.
2035 (Target_powerpc::Relocate::relocate): Correct local sym glink
2036 lookup. Don't destroy "value" when we have a plt call stub,
2037 and when checking plt call validity.
2038 (Target_powerpc::do_dynsym_value): Simplify.
2039
19fec8c1
AM
20402012-10-05 Alan Modra <amodra@gmail.com>
2041
2042 * i386.cc (Output_data_plt_i386::address_for_global,
2043 address_for_local): Add plt offset to returned value. Adjust uses.
2044 * sparc.cc (Output_data_plt_sparc::address_for_global,
2045 address_for_local): Likewise.
2046 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2047 address_for_local): Likewise.
2048 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2049 address_for_local): Likewise.
2050 * target.h (Target::plt_address_for_global, plt_address_for_local):
2051 Update comment.
2052 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2053 (Output_data_got::Got_entry::write): Nor here.
2054 * output.h: Comment fix.
2055
e867b647
WL
20562012-10-02 Jiong Wang <jiwang@tilera.com>
2057
2058 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2059 global_offset_table_ value for larget got.
2060 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2061
e5d5f5ed
AM
20622012-09-29 Alan Modra <amodra@gmail.com>
2063
2064 * powerpc.cc (Target_powerpc::iplt_): New output section.
2065 (Target_powerpc::iplt_section, make_iplt_section,
2066 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2067 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2068 Target_powerpc::plt_entry_count): Count iplt entries too.
2069 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2070 reloc section in constructor. New params.
2071 (Target_powerpc::make_plt_section): Create reloc section here instead.
2072 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2073 functions.
2074 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2075 (Output_data_glink::add_entry, find_entry): New functions to
2076 deal with local syms.
2077 (Glink_sym_ent): Add support for local syms.
2078 (Output_data_glink::do_write): Handle ifunc plt entries.
2079 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2080 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2081 (Target_powerpc::Relocate::relocate): Likewise.
2082 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2083
ec4dbad3
AM
20842012-09-25 Alan Modra <amodra@gmail.com>
2085
2086 * object.h (Sized_relobj_file::adjust_local_symbol,
2087 do_adjust_local_symbol): New functions.
2088 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2089 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2090 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2091 and irregular opd entry spacing.
2092 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2093 (Global_symbol_visitor_opd): New functor.
2094 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2095 on deleted opd entries.
2096
5c0b3823
WL
20972012-09-15 Jiong Wang <jiwang@tilera.com>
2098
2099 * tilegx.cc: New file.
2100 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2101 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2102 * configure.tgt: Add entries for tilegx*.
2103 * configure.ac: Likewise.
2104 * Makefile.in: Rebuild.
2105 * configure: Likewise.
2106 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2107 tilegx.
2108
bfdfa4cd
AM
21092012-09-13 Alan Modra <amodra@gmail.com>
2110
2111 * target-reloc.h (scan_relocs): Call scan.local for relocs
2112 against symbols in discarded sections. Pass is_discarded
2113 param.
2114 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2115 Add is_discarded param.
2116 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2117 is_discarded to flag opd entry as discarded. Don't emit dyn
2118 relocs on such entries.
2119 (Target_powerpc::Scan::global): Similarly detect and handle
2120 such opd entries.
2121 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2122 opd_ent_. Update all uses.
2123 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2124 (Target_powerpc::relocate_section): Zero out discarded opd
2125 entry relocs.
2126
d77a0555
ILT
21272012-09-12 Ian Lance Taylor <iant@google.com>
2128
2129 PR gold/14570
2130 * output.cc: Rename Output_data_got template parameter from size
2131 to got_size for all functions. Compile all variants of
2132 Output_data_got.
2133 (Output_data_got::Got_entry::write): Correct use of size for
2134 symbol value. Use local_is_tls rather than casting to
2135 Sized_relobj_file.
2136 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2137 (class Sized_relobj_file): Add do_local_is_tls.
2138 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2139
815a1205
AM
21402012-09-11 Alan Modra <amodra@gmail.com>
2141
2142 PR gold/14566
2143 * layout.cc (Layout::set_segment_offsets): When using
2144 common-page-size alignment, ensure we are on a new max-page-size
2145 page.
2146 * output.cc (Output_segment::set_section_addresses): Use
2147 abi_pagesize, not common_pagesize for relro boundary.
2148 (Output_segment::set_offset): Likewise.
2149
bd73a62d
AM
21502012-09-11 Alan Modra <amodra@gmail.com>
2151
2152 * output.h (Output_data_got::add_global_tls, add_local_tls,
2153 add_local_tls_pair): New functions.
2154 (Output_data_got::add_local_pair_with_rel): Remove second
2155 reloc param. Expand comment.
2156 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2157 use_plt_or_tls_offset_, similarly for constructor param.
2158 (Output_data_got::Got_entry::write): Add got_index param.
2159 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2160 add_local_tls_pair): New functions.
2161 (Output_data_got::Got_entry::write): Handle tls symbols
2162 with use_plt_or_tls_offset_ set specially.
2163 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2164 (Output_data_got::do_write): Replace iterator with index, pass
2165 index to entry write function.
2166 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2167 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2168 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2169 call.
2170 * i386.cc (Target_i386::Scan::local): Likewise.
2171 * sparc.cc (Target_sparc::Scan::local): Likewise.
2172 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2173 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2174 do_tls_offset_for_global): New functions.
2175 (Target_powerpc::Scan::local): Correct TLS relocations and got
2176 entry values.
2177 (Target_powerpc::Scan::global): Don't emit unnecessary
2178 dynamic relocations on TLS GOT entries.
2179
00716ab1
AM
21802012-09-10 Matthias Klose <doko@ubuntu.com>
2181
2182 * config.in: Disable sanity check for kfreebsd.
2183
c891b3f9
SA
21842012-09-10 Sterling Augustine <saugustine@google.com>
2185
2186 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2187 (Gdb_index::pubtypes_read): New parameter.
2188 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2189 to calls.
2190 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2191 pubtypes_object_.
2192
e81fea4d
AM
21932012-09-09 Alan Modra <amodra@gmail.com>
2194
2195 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2196 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2197 * gc.h (gc_process_relocs): Call target gc_add_reference.
2198 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2199 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2200 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2201 unnecessary cast.
2202 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2203 to cater for when we don't need code offset. Update use.
2204 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2205 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2206 set_opd_valid): New functions.
2207 (Target_powerpc::do_gc_add_reference): New function.
2208 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2209 stashed refs.
2210 (Target_powerpc::do_gc_mark_symbol): New function.
2211
d2d60eef
CC
22122012-09-06 Cary Coutant <ccoutant@google.com>
2213
2214 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2215 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2216 (Dwarf_die::skip_attributes): Likewise.
2217 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2218 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2219 (main): Call it.
2220 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2221
32ed4573
L
22222012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2223
2224 * testsuite/script_test_3.t: Add .got.plt output section
2225 statement.
2226 * testsuite/script_test_4.t: Likewise.
2227
f4baf0d4
AM
22282012-09-05 Alan Modra <amodra@gmail.com>
2229
2230 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2231 update all uses and lose "enum" when using type.
2232
864a1b56
AM
22332012-09-05 Alan Modra <amodra@gmail.com>
2234
2235 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2236 * configure: Regenerate.
2237 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2238 (plugin_final_layout.stdout): Likewise.
2239 (memory_test): Set page sizes to 0x1000.
2240 * testsuite/Makefile.in: Regenerate.
2241 * testsuite/discard_locals_test.sh: Add FIXME comment.
2242 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2243 * testsuite/pr14265.t: Add .got output section statement.
2244 * testsuite/script_test_2.t: Likewise.
2245 * testsuite/script_test_3.t: Likewise.
2246 * testsuite/script_test_4.t: Likewise.
2247 * testsuite/script_test_5.t: Likewise.
2248 * testsuite/script_test_6.t: Likewise.
2249 * testsuite/script_test_7.t: Likewise.
2250 * testsuite/script_test_9.t: Likewise.
2251
3ea0a085
AM
22522012-09-05 Alan Modra <amodra@gmail.com>
2253
2254 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2255 (Powerpc_relocate_functions::Status): New typedef.
2256 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2257 (Target_powerpc::Scan::local): Handle REL64.
2258 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2259 for REL32 and REL64.
2260 (Target_powerpc::symval_for_branch): New function, extracted from..
2261 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2262 checks. Report overflow errors.
2263
7404fe1b
AM
22642012-09-05 Alan Modra <amodra@gmail.com>
2265
2266 * object.h (Sized_relobj_file::emit_relocs): Delete.
2267 (Sized_relobj_file::emit_relocs_reltype): Delete.
2268 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2269 relocate_relocs for --emit-relocs.
2270 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2271 * output.h: Update comment.
2272 (Output_segment::first_section): New function.
2273 (Output_segment::first_section_load_address): Use first_section.
2274 * output.cc (Output_segment::first_section): New function extracted..
2275 (Output_segment::first_section_load_address): ..from here. Delete.
2276 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2277 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2278 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2279 adjust call to target.h function.
2280 * i386.cc (Target_i386): Likewise.
2281 * sparc.cc (Target_sparc): Likewise.
2282 * x86_64.cc (Target_x86_64): Likewise.
2283 * powerpc.cc (Target_powerpc): Likewise.
2284 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2285 first tls section has section symbol for optimised local dynamic
2286 output relocs.
2287 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2288 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2289 optimised tls code.
2290 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2291 Rename to relocate_relocs. Update error message.
2292
957564c9
AS
22932012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2294
2295 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2296 --just-symbols.
2297
dd93cd0a
AM
22982012-08-31 Alan Modra <amodra@gmail.com>
2299
2300 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2301 (Powerpc_relobj::toc_base_offset): New stub function.
2302 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2303 got_mod_index_offset to tlsld_got_offset. Update all refs.
2304 (Target_powerpc::Relocate::enum skip_tls): New.
2305 (Target_powerpc::call_tls_get_addr_): New var.
2306 (Target_powerpc::is_branch_reloc): Move to file scope.
2307 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2308 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2309 New functions.
2310 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2311 (powerpc_info): Correct common_pagesize for ppc64.
2312 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2313 (Powerpc_relocate_functions): Add overflow check enums and functions.
2314 Add non-shift version of rela, rela_ua. Delete all rel public
2315 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2316 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2317 addr16_ha3, addr14 functions.
2318 (Output_data_got_powerpc::add_constant_pair): New function.
2319 (Output_data_got_powerpc::got_base_offset): Likewise.
2320 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2321 (instruction constants): Sort, add some more.
2322 (Output_data_glink::do_write): Add and use Address typedef. Use
2323 object->toc_base_offset() stub for 64-bit.
2324 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2325 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2326 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2327 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2328 Always treat .opd relocs as against locally defined symbol.
2329 Correct condition for RELATIVE relocs.
2330 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2331 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2332 for 32-bit syms with a plt entry. Correct ppc64 toc base
2333 calculations. Handle TLS relocs, and more. Add overflow
2334 checking and adjust for Powerpc_relocate_functions changes.
2335 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2336 Reinstate --emit-relocs code with FIXME.
2337
a1373b60
AM
23382012-08-30 Alan Modra <amodra@gmail.com>
2339
2340 * layout.cc (Layout::set_segment_offsets): Set p_align to
2341 abi_pagesize, not common_pagesize.
2342 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2343 to determine whether file header can go in segment.
2344
703d02da
AM
23452012-08-30 Alan Modra <amodra@gmail.com>
2346
2347 * output.h (Output_reloc::Output_reloc <output section>): Add
2348 is_relative param. Adjust calls.
2349 (Output_reloc::add_output_section_relative): New functions.
2350 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2351 is_relative.
2352 (Output_reloc::symbol_value): Handle SECTION_CODE.
2353
16164a6b
ST
23542012-08-24 Sriraman Tallam <tmsriram@google.com>
2355
2356 * gold.cc (queue_middle_tasks): Call layout again when unique
2357 segments for sections is desired.
2358 * layout.cc (Layout::Layout): Initialize new members.
2359 (Layout::get_output_section_flags): New function.
2360 (Layout::choose_output_section): Call get_output_section_flags.
2361 (Layout::layout): Make output section for mapping to a unique segment.
2362 (Layout::insert_section_segment_map): New function.
2363 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2364 output sections marked so.
16164a6b
ST
2365 (Layout::segment_precedes): Check for unique segments when sorting.
2366 * layout.h (Layout::Unique_segment_info): New struct.
2367 (Layout::Section_segment_map): New typedef.
2368 (Layout::insert_section_segment_map): New function.
2369 (Layout::get_output_section_flags): New function.
2370 (Layout::is_unique_segment_for_sections_specified): New function.
2371 (Layout::set_unique_segment_for_sections_specified): New function.
2372 (Layout::unique_segment_for_sections_specified_): New member.
2373 (Layout::section_segment_map_): New member.
2374 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2375 Rename is_gc_pass_one to is_pass_one.
2376 Rename is_gc_pass_two to is_pass_two.
2377 Rename is_gc_or_icf to is_two_pass.
2378 Check for which pass based on whether symbols data is present.
2379 Make it two pass when unique segments for sections is desired.
2380 * output.cc (Output_section::Output_section): Initialize new
2381 members.
2382 * output.h (Output_section::is_unique_segment): New function.
2383 (Output_section::set_is_unique_segment): New function.
2384 (Output_section::is_unique_segment_): New member.
2385 (Output_section::extra_segment_flags): New function.
2386 (Output_section::set_extra_segment_flags): New function.
2387 (Output_section::extra_segment_flags_): New member.
2388 (Output_section::segment_alignment): New function.
2389 (Output_section::set_segment_alignment): New function.
2390 (Output_section::segment_alignment_): New member.
2391 (Output_segment::Output_segment): Initialize is_unique_segment_.
2392 (Output_segment::is_unique_segment): New function.
2393 (Output_segment::set_is_unique_segment): New function.
2394 (Output_segment::is_unique_segment_): New member.
2395 * plugin.cc (allow_unique_segment_for_sections): New function.
2396 (unique_segment_for_sections): New function.
2397 (Plugin::load): Add new functions to transfer vector.
2398 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2399 * Makefile.in: Regenerate.
2400 * testsuite/plugin_final_layout.sh: Check if unique segment
2401 functionality works.
2402 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2403 are available.
2404 (allow_unique_segment_for_sections): New global.
2405 (unique_segment_for_sections): New global.
2406 (claim_file_hook): Call allow_unique_segment_for_sections.
2407 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2408
1e2bee4f
CC
24092012-08-22 Cary Coutant <ccoutant@google.com>
2410
2411 * layout.cc (Layout::include_section): Don't assert on GROUP
2412 sections with --emit-relocs.
2413
1d5dfe78
CC
24142012-08-21 Cary Coutant <ccoutant@google.com>
2415
2416 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2417 if --export-dynamic-symbol names an undef symbol.
2418
c9269dff
AM
24192012-08-18 Alan Modra <amodra@gmail.com>
2420
2421 * powerpc.cc: Formatting and white space.
2422 (Powerpc_relobj): Rename got2_section_ to special_.
2423 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2424 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2425 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2426 (Target_powerpc): Add Address typedef and invalid_address. Use
2427 throughout.
2428 (Target_powerpc::is_branch_reloc): New function.
2429 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2430 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2431 for dst_mask, value and addend.
2432 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2433 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2434 (Output_data_glink::do_write): Correct toc base. Don't try to use
2435 uint16_t for 24-bit offset. Use get_output_section_offset and
2436 check return.
2437 (Target_powerpc::Scan::local): Handle more relocs.
2438 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2439 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2440 Plug in toc restoring insn after plt calls. Translate branches
2441 to function descriptor symbols to corresponding entry point.
2442 (Target_powerpc::relocate_for_relocatable): Check return from
2443 get_output_section_offset.
2444 * symtab.h: Comment typo.
2445
b1759dce
ILT
24462012-08-14 Ian Lance Taylor <iant@google.com>
2447
2448 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2449 unsupported_relocal_local to call unsupported_reloc_global.
2450
b9b2ae8b
NC
24512012-08-14 Nick Clifton <nickc@redhat.com>
2452
2453 PR ld/14265
2454 * script-sections.cc (Sections_element::output_section_name): Add
2455 keep return parameter.
2456 (Output_section_element::match_name): Add keep return parameter.
2457 Return the value of the keep_ member.
2458 * script-sections.h (class Output_section): Update
2459 output_section_name prototype.
2460 * layout.cc (Layout::keep_input_section): New public member
2461 function.
2462 (Layout::choose_output_section): Pass keep parameter to
2463 output_section_name.
2464 * layout.h (class Layout): Add keep_input_section.
2465 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2466 sections.
2467 * testsuite/Makefile.am: Add a test.
2468 * testsuite/Makefile.in: Regenerate.
2469 * testsuite/pr14265.c: Source file for the test.
2470 * testsuite/pr14265.t: Linker script for the test.
2471 * testsuite/pr14265.sh: Shell script for the test.
2472
921b5322
AM
24732012-08-14 Alan Modra <amodra@gmail.com>
2474
2475 * target.h (Target::output_section_name): New function.
2476 (Target::do_output_section_name): New function.
2477 * layout.cc (Layout::choose_output_section): Call the above.
2478 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2479
6ce78956
AM
24802012-08-14 Alan Modra <amodra@gmail.com>
2481
2482 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2483 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2484 for replace_constant call.
2485 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2486 (Output_data_glink::do_print_to_mapfile): New function.
2487 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2488 (Target_powerpc::Relocate::relocate): Likewise.
2489
d1a8cabd
AM
24902012-08-14 Alan Modra <amodra@gmail.com>
2491
2492 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2493 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2494 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2495 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2496 all references to shndx_. Handle special case for R_PPC_PLTREL24
2497 here.
2498 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2499 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2500 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2501 here.
2502 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2503 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2504
d83ce4e3
AM
25052012-08-12 Alan Modra <amodra@gmail.com>
2506
2507 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2508 (glink insn constants): Use uint32_t.
2509 (Output_data_glink::add_entry): Use insert, not [] operator.
2510
cf43a2fe
AM
25112012-08-11 Alan Modra <amodra@gmail.com>
2512
2513 * object.h (Sized_relobj_file::find_shdr): New function.
2514 (Sized_relobj_file::find_special_sections): New function.
2515 * object.cc (Sized_relobj_file::find_shdr): New function.
2516 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2517 (Sized_relobj_file::find_special_sections): New function, split out..
2518 (Sized_relobj_file::do_read_symbols): ..from here.
2519 * output.h (Output_data_got::replace_constant): New function.
2520 (Output_data_got::num_entries): New function.
2521 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2522 (Output_data_got::got_offset): Protected rather than private.
2523 (Output_data_got::replace_got_entry): New function.
2524 * output.cc (Output_data_got::replace_got_entry): New function.
2525 * powerpc.cc (class Powerpc_relobj): New.
2526 (class Powerpc_relocate_functions): Delete all psymval variants or
2527 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2528 Implement _ha functions using corresponding _hi function.
2529 (Powerpc_relobj::find_special_sections): New function.
2530 (Target_powerpc::do_make_elf_object): New function.
2531 (class Output_data_got_powerpc): New.
2532 (class Output_data_glink): New.
2533 (class Powerpc_scan_relocatable_reloc): New.
2534 Many more changes througout file.
2535
3c892704
NC
25362012-08-09 Nick Clifton <nickc@redhat.com>
2537
2538 * po/vi.po: Updated Vietnamese translation.
2539
82435b3b
ILT
25402012-08-07 Ian Lance Taylor <iant@google.com>
2541
2542 * layout.cc (Layout::add_target_dynamic_tags): If
2543 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2544 plt_rel.
2545
a6dc81d2
NC
25462012-07-30 Nick Clifton <nickc@redhat.com>
2547
2548 * po/gold.pot: Updated template.
2549 * po/es.po: Updated Spanish translation.
2550
f1415016
CC
25512012-07-18 Cary Coutant <ccoutant@google.com>
2552
2553 PR gold/14344
2554 * configure.ac: Add check for -gpubnames support.
2555 * configure: Regenerate.
2556 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2557 support; force -gno-pubnames.
2558 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2559 support.
2560 (gdb_index_test_4): New test.
2561 * testsuite/Makefile.in: Regenerate.
2562 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2563 * testsuite/gdb_index_test_2.sh: Likewise.
2564 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2565 * testsuite/gdb_index_test_4.sh: New script.
2566 * testsuite/gdb_index_test_comm.sh: New script with common code;
2567 don't look for space after colon.
2568
b7fd7c37
ST
25692012-07-16 Sriraman Tallam <tmsriram@google.com>
2570
2571 * gold.cc (queue_middle_tasks): Update function order only after
2572 deferred objects due to plugins are processed.
2573
1f3212db
ILT
25742012-07-11 Ian Lance Taylor <iant@google.com>
2575
2576 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2577 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2578 (Target_arm::scan_reloc_for_stub): Likewise.
2579 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2580 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2581 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2582 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2583 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2584
81c82a68
ILT
25852012-07-10 Dodji Seketeli <dodji@redhat.com>
2586 Ian Lance Taylor <iant@google.com>
2587
2588 PR gold/14309
2589 * configure.ac: Test whether std::tr1::hash<off_t> works.
2590 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2591 needed.
2592 * output.h (class Output_fill): Add virtual destructor.
2593 * configure, config.in: Rebuild.
2594
eabc84f4
RM
25952012-06-22 Roland McGrath <mcgrathr@google.com>
2596
2597 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2598
370e30b6
RÁE
25992012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2600
2601 * plugin.cc (Plugin::load): Handle position independent executables.
2602
fb1b895d
CC
26032012-06-06 Cary Coutant <ccoutant@google.com>
2604
2605 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2606 add .debug_macro.
2607 (lines_only_debug_sections): Likewise.
2608 (gdb_fast_lookup_sections): New static array.
2609 (is_gdb_debug_section): Rename formal parameter.
2610 (is_lines_only_debug_section): Likewise.
2611 (is_gdb_fast_lookup_section): New function.
2612 (Layout::include_section): Check for ".zdebug_" prefix; pass
2613 section name suffix to is_gdb_debug_section, et al.; check for
2614 fast-lookup sections when building .gdb_index.
2615 * options.h (--strip-debug-gdb): Update GDB version number.
2616
7c0640fa
CC
26172012-06-06 Cary Coutant <ccoutant@google.com>
2618
2619 * configure.ac: Add check for fallocate.
2620 * configure: Regenerate.
2621 * config.in: Regenerate.
2622
2623 * options.h (class General_options): Add --mmap-output-file and
2624 --posix-fallocate options.
2625 * output.cc: (posix_fallocate): Remove; replace with...
2626 (gold_fallocate): New function.
2627 (Output_file::map_no_anonymous): Call gold_fallocate.
2628 (Output_file::map): Check --mmap-output-file option.
2629
2a49eb69
DK
26302012-06-05 Jing Yu <jingyu@google.com>
2631
2632 * gold.h (textdomain): Add do {} to empty while(0).
2633 (bindtextdomain): Likewise.
2634
fad072ac
CC
26352012-06-04 Cary Coutant <ccoutant@google.com>
2636
2637 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2638 has_dynsym_index.
2639
8cc69fb6
ST
26402012-05-25 Sriraman Tallam <tmsriram@google.com>
2641
2642 * symtab.cc (Symbol_table::define_special_symbol):
2643 Initialize *poldsym to prevent uninitialized variable errors.
2644
1be75daa
CC
26452012-05-23 Cary Coutant <ccoutant@google.com>
2646
2647 * layout.cc (Layout::section_name_mapping): Add rules to handle
2648 exact match on .data.rel.ro.local or .data.rel.ro.
2649 (Layout::output_section_name): Check for exact matches.
2650
9b689de0
CC
26512012-05-23 Cary Coutant <ccoutant@google.com>
2652
2653 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2654 more carefully.
2655
b24fdbf5
CC
26562012-05-22 Cary Coutant <ccoutant@google.com>
2657
2658 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2659 object before exporting symbol.
2660
e550e1a2
L
26612012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2662
2663 * testsuite/tls_test.cc: Include "config.h" first.
2664 * testsuite/tls_test_c.c: Likewise.
2665
df7b86aa
NC
26662012-05-17 Daniel Richard G. <skunk@iskunk.org>
2667 Nick Clifton <nickc@redhat.com>
2668
2669 PR 14072
2670 * configure.in: Add check that sysdep.h has been included before
2671 any system header files.
2672 * configure: Regenerate.
2673 * config.in: Regenerate.
2674
1007b503
CC
26752012-05-14 Cary Coutant <ccoutant@google.com>
2676
2677 * layout.cc (Layout::make_output_section): Mark .tdata section
2678 as RELRO.
2679 * testsuite/relro_test.cc: Add a TLS variable.
2680
fd885f3a
L
26812012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2682
2683 PR gold/14091
2684 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2685 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2686 R_X86_64_64.
2687
80f5885c
CC
26882012-05-08 Cary Coutant <ccoutant@google.com>
2689
2690 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2691 (lines_only_debug_sections): Likewise.
2692
2e702c99
RM
26932012-05-02 Roland McGrath <mcgrathr@google.com>
2694
2695 * nacl.cc: New file.
2696 * nacl.h: New file.
2697 * Makefile.am (CCFILES, HFILES): Add them.
2698 * Makefile.in: Regenerate.
2699 * i386.cc (Output_data_plt_i386_nacl): New class.
2700 (Output_data_plt_i386_nacl_exec): New class.
2701 (Output_data_plt_i386_nacl_dyn): New class.
2702 (Target_i386_nacl): New class.
2703 (Target_selector_i386_nacl): New class.
2704 (target_selector_i386): Use it instead of Target_selector_i386.
2705 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
2706 (Target_x86_64_nacl): New class.
2707 (Target_selector_x86_64_nacl): New class.
2708 (target_selector_x86_64, target_selector_x32): Use it instead of
2709 Target_selector_x86_64.
2710 * arm.cc (Output_data_plt_arm_nacl): New class.
2711 (Target_arm_nacl): New class.
2712 (Target_selector_arm_nacl): New class.
2713 (target_selector_arm, target_selector_armbe): Use it instead of
2714 Target_selector_arm.
2715
2716 * target-select.cc (select_target): Take new Input_file* and off_t
2717 arguments, pass them on to recognize method of selector.
2718 * object.cc (make_elf_sized_object): Update caller.
2719 * parameters.cc (parameters_force_valid_target): Likewise.
2720 * incremental.cc (make_sized_incremental_binary): Likewise.
2721 * target-select.h: Update decl.
2722 (Target_selector::recognize): Take new Input_file* argument,
2723 pass it on to do_recognize.
2724 (Target_selector::do_recognize): Take new Input_file* argument.
2725 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
2726 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
2727 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
2728 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
2729
2730 * target.h (Target::Target_info): New members isolate_execinstr
2731 and rosegment_gap.
2732 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
2733 * arm.cc (Target_arm::arm_info): Update initializer.
2734 * i386.cc (Target_i386::i386_info): Likewise.
2735 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
2736 * sparc.cc (Target_sparc::sparc_info): Likewise.
2737 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2738 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2739 * layout.cc (Layout::attach_allocated_section_to_segment):
2740 Take new const Target* argument. If target->isolate_execinstr(), act
2741 like --rosegment.
2742 (Layout::find_first_load_seg): Take new const Target* argument;
2743 if target->isolate_execinstr(), reject PF_X segments.
2744 (Layout::relaxation_loop_body): Update caller.
2745 (Layout::set_segment_offsets): If target->isolate_execinstr(),
2746 reset file offset to zero when we hit LOAD_SEG, and then do a second
2747 loop over the segments before LOAD_SEG to reassign offsets after
2748 addresses have been determined. Handle target->rosegment_gap().
2749 (Layout::attach_section_to_segment): Take new const Target* argument;
2750 pass it to attach_allocated_section_to_segment.
2751 (Layout::make_output_section): Update caller.
2752 (Layout::attach_sections_to_segments): Take new const Target* argument;
2753 pass it to attach_section_to_segment.
2754 * gold.cc (queue_middle_tasks): Update caller.
2755 * layout.h (Layout): Update method decls with new arguments.
2756
2757 * arm.cc (Target_arm::Target_arm): Take optional argument for the
2758 Target_info pointer to use.
2759 (Target_arm::do_make_data_plt): New virtual method.
2760 (Target_arm::make_data_plt): New method that calls it.
2761 (Target_arm::make_plt_entry): Use it.
2762 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
2763 for the section alignment.
2764 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
2765 method.
2766 (Output_data_plt_arm::first_plt_entry_offset): Call it.
2767 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
2768 method.
2769 (Output_data_plt_arm::get_plt_entry_size): Call it.
2770 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
2771 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
2772 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
2773 method.
2774 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
2775 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
2776 method instead of sizeof(plt_entry).
2777 (Output_data_plt_arm::add_entry): Likewise.
2778 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
2779 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
2780 than static method.
2781 (Target_arm::plt_entry_size): Likewise.
2782 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
2783 Move to ...
2784 (Output_data_plt_arm_standard): ... here, new class.
2785 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
2786 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
2787 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
2788
2789 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2790 Take additional argument for the PLT entry size.
2791 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
2792 Use get_plt_entry_size method rather than plt_entry_size variable.
2793 (Output_data_plt_x86_64::reserve_slot): Likewise.
2794 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
2795 (Output_data_plt_x86_64::add_entry): Likewise.
2796 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
2797 (Output_data_plt_x86_64::address_for_global): Likewise.
2798 (Output_data_plt_x86_64::address_for_local): Likewise.
2799 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2800 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
2801 Make method non-static.
2802 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
2803 method.
2804 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
2805 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
2806 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
2807 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
2808 virtual method.
2809 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
2810 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
2811 virtual method.
2812 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
2813 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
2814 virtual method.
2815 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
2816 (Output_data_plt_x86_64::plt_entry_size)
2817 (Output_data_plt_x86_64::first_plt_entry)
2818 (Output_data_plt_x86_64::plt_entry)
2819 (Output_data_plt_x86_64::tlsdesc_plt_entry)
2820 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
2821 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
2822 (Output_data_plt_x86_64_standard): ... here, new class.
2823 (Target_x86_64::Target_x86_64): Take optional argument for the
2824 Target_info pointer to use.
2825 (Target_x86_64::do_make_data_plt): New virtual method.
2826 (Target_x86_64::make_data_plt): New method to call it.
2827 (Target_x86_64::init_got_plt_for_update): Use that.
2828 Call this->plt_->add_eh_frame method here.
2829 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
2830 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
2831 rather than static method.
2832 (Target_x86_64::plt_entry_size): Likewise.
2833 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
2834 rather than plt_entry_size variable. Move guts of PLT filling to...
2835 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
2836 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
2837 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
2838
2839 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
2840 additional argument for the section alignment.
2841 Don't do add_eh_frame_for_plt here.
2842 (Output_data_plt_i386::first_plt_entry_offset): Make the method
2843 non-static. Use get_plt_entry_size method rather than plt_entry_size
2844 variable.
2845 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
2846 method.
2847 (Output_data_plt_i386::get_plt_entry_size): Call it.
2848 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
2849 (Output_data_plt_i386::add_eh_frame): New method to call it.
2850 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
2851 method.
2852 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
2853 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
2854 method.
2855 (Output_data_plt_i386::fill_plt_entry): New method to call it.
2856 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
2857 method instead of plt_entry_size.
2858 (Output_data_plt_i386::plt_entry_size)
2859 (Output_data_plt_i386::plt_eh_frame_fde_size)
2860 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
2861 (Output_data_plt_i386_standard): ... here, new class.
2862 (Output_data_plt_i386_exec): New class.
2863 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
2864 (Output_data_plt_i386_exec::first_plt_entry): ... here.
2865 (Output_data_plt_i386::exec_plt_entry): Move to ...
2866 (Output_data_plt_i386_exec::plt_entry): ... here.
2867 (Output_data_plt_i386_dyn): New class.
2868 (Output_data_plt_i386::first_plt_entry): Move to ...
2869 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
2870 (Output_data_plt_i386::dyn_plt_entry): Move to ...
2871 (Output_data_plt_i386_dyn::plt_entry): ... here.
2872 (Target_i386::Target_i386): Take optional argument for the Target_info
2873 pointer to use.
2874 (Target_i386::do_make_data_plt): New virtual method.
2875 (Target_i386::make_data_plt): New method to call it.
2876 (Target_i386::make_plt_section): Use that.
2877 Call this->plt_->add_eh_frame method here.
2878 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
2879 rather than plt_entry_size variable.
2880 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
2881 (Output_data_plt_i386::address_for_local): Likewise.
2882 (Output_data_plt_i386::do_write): Likewise.
2883 Move guts of PLT filling to...
2884 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
2885 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
2886 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
2887 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
2888
b9b9f2ee
CC
28892012-05-01 Cary Coutant <ccoutant@google.com>
2890
2891 * dwarf_reader.cc (Dwarf_die::read_attributes)
2892 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
2893 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
2894 * reduced_debug_output.cc
2895 (Output_reduced_debug_info_section::get_die_end): Remove
2896 DW_FORM_GNU_ref_index. Add default case.
2897
57923f48
MW
28982012-04-26 Mark Wielaard <mjw@redhat.com>
2899
2900 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2901 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2902 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2903 DW_AT_high_pc as offset from DW_AT_low_pc.
2904
2905 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2906 * testsuite/Makefile.in: Regenerate.
2907 * testsuite/gdb_index_test_3.c: New test source file.
2908 * testsuite/gdb_index_test_3.sh: New test source file.
2909
2c54b4f4
ILT
29102012-04-25 Ian Lance Taylor <iant@google.com>
2911
2912 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2913 pointer.
2914 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2915 as a class, not a struct.
2916 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2917 (Target_arm::apply_cortex_a8_workaround): Likewise.
2918 * gc.h: Declare Reloc_types as a struct, not a class.
2919 * object.h: Declare Symbols_data as a struct.
2920 * reloc.h: Declare Read_relocs_data as a struct.
2921 * target.h: Declare Relocate_info as a struct.
2922
a5a5f7a3
DM
29232012-04-24 David S. Miller <davem@davemloft.net>
2924
2925 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2926 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2927 and R_SPARC_WPLT30.
2928
f038d496
CC
29292012-04-24 Cary Coutant <ccoutant@google.com>
2930
2931 * incremental-dump.cc (find_input_containing_global): Replace
2932 magic number with symbolic constant.
2933 (dump_incremental_inputs): Update version number.
2934 * incremental.cc (Output_section_incremental_inputs): Update version
2935 number; import symbolic constants from Incremental_inputs_reader.
2936 (Incremental_inputs::create_data_sections): Align relocations
2937 section correctly for 64-bit targets.
2938 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
2939 constants; add padding.
2940 (Output_section_incremental_inputs::write_header): Add assert for
2941 header_size.
2942 (Output_section_incremental_inputs::write_input_files): Add assert
2943 for input_entry_size.
2944 (Output_section_incremental_inputs::write_info_blocks): Add padding;
2945 add assert for object_info_size, input_section_entry_size,
2946 global_sym_entry_size.
2947 * incremental.h (Incremental_inputs_reader): Add symbolic constants
2948 for data structure sizes; use them.
2949 (Incremental_input_entry_reader): Import symbolic constants from
2950 Incremental_inputs_reader; use them.
2951
a4d85145
DM
29522012-04-23 David S. Miller <davem@davemloft.net>
2953
2954 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
2955 and elf_flags_set_.
2956 (Target_sparc::Target_sparc): Initialize new fields.
2957 (Target_sparc::do_make_elf_object): New function.
2958 (Target_sparc::do_adjust_elf_header): New function.
2959
1d509098
CC
29602012-04-23 Cary Coutant <ccoutant@google.com>
2961
2962 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
2963 CU range table of gdb index.
2964
7ebeff7f
DM
29652012-04-20 David S. Miller <davem@davemloft.net>
2966
2967 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
2968 instead of false.
2969
13cf9988
DM
29702012-04-16 David S. Miller <davem@davemloft.net>
2971
2a1079e8
DM
2972 * sparc.cc (Target_sparc::got_address): New function.
2973 (Sparc_relocate_functions::gdop_hix22): New function.
2974 (Sparc_relocate_functions::gdop_lox10): New function.
2975 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
2976 relocs.
2977 (Target_sparc::Scan::local): Likewise if the global symbol is not
2978 preemptible and is not IFUNC.
2979 (Target_sparc::Relocate::relocate): Perform GOTDATA code
2980 transformations for local and non-preemptible non-IFUNC global
2981 symbols.
2982
0bc964fc
DM
2983 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
2984 writing out 64-bit part of ranges.
2985
661d7a80
DM
2986 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
2987 -fpic and -fpie respectively.
2988 * Makefile.in: Regenerate.
2989
8c2bf391
DM
2990 * sparc.cc (class Target_sparc): Add rela_ifunc_.
2991 (Target_sparc::Target_sparc): Initialize new field.
2992 (Target_sparc::do_plt_section_for_global): New function.
2993 (Target_sparc::do_plt_section_for_local): New function.
2994 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
2995 (Target_sparc::make_plt_section): New function, broken out of
2996 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
2997 (Target_sparc::make_plt_entry): Call make_plt_section.
2998 (Target_sparc::make_local_ifunc_plt_entry): New function.
2999 (Target_sparc::rela_ifunc_section): New function.
3000 (Target_sparc::plt_section): Remove const.
3001 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3002 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3003 and ifunc_count_ fields.
3004 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3005 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3006 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3007 (Output_data_plt_sparc::rela_ifunc): New function.
3008 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3009 (Output_data_plt_sparc::has_ifunc_section): New function.
3010 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3011 (Output_data_plt_sparc::address_for_global): New function.
3012 (Output_data_plt_sparc::address_for_local): New function.
3013 (Output_data_plt_sparc::plt_index_to_offset): New function.
3014 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3015 and entry_count.
3016 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3017 entry_count.
3018 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3019 R_SPARC_JMP_IREL to switch.
3020 (Target_sparc::Scan::check_non_pic): Likewise.
3021 (Target_sparc::Scan::local): Handle IFUNC symbols.
3022 (Target_sparc::Scan::local): Likewise.
3023 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3024 and plt_address_for_local.
3025 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3026 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3027
13cf9988
DM
3028 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3029 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3030 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3031 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3032 global relocs too.
3033 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3034 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3035 calls.
3036 * sparc.cc (Target_sparc::Scan::global): Likewise.
3037 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3038
31821be0
CC
30392012-04-16 Cary Coutant <ccoutant@google.com>
3040
3041 * archive.cc (Library_base::should_include_member): Check for
3042 --export-dynamic-symbol.
3043 * options.h (class General_options): Add --export-dynamic-symbol.
3044 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3045 --export-dynamic-symbol.
3046 (Symbol_table::gc_mark_undef_symbols): Likewise.
3047 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3048
2615994e
DM
30492012-04-12 David S. Miller <davem@davemloft.net>
3050
3051 * sparc.cc (Reloc::wdisp10): New relocation method.
3052 (Reloc::h34): Likewise.
3053 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3054 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3055 R_SPARC_WDISP10.
3056 (Target_sparc::Scan::local): Likewise.
3057 (Target_sparc::Scan::global): Likewise.
3058 (Target_sparc::Relocate::relocate): Likewise.
3059
6782735d
CC
30602012-04-09 Cary Coutant <ccoutant@google.com>
3061
3062 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3063 low_pc == 0.
3064
8c7a0b00
ILT
30652012-04-06 Ian Lance Taylor <iant@google.com>
3066
3067 * timer.cc: #include <unistd.h>.
3068
58797674
RM
30692012-04-06 Roland McGrath <mcgrathr@google.com>
3070
3071 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3072 * config.in: Regenerate.
3073 * configure: Regenerate.
3074
44350750
NC
30752012-04-05 Nick Clifton <nickc@redhat.com>
3076
3077 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3078 (AM_LC_MESSAGES): Add.
3079 * aclocal.m4: Regenerate.
3080 * config.in: Regenerate.
3081 * configure: Regenerate.
3082
c1027032
CC
30832012-03-21 Cary Coutant <ccoutant@google.com>
3084
3085 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3086 * Makefile.in: Regenerate.
3087 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3088 (Sized_elf_reloc_mapper::symbol_section): New function.
3089 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3090 (make_elf_reloc_mapper): New function.
3091 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3092 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3093 (Dwarf_abbrev_table::do_get_abbrev): New function.
3094 (Dwarf_ranges_table::read_ranges_table): New function.
3095 (Dwarf_ranges_table::read_range_list): New function.
3096 (Dwarf_pubnames_table::read_section): New function.
3097 (Dwarf_pubnames_table::read_header): New function.
3098 (Dwarf_pubnames_table::next_name): New function.
3099 (Dwarf_die::Dwarf_die): New function.
3100 (Dwarf_die::read_attributes): New function.
3101 (Dwarf_die::skip_attributes): New function.
3102 (Dwarf_die::set_name): New function.
3103 (Dwarf_die::set_linkage_name): New function.
3104 (Dwarf_die::attribute): New function.
3105 (Dwarf_die::string_attribute): New function.
3106 (Dwarf_die::int_attribute): New function.
3107 (Dwarf_die::uint_attribute): New function.
3108 (Dwarf_die::ref_attribute): New function.
3109 (Dwarf_die::child_offset): New function.
3110 (Dwarf_die::sibling_offset): New function.
3111 (Dwarf_info_reader::check_buffer): New function.
3112 (Dwarf_info_reader::parse): New function.
3113 (Dwarf_info_reader::do_parse): New function.
3114 (Dwarf_info_reader::do_read_string_table): New function.
3115 (Dwarf_info_reader::lookup_reloc): New function.
3116 (Dwarf_info_reader::get_string): New function.
3117 (Dwarf_info_reader::visit_compilation_unit): New function.
3118 (Dwarf_info_reader::visit_type_unit): New function.
3119 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3120 Sized_elf_reloc_mapper.
3121 (Sized_dwarf_line_info::symbol_section): Remove function.
3122 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3123 (Sized_dwarf_line_info::read_line_mappings): Remove object
3124 parameter, adjust callers.
3125 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3126 * dwarf_reader.h: Include <sys/types.h>.
3127 (class Track_relocs): Remove forward declaration.
3128 (class Elf_reloc_mapper): New class.
3129 (class Sized_elf_reloc_mapper): New class.
3130 (class Dwarf_abbrev_table): New class.
3131 (class Dwarf_range_list): New class.
3132 (class Dwarf_ranges_table): New class.
3133 (class Dwarf_pubnames_table): New class.
3134 (class Dwarf_die): New class.
3135 (class Dwarf_info_reader): New class.
3136 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3137 (Sized_dwarf_line_info::symbol_section): Remove member function.
3138 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3139 base class.
3140 * gdb-index.cc: New source file.
3141 * gdb-index.h: New source file.
3142 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3143 and .debug_types sections, call Layout::add_to_gdb_index.
3144 (Sized_relobj_incr::do_section_name): Implement.
3145 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3146 return type; Implement.
3147 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3148 return type.
3149 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3150 parameter list and return type.
3151 (Sized_incr_dynobj::do_section_contents): Likewise.
3152 * layout.cc: Include gdb-index.h.
3153 (Layout::Layout): Initialize gdb_index_data_.
3154 (Layout::init_fixed_output_section): Check for .gdb_index section.
3155 (Layout::add_to_gdb_index): New function. Instantiate.
3156 * layout.h: Add forward declaration for class Gdb_index.
3157 (Layout::add_to_gdb_index): New member function.
3158 (Layout::gdb_index_data_): New data member.
3159 * main.cc: Include gdb-index.h.
3160 (main): Print statistics for gdb index.
3161 * object.cc (Object::section_contents): Move code into
3162 do_section_contents.
3163 (need_decompressed_section): Check for sections needed when building
3164 gdb index.
3165 (build_compressed_section_map): Likewise.
3166 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3167 gdb index.
3168 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3169 sections; call Layout::add_to_gdb_index.
3170 (Sized_relobj_file::do_decompressed_section_contents): Call
3171 do_section_contents directly.
3172 * object.h (Object::do_section_contents): Adjust parameter list and
3173 return type.
3174 (Object::do_decompressed_section_contents): Call do_section_contents
3175 directly.
3176 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3177 return type.
3178 * options.h (class General_options): Add --gdb-index option.
3179 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3180 list and return type.
3181 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3182 * reloc.h (Track_relocs::checkpoint): New function.
3183 (Track_relocs::reset): New function.
3184
3185 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3186 New test cases.
3187 * testsuite/Makefile.in: Regenerate.
3188 * testsuite/gdb_index_test.cc: New test source file.
3189 * testsuite/gdb_index_test_1.sh: New test source file.
3190 * testsuite/gdb_index_test_2.sh: New test source file.
3191
647f1574
DK
31922012-03-19 Doug Kwan <dougkwan@google.com>
3193
3194 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3195 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3196 __exidx_start and __exidx_end. Make symbol table parameter
3197 anonymous as it is not used.
3198 * gold.cc (queue_middle_tasks): Call target hook to define any
3199 target-specific symbols.
3200 * target.h (Target::define_standard_symbols): New method.
3201 (Target::do_define_standard_symbols): Same.
3202 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3203 * testsuite/Makefile.in: Regenerate.
3204 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3205 and __exidx_end.
3206 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3207 relocations are generated for __exidx_start and __exidx_end.
3208
7c6109da
DK
32092012-03-16 Doug Kwan <dougkwan@google.com>
3210
3211 * testsuite/Makefile.am: Disable test initpri3b.
3212 * testsuite/Makefile.in: Regenerate.
3213
7b8957f8
DK
32142012-03-15 Doug Kwan <dougkwan@google.com>
3215
3216 * arm.cc (Target_arm::got_section): Make .got section read-only
3217 if -z now is given.
3218
14dc9ef7
ILT
32192012-03-15 Ian Lance Taylor <iant@google.com>
3220
3221 PR gold/13850
3222 * layout.cc (Layout::make_output_section): Correctly mark
3223 SHT_INIT_ARRAY, et. al., as relro.
3224
fa40b62a
DK
32252012-03-14 Doug Kwan <dougkwan@google.com>
3226
3227 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3228 dynamic relocations for protected symbols in shared objects.
3229
fd325007
ILT
32302012-03-13 Ian Lance Taylor <iant@google.com>
3231
3232 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3233 keep the larger alignment.
3234
e8dd54e1
CC
32352012-03-12 Cary Coutant <ccoutant@google.com>
3236
3237 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3238 handling of DW_LNE_define_file.
3239
feb5f3b0
CC
32402012-03-12 Cary Coutant <ccoutant@google.com>
3241
3242 * reduced_debug_output.cc
3243 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3244 codes to switch.
3245
a1fb4256
CC
32462012-02-29 Cary Coutant <ccoutant@google.com>
3247
3248 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3249
5dd8762a
CC
32502012-02-29 Cary Coutant <ccoutant@google.com>
3251
3252 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3253 Call Object::decompressed_section_contents.
3254 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3255 New dtor.
3256 (Sized_dwarf_line_info::buffer_start_): New data member.
3257 * merge.cc (Output_merge_data::do_add_input_section): Call
3258 Object::decompressed_section_contents.
3259 (Output_merge_string::do_add_input_section): Likewise.
3260 * object.cc (need_decompressed_section): New function.
3261 (build_compressed_section_map): Decompress sections needed later.
3262 (Sized_relobj_file::do_decompressed_section_contents): New function.
3263 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3264 * object.h (Object::decompressed_section_contents): New function.
3265 (Object::discard_decompressed_sections): New function.
3266 (Object::do_decompressed_section_contents): New function.
3267 (Object::do_discard_decompressed_sections): New function.
3268 (Compressed_section_info): New type.
3269 (Compressed_section_map): Include decompressed section contents.
3270 (Sized_relobj_file::do_decompressed_section_contents): New function.
3271 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3272
7b5de7ee
CC
32732012-02-16 Cary Coutant <ccoutant@google.com>
3274
3275 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3276 * testsuite/Makefile.in: Regenerate.
3277
f9fa4a63
CC
32782012-02-14 Cary Coutant <ccoutant@google.com>
3279
3280 * options.cc (General_options::finalize): Disallow -pie and -static.
3281
2c175ebc
DK
32822012-02-03 Doug Kwan <dougkwan@google.com>
3283
3284 * arm.cc (Arm_relocate_functions::abs8,
3285 Arm_relocate_functions::abs16): Use
3286 Bits::has_signed_unsigned_overflow32.
3287 (Arm_relocate_functions::thm_abs8): Correct range of
3288 overflow check.
3289 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3290 in assertions.
3291
90cff06f
DK
32922012-02-02 Doug Kwan <dougkwan@google.com>
3293
3294 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3295 position independent outputs, not just shared objects.
3296
63887f3d
L
32972012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3298
3299 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3300 * configure: Regenerated.
3301
bef2b434
ILT
33022012-01-27 Ian Lance Taylor <iant@google.com>
3303
3304 * reloc.h (Bits): New class with static functions, copied from
3305 namespace utils in arm.cc.
3306 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3307 instead.
3308
c335b55d
L
33092012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3310
3311 * incremental.cc (write_info_blocks): Correct relocation offset.
3312
41194d9f
L
33132012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3314
3315 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3316 (Relocate::tls_gd_to_le): Likewise.
3317
1bae613c
L
33182012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3319
3320 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3321
24482ca0
L
33222012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3323
3324 * configure.ac: Check if -mcmodel=medium works.
3325 * configure: Regenerated.
3326
c2c7840a
CC
33272012-01-24 Cary Coutant <ccoutant@google.com>
3328
3329 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3330 definition and ...
3331 (read_unsigned_LEB_128_x): ... this new function.
3332 (read_signed_LEB_128): Replaced with inline definition and ...
3333 (read_signed_LEB_128_x): ... this new function.
3334 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3335 (read_unsigned_LEB_128): Add inline definition.
3336 (read_signed_LEB_128_x): New function.
3337 (read_signed_LEB_128): Add inline definition.
3338 * testsuite/Makefile.am (leb128_unittest): New unit test.
3339 * testsuite/Makefile.in: Regenerate.
3340 * testsuite/leb128_unittest.cc: New unit test.
3341
833de760 33422012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3343
3344 PR gold/13617
3345 * i386.cc (Target_i386::do_code_fill): When using a jmp
3346 instruction, pad with nop instructions.
3347 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3348
618d6666
L
33492012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3350
3351 * x86_64.cc (gc_process_relocs): Add typename on types used in
3352 template.
3353 (scan_relocs): Likewise.
3354 (relocate_section): Likewise.
3355 (apply_relocation): Likewise.
3356
3660ff06
L
33572012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3358
3359 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3360 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3361 under x32.
3362
fc51264f
L
33632012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3364
3365 * x86_64.cc: Initial support for x32.
3366
dd74ae06
CC
33672012-01-03 Cary Coutant <ccoutant@google.com>
3368
3369 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3370 Use abstract base class for GOT.
3371 * gold/output.h (class Output_data_got_base): New abstract base class.
3372 (class Output_data_got): Derive from new base class, adjust ctors.
3373 (Output_data_got::reserve_slot): Make virtual; rename to
3374 do_reserve_slot; Adjust callers.
3375 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3376 pointer to abstract base class.
3377 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3378
83896202
ILT
33792011-12-18 Ian Lance Taylor <iant@google.com>
3380
3381 * object.h (Relobj::local_symbol_value): New function.
3382 (Relobj::local_plt_offset): New function.
3383 (Relobj::local_has_got_offset): New function.
3384 (Relobj::local_got_offset): New function.
3385 (Relobj::set_local_got_offset): New function.
3386 (Relobj::do_local_symbol_value): New pure virtual function.
3387 (Relobj::do_local_plt_offset): Likewise.
3388 (Relobj::do_local_has_got_offset): Likewise.
3389 (Relobj::do_local_got_offset): Likewise.
3390 (Relobj::do_set_local_got_offset): Likewise.
3391 (Sized_relobj::do_local_has_got_offset): Rename from
3392 local_has_got_offset.
3393 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3394 (Sized_relobj::do_set_local_got_offset): Rename from
3395 set_local_got_offset.
3396 (Sized_relobj_file::do_local_plt_offset): Rename from
3397 local_plt_offset.
3398 (Sized_relobj_file::do_local_symbol_value): New function.
3399 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3400 local_plt_offset.
3401 * output.cc (Output_data_got::Got_entry::write): Change object to
3402 Relobj. Use local_symbol_value.
3403 (Output_data_got::add_global_with_rel): Change rel_dyn to
3404 Output_data_reloc_generic*. Use add_global_generic.
3405 (Output_data_got::add_global_with_rela): Remove. Change all
3406 callers to use add_global_with_rel.
3407 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3408 Output_data_reloc_generic*. Use add_global_generic.
3409 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3410 callers to use add_global_pair_with_rel.
3411 (Output_data_got::add_local): Change object to Relobj*.
3412 (Output_data_got::add_local_plt): Likewise.
3413 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3414 change rel_dyn to Output_data_reloc_generic*. Use
3415 add_local_generic.
3416 (Output_data_got::add_local_with_rela): Remove. Change all
3417 callers to use all_local_with_rel.
3418 (Output_data_got::add_local_pair_with_rel): Change object to
3419 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3420 add_output_section_generic.
3421 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3422 callers to use add_local_pair_with_rel.
3423 (Output_data_got::reserve_local): Change object to Relobj*.
3424 * output.h: (class Output_data_reloc_generic): Add pure virtual
3425 declarations for add_global_generic, add_local_generic,
3426 add_output_section_generic.
3427 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3428 functions for Output_data_reloc_generic. Update declarations for
3429 changes listed in output.cc.
3430 (class Output_data_got): Change template parameter to got_size.
3431 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3432 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3433 function.
3434 (Sized_relobj_incr::do_local_plt_offset): New function.
3435 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3436 add_global_generic.
3437
76677ad0
CC
34382011-12-17 Cary Coutant <ccoutant@google.com>
3439
3440 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3441 * resolve.cc (Symbol_table::resolve): Likewise.
3442 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3443 arrays.
3444 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3445
8b8dd8d5
ILT
34462011-12-16 Ian Lance Taylor <iant@google.com>
3447
3448 * output.h (Output_data_reloc_generic::add): Only call
3449 add_dynamic_reloc if this is a dynamic reloc section.
3450
d55525b9
L
34512011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3452
3453 PR gold/13505
3454 * target-reloc.h (apply_relocation): Replace <64, false> with
3455 <size, big_endian>.
3456
ff81c7c1
NC
34572011-11-25 Nick Clifton <nickc@redhat.com>
3458
3459 * po/it.po: New Italian translation.
3460
628f39be
SA
34612011-11-17 Sterling Augustine <saugustine@google.com>
3462
3463 * script.cc (script_include_directive): Implement.
3464 (read_script_file): New local variables name and search_path. Update
3465 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3466 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3467 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3468
98ef3ea4
SA
34692011-11-11 Sterling Augustine <saugustine@google.com>
3470
3471 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3472 (file_or_sections_cmd): Likewise.
3473
f4a8b6d7
DK
34742011-11-11 Doug Kwan <dougkwan@google.com>
3475
3476 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3477 if --just-symbols is given.
3478
29ab395d
DK
34792011-11-10 Doug Kwan <dougkwan@google.com>
3480
3481 PR gold/13362
3482 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3483 when processing data relocs.
3484 * reloc.h (Relocate_functions::rel_unaligned): New method.
3485 (Relocate_functions::pcrel_unaligned): Ditto.
3486 (Relocate_functions::rel32_unaligned): Ditto.
3487 (Relocate_functions::pcrel32_unaligned): Ditto.
3488
2c339f71
DK
34892011-11-09 Doug Kwan <dougkwan@google.com>
3490
3491 PR gold/13362
3492 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3493 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3494 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3495 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3496 (Relocate_functions::rel_unaligned): New.
3497 (Relocate_functions::rel32_unaligned): New.
3498 * target-reloc.h (relocate_for_relocatable): Add code to handle
3499 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3500 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3501 arm_unaligned_reloc_r): New targets.
3502 * testsuite/Makefile.in: Regenerate.
3503 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3504 linking.
3505
3f3cddf1
ILT
35062011-11-02 Ian Lance Taylor <iant@google.com>
3507
3508 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3509 NATIVE_LINKER.
3510 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3511 * options.cc (General_options::finalize): Use library search path
3512 from configure script if specified. If not native and no sysroot,
3513 only search TOOLLIBDIR.
3514 * options.h (Search_directory::Search_directory): Change name to
3515 const std::string&.
3516 (General_options::add_to_library_path_with_sysroot): Change arg to
3517 const std::string&.
3518 * configure, Makefile.in, config.in: Rebuild.
3519
a8e2273b
ILT
35202011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3521
3522 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3523 we are working around the ARM1176 Erratum.
3524 * options.h (General_options::fix_arm1176): Add option.
3525 * testsuite/Makefile.am: Add testcases, and keep current ones
3526 working.
3527 * testsuite/Makefile.in: Regenerate.
3528 * testsuite/arm_fix_1176.s: New file.
3529 * testsuite/arm_fix_1176.sh: Likewise.
3530
cd6eab1c
ILT
35312011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3532
3533 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3534 may_use_blx_.
3535 (Target_arm::may_use_blx): Remove method.
3536 (Target_arm::set_may_use_blx): Likewise.
3537 (Target_arm::may_use_v4t_interworking): New method.
3538 (Target_arm::may_use_v5t_interworking): Likewise.
3539 (Target_arm::may_use_blx_): Remove member variable.
3540 (Arm_relocate_functions::arm_branch_common): Check for v5T
3541 interworking.
3542 (Arm_relocate_functions::thumb_branch_common): Likewise.
3543 (Reloc_stub::stub_type_for_reloc): Likewise.
3544 (Target_arm::do_finalize_sections): Correct interworking checks.
3545 * testsuite/Makefile.am: Add new tests.
3546 * testsuite/Makefile.in: Regenerate.
3547 * testsuite/arm_farcall_arm_arm.s: New test.
3548 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3549 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3550 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3551 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3552 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3553 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3554 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3555
286adcf4
CC
35562011-10-31 Cary Coutant <ccoutant@google.com>
3557
3558 PR gold/13023
3559 * expression.cc (Expression::eval_with_dot): Add
3560 is_section_dot_assignment parameter.
3561 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3562 absolute and assigning to dot within a section.
3563 * script-sections.cc
3564 (Output_section_element_assignment::set_section_addresses): Pass
3565 dot_section to set_if_absolute.
3566 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3567 as is_section_dot_assignment flag to eval_with_dot.
3568 (Output_section_element_dot_assignment::set_section_addresses):
3569 Likewise.
3570 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3571 parameter. Also set value if relative to dot_section; set the
3572 symbol's output_section.
3573 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3574 parameter. Adjust all callers.
3575 (Expression::eval_maybe_dot): Likewise.
3576 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3577 Adjust all callers.
3578 * testsuite/script_test_2.t: Test assignment of an absolute value
3579 to dot within an output section element.
3580
9634ed06
CC
35812011-10-31 Cary Coutant <ccoutant@google.com>
3582
3583 * options.h (class General_options): Add --[no-]gnu-unique options.
3584 * symtab.cc (Symbol_table::sized_write_globals): Convert
3585 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3586
de4101c7
CC
35872011-10-31 Cary Coutant <ccoutant@google.com>
3588
3589 PR gold/13359
3590 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3591 unnecessary assertion.
3592 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3593
7257cc92
ST
35942011-10-31 Sriraman Tallam <tmsriram@google.com>
3595
3596 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3597 gc_mark_symbol.
3598 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3599 gc_mark_symbol.
3600 Change to just keep the section associated with symbol.
3601 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3602 they are externally visible and --export-dynamic is turned on.
3603 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3604
bfc34b3f
ILT
36052011-10-19 Ian Lance Taylor <iant@google.com>
3606
3607 PR gold/13163
3608 * script-sections.cc
3609 (Output_section_element_dot_assignment::needs_output_section): New
3610 function.
3611
ea0d8c47
ILT
36122011-10-19 Ian Lance Taylor <iant@google.com>
3613
3614 PR gold/13204
3615 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3616 --section-start option was seen.
3617 * options.h (General_options::any_section_start): New function.
3618
abd242a9
DM
36192011-10-18 David S. Miller <davem@davemloft.net>
3620
3621 PR binutils/13301
3622 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3623 member to track relocation locations that have moved during TLS
3624 reloc optimizations.
3625 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3626 (Target_sparc::Relocate::relocate): Adjust view down by 4
3627 bytes if it matches reloc_adjust_addr_.
3628 (Target_sparc::Relocate::relocate_tls): Always move the
3629 __tls_get_addr call delay slot instruction forward 4 bytes when
3630 performing relaxation.
3631
bab9090f
CC
36322011-10-18 Cary Coutant <ccoutant@google.com>
3633
3634 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3635 (Output_file::map_no_anonymous): Check for non-zero
3636 return code from posix_fallocate.
3637
f7c5b166
CC
36382011-10-17 Cary Coutant <ccoutant@google.com>
3639
3640 PR gold/13245
3641 * plugin.cc (is_visible_from_outside): Check for symbols
3642 referenced from dynamic objects.
3643 * resolve.cc (Symbol_table::resolve): Don't count references
3644 from dynamic objects as references from real ELF files.
3645 * testsuite/plugin_test_2.sh: Adjust expected result.
3646
b490c0bb
CC
36472011-10-17 Cary Coutant <ccoutant@google.com>
3648
3649 * gold.cc: Include timer.h.
3650 (queue_middle_tasks): Stamp time.
3651 (queue_final_tasks): Likewise.
3652 * main.cc (main): Store timer in parameters. Print timers
3653 for each pass.
3654 * parameters.cc (Parameters::Parameters): Initialize timer_.
3655 (Parameters::set_timer): New function.
3656 (set_parameters_timer): New function.
3657 * parameters.h (Parameters::set_timer): New function.
3658 (Parameters::timer): New function.
3659 (Parameters::timer_): New data member.
3660 (set_parameters_timer): New function.
3661 * timer.cc (Timer::stamp): New function.
3662 (Timer::get_pass_time): New function.
3663 * timer.h (Timer::stamp): New function.
3664 (Timer::get_pass_time): New function.
3665 (Timer::pass_times_): New data member.
3666
f475cf7b
CC
36672011-10-17 Cary Coutant <ccoutant@google.com>
3668
3669 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3670 task for members of lib groups.
3671
cdd7e244
CC
36722011-10-17 Cary Coutant <ccoutant@google.com>
3673
3674 PR gold/13288
4f95c8b4 3675 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
3676 (File_read::make_view): Move bounds check (replace with assert)...
3677 (File_read::find_or_make_view): ... to here.
3678
dfb45471
CC
36792011-10-12 Cary Coutant <ccoutant@google.com>
3680
4f95c8b4 3681 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
3682 ::read returns less than requested size.
3683
53bbcc1b
CC
36842011-10-10 Cary Coutant <ccoutant@google.com>
3685
4f95c8b4 3686 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
3687 Initialize defined_count_.
3688 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3689 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3690 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3691 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3692 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 3693 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
3694 member.
3695 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 3696 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
3697 Return zeroes instead of internal error.
3698
397b129b
CC
36992011-10-10 Cary Coutant <ccoutant@google.com>
3700
3701 PR gold/13249
4f95c8b4 3702 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 3703 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 3704 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
3705 (Output_reloc::type_): Adjust size of bit field.
3706 (Output_reloc::use_plt_offset_): New bit field.
3707 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
3708 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
3709 flag. Adjust all callers.
4f95c8b4 3710 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
3711 creating RELATIVE relocations.
3712
d5698657
NC
37132011-10-10 Nick Clifton <nickc@redhat.com>
3714
3715 * po/es.po: Updated Spanish translation.
3716 * po/fi.po: Updated Finnish translation.
3717
6a59a5c2
DN
37182011-10-03 Diego Novillo <dnovillo@google.com>
3719
3720 * options.cc (parse_uint): Fix dereference of RETVAL.
3721
f0558624
ST
37222011-09-29 Sriraman Tallam <tmsriram@google.com>
3723
3724 * layout.h (section_order_map_): New member.
3725 (get_section_order_map): New member function.
3726 * output.cc (Output_section::add_input_section): Check for patterns
3727 only when --section-ordering-file is specified.
3728 * gold.cc (queue_middle_tasks): Delay updating order of sections till
3729 output_sections have been formed.
3730 * layout.cc (Layout_Layout): Initialize section_order_map_.
3731 * plugin.cc (update_section_order): Store order in order_map. Do not
3732 update the order.
3733 * testsuite/Makefile.am: Add test case for plugin_final_layout.
3734 * testsuite/Makefile.in: Regenerate.
3735 * testsuite/plugin_section_order.c: New file.
3736 * testsuite/plugin_final_layout.cc: New file.
3737 * testsuite/plugin_final_layout.sh: New file.
3738
a7dac153
CC
37392011-09-29 Cary Coutant <ccoutant@google.com>
3740
4f95c8b4 3741 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 3742 Check for NULL.
4f95c8b4 3743 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
3744 symbols during incremental update.
3745 (Symbol_table::add_from_dynobj): Likewise.
3746
eebd87a5
ILT
37472011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3748 Ian Lance Taylor <iant@google.com>
3749
3750 * symtab.cc (Symbol_table::define_special_symbol): Always
3751 canonicalize version string.
3752
403a3331
CC
37532011-09-26 Cary Coutant <ccoutant@google.com>
3754
4f95c8b4
CC
3755 * gold.cc (queue_initial_tasks): Move option checks ...
3756 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
3757 some options; make others fatal.
3758
235061c2
CC
37592011-09-26 Cary Coutant <ccoutant@google.com>
3760
3761 gcc PR lto/47247
3762 * plugin.cc (get_symbols_v2): New function.
3763 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
3764 (is_referenced_from_outside): New function.
3765 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
3766 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
3767 (get_symbols): Pass version parameter.
3768 (get_symbols_v2): New function.
3769 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
3770 parameter.
3771 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
3772 (onload): Add LDPT_GET_SYMBOLS_V2.
3773 (all_symbols_read_hook): Use get_symbols_v2; check for
3774 LDPR_PREVAILING_DEF_IRONLY_EXP.
3775 * testsuite/plugin_test_3.sh: Update expected results.
3776
dc87f620
ILT
37772011-09-23 Simon Baldwin <simonb@google.com>
3778
3779 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
3780 configuration options.
3781 * configure: Regenerate.
3782 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
3783 * Makefile.in: Regenerate.
3784 * testsuite/Makefile.in: Regenerate.
3785
a8279f82
ST
37862011-09-19 Sriraman Tallam <tmsriram@google.com>
3787
3788 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
3789
0c9350c8
CC
37902011-09-19 Cary Coutant <ccoutant@google.com>
3791
3792 * incremental.cc (can_incremental_update): Fix typo in comment.
3793 * incremental.h (can_incremental_update): Likewise.
3794
aa06ae28
CC
37952011-09-18 Cary Coutant <ccoutant@google.com>
3796
3797 * incremental.cc (can_incremental_update): New function.
3798 * incremental.h (can_incremental_update): New function.
3799 * layout.cc (Layout::init_fixed_output_section): Call it.
3800 (Layout::make_output_section): Don't allow patch space in .eh_frame.
3801 * object.cc (Sized_relobj_file::do_layout): Call
3802 can_incremental_update.
3803
ebb300b2
CC
38042011-09-13 Cary Coutant <ccoutant@google.com>
3805
3806 * configure.ac: Check for glibc support for gnu_indirect_function
3807 support with static linking, setting automake conditional
3808 IFUNC_STATIC.
3809 * Makefile.in: Regenerate.
3810 * configure: Regenerate.
3811
3812 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
3813 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
3814 for IFUNC_STATIC.
3815 * testsuite/Makefile.in: Regenerate.
3816
1206d0d5
CC
38172011-09-13 Cary Coutant <ccoutant@google.com>
3818
3819 * incremental.cc (Sized_relobj_incr::do_layout): Call
3820 report_comdat_group for kept comdat sections.
3821 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
3822 * testsuite/Makefile.in: Regenerate.
3823 * testsuite/incr_comdat_test_1.cc: New source file.
3824 * testsuite/incr_comdat_test_2_v1.cc: New source file.
3825 * testsuite/incr_comdat_test_2_v2.cc: New source file.
3826 * testsuite/incr_comdat_test_2_v3.cc: New source file.
3827
40b29874
ILT
38282011-09-13 Ian Lance Taylor <iant@google.com>
3829
3830 * object.cc (Sized_relobj_file::do_layout): Remove unused local
3831 variable external_symbols_offset.
3832
1b045aac
ILT
38332011-09-12 Ian Lance Taylor <iant@google.com>
3834
3835 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
3836 triggered if object has no symbols.
3837
24c6c55a
DM
38382011-09-09 David S. Miller <davem@davemloft.net>
3839
3840 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
3841 (Output_fill_debug_line::do_write): Likewise.
3842
66570254
CC
38432011-08-29 Cary Coutant <ccoutant@google.com>
3844
3845 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
3846 casts to match formatting specs.
3847 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
3848
8ea8cd50
CC
38492011-08-26 Cary Coutant <ccoutant@google.com>
3850
3851 * layout.cc (Free_list::allocate): Provide guarantee of minimum
3852 remaining hole size when allocating.
3853 (Layout::make_output_section): Set fill methods for debug sections.
3854 * layout.h (Free_list::Free_list_node): Move from private to
3855 public.
3856 (Free_list::set_min_hole_size): New function.
3857 (Free_list::begin, Free_list::end): New functions.
3858 (Free_list::min_hole_): New data member.
3859 * output.cc: Include dwarf.h.
3860 (Output_fill_debug_info::do_minimum_hole_size): New function.
3861 (Output_fill_debug_info::do_write): New function.
3862 (Output_fill_debug_line::do_minimum_hole_size): New function.
3863 (Output_fill_debug_line::do_write): New function.
3864 (Output_section::Output_section): Initialize new data member.
3865 (Output_section::set_final_data_size): Ensure patch space is larger
3866 than minimum hole size.
3867 (Output_section::do_write): Fill holes in debug sections.
3868 * output.h (Output_fill): New class.
3869 (Output_fill_debug_info): New class.
3870 (Output_fill_debug_line): New class.
3871 (Output_section::set_free_space_fill): New function.
3872 (Output_section::free_space_fill_): New data member.
3873 * testsuite/Makefile.am (incremental_test_3): Add
3874 --incremental-patch option.
3875 (incremental_test_4): Likewise.
3876 (incremental_test_5): Likewise.
3877 (incremental_test_6): Likewise.
3878 (incremental_copy_test): Likewise.
3879 (incremental_common_test_1): Likewise.
3880 * testsuite/Makefile.in: Regenerate.
3881
7cf80422
NC
38822011-08-26 Nick Clifton <nickc@redhat.com>
3883
3884 * po/es.po: Updated Spanish translation.
3885
c3f7b0e5
CC
38862011-08-01 Cary Coutant <ccoutant@google.com>
3887
3888 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
3889 * gold/testsuite/Makefile.in: Regenerate.
3890 * gold/testsuite/justsyms_exec.c: New source file.
3891 * gold/testsuite/justsyms_lib.c: New source file.
3892
9590bf25
CC
38932011-08-01 Cary Coutant <ccoutant@google.com>
3894
3895 * layout.cc (Layout::set_segment_offsets): Don't realign text
3896 segment if -Ttext was specified.
3897 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
3898 file type.
3899 * object.h (Sized_relobj_file::e_type): New function.
3900 (Sized_relobj_file::e_type_): New data member.
3901 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3902 base address for ET_EXEC files.
3903 * target.cc (Target::do_make_elf_object_implementation): Allow
3904 ET_EXEC files with --just-symbols option.
3905
dcd8d12e
CC
39062011-07-28 Cary Coutant <ccoutant@google.com>
3907
3908 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3909 Add thread_number parameter.
3910 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3911 * workqueue-threads.cc
3912 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3913 current thread if its thread number is greater than desired thread
3914 count.
3915 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3916 Add thread_number parameter.
3917 (Workqueue::should_cancel_thread): Likewise.
3918 (Workqueue::find_runnable_or_wait): Pass thread_number to
3919 should_cancel_thread.
3920 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3921 parameter.
3922
804eb480
ST
39232011-07-22 Sriraman Tallam <tmsriram@google.com>
3924
3925 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3926 only after checking if it cannot be forced local.
3927 * symtab.h (is_externally_visible): Check if the symbol is not forced
3928 local.
3929
f1ddb600
ILT
39302011-07-15 Ian Lance Taylor <iant@google.com>
3931
3932 * options.h (class General_options): Add --print-output-format.
3933 Move -EL next to -EB, for better --help output.
3934 * target-select.cc: Include <cstdio>, "options.h", and
3935 "parameters.h".
3936 (Target_selector::do_target_bfd_name): New function.
3937 (print_output_format): New function.
3938 * target-select.h (class Target_selector): Update declarations.
3939 (Target_selector::target_bfd_name): New function.
3940 (print_output_format): Declare.
3941 * main.cc: Include "target-select.h".
3942 (main): Handle --print-output-format.
3943 * gold.cc: Include "target-select.h".
3944 (queue_initial_tasks): Handle --print-output-format when there are
3945 no input files.
3946 * parameters.cc (parameters_force_valid_target): Give a better
3947 error message if -EB/-EL does not match target.
3948 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
3949 function.
3950
7d172687
ILT
39512011-07-15 Ian Lance Taylor <iant@google.com>
3952
3953 * i386.cc (class Output_data_plt_i386): Add layout_ field.
3954 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
3955 (Output_data_plt_i386::do_write): Write address of .dynamic
3956 section to first entry in .got.plt section.
3957 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
3958 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3959 Initialize layout_.
3960 (Output_data_plt_x86_64::do_write): Write address of .dynamic
3961 section to first entry in .got.plt section.
3962 * layout.h (Layout::dynamic_section): New function.
3963
e9552f7e
ST
39642011-07-13 Sriraman Tallam <tmsriram@google.com>
3965
3966 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
3967 to claim_file call.
3968 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
3969 input_section_position_, and input_section_glob_.
3970 (read_layout_from_file): Call function section_ordering_specified.
3971 * layout.h (is_section_ordering_specified): New function.
3972 (section_ordering_specified): New function.
3973 (section_ordering_specified_): New boolean member.
3974 * main.cc(main): Call load_plugins after layout object is defined.
3975 * output.cc (Output_section::add_input_section): Use
3976 function section_ordering_specified to check if section ordering is
3977 needed.
3978 * output.cc (Output_section::add_relaxed_input_section): Use
3979 function section_ordering_specified to check if section ordering is
3980 needed.
3981 (Output_section::update_section_layout): New function.
3982 (Output_section::sort_attached_input_sections): Check if input section
3983 must be reordered.
3984 * output.h (Output_section::update_section_layout): New function.
3985 * plugin.cc (get_section_count): New function.
3986 (get_section_type): New function.
3987 (get_section_name): New function.
3988 (get_section_contents): New function.
3989 (update_section_order): New function.
58797674 3990 (allow_section_ordering): New function.
e9552f7e
ST
3991 (Plugin::load): Add the new interfaces to the transfer vector.
3992 (Plugin_manager::load_plugins): New parameter.
3993 (Plugin_manager::all_symbols_read): New parameter.
3994 (Plugin_manager::claim_file): New parameter. Save the elf object for
3995 unclaimed objects.
3996 (Plugin_manager::get_elf_object): New function.
3997 (Plugin_manager::get_view): Change to directly use the bool to check
3998 if get_view is called from claim_file_hook.
3999 * plugin.h (input_objects): New function
4000 (Plugin__manager::load_plugins): New parameter.
4001 (Plugin_manager::claim_file): New parameter.
4002 (Plugin_manager::get_elf_object): New function.
4003 (Plugin_manager::in_claim_file_handler): New function.
4004 (Plugin_manager::in_claim_file_handler_): New member.
4005 (layout): New function.
4006 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4007 handler with an extra parameter. Make the elf object before calling
4008 claim_file handler.
4009 * testsuite/plugin_test.c (get_section_count): New function pointer.
4010 (get_section_type): New function pointer.
4011 (get_section_name): New function pointer.
4012 (get_section_contents): New function pointer.
4013 (update_section_order): New function pointer.
4014 (allow_section_ordering): New function pointer.
4015 (onload): Check if the new interfaces exist.
4016
9446efde
ILT
40172011-07-13 Ian Lance Taylor <iant@google.com>
4018
4019 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4020 relro section.
4021 * x86_64.cc (Target_x86_64::got_section): Likewise.
4022 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4023 (relro_now_test_SOURCES): New variable.
4024 (relro_now_test_DEPENDENCIES): New variable.
4025 (relro_now_test_LDFLAGS): New variable.
4026 (relro_now_test_LDADD): New variable.
4027 (relro_now_test.so): New target.
4028 * testsuite/Makefile.in: Rebuild.
4029
07aa62f2
ILT
40302011-07-12 Ian Lance Taylor <iant@google.com>
4031
4032 PR gold/12980
4033 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4034 GLOB_DAT relocation rather than a RELATIVE relocation for a
4035 protected symbol when creating a shared library.
4036 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4037 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4038 * testsuite/protected_main_1.cc (main): Test that protected
4039 function has same address.
4040
e2153196
ILT
40412011-07-11 Ian Lance Taylor <iant@google.com>
4042
4043 PR gold/12979
4044 * options.h (class General_options): Add -Bgroup.
4045 * options.cc (General_options::finalize): If -Bgroup is set,
4046 default to --unresolved-symbols=report-all.
4047 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4048 * target-reloc.h (issue_undefined_symbol_error): Handle
4049 --unresolved-symbols=report-all.
4050
6daf5215
ILT
40512011-07-08 Ian Lance Taylor <iant@google.com>
4052
4053 PR gold/11985
4054 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4055 if linker script discards key sections.
4056 (Layout::create_dynamic_symtab): Likewise.
4057 (Layout::assign_local_dynsym_offsets): Likewise.
4058 (Layout::sized_create_version_sections): Likewise.
4059 (Layout::create_interp): Likewise.
4060 (Layout::finish_dynamic_section): Likewise.
4061 (Layout::set_dynamic_symbol_size): Likewise.
4062
beabb2c6
ILT
40632011-07-08 Ian Lance Taylor <iant@google.com>
4064
4065 PR gold/12386
4066 * options.h (class General_options): Add --unresolved-symbols.
4067 * target-reloc.h (issue_undefined_symbol_error): Check
4068 --unresolved-symbols. Add comments.
4069
9c16daf1
ILT
40702011-07-08 Ian Lance Taylor <iant@google.com>
4071
4072 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4073 expression more complex.
4074
191f1a2d
ILT
40752011-07-08 Ian Lance Taylor <iant@google.com>
4076
4077 PR gold/11317
4078 * target-reloc.h (issue_undefined_symbol_error): New inline
4079 function, broken out of relocate_section.
4080 (relocate_section): Call issue_undefined_symbol_error.
4081 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4082 there is no TLS segment if we are about to issue an undefined
4083 symbol error.
4084 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4085
62855347
ILT
40862011-07-08 Ian Lance Taylor <iant@google.com>
4087
4088 PR gold/12279
4089 * resolve.cc (Symbol_table::should_override): Add fromtype
4090 parameter. Change all callers. Give error when linking together
4091 TLS and non-TLS symbol.
4092 (Symbol_table::should_override_with_special): Add fromtype
4093 parameter. Change all callers.
4094 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4095 there is no TLS segment if we have reported some errors.
4096 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4097
67181c72
ILT
40982011-07-08 Ian Lance Taylor <iant@google.com>
4099
4100 PR gold/12372
4101 * target.h (Target::plt_address_for_global): New function.
4102 (Target::plt_address_for_local): New function.
4103 (Target::plt_section_for_global): Remove.
4104 (Target::plt_section_for_local): Remove.
4105 (Target::do_plt_address_for_global): New virtual function.
4106 (Target::do_plt_address_for_local): New virtual function.
4107 (Target::do_plt_section_for_global): Remove.
4108 (Target::do_plt_section_for_local): Remove.
4109 (Target::register_global_plt_entry): Add Symbol_table and Layout
4110 parameters.
4111 * output.cc (Output_data_got::Got_entry::write): Use
4112 plt_address_for_global and plt_address_for_local.
4113 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4114 address of output section.
4115 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4116 got_irelative_, and irelative_count_ fields. Update
4117 declarations.
4118 (Output_data_plt_i386::has_irelative_section): New function.
4119 (Output_data_plt_i386::entry_count): Add irelative_count_.
4120 (Output_data_plt_i386::set_final_data_size): Likewise.
4121 (class Target_i386): Add got_irelative_ and rel_irelative_
4122 fields. Update declarations.
4123 (Target_i386::Target_i386): Initialize new fields.
4124 (Target_i386::do_plt_address_for_global): New function replacing
4125 do_plt_section_for_global.
4126 (Target_i386::do_plt_address_for_local): New function replacing
4127 do_plt_section_for_local.
4128 (Target_i386::got_section): Create got_irelative_.
4129 (Target_i386::rel_irelative_section): New function.
4130 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4131 fields. Don't define __rel_iplt_{start,end}.
4132 (Output_data_plt_i386::add_entry): Add symtab and layout
4133 parameters. Change all callers. Use different PLT and GOT for
4134 IFUNC symbols.
4135 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4136 layout parameters. Change all callers. Use different PLT and
4137 GOT.
4138 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4139 (Output_data_plt_i386::rel_irelative): New function.
4140 (Output_data_plt_i386::address_for_global): New function.
4141 (Output_data_plt_i386::address_for_local): New function.
4142 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4143 IRELATIVE GOT when changing IFUNC GOT entries.
4144 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4145 reloc.
4146 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4147 if we didn't create an IRELATIVE GOT.
4148 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4149 plt_address_for_local.
4150 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4151 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4152 got_irelative_, and irelative_count_ fields. Update
4153 declarations.
4154 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4155 Initialize new fields. Remove symtab parameter. Change all
4156 callers.
4157 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4158 irelative_count_.
4159 (Output_data_plt_x86_64::has_irelative_section): New function.
4160 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4161 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4162 fields. Update declarations.
4163 (Target_x86_64::Target_x86_64): Initialize new fields.
4164 (Target_x86_64::do_plt_address_for_global): New function replacing
4165 do_plt_section_for_global.
4166 (Target_x86_64::do_plt_address_for_local): New function replacing
4167 do_plt_section_for_local.
4168 (Target_x86_64::got_section): Create got_irelative_.
4169 (Target_x86_64::rela_irelative_section): New function.
4170 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4171 all callers. Don't create __rel_iplt_{start,end}.
4172 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4173 parameters. Change all callers. Use different PLT and GOT for
4174 IFUNC symbols.
4175 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4176 layout parameters. Change all callers. Use different PLT and
4177 GOT.
4178 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4179 parameters. Change all callers. Use different PLT and GOT for
4180 IFUNC symbols.
4181 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4182 (Output_data_plt_x86_64::rela_irelative): New function.
4183 (Output_data_plt_x86_64::address_for_global): New function.
4184 (Output_data_plt_x86_64::address_for_local): New function.
4185 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4186 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4187 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4188 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4189 parameters.
4190 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4191 reloc.
4192 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4193 symbols if we didn't create an IRELATIVE GOT.
4194 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4195 plt_address_for_local.
4196 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4197 * testsuite/ifuncvar1.c: New test file.
4198 * testsuite/ifuncvar2.c: New test file.
4199 * testsuite/ifuncvar3.c: New test file.
4200 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4201 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4202 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4203 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4204 * testsuite/Makefile.in: Rebuild.
4205
33c15b45
CC
42062011-07-07 Cary Coutant <ccoutant@google.com>
4207
4208 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4209 (two_file_test_1_ndebug.o): Likewise.
4210 (two_file_test_1b_ndebug.o): Likewise.
4211 (two_file_test_2_ndebug.o): Likewise.
4212 (two_file_test_main_ndebug.o): Likewise.
4213 (incremental_test_2): Link with no-debug versions.
4214
f48b5fb7
CC
42152011-07-06 Cary Coutant <ccoutant@google.com>
4216
4217 * gold/incremental.cc
4218 (Output_section_incremental_inputs::write_info_blocks): Check for
4219 hidden and internal symbols.
4220
221597a5
CC
42212011-07-06 Cary Coutant <ccoutant@google.com>
4222
4223 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4224 Check disposition for startup file.
4225 (Incremental_inputs::report_command_line): Ignore
4226 --incremental-startup-unchanged option.
4227 * options.cc (General_options::parse_incremental_startup_unchanged):
4228 New function.
4229 (General_options::General_options): Initialize new data member.
4230 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4231 (General_options): Add --incremental-startup-unchanged option.
4232 (General_options::incremental_startup_disposition): New function.
4233 (General_options::incremental_startup_disposition_): New data member.
4234
e24719f6
CC
42352011-07-06 Cary Coutant <ccoutant@google.com>
4236
4237 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4238 input file index to Script_info ctor.
4239 (Sized_incremental_binary::do_file_has_changed): Find the
4240 command-line argument for files named in scripts.
4241 * incremental.h (Script_info::Script_info): New ctor
4242 with input file index.
4243 (Script_info::input_file_index): New function.
4244 (Script_info::input_file_index_): New data member.
4245 (Incremental_binary::get_library): Add const.
4246 (Incremental_binary::get_script_info): Add const.
4247 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4248 * testsuite/Makefile.am (incremental_test_5): New test case.
4249 (incremental_test_6): New test case.
4250 * testsuite/Makefile.in: Regenerate.
4251
8f7c81e8
CC
42522011-07-06 Cary Coutant <ccoutant@google.com>
4253
4254 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4255 debug output when command lines differ.
4256
9fbd3822
CC
42572011-07-06 Cary Coutant <ccoutant@google.com>
4258
4259 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4260 --incremental-patch option.
4261 * layout.cc (Free_list::allocate): Extend allocation beyond original
4262 end if enabled.
4263 (Layout::make_output_section): Mark sections that should get
4264 patch space.
4265 * options.cc (parse_percent): New function.
4266 * options.h (parse_percent): New function.
4267 (DEFINE_percent): New macro.
4268 (General_options): Add --incremental-patch option.
4269 * output.cc (Output_section::Output_section): Initialize new data
4270 members.
4271 (Output_section::add_input_section): Print section name when out
4272 of patch space.
4273 (Output_section::add_output_section_data): Likewise.
4274 (Output_section::set_final_data_size): Add patch space when
4275 doing --incremental-full.
4276 (Output_section::do_reset_address_and_file_offset): Remove patch
4277 space.
4278 (Output_segment::set_section_list_addresses): Print debug output
4279 only if --incremental-update.
4280 * output.h (Output_section::set_is_patch_space_allowed): New function.
4281 (Output_section::is_patch_space_allowed_): New data member.
4282 (Output_section::patch_space_): New data member.
4283 * parameters.cc (Parameters::incremental_full): New function.
4284 * parameters.h (Parameters::incremental_full): New function
4285 * testsuite/Makefile.am (incremental_test_2): Add test for
4286 --incremental-patch option.
4287 * testsuite/Makefile.in: Regenerate.
4288 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4289 (t18): Remove function body.
4290
f6cccc2c
DK
42912011-07-05 Doug Kwan <dougkwan@google.com>
4292
4293 PR gold/12771
4294 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4295 Arm_Address type for relocation result.
4296 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4297 overflow check.
4298 (Arm_relocate_functions::abs32): Use unaligned access.
4299 (Arm_relocate_functions::rel32): Ditto.
4300 (Arm_relocate_functions::prel31): Ditto.
4301 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4302 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4303 static data relocations.
4304 * testsuite/Makefile.in: Regnerate.
4305 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4306
28a13fec
ILT
43072011-07-05 Ian Lance Taylor <iant@google.com>
4308
4309 PR gold/12392
4310 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4311 symbols if necessary.
4312 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4313
24d47b34
ILT
43142011-07-05 Ian Lance Taylor <iant@google.com>
4315
4316 PR gold/12952
4317 * resolve.cc (Symbol::override_base_with_special): Simply override
4318 version with special symbol version, ignoring previous version.
4319
41f9cbbe
ILT
43202011-07-05 Ian Lance Taylor <iant@google.com>
4321
4322 * object.cc (Sized_relobj_file::include_section_group): Add
4323 information to comment about signature location.
4324
886288f1
ILT
43252011-07-02 Ian Lance Taylor <iant@google.com>
4326
4327 PR gold/12957
4328 * options.h (class General_options): Add -f and -F.
4329 * options.cc (General_options::finalize): Fatal error if -f/-F
4330 are used without -shared.
4331 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4332
ae3a6d4f
ILT
43332011-07-02 Ian Lance Taylor <iant@google.com>
4334
4335 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4336
21131061
ILT
43372011-07-01 Ian Lance Taylor <iant@google.com>
4338
4339 PR gold/12525
4340 PR gold/12952
4341 * resolve.cc (Symbol::override_base_with_special): Don't override
4342 the version if the overriding symbol has a different name.
4343 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4344 all callers. If we give an error about an undefined version,
4345 define the base version if necessary.
4346 * dynobj.h (class Versions): Update declaration.
4347 * testsuite/weak_alias_test_5.cc: New file.
4348 * testsuite/weak_alias_test.script: New file.
4349 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4350 and versioned_alias have the right value, and call t2.
4351 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4352 weak_alias_test_5.so.
4353 (weak_alias_test_LDADD): Likewise.
4354 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4355 * testsuite/Makefile.in: Rebuild.
4356
611062c0
ILT
43572011-07-01 Ian Lance Taylor <iant@google.com>
4358
4359 PR gold/12525
4360 * options.h (class General_options): Support -z notext.
4361 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4362 -Wl,-z,notext.
4363 (two_file_shared_nonpic.so): Likewise.
4364 (two_file_shared_mixed.so): Likewise.
4365 (two_file_shared_mixed_1.so): Likewise.
4366 (weak_undef_lib_nonpic.so): Likewise.
4367 (alt/weak_undef_lib_nonpic.so): Likewise.
4368 (tls_test_shared_nonpic.so): Likewise.
4369 * testsuite/Makefile.in: Rebuild.
4370
328c7c2f
ILT
43712011-07-01 Ian Lance Taylor <iant@google.com>
4372
4373 PR gold/12525
4374 * configure.ac: Test whether static linking works, setting
4375 the automake conditional HAVE_STATIC.
4376 * testsuite/Makefile.am: Disable tests using -static if
4377 HAVE_STATIC is not true.
4378 * configure, testsuite/Makefile.in: Rebuild.
4379
02d7cd44
ILT
43802011-07-01 Ian Lance Taylor <iant@google.com>
4381
4382 PR gold/12525
4383 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4384 Assert if we see DW_EH_PE_indirect.
4385 * target.h (Target::ehframe_datarel_base): New function.
4386 (Target::do_ehframe_datarel_base): New target function.
4387 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4388 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4389 function.
4390
07a60597
ILT
43912011-07-01 Ian Lance Taylor <iant@google.com>
4392
4393 PR gold/12571
4394 * options.h (class General_options): Add
4395 --ld-generated-unwind-info.
4396 * ehframe.cc (Fde::write): Add address parameter. Change all
4397 callers. If associated with PLT, fill in address and size.
4398 (Cie::set_output_offset): Only add merge mapping if there is an
4399 object.
4400 (Cie::write): Add address parameter. Change all callers.
4401 (Eh_frame::add_ehframe_for_plt): New function.
4402 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4403 input_offset_ fields into union u_, with new plt field.
4404 (Fde::Fde): Adjust for new union field.
4405 (Fde::Fde) [Output_data version]: New constructor.
4406 (Fde::add_mapping): Only add merge mapping if there is an object.
4407 (class Cie): Update declarations.
4408 (class Eh_frame): Declare add_ehframe_for_plt.
4409 * layout.cc (Layout::layout_eh_frame): Break out code into
4410 make_eh_frame_section, and call it.
4411 (Layout::make_eh_frame_section): New function.
4412 (Layout::add_eh_frame_for_plt): New function.
4413 * layout.h (class Layout): Update declarations.
4414 * merge.cc (Merge_map::add_mapping): Add assertion.
4415 * i386.cc: Include "dwarf.h".
4416 (class Output_data_plt_i386): Make first_plt_entry,
4417 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4418 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4419 and plt_eh_frame_fde.
4420 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4421 boundary. Call add_eh_frame_for_plt if appropriate.
4422 * x86_64.cc: Include "dwarf.h".
4423 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4424 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4425 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4426 and plt_eh_frame_fde.
4427 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4428 appropriate.
4429
14788a3f
ILT
44302011-06-29 Ian Lance Taylor <iant@google.com>
4431
4432 PR gold/12629
4433 * object.cc (Sized_relobj_file::layout_section): Change shdr
4434 parameter to be const.
4435 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4436 out of do_layout.
4437 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4438 appropriate. Call layout_eh_frame_section.
4439 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4440 sections.
4441 * object.h (class Sized_relobj_file): Update declarations.
4442
6c21fce1
ILT
44432011-06-29 Ian Lance Taylor <iant@google.com>
4444
37e41b03 4445 PR gold/12652
6c21fce1
ILT
4446 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4447 modifier.
4448 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4449
4d5e4e62
ILT
44502011-06-29 Ian Lance Taylor <iant@google.com>
4451
4452 PR gold/12675
4453 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4454 SHT_X86_64_UNWIND.
4455 * layout.cc (Layout::layout_eh_frame): Likewise.
4456
886f533a
ILT
44572011-06-29 Ian Lance Taylor <iant@google.com>
4458
4459 PR gold/12695
4460 * layout.cc (Layout::symtab_section_shndx): New function.
4461 * layout.h (class Layout): Declare symtab_section_shndx.
4462 * output.cc (Output_section::write_header): Call it.
4463
f3ae1b28
ILT
44642011-06-29 Ian Lance Taylor <iant@google.com>
4465
4466 PR gold/12818
4467 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4468 symbols which are not used in a relocation.
4469
aecf301f
ILT
44702011-06-28 Ian Lance Taylor <iant@google.com>
4471
4472 PR gold/12898
4473 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4474 script create indistinguishable segments.
4475 (Layout::set_segment_offsets): Use stable_sort when sorting
4476 segments. Pass this to Compare_segments constructor.
4477 * layout.h (class Layout): Make segment_precedes non-static.
4478 (class Compare_segments): Change from struct to class. Add
4479 layout_ field. Add constructor.
4480 * script-sections.cc
4481 (Script_sections::attach_sections_using_phdrs_clause): Rename
4482 local orphan to is_orphan. Don't report failure to put empty
4483 section in segment. On attachment failure, report name of
4484 section, and attach to first PT_LOAD segment.
4485
03ef7571
ILT
44862011-06-28 Ian Lance Taylor <iant@google.com>
4487
4488 PR gold/12934
4489 * target-select.cc (Target_selector::Target_selector): Add
4490 emulation parameter. Change all callers.
4491 (select_target_by_bfd_name): Rename from select_target_by_name.
4492 Change all callers.
4493 (select_target_by_emulation): New function.
4494 (supported_emulation_names): New function.
4495 * target-select.h (class Target_selector): Add emulation_ field.
4496 Update declarations.
4497 (Target_selector::recognize_by_bfd_name): Rename from
4498 recognize_by_name. Change all callers.
4499 (Target_selector::supported_bfd_names): Rename from
4500 supported_names. Change all callers.
4501 (Target_selector::recognize_by_emulation): New function.
4502 (Target_selector::supported_emulations): New function.
4503 (Target_selector::emulation): New function.
4504 (Target_selector::do_recognize_by_bfd_name): Rename from
4505 do_recognize_by_name. Change all callers.
4506 (Target_selector::do_supported_bfd_names): Rename from
4507 do_supported_names. Change all callers.
4508 (Target_selector::do_recognize_by_emulation): New function.
4509 (Target_selector::do_supported_emulations): New function.
4510 (select_target_by_bfd_name): Change name in declaration.
4511 (select_target_by_emulation): Declare.
4512 (supported_emulation_names): Declare.
4513 * parameters.cc (parameters_force_valid_target): Try to find
4514 target based on emulation from -m option.
4515 * options.h (class General_options): Change doc string for -m.
4516 * options.cc (help): Print emulations.
4517 (General_options::parse_V): Likewise.
4518 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4519 Add emulation parameter. Change all callers.
4520
200b2bb9
ILT
45212011-06-28 Ian Lance Taylor <iant@google.com>
4522
4523 * target.h (class Target): Add osabi_ field.
4524 (Target::osabi): New function.
4525 (Target::set_osabi): New function.
4526 (Target::Target): Initialize osabi_.
4527 (Target::do_adjust_elf_header): Make pure virtual.
4528 (Sized_target::do_adjust_elf_header): Declare.
4529 * target.cc (Sized_target::do_adjust_elf_header): New function.
4530 (class Sized_target): Instantiate all versions.
4531 * freebsd.h (class Target_freebsd): Remove.
4532 (Target_selector_freebsd::do_recognize): Call set_osabi on
4533 Target.
4534 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4535 (Target_selector_freebsd::set_osabi): Remove.
4536 * i386.cc (class Target_i386): Inherit from Sized_target rather
4537 than Target_freebsd.
4538 * x86_64.cc (class Target_x86_64): Likewise.
4539
b3ce541e
ILT
45402011-06-28 Ian Lance Taylor <iant@google.com>
4541
4542 * target.h (Target::can_check_for_function_pointers): Rewrite.
4543 Make non-virtual.
4544 (Target::can_icf_inline_merge_sections): Likewise.
4545 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4546 (Target::Target_info): Add can_icf_inline_merge_sections field.
4547 (Target::do_can_check_for_function_pointers): New virtual
4548 function.
4549 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4550 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4551 from can_check_for_function_pointers, move in file.
4552 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4553 section_may_have_icf_unsafe_poineters, move in file.
4554 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4555 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4556 Rename from can_check_for_function_pointers, move in file.
4557 (Target_i386::can_icf_inline_merge_sections): Remove.
4558 (Target_i386::i386_info): Initialize
4559 can_icf_inline_merge_sections.
4560 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4561 Initialize can_icf_inline_merge_sections.
4562 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4563 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4564 Rename from can_check_for_function_pointers, move in file.
4565 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4566 (Target_x86_64::x86_64_info): Initialize
4567 can_icf_inline_merge_sections.
4568 * testsuite/testfile.cc (Target_test::test_target_info):
4569 Likewise.
4570 * icf.cc (get_section_contents): Correct formatting.
4571
6d1c4efb
ILT
45722011-06-27 Ian Lance Taylor <iant@google.com>
4573
4574 * symtab.cc (Symbol::versioned_name): New function.
4575 (Symbol_table::add_to_final_symtab): Use versioned_name when
4576 appropriate.
4577 (Symbol_table::sized_write_symbol): Likewise.
4578 * symtab.h (class Symbol): Declare versioned_name.
4579 * stringpool.h (class Stringpool_template): Add variant of add
4580 which takes a std::basic_string.
4581 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4582 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4583 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4584 (ver_test_12.o): New target.
4585 * testsuite/Makefile.in: Rebuild.
4586
57eb9b50
DK
45872011-06-27 Doug Kwan <dougkwan@google.com>
4588
4589 * arm.cc (Arm_relocate_functions::thm_jump8,
4590 Arm_relocate_functions::thm_jump11): Use a wider signed
4591 type to compute offset.
4592 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4593 arm_thm_jump8.
4594 * testsuite/Makefile.in: Regenerate.
4595 * testsuite/arm_branch_in_range.sh: Check test results of
4596 arm_thm_jump11 and arm_thm_jump8.
4597 * testsuite/arm_thm_jump11.s: New test source file.
4598 * testsuite/arm_thm_jump11.t: New linker script.
4599 * testsuite/arm_thm_jump8.s: New test source file.
4600 * testsuite/arm_thm_jump8.t: New linker script.
4601
487b39df
ILT
46022011-06-24 Ian Lance Taylor <iant@google.com>
4603
4604 * layout.cc: Include "object.h".
4605 (ctors_sections_in_init_array): New static variable.
4606 (Layout::is_ctors_in_init_array): New function.
4607 (Layout::layout): Add entry to ctors_sections_in_init_array if
4608 appropriate.
4609 * layout.h (class Layout): Declare is_ctors_in_init_array.
4610 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4611 is_ctors_reverse_view is set.
4612 (Sized_relobj_file::write_sections): Add layout parameter. Change
4613 all callers. Set is_ctors_reverse_view field of View_size.
4614 (Sized_relobj_file::reverse_words): New function.
4615 * object.h (Sized_relobj_file::View_size): Add
4616 is_ctors_reverse_view field.
4617 (class Sized_relobj_file): Update declarations.
4618 * testsuite/initpri3.c: New test.
4619 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4620 initpri3b.
4621 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4622 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4623 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4624 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4625 * testsuite/Makefile.in: Rebuild.
4626
472076e4
CC
46272011-06-24 Cary Coutant <ccoutant@google.com>
4628
4629 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4630 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4631 (debug_msg_cdebug.err): New targets.
4632 * testsuite/Makefile.in: Regenerate.
4633 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4634 Fix checks for link with shared library.
4635
a60af0db
DK
46362011-06-24 Doug Kwan <dougkwan@google.com>
4637
4638 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4639 skip empty text sections.
4640 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4641
5393d741
ILT
46422011-06-22 Ian Lance Taylor <iant@google.com>
4643
4644 PR gold/12910
4645 * options.h (class General_options): Add --ctors-in-init-array.
4646 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4647 friends as SHT_PROGBITS for merging sections.
4648 (Layout::layout): Remove special handling of .init_array and
4649 friends. Don't sort if doing relocatable link. Sort for .ctors
4650 and .dtors if ctors_in_init_array.
4651 (Layout::make_output_section): Force correct section types for
4652 .init_array and friends. Don't sort if doing relocatable link,
4653 Don't sort .ctors and .dtors if ctors_in_init_array.
4654 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4655 (Layout::output_section_name): Add relobj parameter. Change all
4656 callers. Handle .ctors. and .dtors. in code rather than table.
4657 Handle .ctors and .dtors if ctors_in_init_array.
4658 (Layout::match_file_name): New function, moved from output.cc.
4659 * layout.h (class Layout): Update declarations.
4660 * output.cc: Include "layout.h".
4661 (Input_section_sort_entry::get_priority): New function.
4662 (Input_section_sort_entry::match_file_name): Just call
4663 Layout::match_file_name.
4664 (Output_section::Input_section_sort_init_fini_compare::operator()):
4665 Handle .ctors and .dtors. Sort by explicit priority rather than
4666 by name.
4667 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4668 * testsuite/initpri2.c: New test.
4669 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4670 (check_PROGRAMS): Add initpri2.
4671 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4672 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4673 * configure, testsuite/Makefile.in: Rebuild.
4674
e1f74f98
ILT
46752011-06-19 Ian Lance Taylor <iant@google.com>
4676
4677 PR gold/12880
4678 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4679 .interp section to a PT_INTERP segment even if we have seen a
4680 --dynamic-linker option. Don't do it if we have seen a PHDRS
4681 clause in a linker script.
4682 (Layout::finalize): Don't create a .interp section if we've
4683 already create a PT_INTERP segment.
4684 (Layout::create_interp): Always call choose_output_section (revert
4685 patch of 2011-06-17). Don't create PT_INTERP segment.
4686 * script-sections.cc
4687 (Script_sections::create_note_and_tls_segments): Add a .interp
4688 section to a PT_INTERP segment even if we have seen a
4689 --dynamic-linker option.
4690
766f91bb
ILT
46912011-06-18 Ian Lance Taylor <iant@google.com>
4692
4693 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
4694 merely because a non-PT_LOAD segment has a dynamic reloc.
4695
0d212c3a
ILT
46962011-06-18 Ian Lance Taylor <iant@google.com>
4697
4698 * layout.cc (Layout::finish_dynamic_section): Don't create
4699 DT_FLAGS entry if not needed.
4700
911a5072
ILT
47012011-06-18 Ian Lance Taylor <iant@google.com>
4702
4703 PR gold/12745
4704 * layout.cc (Layout::layout_eh_frame): Correct handling of
4705 writable .eh_frame section.
4706
534b4e5f
ILT
47072011-06-17 Ian Lance Taylor <iant@google.com>
4708
4709 PR gold/12893
4710 * resolve.cc (Symbol_table::resolve): Don't give an error if a
4711 symbol is redefined with the exact same object and value.
4712
10b4f102
ILT
47132011-06-17 Ian Lance Taylor <iant@google.com>
4714
4715 PR gold/12880
4716 * layout.h (class Layout): Add interp_segment_ field.
4717 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
4718 (Layout::attach_allocated_section_to_segment): If making shared
4719 library, put .interp section in PT_INTERP segment.
4720 (Layout::finalize): Also call create_interp if -dynamic-linker
4721 option was used.
4722 (Layout::create_interp): Assert that there is no PT_INTERP
4723 segment. If not using a SECTIONS clause, use make_output_section.
4724 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
4725 * script-sections.cc
4726 (Script_sections::create_note_and_tls_segments): If making shared
4727 library, put .interp section in PT_INTERP segment.
4728
a29b0dad
ILT
47292011-06-17 Ian Lance Taylor <iant@google.com>
4730
e588ea8d
ILT
4731 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
4732 when making a shared library.
4733
47342011-06-17 Ian Lance Taylor <iant@google.com>
4735
4736 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
4737 parameter. Change all callers. Don't issue warning about PC32
4738 against locally defined symbol.
a29b0dad 4739
9d3b0698
ILT
47402011-06-16 Ian Lance Taylor <iant@google.com>
4741
4742 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
4743 occurs in same object.
4744
85b0f90c
AM
47452011-06-14 Alan Modra <amodra@gmail.com>
4746
4747 * po/POTFILES.in: Regenerate.
4748
a94907d9
ILT
47492011-06-09 Ian Lance Taylor <iant@google.com>
4750
4751 * script-sections.cc
4752 (Orphan_output_section::set_section_addresses): For a relocatable
4753 link set address to 0.
4754
4fb3a1c3
CC
47552011-06-09 Cary Coutant <ccoutant@google.com>
4756
4757 PR gold/12804
4758 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
4759 used with --compress-debug-sections.
4760 * gold/object.cc (Sized_relobj_file::do_layout): Report
4761 uncompressed size of compressed input sections.
4762
61220854
CC
47632011-06-08 Cary Coutant <ccoutant@google.com>
4764
4765 PR gold/12804
4766 * testsuite/two_file_test_2_v1.cc: Change initialization of
4767 v2 to keep it in .data.
4768
e6455dfb
CC
47692011-06-07 Cary Coutant <ccoutant@google.com>
4770
4771 * common.cc (Symbol_table::do_allocate_commons_list): Call
4772 gold_fallback.
4773 * errors.cc (Errors::fatal): Adjust call to gold_exit.
4774 (Errors::fallback): New function.
4775 (gold_fallback): New function.
4776 * errors.h (Errors::fallback): New function.
4777 * gold.cc (gold_exit): Change status parameter to enum; adjust
4778 all callers.
4779 (queue_initial_tasks): Call gold_fallback.
4780 * gold.h: Include cstdlib.
4781 (Exit_status): New enum type.
4782 (gold_exit): Change status parameter to enum.
4783 (gold_fallback): New function.
4784 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
4785 (Layout::create_symtab_sections): Likewise.
4786 (Layout::create_shdrs): Likewise.
4787 * main.cc (main): Adjust call to gold_exit.
4788 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
4789 (Output_data_got::add_got_entry_pair): Likewise.
4790 (Output_section::add_input_section): Likewise.
4791 (Output_section::add_output_section_data): Likewise.
4792 (Output_segment::set_section_list_addresses): Likewise.
4793 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
4794
fb0e076f
CC
47952011-06-07 Cary Coutant <ccoutant@google.com>
4796
4797 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
4798 for incremental links.
4799 * output.cc (Output_segment::set_section_list_addresses): Remove
4800 FIXME and test for TLS or BSS.
4801
a5ee4d5d
CC
48022011-06-07 Cary Coutant <ccoutant@google.com>
4803
4804 * testsuite/Makefile.am: Add incremental_copy_test,
4805 incremental_common_test_1.
4806 * testsuite/Makefile.in: Regenerate.
4807 * testsuite/common_test_1_v1.c: New source file.
4808 * testsuite/common_test_1_v2.c: New source file.
4809 * testsuite/copy_test_v1.cc: New source file.
4810
5146f448
CC
48112011-06-07 Cary Coutant <ccoutant@google.com>
4812
4813 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
4814 update, allocate common from bss section's free list.
4815 * incremental-dump.cc (dump_incremental_inputs): Print flag for
4816 linker-defined symbols.
4817 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4818 Skip GOT and PLT entries that are no longer referenced.
4819 (Output_section_incremental_inputs::write_info_blocks): Mark
4820 linker-defined symbols.
4821 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
4822 * output.cc (Output_section::allocate): New function.
4823 * output.h (Output_section::allocate): New function.
4824 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
4825 linker-defined symbols.
4826 (Symbol::override_base_with_special): Copy is_predefined_ flag.
4827 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
4828 (Symbol::init_base_output_data): Likewise.
4829 (Symbol::init_base_output_segment): Likewise.
4830 (Symbol::init_base_constant): Likewise.
4831 (Sized_symbol::init_output_data): Likewise.
4832 (Sized_symbol::init_output_segment): Likewise.
4833 (Sized_symbol::init_constant): Likewise.
4834 (Symbol_table::do_define_in_output_data): Likewise.
4835 (Symbol_table::do_define_in_output_segment): Likewise.
4836 (Symbol_table::do_define_as_constant): Likewise.
4837 * symtab.h (Symbol::is_predefined): New function.
4838 (Symbol::init_base_output_data): Add is_predefined parameter.
4839 (Symbol::init_base_output_segment): Likewise.
4840 (Symbol::init_base_constant): Likewise.
4841 (Symbol::is_predefined_): New data member.
4842 (Sized_symbol::init_output_data): Add is_predefined parameter.
4843 (Sized_symbol::init_output_segment): Likewise.
4844 (Sized_symbol::init_constant): Likewise.
4845 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
4846
26d3c67d
CC
48472011-06-07 Cary Coutant <ccoutant@google.com>
4848
4849 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
4850 instead of emit_copy_reloc.
4851 (Copy_relocs::emit_copy_reloc): Refactor.
4852 (Copy_relocs::make_copy_reloc): New function.
4853 (Copy_relocs::add_copy_reloc): Remove.
4854 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
4855 section.
4856 (Copy_relocs::make_copy_reloc): New function.
4857 (Copy_relocs::add_copy_reloc): Remove.
4858 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
4859 unchanged input files.
4860 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
4861 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
4862 Reserve BSS space for COPY relocations.
4863 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4864 (Output_section_incremental_inputs::write_info_blocks): Record
4865 whether a symbol is copied from a shared object.
4866 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
4867 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
4868 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
4869 (Incremental_input_entry_reader::get_output_symbol_index): Add
4870 is_copy parameter.
4871 (Incremental_binary::emit_copy_relocs): New function.
4872 (Incremental_binary::do_emit_copy_relocs): New function.
4873 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4874 new data member.
4875 (Sized_incremental_binary::add_copy_reloc): New function.
4876 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4877 (Sized_incremental_binary::Copy_reloc): New struct.
4878 (Sized_incremental_binary::Copy_relocs): New typedef.
4879 (Sized_incremental_binary::copy_relocs_): New data member.
4880 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
4881 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
4882 * target.h (Sized_target::emit_copy_reloc): New function.
4883 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
4884
7cdb37d9
CC
48852011-06-02 Cary Coutant <ccoutant@google.com>
4886
4887 PR gold/12163
4888 * gold/archive.cc (Archive::Archive): Initialize new data member.
4889 (Archive::include_all_members): Return if archive has already been
4890 included.
4891 * gold/archive.h (Archive::include_all_members_): New data member.
4892
cc643b88
NC
48932011-06-02 Nick Clifton <nickc@redhat.com>
4894
4895 * dynobj.h: Fix spelling mistake in comment.
4896 * output.cc: Likewise.
4897
f62a3ca7 48982011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 4899 Asier Llano
f62a3ca7
DK
4900
4901 PR gold/12826
cc643b88 4902 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
4903 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4904 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4905 redundant arm_exidx_test.so.
4906 * testsuite/Makefile.in: Regenerate.
4907 (check_SCRIPTS): Add pr12826.sh
4908 (check_DATA): Add pr12826.stdout
4909 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4910 * testsuite/pr12826.sh: New file.
4911 * testsuite/pr12826_1.s: Ditto.
4912 * testsuite/pr12826_1.s: Ditto.
4913
8dbe1edc
ILT
49142011-05-30 Ian Lance Taylor <iant@google.com>
4915
4916 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4917 sections.
4918
c49875be
ILT
49192011-05-29 Ian Lance Taylor <iant@google.com>
4920
4921 PR gold/12804
4922 * testsuite/Makefile.am: Use different file name for two_file_test
4923 temporary file for each incremental test.
4924 * testsuite/Makefile.in: Rebuild.
4925
69d53f7a
ILT
49262011-05-29 Ian Lance Taylor <iant@google.com>
4927
4928 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4929 binary input file is empty.
4930
41d0ab5f
ILT
49312011-05-27 Ian Lance Taylor <iant@google.com>
4932
4933 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4934 (ver_test_9.so): Likewise.
4935 * testsuite/Makefile.in: Rebuild.
4936
89d8a36b
CC
49372011-05-26 Cary Coutant <ccoutant@google.com>
4938
4939 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4940 * incremental.cc (Incremental_inputs::report_input_section): Fix
4941 comment, indentation.
4942 (Incremental_inputs::report_comdat_group): New function.
4943 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4944 of data for incremental input file entry.
4945 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
4946 group count, COMDAT group signatures.
4947 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
4948 an unchanged input file.
4949 * incremental.h (Incremental_object_entry::Incremental_object_entry):
4950 Initialize new data member.
4951 (Incremental_object_entry::add_comdat_group): New function.
4952 (Incremental_object_entry::get_comdat_group_count): New function.
4953 (Incremental_object_entry::get_comdat_signature_key): New function.
4954 (Incremental_object_entry::groups_): New data member.
4955 (Incremental_inputs::report_comdat_group): New function.
4956 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
4957 data for incremental input file entry.
4958 (Incremental_input_entry_reader::get_comdat_group_count): New function.
4959 (Incremental_input_entry_reader::get_input_section): Adjust size of
4960 data for incremental input file entry.
4961 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
4962 (Incremental_input_entry_reader::get_comdat_group_signature): New
4963 function.
4964 * object.cc (Sized_relobj::include_section_group): Report kept
4965 COMDAT groups for incremental links.
4966
1706a06f
ILT
49672011-05-24 David Meyer <pdox@google.com>
4968
4969 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
4970 with name parameter. Add found_name parameter.
4971 * fileread.cc (Input_file::find_file): Adjust code accordingly.
4972 * dirsearch.h (class Dirsearch): Update declaration.
4973
a10ae760
ILT
49742011-05-24 Ian Lance Taylor <iant@google.com>
4975
4976 * archive.cc (Library_base::should_include_member): Pull in object
4977 from archive if it defines the entry symbol.
4978 * parameters.cc (Parameters::entry): New function.
4979 * parameters.h (class Parameters): Declare entry.
4980 * output.h (class Output_file_header): Remove entry_ field.
4981 * output.cc (Output_file_header::Output_file_header): Remove entry
4982 parameter. Change all callers.
4983 (Output_file_header::entry): Use parameters->entry.
4984 * gold.cc (queue_middle_tasks): Likewise.
4985 * plugin.cc (Plugin_hook::run): Likewise.
4986
aa92d6ed
CC
49872011-05-24 Cary Coutant <ccoutant@google.com>
4988
4989 * gold.cc (queue_initial_tasks): Pass incremental base filename
4990 to Output_file::open_base_file; don't print error message.
4991 * incremental-dump.cc (main): Adjust call to
4992 Output_file::open_for_modification.
4993 * incremental-dump.cc (main): Likewise.
4994 * incremental.cc (Incremental_inputs::report_command_line):
4995 Ignore --incremental-base option when comparing command lines.
4996 Ignore parameter when given as separate argument.
4997 * options.h (class General_options): Add --incremental-base.
4998 * output.cc (Output_file::Output_file):
4999 (Output_file::open_base_file): Add base_name and writable parameters;
5000 read base file into new file; print error message here.
5001 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5002 callers.
5003 * output.h (Output_file::open_for_modification): Rename to...
5004 (Output_file::open_base_file): ...this; add base_name and
5005 writable parameters; adjust all callers.
5006 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5007 callers.
5008 * testsuite/Makefile.am (incremental_test_4): Test
5009 --incremental-base.
5010 * testsuite/Makefile.in: Regenerate.
5011
2eedd706
CC
50122011-05-24 Cary Coutant <ccoutant@google.com>
5013
5014 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5015 incremental_test_4.
5016 * testsuite/Makefile.in: Regenerate.
5017 * testsuite/two_file_test_1_v1.cc: New test source file.
5018 * testsuite/two_file_test_1b_v1.cc: New test source file.
5019 * testsuite/two_file_test_2_v1.cc: New test source file.
5020
0f1c85a6
CC
50212011-05-24 Cary Coutant <ccoutant@google.com>
5022
5023 * dynobj.h (Dynobj::do_dynobj): New function.
5024 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5025 flag and soname for shared objects.
5026 * incremental.cc (Incremental_inputs::report_object): Make
5027 either Incremental_object_entry or Incremental_dynobj_entry; add
5028 soname to string table.
5029 (Incremental_inputs::report_input_section): Add assertion.
5030 (Output_section_incremental_inputs::set_final_data_size): Adjust
5031 type of input file entry for shared libraries; adjust size of
5032 shared library info entry.
5033 (Output_section_incremental_inputs::write_input_files): Write
5034 as_needed flag for shared libraries.
5035 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5036 of input file entry for shared libraries; write soname.
5037 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5038 soname from incremental info.
5039 * incremental.h (enum Incremental_input_flags): Add
5040 INCREMENTAL_INPUT_AS_NEEDED.
5041 (Incremental_input_entry::Incremental_input_entry): Initialize new
5042 data member.
5043 (Incremental_input_entry::set_as_needed): New function.
5044 (Incremental_input_entry::as_needed): New function.
5045 (Incremental_input_entry::do_dynobj_entry): New function.
5046 (Incremental_input_entry::as_needed_): New data member.
5047 (Incremental_object_entry::Incremental_object_entry): Don't check
5048 for shared library.
5049 (Incremental_object_entry::do_type): Likewise.
5050 (class Incremental_dynobj_entry): New class.
5051 (Incremental_input_entry_reader::as_needed): New function.
5052 (Incremental_input_entry_reader::get_soname): New function.
5053 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5054 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5055 size of shared library info entry.
58797674 5056 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5057 incremental link when adding DT_NEEDED entries.
5058 * object.h (Object::Object): Initialize new data member.
5059 (Object::dynobj): New function.
5060 (Object::set_as_needed): New function.
5061 (Object::as_needed): New function.
5062 (Object::do_dynobj): New function.
5063 (Object::as_needed_): New data member.
5064
6fa2a40b
CC
50652011-05-24 Cary Coutant <ccoutant@google.com>
5066
5067 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5068 info; adjust display of GOT entries.
5069 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5070 vector of input objects; remove file_status_.
5071 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5072 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5073 got_plt reader; call target hooks to reserve GOT entries.
5074 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5075 of input file info header and GOT info entry.
5076 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5077 relocation info.
5078 (Got_plt_view_info::got_descriptor): Remove.
5079 (Got_plt_view_info::sym_index): New data member.
5080 (Got_plt_view_info::input_index): New data member.
5081 (Local_got_offset_visitor::visit): Write input file index.
5082 (Global_got_offset_visitor::visit): Write 0 for input file index.
5083 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5084 with sym_index and input_index.
5085 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5086 incremental info GOT entry; replace got_descriptor with input_index.
5087 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5088 map from input file index to object.
5089 (Sized_relobj_incr::do_layout): Replace direct data member reference
5090 with accessor function.
5091 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5092 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5093 Adjust size of input file info header.
5094 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5095 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5096 (Incremental_input_entry_reader::get_input_section): Adjust size of
5097 input file info header.
5098 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5099 of incremental info GOT entry.
5100 (Incremental_got_plt_reader::get_got_desc): Remove.
5101 (Incremental_got_plt_reader::get_got_symndx): New function.
5102 (Incremental_got_plt_reader::get_got_input_index): New function.
5103 (Sized_incremental_binary::Sized_incremental_binary): Remove
5104 file_status_; add input_objects_.
5105 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5106 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5107 (Sized_incremental_binary::file_is_unchanged): Remove.
5108 (Sized_incremental_binary::set_input_object): New function.
5109 (Sized_incremental_binary::input_object): New function.
5110 (Sized_incremental_binary::file_status_): Remove.
5111 (Sized_incremental_binary::input_objects_): New data member.
5112 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5113 references.
5114 (Sized_relobj_incr::invalid_address): Move to base class.
5115 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5116 class.
5117 (Sized_relobj_incr::do_output_section_offset): Likewise.
5118 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5119 (Sized_relobj_incr::section_offsets_): Likewise.
5120 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5121 function.
5122 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5123 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5124 with accessor function.
5125 (Sized_relobj_file::do_layout): Likewise.
5126 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5127 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5128 (Sized_relobj_file::compute_final_local_value): Replace refs to
5129 section_offsets_ with accessor function.
5130 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5131 * object.h (Relobj::Relobj): Initialize new data members.
5132 (Relobj::add_dyn_reloc): New function.
5133 (Relobj::first_dyn_reloc): New function.
5134 (Relobj::dyn_reloc_count): New function.
5135 (Relobj::first_dyn_reloc_): New data member.
5136 (Relobj::dyn_reloc_count_): New data member.
5137 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5138 references.
5139 (Sized_relobj::Address): New typedef.
5140 (Sized_relobj::invalid_address): Move here from child class.
5141 (Sized_relobj::Sized_relobj): Initialize new data members.
5142 (Sized_relobj::sized_relobj): New function.
5143 (Sized_relobj::is_output_section_offset_invalid): Move here from
5144 child class.
5145 (Sized_relobj::get_output_section_offset): Likewise.
5146 (Sized_relobj::local_has_got_offset): Likewise.
5147 (Sized_relobj::local_got_offset): Likewise.
5148 (Sized_relobj::set_local_got_offset): Likewise.
5149 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5150 (Sized_relobj::clear_got_offsets): New function.
5151 (Sized_relobj::section_offsets): Move here from child class.
5152 (Sized_relobj::do_output_section_offset): Likewise.
5153 (Sized_relobj::do_set_section_offset): Likewise.
5154 (Sized_relobj::Local_got_offsets): Likewise.
5155 (Sized_relobj::local_got_offsets_): Likewise.
5156 (Sized_relobj::section_offsets_): Likewise.
5157 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5158 references.
5159 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5160 class.
5161 (Sized_relobj_file::sized_relobj): New function
5162 (Sized_relobj_file::local_has_got_offset): Move to base class.
5163 (Sized_relobj_file::local_got_offset): Likewise.
5164 (Sized_relobj_file::set_local_got_offset): Likewise.
5165 (Sized_relobj_file::get_output_section_offset): Likewise.
5166 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5167 (Sized_relobj_file::do_output_section_offset): Likewise.
5168 (Sized_relobj_file::do_set_section_offset): Likewise.
5169 (Sized_relobj_file::Local_got_offsets): Likewise.
5170 (Sized_relobj_file::local_got_offsets_): Likewise.
5171 (Sized_relobj_file::section_offsets_): Likewise.
5172 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5173 (all constructors).
5174 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5175 (Output_reloc::get_symbol_index): Likewise.
5176 (Output_reloc::local_section_offset): Likewise.
5177 (Output_reloc::get_address): Likewise.
5178 (Output_reloc::symbol_value): Likewise.
5179 (Output_data_got::reserve_slot): Move to class definition.
5180 (Output_data_got::reserve_local): New function.
5181 (Output_data_got::reserve_slot_for_global): Remove.
5182 (Output_data_got::reserve_global): New function.
5183 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5184 (all constructors, two instantiations).
5185 (Output_reloc::get_relobj): New function (two instantiations).
5186 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5187 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5188 (Output_data_reloc::add_global): Adjust type of relobj.
5189 (Output_data_reloc::add_global_relative): Likewise.
5190 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5191 (Output_data_reloc::add_local): Likewise.
5192 (Output_data_reloc::add_local_relative): Likewise.
5193 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5194 (Output_data_reloc::add_local_section): Likewise.
5195 (Output_data_reloc::add_output_section): Likewise.
5196 (Output_data_reloc::add_absolute): Likewise.
5197 (Output_data_reloc::add_target_specific): Likewise.
5198 (Output_data_got::reserve_slot): Move definition here.
5199 (Output_data_got::reserve_local): New function.
5200 (Output_data_got::reserve_global): New function.
5201 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5202 section_offsets_ with accessor function.
5203 (Sized_relobj_file::write_sections): Likewise.
5204 (Sized_relobj_file::do_relocate_sections): Likewise.
5205 * target.h (Sized_target::reserve_local_got_entry): New function.
5206 (Sized_target::reserve_global_got_entry): New function.
5207 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5208 (Target_x86_64::reserve_global_got_entry): New function.
5209 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5210
4829d394
CC
52112011-05-23 Cary Coutant <ccoutant@google.com>
5212
5213 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5214 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5215 bit when checking got_type.
5216 * incremental.cc (Sized_incremental_binary::setup_readers):
5217 Store symbol table and string table locations; initialize bit vector
5218 of file status flags.
5219 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5220 unchanged files.
5221 (Sized_incremental_binary::do_process_got_plt): New function.
5222 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5223 (Output_section_incremental_inputs::set_final_data_size): Record
5224 file index for each input file.
5225 (Output_section_incremental_inputs::write_got_plt): Store file index
5226 instead of input entry offset for each GOT entry.
5227 * incremental.h
5228 (Incremental_input_entry::Incremental_input_entry): Initialize new
5229 data member.
5230 (Incremental_input_entry::set_offset): Store file index.
5231 (Incremental_input_entry::get_file_index): New function.
5232 (Incremental_input_entry::file_index_): New data member.
5233 (Incremental_binary::process_got_plt): New function.
5234 (Incremental_binary::do_process_got_plt): New function.
5235 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5236 data members.
5237 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5238 (Sized_incremental_binary::set_file_is_unchanged): New function.
5239 (Sized_incremental_binary::file_is_unchanged): New function.
5240 (Sized_incremental_binary::do_process_got_plt): New function.
5241 (Sized_incremental_binary::file_status_): New data member.
5242 (Sized_incremental_binary::main_symtab_loc_): New data member.
5243 (Sized_incremental_binary::main_strtab_loc_): New data member.
5244 * output.cc (Output_data_got::Got_entry::write): Add case
5245 RESERVED_CODE.
5246 (Output_data_got::add_global): Call add_got_entry.
5247 (Output_data_got::add_global_plt): Likewise.
5248 (Output_data_got::add_global_with_rel): Likewise.
5249 (Output_data_got::add_global_with_rela): Likewise.
5250 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5251 (Output_data_got::add_global_pair_with_rela): Likewise.
5252 (Output_data_got::add_local): Call add_got_entry.
5253 (Output_data_got::add_local_plt): Likewise.
5254 (Output_data_got::add_local_with_rel): Likewise.
5255 (Output_data_got::add_local_with_rela): Likewise.
5256 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5257 (Output_data_got::add_local_pair_with_rela): Likewise.
5258 (Output_data_got::reserve_slot): New function.
5259 (Output_data_got::reserve_slot_for_global): New function.
5260 (Output_data_got::add_got_entry): New function.
5261 (Output_data_got::add_got_entry_pair): New function.
5262 (Output_section::add_output_section_data): Edit FIXME.
5263 * output.h
5264 (Output_section_data_build::Output_section_data_build): New
5265 constructor with size parameter.
5266 (Output_data_space::Output_data_space): Likewise.
5267 (Output_data_got::Output_data_got): Initialize new data member; new
5268 constructor with size parameter.
5269 (Output_data_got::add_constant): Call add_got_entry.
5270 (Output_data_got::reserve_slot): New function.
5271 (Output_data_got::reserve_slot_for_global): New function.
5272 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5273 (Output_data_got::add_got_entry): New function.
5274 (Output_data_got::add_got_entry_pair): New function.
5275 (Output_data_got::free_list_): New data member.
5276 * target.h (Sized_target::init_got_plt_for_update): New function.
5277 (Sized_target::register_global_plt_entry): New function.
5278 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5279 Initialize new data member; call init; add constructor with PLT count.
5280 (Output_data_plt_x86_64::init): New function.
5281 (Output_data_plt_x86_64::add_relocation): New function.
5282 (Output_data_plt_x86_64::reserve_slot): New function.
5283 (Output_data_plt_x86_64::free_list_): New data member.
5284 (Target_x86_64::init_got_plt_for_update): New function.
5285 (Target_x86_64::register_global_plt_entry): New function.
5286 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5287 incremental updates.
5288 (Output_data_plt_x86_64::add_relocation): New function.
5289 * testsuite/object_unittest.cc (Object_test): Set default options.
5290
ec69d6da
ILT
52912011-05-16 Ian Lance Taylor <iant@google.com>
5292
5293 * options.h (class General_options): Make -i a synonym for -r.
5294
732e31de
ILT
52952011-05-16 Ian Lance Taylor <iant@google.com>
5296
5297 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5298
403676b5
CC
52992011-05-10 Cary Coutant <ccoutant@google.com>
5300
5301 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5302 strip_all (-s).
5303
5b7b7d6e
ILT
53042011-05-06 Ian Lance Taylor <iant@google.com>
5305
5306 * layout.cc (Layout::layout): If the output section flags change,
5307 update the ordering.
5308
f0f9babf
CC
53092011-04-25 Cary Coutant <ccoutant@google.com>
5310
5311 * incremental-dump.cc (dump_incremental_inputs): Print local
5312 symbol info for each input file.
5313 * incremental.cc
5314 (Output_section_incremental_inputs::set_final_data_size): Add local
5315 symbol info to input file entries in incremental info.
5316 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5317 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5318 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5319 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5320 implementation.
5321 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5322 (Sized_incr_relobj::do_relocate): Write the local symbols.
5323 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5324 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5325 Adjust size of input file header.
5326 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5327 (Incremental_inputs_reader::get_local_symbol_count): New function.
5328 (Incremental_inputs_reader::get_input_section): Adjust size of input
5329 file header.
5330 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5331 (Sized_incr_relobj::This): New typedef.
5332 (Sized_incr_relobj::sym_size): New const data member.
5333 (Sized_incr_relobj::Local_symbol): New struct.
5334 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5335 (Sized_incr_relobj::do_local_symbol_offset): New function.
5336 (Sized_incr_relobj::local_symbol_count_): New data member.
5337 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5338 (Sized_incr_relobj::local_symbol_index_): New data member.
5339 (Sized_incr_relobj::local_symbol_offset_): New data member.
5340 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5341 (Sized_incr_relobj::local_symbols_): New data member.
5342 * object.h (Relobj::output_local_symbol_count): New function.
5343 (Relobj::local_symbol_offset): New function.
5344 (Relobj::do_output_local_symbol_count): New function.
5345 (Relobj::do_local_symbol_offset): New function.
5346 (Sized_relobj::do_output_local_symbol_count): New function.
5347 (Sized_relobj::do_local_symbol_offset): New function.
5348
d0a9ace3
ILT
53492011-04-22 Vladimir Simonov <sv@sw.ru>
5350
5351 * descriptors.cc (set_close_on_exec): New function.
5352 (Descriptors::open): Use set_close_on_exec.
5353 * output.cc (S_ISLNK): Define if not defined.
5354
94a3fc8b
CC
53552011-04-22 Cary Coutant <ccoutant@google.com>
5356
5357 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5358 global symbol map.
5359 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5360 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5361 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5362 relocations.
5363 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5364 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5365 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5366 * incremental.h
5367 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5368 function.
5369 (Incremental_binary::apply_incremental_relocs): New function.
5370 (Incremental_binary::do_apply_incremental_relocs): New function.
5371 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5372 data member.
5373 (Sized_incremental_binary::add_global_symbol): New function.
5374 (Sized_incremental_binary::global_symbol): New function.
5375 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5376 (Sized_incremental_binary::symbol_map_): New data member.
5377 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5378 * target.h (Sized_target::apply_relocation): New function.
5379 * target-reloc.h (apply_relocation): New function.
5380 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5381
c87e4302
DK
53822011-04-22 Doug Kwan <dougkwan@google.com>
5383
5384 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5385 flag of a SHT_ARM_EXIDX section.
2e702c99 5386 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5387 * testsuite/Makefile.in: Regenerate.
5388 * testsuite/arm_exidx_test.s: New file.
5389 * testsuite/arm_exidx_test.sh: Same.
5390
e7782cf6
CC
53912011-04-20 Cary Coutant <ccoutant@google.com>
5392
5393 PR gold/12689
5394 * archive.h (Incremental_archive_entry::Archive_member):
5395 Initialize arg_serial_ (second constructor).
5396
308ecdc7
ILT
53972011-04-17 Ian Lance Taylor <iant@google.com>
5398
5399 * object.cc (Relocate_info::location): Simplify location string.
5400 * errors.cc (Errors::error_at_location): Don't print program
5401 name.
5402 (Errors::warning_at_location): Likewise.
5403 (Errors::undefined_symbol): Likewise.
5404 * testsuite/debug_msg.sh: Update accordingly.
5405
bec5b579
CC
54062011-04-14 Cary Coutant <ccoutant@google.com>
5407
5408 * gold/layout.cc (Layout::symtab_section_offset): New function.
5409 * gold/layout.h (Layout::symtab_section_offset): New function.
5410 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5411
88597d34
ILT
54122011-04-12 Ian Lance Taylor <iant@google.com>
5413
5414 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5415 with MREMAP_MAYMOVE.
5416 * output.h (class Output_file): Add map_is_allocated_ field.
5417 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5418 not available, provide stubs. If mremap is not available, #define
5419 it to gold_mremap.
5420 (MREMAP_MAYMOVE): Define if not defined.
5421 (Output_file::Output_file): Initialize map_is_allocated_.
5422 (Output_file::resize): Check map_is_allocated_.
5423 (Output_file::map_anonymous): If mmap fails, use malloc.
5424 (Output_file::unmap): Don't do anything for an anonymous map.
5425 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5426 is not available, provide stubs.
5427 (File_read::View::~View): Use free rather than delete[].
5428 (File_read::make_view): Use malloc rather than new[]. If mmap
5429 fails, use malloc.
5430 (File_read::find_or_make_view): Use malloc rather than new[].
5431 * gold.h: Remove HAVE_REMAP code.
5432 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5433 exists. Rename mremap to gold_mremap. If mmap is not available
5434 don't do anything.
5435 * configure, config.in: Rebuild.
5436
11e361bc
ILT
54372011-04-11 Ian Lance Taylor <iant@google.com>
5438
5439 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5440 initialize local variable v.
5441
cdc29364
CC
54422011-04-11 Cary Coutant <ccoutant@google.com>
5443
5444 * archive.cc (Archive::include_member): Adjust call to
5445 report_object.
5446 (Add_archive_symbols::run): Track argument serial numbers.
5447 (Lib_group::include_member): Likewise.
5448 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5449 * archive.h (Incremental_archive_entry::Archive_member):
5450 Initialize arg_serial_.
5451 (Archive_member::arg_serial_): New data member.
5452 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5453 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5454 incremental link.
5455 (Sized_dynobj::do_for_all_local_got_entries): New function.
5456 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5457 function.
5458 * fileread.cc (get_mtime): New function.
5459 * fileread.h (get_mtime): New function.
5460 * gold.cc (queue_initial_tasks): Check for incremental update.
5461 (process_incremental_input): New function.
5462 (queue_middle_tasks): Don't force valid target for incremental
5463 update.
5464 * incremental-dump.cc (find_input_containing_global): Adjust
5465 size of symbol info entry.
5466 (dump_incremental_inputs): Dump argument serial number and
5467 in_system_directory flag; bias shndx by 1; print symbol names
5468 when dumping per-file symbol lists; use new symbol info readers.
5469 * incremental.cc
5470 (Output_section_incremental_inputs:update_data_size): New function.
5471 (Sized_incremental_binary::setup_readers): Setup input readers
5472 for each input file; build maps for files added from libraries
5473 and scripts.
5474 (Sized_incremental_binary::check_input_args): New function.
5475 (Sized_incremental_binary::do_check_inputs): Build map of argument
5476 serial numbers to input arguments.
5477 (Sized_incremental_binary::do_file_has_changed): Rename
5478 do_file_is_unchanged to this; compare file modification times.
5479 (Sized_incremental_binary::do_init_layout): New function.
5480 (Sized_incremental_binary::do_reserve_layout): New function.
5481 (Sized_incremental_binary::do_get_input_reader): Remove.
5482 (Sized_incremental_binary::get_symtab_view): New function.
5483 (Incremental_checker::can_incrementally_link_output_file): Remove.
5484 (Incremental_inputs::report_command_line): Exclude --debug options.
5485 (Incremental_inputs::report_archive_begin): Add parameter; track
5486 argument serial numbers; don't put input file entry for archive
5487 before archive members.
5488 (Incremental_inputs::report_archive_end): Put input file entry
5489 for archive after archive members.
5490 (Incremental_inputs::report_object): Add parameter; track argument
5491 serial numbers and in_system_directory flag.
5492 (Incremental_inputs::report_script): Add parameter; track argument
5493 serial numbers.
5494 (Output_section_incremental_inputs::set_final_data_size): Adjust
5495 size of symbol info entry; check for forwarding symbols.
5496 (Output_section_incremental_inputs::write_input_files): Write
5497 in_system_directory flag and argument serial number.
5498 (Output_section_incremental_inputs::write_info_blocks): Map section
5499 indices between incremental info and original input file; store
5500 input section index for each symbol.
5501 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5502 change operator() to visit().
5503 (class Global_got_offset_visitor): Likewise.
5504 (class Global_symbol_visitor_got_plt):
5505 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5506 classes.
5507 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5508 (Sized_incr_relobj::do_read_symbols): New function.
5509 (Sized_incr_relobj::do_layout): New function.
5510 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5511 (Sized_incr_relobj::do_add_symbols): New function.
5512 (Sized_incr_relobj::do_should_include_member): New function.
5513 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5514 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5515 (Sized_incr_relobj::do_section_size): New function.
5516 (Sized_incr_relobj::do_section_name): New function.
5517 (Sized_incr_relobj::do_section_contents): New function.
5518 (Sized_incr_relobj::do_section_flags): New function.
5519 (Sized_incr_relobj::do_section_entsize): New function.
5520 (Sized_incr_relobj::do_section_address): New function.
5521 (Sized_incr_relobj::do_section_type): New function.
5522 (Sized_incr_relobj::do_section_link): New function.
5523 (Sized_incr_relobj::do_section_info): New function.
5524 (Sized_incr_relobj::do_section_addralign): New function.
5525 (Sized_incr_relobj::do_initialize_xindex): New function.
5526 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5527 (Sized_incr_relobj::do_read_relocs): New function.
5528 (Sized_incr_relobj::do_gc_process_relocs): New function.
5529 (Sized_incr_relobj::do_scan_relocs): New function.
5530 (Sized_incr_relobj::do_count_local_symbols): New function.
5531 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5532 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5533 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5534 (Sized_incr_relobj::do_relocate): New function.
5535 (Sized_incr_relobj::do_set_section_offset): New function.
5536 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5537 (Sized_incr_dynobj::do_read_symbols): New function.
5538 (Sized_incr_dynobj::do_layout): New function.
5539 (Sized_incr_dynobj::do_add_symbols): New function.
5540 (Sized_incr_dynobj::do_should_include_member): New function.
5541 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5542 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5543 (Sized_incr_dynobj::do_section_size): New function.
5544 (Sized_incr_dynobj::do_section_name): New function.
5545 (Sized_incr_dynobj::do_section_contents): New function.
5546 (Sized_incr_dynobj::do_section_flags): New function.
5547 (Sized_incr_dynobj::do_section_entsize): New function.
5548 (Sized_incr_dynobj::do_section_address): New function.
5549 (Sized_incr_dynobj::do_section_type): New function.
5550 (Sized_incr_dynobj::do_section_link): New function.
5551 (Sized_incr_dynobj::do_section_info): New function.
5552 (Sized_incr_dynobj::do_section_addralign): New function.
5553 (Sized_incr_dynobj::do_initialize_xindex): New function.
5554 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5555 (make_sized_incremental_object): New function.
5556 (Incremental_library::copy_unused_symbols): New function.
5557 (Incremental_library::do_for_all_unused_symbols): New function.
5558 * incremental.h (enum Incremental_input_flags): New type.
5559 (class Incremental_checker): Remove.
5560 (Incremental_input_entry::Incremental_input_entry): Add argument
5561 serial number.
5562 (Incremental_input_entry::arg_serial): New function.
5563 (Incremental_input_entry::set_is_in_system_directory): New function.
5564 (Incremental_input_entry::is_in_system_directory): New function.
5565 (Incremental_input_entry::arg_serial_): New data member.
5566 (Incremental_input_entry::is_in_system_directory_): New data member.
5567 (class Script_info): Move here from script.h.
5568 (Script_info::Script_info): Add filename parameter.
5569 (Script_info::filename): New function.
5570 (Script_info::filename_): New data member.
5571 (Incremental_script_entry::Incremental_script_entry): Add argument
5572 serial number.
5573 (Incremental_object_entry::Incremental_object_entry): Likewise.
5574 (Incremental_object_entry::add_input_section): Build list of input
5575 sections with map to original shndx.
5576 (Incremental_object_entry::get_input_section_index): New function.
5577 (Incremental_object_entry::shndx_): New data member.
5578 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5579 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5580 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5581 serial number.
5582 (Incremental_inputs::report_archive_begin): Likewise.
5583 (Incremental_inputs::report_object): Likewise.
5584 (Incremental_inputs::report_script): Likewise.
5585 (class Incremental_global_symbol_reader): New class.
5586 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5587 and store flags and input file type.
5588 (Incremental_input_entry_reader::arg_serial): New function.
5589 (Incremental_input_entry_reader::type): Extract type from flags.
5590 (Incremental_input_entry_reader::is_in_system_directory): New function.
5591 (Incremental_input_entry_reader::get_input_section_count): Call
5592 accessor function for type.
5593 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5594 function for type; adjust size of global symbol entry.
5595 (Incremental_input_entry_reader::get_global_symbol_count): Call
5596 accessor function for type.
5597 (Incremental_input_entry_reader::get_object_count): Likewise.
5598 (Incremental_input_entry_reader::get_object_offset): Likewise.
5599 (Incremental_input_entry_reader::get_member_count): Likewise.
5600 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5601 (Incremental_input_entry_reader::get_member_offset): Likewise.
5602 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5603 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5604 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5605 (Incremental_input_entry_reader::get_global_symbol_reader): New
5606 function.
5607 (Incremental_input_entry_reader::get_output_symbol_index): New
5608 function.
5609 (Incremental_input_entry_reader::type_): Remove.
5610 (Incremental_input_entry_reader::flags_): New data member.
5611 (Incremental_inputs_reader::input_file_offset): New function.
5612 (Incremental_inputs_reader::input_file_index): New function.
5613 (Incremental_inputs_reader::input_file): Call input_file_offset.
5614 (Incremental_inputs_reader::input_file_at_offset): New function.
5615 (Incremental_relocs_reader::get_r_type): Reformat.
5616 (Incremental_relocs_reader::get_r_shndx): Reformat.
5617 (Incremental_relocs_reader::get_r_offset): Reformat.
5618 (Incremental_relocs_reader::data): New function.
5619 (Incremental_binary::Incremental_binary): Initialize new data members.
5620 (Incremental_binary::check_inputs): Add cmdline parameter.
5621 (Incremental_binary::file_is_unchanged): Remove.
5622 (Input_reader::arg_serial): New function.
5623 (Input_reader::get_unused_symbol_count): New function.
5624 (Input_reader::get_unused_symbol): New function.
5625 (Input_reader::do_arg_serial): New function.
5626 (Input_reader::do_get_unused_symbol_count): New function.
5627 (Input_reader::do_get_unused_symbol): New function.
5628 (Incremental_binary::input_file_count): New function.
5629 (Incremental_binary::get_input_reader): Change signature to use
5630 index instead of filename.
5631 (Incremental_binary::file_has_changed): New function.
5632 (Incremental_binary::get_input_argument): New function.
5633 (Incremental_binary::get_library): New function.
5634 (Incremental_binary::get_script_info): New function.
5635 (Incremental_binary::init_layout): New function.
5636 (Incremental_binary::reserve_layout): New function.
5637 (Incremental_binary::output_file): New function.
5638 (Incremental_binary::do_check_inputs): New function.
5639 (Incremental_binary::do_file_is_unchanged): Remove.
5640 (Incremental_binary::do_file_has_changed): New function.
5641 (Incremental_binary::do_init_layout): New function.
5642 (Incremental_binary::do_reserve_layout): New function.
5643 (Incremental_binary::do_input_file_count): New function.
5644 (Incremental_binary::do_get_input_reader): Change signature.
5645 (Incremental_binary::input_args_map_): New data member.
5646 (Incremental_binary::library_map_): New data member.
5647 (Incremental_binary::script_map_): New data member.
5648 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5649 new data members.
5650 (Sized_incremental_binary::output_section): New function.
5651 (Sized_incremental_binary::inputs_reader): Add const.
5652 (Sized_incremental_binary::symtab_reader): Add const.
5653 (Sized_incremental_binary::relocs_reader): Add const.
5654 (Sized_incremental_binary::got_plt_reader): Add const.
5655 (Sized_incremental_binary::get_symtab_view): New function.
5656 (Sized_incremental_binary::Inputs_reader): New typedef.
5657 (Sized_incremental_binary::Input_entry_reader): New typedef.
5658 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5659 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5660 (Sized_incremental_binary::do_file_has_changed): New function.
5661 (Sized_incremental_binary::do_init_layout): New function.
5662 (Sized_incremental_binary::do_reserve_layout): New function.
5663 (Sized_input_reader::Inputs_reader): Remove.
5664 (Sized_input_reader::Input_entry_reader): Remove.
5665 (Sized_input_reader::do_arg_serial): New function.
5666 (Sized_input_reader::do_get_unused_symbol_count): New function.
5667 (Sized_input_reader::do_get_unused_symbol): New function.
5668 (Sized_incremental_binary::do_input_file_count): New function.
5669 (Sized_incremental_binary::do_get_input_reader): Change signature;
5670 use index instead of filename.
5671 (Sized_incremental_binary::section_map_): New data member.
5672 (Sized_incremental_binary::input_entry_readers_): New data member.
5673 (class Sized_incr_relobj): New class.
5674 (class Sized_incr_dynobj): New class.
5675 (make_sized_incremental_object): New function.
5676 (class Incremental_library): New class.
5677 * layout.cc (Free_list::num_lists): New static data member.
5678 (Free_list::num_nodes): New static data member.
5679 (Free_list::num_removes): New static data member.
5680 (Free_list::num_remove_visits): New static data member.
5681 (Free_list::num_allocates): New static data member.
5682 (Free_list::num_allocate_visits): New static data member.
5683 (Free_list::init): New function.
5684 (Free_list::remove): New function.
5685 (Free_list::allocate): New function.
5686 (Free_list::dump): New function.
5687 (Free_list::print_stats): New function.
5688 (Layout_task_runner::run): Resize output file for incremental updates.
5689 (Layout::Layout): Initialize new data members.
5690 (Layout::set_incremental_base): New function.
5691 (Layout::init_fixed_output_section): New function.
5692 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
5693 incremental updates.
5694 (Layout::create_gold_note): Do not create gold note section for
5695 incremental updates.
5696 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
5697 for incremental updates.
5698 (Layout::set_section_offsets): For incremental updates, allocate space
5699 from free list.
5700 (Layout::create_symtab_sections): Layout with offsets relative to
5701 start of section; for incremental updates, allocate space from free
5702 list.
5703 (Layout::create_shdrs): For incremental updates, allocate space from
5704 free list.
5705 (Layout::finish_dynamic_section): For incremental updates, do not
5706 check --as-needed (fixed in subsequent patch).
5707 * layout.h (class Free_list): New class.
5708 (Layout::set_incremental_base): New function.
5709 (Layout::incremental_base): New function.
5710 (Layout::init_fixed_output_section): New function.
5711 (Layout::allocate): New function.
5712 (Layout::incremental_base_): New data member.
5713 (Layout::free_list_): New data member.
5714 * main.cc (main): Print Free_list statistics.
5715 * object.cc (Relobj::finalize_incremental_relocs): Add
5716 clear_counts parameter; clear counts only when clear_counts is set.
5717 (Sized_relobj::Sized_relobj): Initialize new base class.
5718 (Sized_relobj::do_layout): Don't report special sections.
5719 (Sized_relobj::do_for_all_local_got_entries): New function.
5720 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
5721 symtab_off to all symbol table offsets.
5722 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
5723 * object.h (class Got_offset_list): Move to top of file.
5724 (Object::Object): Allow case where input_file == NULL.
5725 (Object::~Object): Likewise.
5726 (Object::input_file): Assert that input_file != NULL.
5727 (Object::lock): Allow case where input_file == NULL.
5728 (Object::unlock): Likewise.
5729 (Object::is_locked): Likewise.
5730 (Object::token): Likewise.
5731 (Object::release): Likewise.
5732 (Object::is_incremental): New function.
5733 (Object::get_mtime): New function.
5734 (Object::for_all_local_got_entries): New function.
5735 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
5736 (Object::set_is_in_system_directory): New function.
5737 (Object::is_in_system_directory): New function.
5738 (Object::do_is_incremental): New function.
5739 (Object::do_get_mtime): New function.
5740 (Object::do_for_all_local_got_entries): New function.
5741 (Object::is_in_system_directory_): New data member.
5742 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
5743 (class Sized_relobj_base): New class.
5744 (class Sized_relobj): Derive from Sized_relobj_base.
5745 (class Sized_relobj::Symbols): Redeclare from base class.
5746 (class Sized_relobj::local_got_offset_list): Remove.
5747 (class Sized_relobj::Output_sections): Redeclare from base class.
5748 (class Sized_relobj::do_for_all_local_got_entries): New function.
5749 (class Sized_relobj::write_local_symbols): Add offset parameter.
5750 (class Sized_relobj::local_symbol_offset_): Update comment.
5751 (class Sized_relobj::local_dynsym_offset_): Update comment.
5752 * options.cc (Input_arguments::add_file): Remove const.
5753 * options.h (Input_file_argument::Input_file_argument):
5754 Initialize arg_serial_ (all constructors).
5755 (Input_file_argument::set_arg_serial): New function.
5756 (Input_file_argument::arg_serial): New function.
5757 (Input_file_argument::arg_serial_): New data member.
5758 (Input_arguments::Input_arguments): Initialize file_count_.
5759 (Input_arguments::add_file): Remove const.
5760 (Input_arguments::number_of_input_files): New function.
5761 (Input_arguments::file_count_): New data member.
5762 (Command_line::number_of_input_files): Call
5763 Input_arguments::number_of_input_files.
5764 * output.cc (Output_segment_headers::Output_segment_headers):
5765 Set current size.
5766 (Output_section::Input_section::current_data_size): New function.
5767 (Output_section::Output_section): Initialize new data members.
5768 (Output_section::add_input_section): Don't do merge sections for
5769 an incremental link; allocate space from free list for an
5770 incremental update.
5771 (Output_section::add_output_section_data): Allocate space from
5772 free list for an incremental update.
5773 (Output_section::update_data_size): New function.
5774 (Output_section::set_fixed_layout): New function.
5775 (Output_section::reserve): New function.
5776 (Output_segment::set_section_addresses): Remove const.
5777 (Output_segment::set_section_list_addresses): Remove const; allocate
5778 space from free list for an incremental update.
5779 (Output_segment::set_offset): Adjust size of RELRO segment for an
5780 incremental update.
5781 * output.h (Output_data::current_data_size): Move here from
5782 child classes.
5783 (Output_data::pre_finalize_data_size): New function.
5784 (Output_data::update_data_size): New function.
5785 (Output_section_headers::update_data_size): new function.
5786 (Output_section_data_build::current_data_size): Move to Output_data.
5787 (Output_data_strtab::update_data_size): New function.
5788 (Output_section::current_data_size): Move to Output_data.
5789 (Output_section::set_fixed_layout): New function.
5790 (Output_section::has_fixed_layout): New function.
5791 (Output_section::reserve): New function.
5792 (Output_section::update_data_size): New function.
5793 (Output_section::has_fixed_layout_): New data member.
5794 (Output_section::free_list_): New data member.
5795 (Output_segment::set_section_addresses): Remove const.
5796 (Output_segment::set_section_list_addresses): Remove const.
5797 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
5798 New function.
5799 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
5800 New function.
5801 * readsyms.cc (Read_symbols::do_read_symbols): Add library
5802 parameter when calling Add_symbols constructor; store argument
5803 serial number for members of a lib group.
5804 (Add_symbols::locks): Allow case where token == NULL.
5805 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
5806 (Read_member::~Read_member): New function.
5807 (Read_member::is_runnable): New function.
5808 (Read_member::locks): New function.
5809 (Read_member::run): New function.
5810 (Check_script::~Check_script): New function.
5811 (Check_script::is_runnable): New function.
5812 (Check_script::locks): New function.
5813 (Check_script::run): New function.
5814 (Check_library::~Check_library): New function.
5815 (Check_library::is_runnable): New function.
5816 (Check_library::locks): New function.
5817 (Check_library::run): New function.
5818 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
5819 (Add_symbols::library_): New data member.
5820 (class Read_member): New class.
5821 (class Check_script): New class.
5822 (class Check_library): New class.
5823 * reloc.cc (Read_relocs::is_runnable): Allow case where
5824 token == NULL.
5825 (Read_relocs::locks): Likewise.
5826 (Scan_relocs::locks): Likewise.
5827 (Relocate_task::locks): Likewise.
5828 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
5829 to clear counters.
5830 (Sized_relobj::incremental_relocs_scan): Fix comment.
5831 (Sized_relobj::do_relocate): Pass output file offset to
5832 write_local_symbols.
5833 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
5834 from class declaration.
5835 * script.cc (read_input_script): Allocate Script_info; pass
5836 argument serial number to report_script.
5837 * script.h (class Script_info): Move to incremental.h.
5838 * symtab.cc (Symbol_table::add_from_incrobj): New function.
5839 * symtab.h (Symbol_table::add_from_incrobj): New function.
5840 (Symbol_table::set_file_offset): New function.
5841
b961d0d7
CC
58422011-04-05 Cary Coutant <ccoutant@google.com>
5843
5844 * incremental-dump.cc (dump_incremental_inputs): Change signature
5845 to take a Sized_incremental_binary; change caller. Use readers
5846 in Sized_incremental_binary.
5847 * incremental.cc
5848 (Sized_incremental_binary::find_incremental_inputs_sections):
5849 Rename do_find_incremental_inputs_sections to this.
5850 (Sized_incremental_binary::setup_readers): New function.
5851 (Sized_incremental_binary::do_check_inputs): Check
5852 has_incremental_info_ flag; move setup code to setup_readers;
5853 use input readers.
5854 (Sized_incremental_binary::do_file_is_unchanged): New function.
5855 (Sized_incremental_binary::do_get_input_reader): New function.
5856 * incremental.h (class Incremental_binary): Move to end of file.
5857 (Incremental_binary::file_is_unchanged): New function.
5858 (Incremental_binary::do_file_is_unchanged): New function.
5859 (Incremental_binary::Input_reader): New class.
5860 (Incremental_binary::get_input_reader): New function.
5861 (class Sized_incremental_binary): Move to end of file.
5862 (Sized_incremental_binary::Sized_incremental_binary): Setup the
5863 input section reader classes.
5864 (Sized_incremental_binary::has_incremental_info): New function.
5865 (Sized_incremental_binary::inputs_reader): New function.
5866 (Sized_incremental_binary::symtab_reader): New function.
5867 (Sized_incremental_binary::relocs_reader): New function.
5868 (Sized_incremental_binary::got_plt_reader): New function.
5869 (Sized_incremental_binary::do_file_is_unchanged): New function.
5870 (Sized_incremental_binary::Sized_input_reader): New class.
5871 (Sized_incremental_binary::get_input_reader): New function.
5872 (Sized_incremental_binary::find_incremental_inputs_sections):
5873 Rename do_find_incremental_inputs_sections to this.
5874 (Sized_incremental_binary::setup_readers): New function.
5875 (Sized_incremental_binary::has_incremental_info_): New data member.
5876 (Sized_incremental_binary::inputs_reader_): New data member.
5877 (Sized_incremental_binary::symtab_reader_): New data member.
5878 (Sized_incremental_binary::relocs_reader_): New data member.
5879 (Sized_incremental_binary::got_plt_reader_): New data member.
5880 (Sized_incremental_binary::current_input_file_): New data member.
5881
a869183f
PP
58822011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
5883
5884 PR gold/12640
5885 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5886 violation.
5887
58882011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
5889
5890 * archive.cc (Archive::include_member): Adjust call to report_object.
5891 (Add_archive_symbols::run): Add script_info to call to
5892 report_archive_begin.
5893 (Lib_group::include_member): Adjust call to report_object.
5894 (Add_lib_group_symbols::run): Adjust call to report_object.
5895 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
5896 blocks. Add object count for script input files.
5897 * incremental.cc (Incremental_inputs::report_archive_begin): Add
5898 script_info parameter; change all callers.
5899 (Incremental_inputs::report_object): Add script_info parameter;
5900 change all callers.
5901 (Incremental_inputs::report_script): Store backpointer to
5902 incremental info entry.
5903 (Output_section_incremental_inputs::set_final_data_size): Record
5904 additional information for scripts.
5905 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5906 * incremental.h (Incremental_script_entry::add_object): New function.
5907 (Incremental_script_entry::get_object_count): New function.
5908 (Incremental_script_entry::get_object): New function.
5909 (Incremental_script_entry::objects_): New data member; adjust
5910 constructor.
5911 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5912 (Incremental_inputs::report_object): Add script_info parameter.
5913 (Incremental_inputs_reader::get_object_count): New function.
5914 (Incremental_inputs_reader::get_object_offset): New function.
5915 * options.cc (Input_arguments::add_file): Return reference to
5916 new input argument.
5917 * options.h (Input_argument::set_script_info): New function.
5918 (Input_argument::script_info): New function.
5919 (Input_argument::script_info_): New data member; adjust all
5920 constructors.
5921 (Input_file_group::add_file): Return reference to new input argument.
5922 (Input_file_lib::add_file): Likewise.
5923 (Input_arguments::add_file): Likewise.
5924 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5925 * script.cc (Parser_closure::Parser_closure): Add script_info
5926 parameter; adjust all callers.
5927 (Parser_closure::script_info): New function.
5928 (Parser_closure::script_info_): New data member.
5929 (read_input_script): Report scripts earlier to incremental info.
5930 (script_add_file): Set script_info in Input_argument.
5931 (script_add_library): Likewise.
5932 * script.h (Script_options::Script_info): Rewrite class.
5933
a869183f 59342011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
5935
5936 * archive.cc (Library_base::should_include_member): Move
5937 method here from class Archive.
5938 (Archive::Archive): Initialize base class.
5939 (Archive::should_include_member): Move to base class.
5940 (Archive::do_for_all_unused_symbols): New function.
5941 (Add_archive_symbols::run): Remove redundant access to
5942 incremental_inputs.
5943 (Lib_group::Lib_group): Initialize base class.
5944 (Lib_group::do_filename): New function.
5945 (Lib_group::include_member): Pass pointer to Lib_group to
5946 report_object.
5947 (Lib_group::do_for_all_unused_symbols): New function.
5948 (Add_lib_group_symbols::run): Report archive information for
5949 incremental links.
5950 * archive.h (class Library_base): New base class.
5951 (class Archive): Derive from Library_base.
5952 (Archive::filename): Move to base class.
5953 (Archive::set_incremental_info): Likewise.
5954 (Archive::incremental_info): Likewise.
5955 (Archive::Should_include): Likewise.
5956 (Archive::should_include_member): Likewise.
5957 (Archive::Armap_entry): Remove.
5958 (Archive::Unused_symbol_iterator): Remove.
5959 (Archive::unused_symbols_begin): Remove.
5960 (Archive::unused_symbols_end): Remove.
5961 (Archive::do_filename): New function.
5962 (Archive::do_get_mtime): New function.
5963 (Archive::do_for_all_unused_symbols): New function.
5964 (Archive::task_): Move to base class.
5965 (Archive::incremental_info_): Likewise.
5966 (class Lib_group): Derive from Library_base.
5967 (Lib_group::do_filename): New function.
5968 (Lib_group::do_get_mtime): New function.
5969 (Lib_group::do_for_all_unused_symbols): New function.
5970 (Lib_group::task_): Move to base class.
5971 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
5972 function.
5973 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
5974 function.
5975 * incremental.cc (Incremental_inputs::report_archive_begin):
5976 Use Library_base; call library's get_mtime; add incremental inputs
5977 entry before members.
5978 (class Unused_symbol_visitor): New class.
5979 (Incremental_inputs::report_archive_end): Use Library_base; use
5980 visitor class to record unused symbols; don't add incremental inputs
5981 entry after members.
5982 (Incremental_inputs::report_object): Use Library_base.
5983 * incremental.h
5984 (Incremental_archive_entry::Incremental_archive_entry): Remove
5985 unused Archive parameter.
5986 (Incremental_inputs::report_archive_begin): Use Library_base.
5987 (Incremental_inputs::report_archive_end): Likewise.
5988 (Incremental_inputs::report_object): Likewise.
5989 * object.cc (Sized_relobj::do_for_all_global_symbols): New
5990 function.
5991 * object.h (Object::for_all_global_symbols): New function.
5992 (Object::do_for_all_global_symbols): New function.
5993 (Sized_relobj::do_for_all_global_symbols): New function.
5994 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
5995 function.
5996 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
5997 function.
5998
61ab3e40
ILT
59992011-03-27 Ian Lance Taylor <iant@google.com>
6000
6001 * archive.cc (Archive::interpret_header): Return -1 if something
6002 goes wrong. Change callers accordingly.
6003
30e1f9e6
CC
60042011-03-25 Cary Coutant <ccoutant@google.com>
6005
6006 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6007 * testsuite/Makefile.in: Regenerate.
6008
9370ce59 60092011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6010
6011 * plugin.cc (get_view): New.
6012 (Plugin::load): Pass get_view to the plugin.
6013 (Plugin_manager::get_view): New.
6014
9312bb0a
ILT
60152011-03-21 Ian Lance Taylor <iant@google.com>
6016
6017 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6018 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6019
7e12ba9e
ST
60202011-03-21 Sriraman Tallam <tmsriram@google.com>
6021
6022 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6023 Change == to -eq.
6024 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6025 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6026 Change == to -eq.
6027 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6028 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6029
fd7a005d
ILT
60302011-03-14 Ian Lance Taylor <iant@google.com>
6031
6032 * script-sections.cc (Sort_output_sections::script_compare):
6033 Rename from is_before, change return type.
6034 (Sort_output_sections::operator()): Adjust accordingly.
6035
ed16fd1b
ILT
60362011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6037
6038 PR gold/12572
6039 * testsuite/odr_violation2.cc: Add comment to make all error line
6040 numbers double digits.
6041 * testsuite/debug_msg.sh: Adjust expected errors.
6042
71ff8986
ILT
60432011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6044
6045 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6046 but mark earlier ones as non-canonical
6047 (offset_to_iterator): Update search target and example
6048 (do_addr2line): Return extra lines in a vector*
6049 (format_file_lineno): Extract from do_addr2line
6050 (one_addr2line): Add vector* out-param
6051 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6052 when a lineno entry appeared last for its instruction
6053 (Dwarf_line_info): Add vector* out-param
6054 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6055 * symtab.cc (Odr_violation_compare): Include the lineno in the
6056 comparison again.
6057 (linenos_from_loc): New. Combine the canonical line for an
6058 address with its other lines.
6059 (True_if_intersect): New. Helper functor to make
6060 std::set_intersection a query.
6061 (detect_odr_violations): Compare sets of lines instead of just
6062 one line for each function. This became less deterministic, but
6063 has fewer false positives.
6064 * symtab.h: Declarations.
6065 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6066 mix an optimized and non-optimized object in the same binary
6067 (odr_violation2.so): Same.
6068 * testsuite/Makefile.in: Regenerate from Makefile.am.
6069 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6070 * testsuite/debug_msg.sh: Update line numbers and add
6071 assertions.
6072 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6073 non-optimized context.
6074 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6075 isn't inlined, and use OdrDerived in an optimized context.
6076 * testsuite/odr_header1.h: Defines OdrDerived, where
6077 optimization will change the
6078 first-instruction-in-the-destructor's file and line number.
6079 * testsuite/odr_header2.h: Defines OdrBase.
6080
a19fefdc
ILT
60812011-03-09 Ian Lance Taylor <iant@google.com>
6082
6083 * fileread.cc (File_read::clear_views): Don't delete the whole
6084 file view.
6085
ecb351e9
ILT
60862011-03-08 Ian Lance Taylor <iant@google.com>
6087
6088 PR gold/12525
6089 * fileread.cc: #include <climits>.
6090 (GOLD_IOV_MAX): Define.
6091 (File_read::read_multiple): Limit number of entries by iov_max.
6092 * fileread.h (class File_read): Always set max_readv_entries to
6093 128.
6094
b821d13c
ILT
60952011-03-07 Ian Lance Taylor <iant@google.com>
6096
6097 PR gold/12525
6098 * options.h (class General_options): Add -dy and -dn.
6099
89243142
CC
61002011-03-02 Cary Coutant <ccoutant@google.com>
6101
6102 * testsuite/script_test_9.t: Add TLS segment.
6103
d0773f31
ILT
61042011-03-02 Simon Baldwin <simonb@google.com>
6105
6106 * configure.ac: Add check for gnu_indirect_function support in
6107 the toolchain building binutils.
6108 * configure: Rebuild.
6109
9370ce59 61102011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6111
6112 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6113 plugin only symbols.
6114 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6115 in plugin files as not needed in the symbol table.
6116
4cf7a849
ST
61172011-02-11 Sriraman Tallam <tmsriram@google.com>
6118
6119 * output.cc (Output_section::add_input_section): Delay fill
6120 generation for section ordering.
6121
b578bd7d
ILT
61222011-02-09 Ian Lance Taylor <iant@google.com>
6123
6124 PR gold/12316
6125 * object.h (class Sized_relobj): Remove clear_local_symbols.
6126 * reloc.cc (Sized_relobj::do_relocate): Don't call
6127 clear_local_symbols.
6128
9370ce59 61292011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6130
6131 * plugin.cc (is_visible_from_outside): Return true for symbols
6132 in the -u option.
6133
55382fb7
ILT
61342011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6135
6136 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6137 filename.
6138
4e271fff
ST
61392011-02-02 Sriraman Tallam <tmsriram@google.com>
6140
6141 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6142 to std::string.
4e271fff 6143 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6144 section_name to be std::string.
4e271fff
ST
6145 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6146
d433c3ac
ILT
61472011-01-25 Ian Lance Taylor <iant@google.com>
6148
6149 * script.cc (script_add_extern): Rewrite to use
6150 add_symbol_reference.
6151
880473a6
DK
61522011-01-25 Doug Kwan <dougkwan@google.com>
6153
d433c3ac 6154 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6155
f30f86fa
ILT
61562011-01-24 Ian Lance Taylor <iant@google.com>
6157
6158 * options.h (class General_options): Accept
6159 --no-detect-odr-violations.
6160
8e51a0b9
ILT
61612011-01-24 Ian Lance Taylor <iant@google.com>
6162
6163 * version.cc (version_string): Bump to 1.11.
6164
0f3b89d8
ILT
61652011-01-24 Ian Lance Taylor <iant@google.com>
6166
6167 * plugin.cc (class Plugin_rescan): Define new class.
6168 (Plugin_manager::claim_file): Set any_claimed_.
6169 (Plugin_manager::save_archive): New function.
6170 (Plugin_manager::save_input_group): New function.
6171 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6172 necessary.
6173 (Plugin_manager::new_undefined_symbol): New function.
6174 (Plugin_manager::rescan): New function.
6175 (Plugin_manager::rescannable_defines): New function.
6176 (Plugin_manager::add_input_file): Set any_added_.
6177 * plugin.h (class Plugin_manager): define new fields rescannable_,
6178 undefined_symbols_, any_claimed_, and any_added_. Declare
6179 Plugin_rescan as friend. Declare new functions.
6180 (Plugin_manager::Rescannable): Define type.
6181 (Plugin_manager::Rescannable_list): Define type.
6182 (Plugin_manager::Undefined_symbol_list): Define type.
6183 (Plugin_manager::Plugin_manager): Initialize new fields.
6184 * archive.cc (Archive::defines_symbol): New function.
6185 (Add_archive_symbols::run): Pass archive to plugins if any.
6186 * archive.h (class Archive): Declare defines_symbol.
6187 * readsyms.cc (Input_group::~Input_group): New function.
6188 (Finish_group::run): Pass input_group to plugins if any.
6189 * readsyms.h (class Input_group): Declare destructor.
6190 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6191 any.
6192
3bb951e5
ILT
61932011-01-10 Ian Lance Taylor <iant@google.com>
6194
6195 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6196 section as relro.
6197 (Layout::set_segment_offsets): Reset increase_relro before calling
6198 set_section_addresses a second time.
6199
0aa45fac
CC
62002011-01-04 Cary Coutant <ccoutant@google.com>
6201
6202 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6203 sections before NOBITS sections.
6204
0db46eb4
L
62052011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6206
6207 * version.cc (print_version): Update copyright to 2011.
6208
829c9745
CC
62092010-12-23 Cary Coutant <ccoutant@google.com>
6210
6211 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6212 of OS to this->add. Add OD parameter to second form of the function.
6213
7500420b
ILT
62142010-12-20 Ian Lance Taylor <iant@google.com>
6215
6216 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6217 second of two consecutive entries with same offset.
6218
f8e9a930
RW
62192010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6220
6221 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6222 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6223 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6224 to avoid unneeded links against $(LDADD).
6225 * testsuite/Makefile.in: Regenerate.
6226
2fbb4320
ILT
62272010-12-15 Ian Lance Taylor <iant@google.com>
6228
6229 PR gold/12324
6230 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6231 for R_X86_64_32 and R_X86_64_PC32.
6232 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6233 ver_matching_def_pic.o.
6234 (ver_matching_def_pic.o): New target.
6235
fedb228d
RW
62362010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6237
6238 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6239 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6240 Move definition before File_read::View member definitions.
6241 (File_read::View::~View): Initialize and hold lock before
6242 updating current_mapped_bytes.
6243
9b547ce6
RW
62442010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6245
6246 * dwarf_reader.cc: Remove outdated comment.
6247 * gold-threads.cc: Fix typo in error message.
6248 * archive.cc: Fix typos in comments.
6249 * archive.h: Likewise.
6250 * arm-reloc-property.cc: Likewise.
6251 * arm-reloc-property.h: Likewise.
6252 * arm-reloc.def: Likewise.
6253 * arm.cc: Likewise.
6254 * attributes.h: Likewise.
6255 * cref.cc: Likewise.
6256 * ehframe.cc: Likewise.
6257 * fileread.h: Likewise.
6258 * gold.h: Likewise.
6259 * i386.cc: Likewise.
6260 * icf.cc: Likewise.
6261 * incremental.h: Likewise.
6262 * int_encoding.cc: Likewise.
6263 * layout.h: Likewise.
6264 * main.cc: Likewise.
6265 * merge.h: Likewise.
6266 * object.cc: Likewise.
6267 * object.h: Likewise.
6268 * options.cc: Likewise.
6269 * readsyms.cc: Likewise.
6270 * reduced_debug_output.cc: Likewise.
6271 * reloc.cc: Likewise.
6272 * script-sections.cc: Likewise.
6273 * sparc.cc: Likewise.
6274 * symtab.h: Likewise.
6275 * target-reloc.h: Likewise.
6276 * target.cc: Likewise.
6277 * target.h: Likewise.
6278 * timer.cc: Likewise.
6279 * timer.h: Likewise.
6280 * x86_64.cc: Likewise.
6281
83e17bd5
CC
62822010-12-09 Cary Coutant <ccoutant@google.com>
6283
6284 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6285 stack.
6286 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6287 parameter; change all callers.
6288 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6289 * options.h (warn_execstack): New option.
6290
017257f8
DK
62912010-12-07 Doug Kwan <dougkwan@google.com>
6292
6293 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6294 like function call relocations.
6295
c20cbc06
ILT
62962010-12-07 Ian Lance Taylor <iant@google.com>
6297
6298 * archive.cc (Archive::get_elf_object_for_member): Permit
6299 punconfigured to be NULL.
6300 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6301 (Archive::include_member): Pass NULL to get_elf_object_for_member
6302 if we searched for the archive and this is the first included
6303 object.
6304
4dbfafcc
ILT
63052010-12-01 Ian Lance Taylor <iant@google.com>
6306
6307 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6308 track_relocs_type_ field.
6309 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6310 Set track_relocs_type_.
6311 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6312 contents when using RELA relocs.
6313 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6314 reloc_map_.
6315 * reloc.cc (Track_relocs::next_addend): New function.
6316 * reloc.h (class Track_relocs): Declare next_addend.
6317
e5e19edd
ILT
63182010-12-01 Ian Lance Taylor <iant@google.com>
6319
6320 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6321 virtual destructor.
6322
9a5ce24c
ILT
63232010-12-01 Ian Lance Taylor <iant@google.com>
6324
6325 * README: Update compilers known to work and fail.
6326
c7791212
NC
63272010-11-23 Matthias Klose <doko@ubuntu.com>
6328
6329 * configure.in: For --enable-gold, handle value `default' instead of
6330 `both*'. Always install ld as ld.bfd, install as ld if gold is
6331 not the default.
6332 * configure: Regenerate.
6333
0ad220c9
DK
63342010-11-18 Doug Kwan <dougkwan@google.com>
6335
6336 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6337 and right_alignment to be zero. Store result alignment only if it is
6338 greater than existing alignment.
6339
ab8056e0
CC
63402010-11-16 Cary Coutant <ccoutant@google.com>
6341
6342 PR gold/12220
6343 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6344 Check for ".zdebug_line".
6345
fd064a5b
CC
63462010-11-16 Doug Kwan <dougkwan@google.com>
6347 Cary Coutant <ccoutant@google.com>
6348
6349 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6350 by reference; adjust all callers.
6351 * output.cc (Output_segment::set_section_addresses): Adjust references
6352 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6353 list is empty.
6354 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6355 end at page boundary.
6356
6fc6ea19
CC
63572010-11-16 Cary Coutant <ccoutant@google.com>
6358
6359 PR gold/12220
6360 * layout.cc (Layout::choose_output_section): Transform names of
6361 compressed sections even when using a script with a SECTIONS clause.
6362 (Layout::output_section_name): Remove code to transform
6363 compressed debug section names.
6364 * output.cc (Output_section::add_input_section): Use uncompressed
6365 section size when tracking input sections.
6366
95a2c8d6
RS
63672010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6368
6369 * symtab.h (Symbol::NON_PIC_REF): Remove.
6370 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6371 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6372 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6373 (Symbol::use_plt_offset): Take a flags argument and pass it
6374 directly to needs_dynamic_reloc. Restrict check for undefined
6375 weak symbols to function calls.
6376 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6377 (Target_arm::Scan::global): Use it.
6378 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6379 (Target_arm::Relocate::relocate): Likewise.
6380 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6381 parameter with an r_type parameter. Use get_reference_flags
6382 to get the flags.
6383 (Target_arm::Relocate::relocate): Update accordingly.
6384 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6385 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6386 (Target_i386::Scan::global): Likewise.
6387 (Target_i386::Relocate::relocate): Likewise.
6388 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6389 parameter with an r_type parameter. Use get_reference_flags
6390 to get the flags.
6391 (Target_i386::Relocate::relocate): Update accordingly.
6392 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6393 (Target_powerpc::Scan::global): Use it.
6394 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6395 (Target_powerpc::Relocate::relocate): Likewise.
6396 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6397 (Target_sparc::Scan::global): Use it.
6398 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6399 (Target_sparc::Relocate::relocate): Likewise.
6400 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6401 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6402 (Target_x86_64::Scan::global): Likewise.
6403 (Target_x86_64::Relocate::relocate): Likewise.
6404
f625ae50
DK
64052010-11-08 Doug Kwan <dougkwan@google.com>
6406 Cary Coutant <ccoutant@google.com>
6407
6408 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6409 (Arm_exidx_merge_section::section_contents_): New data member.
6410 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6411 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6412 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6413 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6414 in parameters instead of calling Object::section_contents without
6415 locking.
6416 (Arm_output_section::group_section): New parameter TASK. Pass it
6417 to callees that need locking objects.
6418 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6419 to lock EXIDX input sections. Fix a formatting issue. Call
6420 Arm_exidx_merged_section::build_contents to create merged section
6421 contents.
6422 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6423 to lock object of stub table owner.
6424 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6425 TEXT_SIZE to initialize data member TEXT_SIZE_.
6426 (Arm_exidx_input_section::addralign): Fix typo in comment.
6427 (Arm_exidx_input_section::text_size): New method.
6428 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6429 that require locking objects. Lock objects before scanning for stubs
6430 and updating local symbols.
6431 (Arm_input_section<big_endian>::init): Copy contents of original
6432 input section.
2e702c99 6433 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6434 original input section instead of calling Object::section_contents
6435 without locking.
6436 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6437 size without calling Object::section_size().
6438 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6439 for size. Allocate a buffer for merged EXIDX entries.
6440 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 6441 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
6442 building code to Arm_exidx_merged_section::build_contetns. Write
6443 out contetns in buffer instead of building it on the fly.
6444 (Arm_relobj::make_exidx_input_section): Also pass text section size
6445 to Arm_exidx_input_section constructor.
6446 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6447 (Arm_dynobj::do_read_symbols): Fix memory leak.
6448 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6449 * target.h: (class Task): Add forward declaration.
6450 (Target::relax): Add new parameter TASK and pass it to
6451 Target::do_relax().
6452 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6453
5f9bcf58
CC
64542010-11-05 Cary Coutant <ccoutant@google.com>
6455
6456 PR gold/10708
6457 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6458 object when reading from the file.
6459 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6460 second layout pass.
6461 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6462 when reading section contents.
6463 (get_section_contents): Likewise.
6464 (icf::find_identical_sections): Likewise.
6465 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6466 object when reading from the file.
6467 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6468 the object when doing deferred section layout.
6469
e597fa08
NC
64702010-11-03 Nick Clifton <nickc@redhat.com>
6471
6472 PR gold/12001
6473 * script.h (class Symbol_assignment: name): New member. Returns
6474 the name of the symbol.
6475 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6476 Returns true if the given symbol name is on the list of
6477 assignments wating to be processed.
6478 * archive.cc (should_incldue_member): If the symbol is undefined,
6479 check to see if it is on the list of symbols pending assignment.
6480
3f9a3278
ILT
64812010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6482
6483 * script-sections.cc (Script_sections::find_memory_region): Check
6484 for a NULL output section pointer.
6485
d06fb4d1
DK
64862010-10-29 Doug Kwan <dougkwan@google.com>
6487
6488 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6489 Output_section::add_relaxed_input_section.
6490 * output.cc (Output_section::add_relaxed_input_section): Add new
6491 arguments LAYOUT and NAME. Set section order index.
6492 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6493 Copy section order index.
6494 * output.h (Output_section::add_relaxed_input_section): Add new
6495 arguments LAYOUT and NAME.
6496
90e24de5
ILT
64972010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6498
6499 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 6500 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
6501 * testsuite/Makefile.in: Regenerate.
6502
c9484ea5
DK
65032010-10-20 Doug Kwan <dougkwan@google.com>
6504
6505 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6506 without SHF_LINK_ORDER flags.
6507 * layout.cc (Layout::choose_output_section): Do not filter
6508 SHF_LINK_ORDER flag in a relocatable link.
6509
5bc2f5be
CC
65102010-10-17 Cary Coutant <ccoutant@google.com>
6511
6512 * output.h (Output_segment::set_section_addresses): Change function
6513 signature. Update all callers.
6514 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6515 sections.
6516 (Output_segment::set_section_addresses): Align after last TLS
6517 section. Add padding before last relro section instead of after.
6518
0c91cf04
DK
65192010-10-17 Doug Kwan <dougkwan@google.com>
6520
6521 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6522 GOT output section to be writable.
6523
8c21d9d3
CC
65242010-10-14 Cary Coutant <ccoutant@google.com>
6525
6526 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
6527 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6528 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6529 mode.
6530 * incremental.cc (report_command_line): Ignore all forms of
6531 --incremental.
6532 * layout.cc (Layout::Layout): Check parameters for incremental link
6533 mode.
6534 * options.cc (General_options::parse_incremental): New function.
6535 (General_options::parse_no_incremental): New function.
6536 (General_options::parse_incremental_full): New function.
6537 (General_options::parse_incremental_update): New function.
6538 (General_options::incremental_mode_): New data member.
6539 (General_options::finalize): Check incremental_mode_.
6540 * options.h (General_options): Update help text for --incremental.
6541 Add --no-incremental, --incremental-full, --incremental-update.
6542 (General_options::Incremental_mode): New enum type.
6543 (General_options::incremental_mode): New function.
6544 (General_options::incremental_mode_): New data member.
6545 * parameters.cc (Parameters::incremental_mode_): New data member.
6546 (Parameters::set_options): Set incremental_mode_.
6547 (Parameters::set_incremental_full): New function.
6548 (Parameters::incremental): New function.
6549 (Parameters::incremental_update): New function.
6550 (set_parameters_incremental_full): New function.
6551 * parameters.h (Parameters::set_incremental_full): New function.
6552 (Parameters::incremental): New function.
6553 (Parameters::incremental_update): New function.
6554 (Parameters::incremental_mode_): New data member.
6555 (set_parameters_incremental_full): New function.
6556 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6557 incremental link mode.
6558 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6559 (Sized_relobj::do_relocate_sections): Likewise.
6560 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6561 option.
6562 * testsuite/Makefile.in: Regenerate.
6563 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 6564
bb32aa18 65652010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
6566
6567 * script-sections.h (class Script_sections): Make
6568 Sections_elements typedef public.
6569 * script-sections.cc (class Sort_output_sections): Add elements_
6570 field. Add constructor which sets it; change all callers.
6571 (Sort_output_sections::is_before): New function.
6572 (Sort_output_sections::operator()): Call is_before.
6573 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6574 conditional.
6575 * testsuite/script_test_10.sh: New test. Test script section
6576 order.
6577 * testsuite/script_test_10.t: Likewise.
6578 * testsuite/script_test_10.s: Likewise.
6579 * testsuite/Makefile.am: Wrap the cross linker tests and the
6580 common tests into NATIVE_OR_CROSS_LINKER.
6581 (check_SCRIPTS): Add script_test_10.sh.
6582 (check_DATA): Add script_test_10.stdout.
6583 (script_test_10.o, script_test_10): New targets.
6584 (script_test_10.stdout): New target.
6585 * configure, testsuite/Makefile.in: Regenerate.
6586
3cef7179
ILT
65872010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6588
6589 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6590 error for the deprecated relocations.
6591 (Target_arm::Scan::global): Likewise.
6592 (Target_arm::Relocate::relocate): Likewise.
6593
7411e9a8
RS
65942010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6595
6596 * fileread.cc (Input_file::find_file): Initialize *found_name
6597 and *namep when using the fallback search for case 4.
6598
6a9da32a
CC
65992010-10-11 Cary Coutant <ccoutant@google.com>
6600
6601 * options.h (class General_options): Redefine -z lazy as an alias for
6602 the negation of -z now.
6603
ac897c20
ILT
66042010-10-11 Ian Lance Taylor <iant@google.com>
6605
6606 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6607 binding.
6608
ea5cae92
NC
66092010-10-06 Nick Clifton <nickc@redhat.com>
6610
6611 * script-sections.cc(class Memory_region): Remove
6612 current_lma_offset_ field. Rename current_vma_offset_ to
6613 current_offset_. Add last_section_ field.
6614 (Memory_region::get_current_vma_address): Rename to
6615 get_current_address.
6616 (Memory_region::get_current_lma_address): Delete.
6617 (Memory_region::increment_vma_offset): Rename to
6618 increment_offset.
6619 (Memory_region::increment_lma_offset): Delete.
6620 (Memory_region::attributes_compatible): New method. Returns
6621 true if the provided section is compatible with the region.
6622 (Memory_region::get_last_section): New method. Returns the last
6623 section to use the region.
6624 (Memory_region::set_last_section): New method. Stores the last
6625 section to use the region.
6626 (Script_sections::block_in_region): New method. Returns true if
6627 a block of memory is contained within a region.
6628 (Script_sections::find_memory_region): New method. Locates a
6629 memory region to be used to set a VMA or LMA address.
6630 (Output_section_definition::set_section_addresses): Add code to
6631 check for addresses set by memory regions.
6632 (Output_segment::set_section_addresses): Remove memory region
6633 walking code.
6634 (Script_sections::create_segment): Add a warning if a header
6635 segment is created outside of any region.
6636 * script-sections.h (class Script_sections): Add prototypes for
6637 find_memory_region and block_in_region methods.
6638 * testsuite/memory_test.s: Use .long instead of .word.
6639 * testsuite/memory_test.t: Add some more output sections.
6640 * testsuite/memory_test.sh: Update expected output.
6641
a9bfd952
DK
66422010-10-02 Doug Kwan <dougkwan@google.com>
6643
6644 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6645 defintion to symtab.h
6646 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6647 declaration to defintion.
6648
bacff3ab
NC
66492010-10-01 Nick Clifton <nickc@redhat.com>
6650
6651 * expression.cc (eval): Replace dummy argument with NULL.
6652 (eval_maybe_dot): Check for a NULL result section pointer.
6653 (Symbol_expression::value): Likewise.
6654 (Dot_expression::value): Likewise.
6655 (BINARY_EXPRESSION): Likewise.
6656 (Max_expression::value): Likewise.
6657 (Min_expression::value): Likewise.
6658 (Absolute_expression::value): Likewise.
6659 (Addr_expression::value_from_output_section): Likewise.
6660 (Loaddddr_expression::value_from_output_section): Likewise.
6661 (Segment_start_expression::value): Likewise.
6662 * script-sections.cc
6663 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6664 argument with NULL.
6665 (Sections_elememt_dot_assignment::set_section_addresses):
6666 Likewise.
6667 (Output_data_expression::do_write_to_buffer): Likewise.
6668 (Output_section_definition::finalize_symbols): Likewise.
6669 (Output_section_definition::set_section_addresses): Likewise.
6670
f81bc8b5
DK
66712010-09-30 Doug Kwan <dougkwan@google.com>
6672
6673 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6674
c95e9f27
ST
66752010-09-28 Sriraman Tallam <tmsriram@google.com>
6676
6677 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 6678 function.
c95e9f27
ST
6679 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6680 virtual function.
6681 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6682 virtual function.
6683 * icf.cc (get_section_contents): Inline merge sections only when
6684 target allows it.
6685
3cac54d2
RW
66862010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6687
6688 * configure: Regenerate.
6689
2904037a
ILT
66902010-09-17 Ian Lance Taylor <iant@google.com>
6691
6692 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
6693 * testsuite/Makefile.am (memory_test.o): New target.
6694 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
6695 memory_test.t.
6696 * testsuite/Makefile.in: Rebuild.
2904037a 6697
bca7fb63
DK
66982010-09-17 Doug Kwan <dougkwan@google.com>
6699
6700 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
6701 defintion if relocation uses GOT entries of the symbol.
6702 * testsuite/icf_safe_test.sh: Fix test.
6703 * testsuite/icf_safe_so_test.sh: Fix test.
6704
4ef28648
CC
67052010-09-16 Cary Coutant <ccoutant@google.com>
6706
6707 * script_sections.cc (class Memory_region): Remove "NULL" from
6708 vector initializations.
6709
793990de
CC
67102010-09-15 Cary Coutant <ccoutant@google.com>
6711
6712 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
6713 Resolve forwarding symbols.
6714
81e015e2
DK
67152010-09-15 Doug Kwan <dougkwan@google.com>
6716
6717 * gold/testsuite/script_test_3.t: Add ARM special sections.
6718 * gold/testsuite/script_test_4.t: Same.
6719 * gold/testsuite/script_test_5.t: Same.
6720 * gold/testsuite/script_test_6.t: Same.
6721 * gold/testsuite/script_test_7.t: Same.
6722 * gold/testsuite/script_test_7.t: Same.
6723 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
6724
36171d64
CC
67252010-09-14 Cary Coutant <ccoutant@google.com>
6726
6727 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
6728 (Target_x86_64::Relocate::relocate_tls): Replace check for
6729 saw_tls_block_reloc_ with test for executable section.
6730
d89051bd
CC
67312010-09-12 Cary Coutant <ccoutant@google.com>
6732
6733 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
6734 position-independent executables to shared libraries need dynamic
6735 relocations.
6736 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
6737 position-independent executables.
6738 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
6739 * testsuite/Makefile.in: Regenerate.
6740
fca41f0f
NC
67412010-09-10 Nick Clifton <nickc@redhat.com>
6742
6743 PR gold/11997
6744 * testsuite/memory_test.t: Discard any sections that are not
6745 needed.
6746
6695e4b3
L
67472010-09-09 H.J. Lu <hongjiu.lu@intel.com>
6748
6749 PR gold/11996
6750 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
6751 "This::" to work around a bug in gcc 4.2.
6752
6753 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
6754
0f72bf6f
RÁE
67552010-09-09 Rafael Espindola <espindola@google.com>
6756
6757 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
6758 sections with different PF_X flags in the same segment.
6759 (Layout::find_first_load_seg): Search all segments to find the first
6760 one.
6761 * options.h (rosegment): New.
6762
67632010-09-08 Rafael Espindola <espindola@google.com>
a6577478 6764
05a79166 6765 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 6766
aa98ff75
DK
67672010-09-08 Doug Kwan <dougkwan@google.com>
6768
6769 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
6770 (Arm_relobj::do_relocate_sections): Add new parameter for output
6771 file to match the parent.
6772 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
6773 of local symbols instead of input values. Update code to track
6774 changes in gold::relocate_section.
6775 * object.cc (Sized_relobj::compute_final_local_value): New methods.
6776 (Sized_relobj::compute_final_local_value_internal): New methods.
6777 (Sized_relobj::do_finalize_local_symbols): Move code from loop
6778 body into private version of Sized_relobj::compute_final_local_value.
6779 Call the inline method.
6780 * object.h (Symbol_value::Symbol_value): Define destructor. Free
6781 merged symbol value if there is one.
6782 (Symbol_value::has_output_value): New method defintiion.
6783 (Sized_relobj::Compute_final_local_value_status): New enum type.
6784 (Sized_relobj::compute_final_local_value): New methods.
6785 (Sized_relobj::compute_final_local_value_internal): New methods.
6786 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
6787 and arm_cortex_a8.sh.
6788 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
6789 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
6790 New tests.
6791 * Makefile.in: Regenerate.
6792 * testsuite/arm_bl_out_of_range.s: Update test.
6793 * testsuite/thumb_bl_out_of_range.s: Ditto.
6794 * testsuite/thumb_blx_out_of_range.s: Ditto.
6795 * testsuite/arm_branch_out_of_range.sh: New file.
6796 * testsuite/arm_cortex_a8.sh: Ditto.
6797 * testsuite/arm_cortex_a8_b.s: Ditto.
6798 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
6799 * testsuite/arm_cortex_a8_b_local.s: Ditto.
6800 * testsuite/arm_cortex_a8_bl.s: Ditto.
6801 * testsuite/arm_cortex_a8_blx.s: Ditto.
6802 * testsuite/arm_cortex_a8_local.s: Ditto.
6803 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
6804 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
6805
05a79166
L
68062010-09-08 Rafael Espindola <espindola@google.com>
6807
6808 * Makefile.am (memory_test.stdout): Run readelf with -W.
6809 * Makefile.in: Regenerate.
6810 * testsuite/memory_test.sh: Make the regexps accept both 32 and
6811 64 bit output.
6812
33dbc701
RÁE
68132010-09-08 Rafael Espindola <espindola@google.com>
6814
6815 * script-sections.cc (Script_sections::add_memory_region): Convert
6816 field precision to int.
6817 * script.cc (script_set_section_region, script_set_section_region):
6818 Convert field precision to int.
6819
731ca54a
RÁE
68202010-09-08 Rafael Espindola <espindola@google.com>
6821
6822 * arm.cc (do_finalize_sections): Create the __exidx_start and
6823 __exdix_end symbols even when the section is missing.
6824
7f8cd844
NC
68252010-09-08 Nick Clifton <nickc@redhat.com>
6826
6827 * README: Remove claim that MEMORY is not supported.
6828 * expression.cc (script_exp_function_origin)
6829 (script_exp_function_length): Move from here to ...
6830 * script.cc: ... here.
6831 (script_set_section_region, script_add_memory)
6832 (script_parse_memory_attr, script_include_directive): New
6833 functions.
6834 * script-sections.cc
6835 (class Memory_region): New class.
6836 (class Output_section_definition): Add set_memory_region,
6837 set_section_vma, set_section_lma and get_section_name methods.
6838 (class Script_Sections): Add add_memory_region,
6839 find_memory_region, find_memory_region_origin,
6840 find_memory_region_length and set_memory_region methods.
6841 Have set_section_addresses method walk the list of set memory
6842 regions.
6843 Extend the print methos to display memory regions.
6844 * script-sections.h: Add prototypes for new methods.
6845 Add enum for MEMORY region attributes.
6846 * yyscript.y: Add support for parsing MEMORY regions.
6847 * script-c.h: Add prototypes for new functions.
6848 * testsuite/Makefile.am: Add test of MEMORY region functionality.
6849 * testsuite/Makefile.in: Regenerate.
6850 * testsuite/memory_test.sh: New script.
6851 * testsuite/memory_test.s: New assembler source file.
6852 * testsuite/memory_test.t: New linker script.
6853
a4649286
DK
68542010-08-27 Doug Kwan <dougkwan@google.com>
6855
6856 * gold/resolve.cc (Symbol_table::should_override): Let a weak
6857 reference override an existing dynamic weak reference.
6858 * testsuite/Makefile.am: Add new test dyn_weak_ref.
6859 * testsuite/Makefile.in: Regenerate.
6860 * testsuite/dyn_weak_ref.sh: New file.
6861 * testsuite/dyn_weak_ref_1.c: Ditto.
6862 * testsuite/dyn_weak_ref_2.c: Ditto.
6863
b56648ad
ILT
68642010-08-27 Ian Lance Taylor <iant@google.com>
6865
6866 * incremental.h (class Incremental_input_entry): Add virtual
6867 destructor.
6868
809313cb
ILT
68692010-08-27 Ian Lance Taylor <iant@google.com>
6870
6871 * testsuite/start_lib_test_3.c: Mark t3 as used.
6872
11e32464
NC
68732010-08-27 Nick Clifton <nickc@redhat.com>
6874
6875 * options.cc (version_script): Fix small typo in previous
6876 whitespace tidyup.
6877
ca09d69a
NC
68782010-08-25 Nick Clifton <nickc@redhat.com>
6879
6880 * archive.cc: Formatting fixes: Remove whitespace between
6881 typename and following asterisk. Remove whitespace between
6882 function name and opening parenthesis.
6883 * archive.h: Likewise.
6884 * arm.cc: Likewise.
6885 * attributes.cc: Likewise.
6886 * attributes.h: Likewise.
6887 * common.cc: Likewise.
6888 * copy-relocs.cc: Likewise.
6889 * dirsearch.h: Likewise.
6890 * dynobj.cc: Likewise.
6891 * ehframe.cc: Likewise.
6892 * ehframe.h: Likewise.
6893 * expression.cc: Likewise.
6894 * fileread.cc: Likewise.
6895 * fileread.h: Likewise.
6896 * gc.h: Likewise.
6897 * gold-threads.cc: Likewise.
6898 * gold.cc: Likewise.
6899 * i386.cc: Likewise.
6900 * icf.h: Likewise.
6901 * incremental-dump.cc: Likewise.
6902 * incremental.cc: Likewise.
6903 * layout.cc: Likewise.
6904 * layout.h: Likewise.
6905 * main.cc: Likewise.
6906 * merge.cc: Likewise.
6907 * merge.h: Likewise.
6908 * object.cc: Likewise.
6909 * object.h: Likewise.
6910 * options.cc: Likewise.
6911 * options.h: Likewise.
6912 * output.cc: Likewise.
6913 * output.h: Likewise.
6914 * plugin.cc: Likewise.
6915 * plugin.h: Likewise.
6916 * powerpc.cc: Likewise.
6917 * reloc.cc: Likewise.
6918 * script-c.h: Likewise.
6919 * script-sections.cc: Likewise.
6920 * script.cc: Likewise.
6921 * stringpool.cc: Likewise.
6922 * symtab.cc: Likewise.
6923 * symtab.h: Likewise.
6924 * target.cc: Likewise.
6925 * timer.cc: Likewise.
6926 * timer.h: Likewise.
6927 * version.cc: Likewise.
6928 * x86_64.cc: Likewise.
6929
b8fa8750
NC
69302010-08-24 Nick Clifton <nickc@redhat.com>
6931
6932 PR 11899
6933 * layout.cc (segment_precedes): Sort segments by their physical
6934 addresses, if they have been set.
6935
9919d93b
CC
69362010-08-23 Cary Coutant <ccoutant@google.com>
6937
6938 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
6939 symbols data.
6940 (Lib_group::include_member): Unlock object after deleting its
6941 symbols data.
6942 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
6943 the bug fixed here.
6944
97b4be1c
CC
69452010-08-19 Neil Vachharajani <nvachhar@google.com>
6946 Cary Coutant <ccoutant@google.com>
6947
6948 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
6949 constructor, and set_blocker.
6950 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
6951 readsyms_blocker_.
6952 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
6953 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
6954 * testsuite/Makefile.am (start_lib_test): New test case.
6955 * testsuite/Makefile.in: Regenerate.
6956 * testsuite/start_lib_test_main.c: New file.
6957 * testsuite/start_lib_test_1.c: New file.
6958 * testsuite/start_lib_test_2.c: New file.
6959 * testsuite/start_lib_test_3.c: New file.
6960
dd0b1884
ILT
69612010-08-19 Ian Lance Taylor <iant@google.com>
6962
6963 * Makefile.in: Rebuild with automake 1.11.1.
6964 * aclocal.m4: Likewise.
6965 * testsuite/Makefile.in: Likewise.
6966
7223e9ca
ILT
69672010-08-19 Ian Lance Taylor <iant@google.com>
6968
6969 PR 10893
6970 * i386.cc (class Output_data_plt_i386): Update declarations.
6971 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
6972 local_ifuncs_ fields.
6973 (Target_i386::do_plt_section_for_global): New function.
6974 (Target_i386::do_plt_section_for_local): New function.
6975 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
6976 parameter; change all callers. Initialize global_ifuncs_ and
6977 local_ifuncs_. If doing a static link define __rel_iplt_start and
6978 __rel_iplt_end.
6979 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
6980 (Output_data_plt_i386::add_local_ifunc_entry): New function.
6981 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
6982 symbols.
6983 (Target_i386::make_plt_section): New function, broken out of
6984 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
6985 (Target_i386::make_plt_entry): Call make_plt_section.
6986 (Target_i386::make_local_ifunc_plt_entry): New function.
6987 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
6988 (Target_i386::Scan::local): Handle IFUNC symbols. Add
6989 R_386_IRELATIVE to switch.
6990 (Target_i386::Scan::global): Likewise.
6991 (Target_i386::Relocate::relocate): Likewise.
6992 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
6993 switch.
6994 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
6995 (Target_x86_64::do_plt_section_for_global): New function.
6996 (Target_x86_64::do_plt_section_for_local): New function.
6997 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
6998 parameter; change all callers. If doing a static link define
6999 __rela_iplt_start and __rela_iplt_end.
7000 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7001 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7002 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7003 to point to .plt.
7004 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7005 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7006 switch.
7007 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7008 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7009 R_X86_64_IRELATIVE to switch.
7010 (Target_x86_64::Scan::global): Likewise.
7011 (Target_x86_64::Relocate::relocate): Likewise.
7012 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7013 switch.
7014 * target.h (class Target): Add plt_section_for_global and
7015 plt_section_for_local functions. Add do_plt_section_for_global
7016 and do_plt_section_for_local virtual functions.
7017 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7018 clarifying comments.
7019 (Symbol::use_plt_offset): Handle IFUNC symbol.
7020 * object.cc (Sized_relobj::Sized_relobj): Initialize
7021 local_plt_offsets_.
7022 (Sized_relobj::local_has_plt_offset): New function.
7023 (Sized_relobj::local_plt_offset): New function.
7024 (Sized_relobj::set_local_plt_offset): New function.
7025 (Sized_relobj::do_count): Handle IFUNC symbol.
7026 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7027 a bit away from input_shndx_ field. Add set_is_func_symbol and
7028 is_ifunc_symbol functions.
7029 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7030 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7031 local_plt_offsets_ field.
7032 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7033 * output.h (class Output_section_data): Add non-const
7034 output_section function.
7035 (class Output_data_got): Update declarations.
7036 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7037 Add use_plt_offset parameter to global and local constructors.
7038 Change all callers. Change local_sym_index_ field to 31 bits.
7039 Change GSYM_CODE and CONSTANT_CODE accordingly.
7040 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7041 doing a static link don't set sh_link field.
7042 (Output_data_got::Got_entry::write): Use PLT offset if
7043 appropriate.
7044 (Output_data_got::add_global_plt): New function.
7045 (Output_data_got::add_local_plt): New function.
7046 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7047 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7048 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7049 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7050 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7051 IFUNC conditional.
7052 * testsuite/ifunc-sel.h: New file.
7053 * testsuite/ifuncmain1.c: New file.
7054 * testsuite/ifuncmain1vis.c: New file.
7055 * testsuite/ifuncmod1.c: New file.
7056 * testsuite/ifuncdep2.c: New file.
7057 * testsuite/ifuncmain2.c: New file.
7058 * testsuite/ifuncmain3.c: New file.
7059 * testsuite/ifuncmod3.c: New file.
7060 * testsuite/ifuncmain4.c: New file.
7061 * testsuite/ifuncmain5.c: New file.
7062 * testsuite/ifuncmod5.c: New file.
7063 * testsuite/ifuncmain6pie.c: New file.
7064 * testsuite/ifuncmod6.c: New file.
7065 * testsuite/ifuncmain7.c: New file.
7066 * configure, testsuite/Makefile.in: Rebuild.
7067
56f75c03
ILT
70682010-08-18 Ian Lance Taylor <iant@google.com>
7069
7070 * incremental.cc
7071 (Output_section_incremental_inputs::write_input_files): Add cast
7072 to avoid signed/unsigned comparison warning.
7073 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7074
55455f89
CC
70752010-08-12 Cary Coutant <ccoutant@google.com>
7076
7077 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7078
e2054bcb
ILT
70792010-08-13 Ian Lance Taylor <iant@google.com>
7080
7081 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7082
74f67560
DK
70832010-08-12 Cary Coutant <ccoutant@google.com>
7084 Doug Kwan <dougkwan@google.com>
7085
7086 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7087 defintion overrides non-weak undef, remember that the original undef
7088 is not weak.
7089 * symtab.cc (Symbol_table::sized_write_global): For undef without
7090 an original weak binding, set binding to global in output.
7091 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7092 * testsuite/Makefile.in: Regenerate.
7093 * testsuite/strong_ref_weak_def.sh: New file.
7094 * testsuite/strong_ref_weak_def_1.c: Ditto.
7095 * testsuite/strong_ref_weak_def_2.c: Ditto.
7096
d1238d12
CC
70972010-08-12 Cary Coutant <ccoutant@google.com>
7098
7099 * testsuite/incremental_test.sh: Rewrite.
7100 * testsuite/incremental_test_1.c: Rewrite.
7101 * testsuite/incremental_test_2.c: Rewrite.
7102
0e70b911
CC
71032010-08-12 Cary Coutant <ccoutant@google.com>
7104
7105 * arm.cc (Target_arm::got_size): Add const.
7106 (Target_arm::got_entry_count): New function.
7107 (Target_arm::plt_entry_count): New function.
7108 (Target_arm::first_plt_entry_offset): New function.
7109 (Target_arm::plt_entry_size): New function.
7110 (Output_data_plt_arm::entry_count): New function.
7111 (Output_data_plt_arm::first_plt_entry_offset): New function.
7112 (Output_data_plt_arm::get_plt_entry_size): New function.
7113 * i386.cc (Target_i386::got_size): Add const.
7114 (Target_i386::got_entry_count): New function.
7115 (Target_i386::plt_entry_count): New function.
7116 (Target_i386::first_plt_entry_offset): New function.
7117 (Target_i386::plt_entry_size): New function.
7118 (Output_data_plt_i386::entry_count): New function.
7119 (Output_data_plt_i386::first_plt_entry_offset): New function.
7120 (Output_data_plt_i386::get_plt_entry_size): New function.
7121 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7122 find_incremental_inputs_sections. Dump incremental_got_plt section.
7123 * incremental.cc: Include target.h.
7124 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7125 parameter. Adjust all callers. Find incremental_got_plt section.
7126 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7127 section.
7128 (Output_section_incremental_inputs::set_final_data_size): Calculate
7129 size of incremental_got_plt section.
7130 (Output_section_incremental_inputs::do_write): Write the
7131 incremental_got_plt section.
7132 (Got_plt_view_info): New struct.
7133 (Local_got_offset_visitor): New class.
7134 (Global_got_offset_visitor): New class.
7135 (Global_symbol_visitor_got_plt): New class.
7136 (Output_section_incremental_inputs::write_got_plt): New function.
7137 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7138 Add parameter. Adjust all callers.
7139 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7140 (Incremental_inputs::got_plt_section): New function.
7141 (Incremental_inputs::got_plt_section_): New data member.
7142 (Incremental_got_plt_reader): New class.
7143 * layout.cc (Layout::create_incremental_info_sections): Add the
7144 incremental_got_plt section.
7145 * object.h (Got_offset_list::get_list): New function.
7146 (Got offset_list::for_all_got_offsets): New function.
7147 (Sized_relobj::local_got_offset_list): New function.
7148 * powerpc.cc (Target_powerpc::got_size): Add const.
7149 (Target_powerpc::got_entry_count): New function.
7150 (Target_powerpc::plt_entry_count): New function.
7151 (Target_powerpc::first_plt_entry_offset): New function.
7152 (Target_powerpc::plt_entry_size): New function.
7153 (Output_data_plt_powerpc::entry_count): New function.
7154 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7155 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7156 * sparc.cc (Target_sparc::got_size): Add const.
7157 (Target_sparc::got_entry_count): New function.
7158 (Target_sparc::plt_entry_count): New function.
7159 (Target_sparc::first_plt_entry_offset): New function.
7160 (Target_sparc::plt_entry_size): New function.
7161 (Output_data_plt_sparc::entry_count): New function.
7162 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7163 (Output_data_plt_sparc::get_plt_entry_size): New function.
7164 * symtab.h (Symbol::got_offset_list): New function.
7165 (Symbol_table::for_all_symbols): New function.
7166 * target.h (Sized_target::got_entry_count): New function.
7167 (Sized_target::plt_entry_count): New function.
7168 (Sized_target::plt_entry_size): New function.
7169 * x86_64.cc (Target_x86_64::got_size): Add const.
7170 (Target_x86_64::got_entry_count): New function.
7171 (Target_x86_64::plt_entry_count): New function.
7172 (Target_x86_64::first_plt_entry_offset): New function.
7173 (Target_x86_64::plt_entry_size): New function.
7174 (Output_data_plt_x86_64::entry_count): New function.
7175 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7176 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7177
09ec0418
CC
71782010-08-12 Cary Coutant <ccoutant@google.com>
7179
7180 * archive.cc: Include incremental.h.
7181 (Archive::Archive): Initialize incremental_info_.
7182 (Archive::include_member): Record archive members in incremental info.
7183 (Add_archive_symbols::run): Record begin and end of an archive in
7184 incremental info.
7185 (Lib_group::include_member): Record objects in incremental info.
7186 * archive.h (Incremental_archive_entry): Forward declaration.
7187 (Archive::set_incremental_info): New member function.
7188 (Archive::incremental_info): New member function.
7189 (Archive::Unused_symbol_iterator): New class.
7190 (Archive::unused_symbols_begin): New member function.
7191 (Archive::unused_symbols_end): New member function.
7192 (Archive::incremental_info_): New data member.
7193 * incremental-dump.cc (find_input_containing_global): New function.
7194 (dump_incremental_inputs): Dump new incremental info sections.
7195 * incremental.cc: Include symtab.h.
7196 (Output_section_incremental_inputs): New class.
7197 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7198 new incremental info sections.
7199 (Sized_incremental_binary::do_check_inputs): Likewise.
7200 (Incremental_inputs::report_archive): Remove.
7201 (Incremental_inputs::report_archive_begin): New function.
7202 (Incremental_inputs::report_archive_end): New function.
7203 (Incremental_inputs::report_object): New function.
7204 (Incremental_inputs::finalize_inputs): Remove.
7205 (Incremental_inputs::report_input_section): New function.
7206 (Incremental_inputs::report_script): Rewrite.
7207 (Incremental_inputs::finalize): Do nothing but finalize string table.
7208 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7209 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7210 (Incremental_inputs::create_data_sections): New function.
7211 (Incremental_inputs::relocs_entsize): New function.
7212 (Output_section_incremental_inputs::set_final_data_size): New function.
7213 (Output_section_incremental_inputs::do_write): New function.
7214 (Output_section_incremental_inputs::write_header): New function.
7215 (Output_section_incremental_inputs::write_input_files): New function.
7216 (Output_section_incremental_inputs::write_info_blocks): New function.
7217 (Output_section_incremental_inputs::write_symtab): New function.
7218 * incremental.h (Incremental_script_entry): Forward declaration.
7219 (Incremental_object_entry): Forward declaration.
7220 (Incremental_archive_entry): Forward declaration.
7221 (Incremental_inputs): Forward declaration.
7222 (Incremental_inputs_header_data): Remove.
7223 (Incremental_inputs_header): Remove.
7224 (Incremental_inputs_header_write): Remove.
7225 (Incremental_inputs_entry_data): Remove.
7226 (Incremental_inputs_entry): Remove.
7227 (Incremental_inputs_entry_write): Remove.
7228 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7229 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7230 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7231 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7232 Likewise.
7233 (Incremental_input_entry): New class.
7234 (Incremental_script_entry): New class.
7235 (Incremental_object_entry): New class.
7236 (Incremental_archive_entry): New class.
7237 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7238 (Incremental_inputs::report_inputs): Remove.
7239 (Incremental_inputs::report_archive): Remove.
7240 (Incremental_inputs::report_archive_begin): New function.
7241 (Incremental_inputs::report_archive_end): New function.
7242 (Incremental_inputs::report_object): Change prototype.
7243 (Incremental_inputs::report_input_section): New function.
7244 (Incremental_inputs::report_script): Change prototype.
7245 (Incremental_inputs::get_reloc_count): New function.
7246 (Incremental_inputs::set_reloc_count): New function.
7247 (Incremental_inputs::create_data_sections): New function.
7248 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7249 (Incremental_inputs::inputs_section): New function.
7250 (Incremental_inputs::symtab_section): New function.
7251 (Incremental_inputs::relocs_section): New function.
7252 (Incremental_inputs::get_stringpool): Add const.
7253 (Incremental_inputs::command_line): Add const.
7254 (Incremental_inputs::inputs): Remove.
7255 (Incremental_inputs::command_line_key): New function.
7256 (Incremental_inputs::input_file_count): New function.
7257 (Incremental_inputs::input_files): New function.
7258 (Incremental_inputs::relocs_entsize): New function.
7259 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7260 (Incremental_inputs::finalize_inputs): Remove.
7261 (Incremental_inputs::Input_info): Remove.
7262 (Incremental_inputs::lock_): Remove.
7263 (Incremental_inputs::inputs_): Change type.
7264 (Incremental_inputs::inputs_map_): Remove.
7265 (Incremental_inputs::current_object_entry_): New data member.
7266 (Incremental_inputs::inputs_section_): New data member.
7267 (Incremental_inputs::symtab_section_): New data member.
7268 (Incremental_inputs::relocs_section_): New data member.
7269 (Incremental_inputs::reloc_count_): New data member.
7270 (Incremental_inputs_reader): New class.
7271 (Incremental_symtab_reader): New class.
7272 (Incremental_relocs_reader): New class.
7273 * layout.cc (Layout::finalize): Move finalization of incremental info
7274 and creation of incremental info sections to follow finalization of
7275 symbol table. Set offsets for postprocessing sections.
7276 (Layout::create_incremental_info_sections): Call
7277 Incremental_inputs::create_data_sections. Add incremental symtab
7278 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7279 sections to layout after input sections.
7280 * layout.h (struct Timespec): Forward declaration.
7281 (Layout::incremental_inputs): Add const.
7282 (Layout::create_incremental_info_sections): Add parameter.
7283 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7284 * object.cc: Include incremental.h.
7285 (Relobj::finalize_incremental_relocs): New function.
7286 (Sized_relobj::do_layout): Record input sections in incremental info.
7287 * object.h (Object::output_section): New function.
7288 (Object::output_section_offset): Moved from Relobj.
7289 (Object::get_incremental_reloc_base): New function.
7290 (Object::get_incremental_reloc_count): New function.
7291 (Object::do_output_section): New function.
7292 (Object::do_output_section_offset): Moved from Relobj.
7293 (Object::do_get_incremental_reloc_base): New function.
7294 (Object::do_get_incremental_reloc_count): New function.
7295 (Object::Object): Initialize new data members.
7296 (Relobj::output_section): Renamed do_output_section and moved to
7297 protected.
7298 (Relobj::output_section_offset): Moved to Object.
7299 (Relobj::do_get_incremental_reloc_base): New function.
7300 (Relobj::do_get_incremental_reloc_count): New function.
7301 (Relobj::allocate_incremental_reloc_counts): New function.
7302 (Relobj::count_incremental_reloc): New function.
7303 (Relobj::finalize_incremental_relocs): New function.
7304 (Relobj::next_incremental_reloc_index): New function.
7305 (Relobj::reloc_counts_): New data member.
7306 (Relobj::reloc_bases_): New data member.
7307 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7308 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7309 (Sized_relobj::incremental_relocs_scan): New function.
7310 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7311 (Sized_relobj::incremental_relocs_write): New function.
7312 (Sized_relobj::incremental_relocs_write_reltype): New function.
7313 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7314 incremental link.
7315 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7316 archives and object files elsewhere.
7317 (Add_symbols::run): Report object files here.
7318 (Finish_group::run): Report end of archive at end of group.
7319 * reloc.cc: Include layout.h, incremental.h.
7320 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7321 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7322 (Sized_relobj::incremental_relocs_scan): New function.
7323 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7324 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7325 (Sized_relobj::incremental_relocs_write): New function.
7326 (Sized_relobj::incremental_relocs_write_reltype): New function.
7327 * script.cc (read_input_script): Rewrite test for incremental link.
7328 Change call to Incremental_inputs::report_script.
7329 * symtab.h (Symbol_table::first_global_index): New function.
7330 (Symbol_table::output_count): New function.
7331
ce0d1972
DK
73322010-08-12 Doug Kwan <dougkwan@google.com>
7333
7334 * arm.cc (Target_arm::merge_object_attributes): Check command line
7335 options --no-wchar-size-warning and --no-enum-size-warning.
7336 * options.h (General_options): Add ld-compatible options
7337 --no-enum-size-warning and --no-wchar-size-warning.
7338
6e5710ce
ILT
73392010-08-04 Ian Lance Taylor <iant@google.com>
7340
7341 * x86_64.cc (Target_x86_64::Scan::local): Use
7342 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7343 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7344 (Target_x86_64::Scan::global): Likewise.
7345 (Target_x86_64::Relocate::relocate): Likewise.
7346 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7347 Likewise.
7348
fef830db
CC
73492010-08-03 Cary Coutant <ccoutant@google.com>
7350
7351 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7352 to reserve space in merged_strings vector. Keep total input size
7353 for stats.
7354 (Output_merge_string::do_print_merge_stats): Print total input size.
7355 * merge.h (Output_merge_string): Add input_size_ field.
7356 * stringpool.cc (Stringpool_template::string_length): Move
7357 implementations out of Stringpool_template class and place in
7358 stringpool.h.
7359 * stringpool.h (string_length): Move out of Stringpool_template.
7360
1e3811b0
ILT
73612010-08-03 Ian Lance Taylor <iant@google.com>
7362
7363 PR 11712
7364 * layout.cc (relaxation_loop_body): If address of load segment is
7365 set, adjust address to include headers if possible.
7366
7af0c620
ILT
73672010-08-03 Ian Lance Taylor <iant@google.com>
7368
7369 * version.cc (version_string): Bump to 1.10.
7370
22f0da72
ILT
73712010-08-03 Ian Lance Taylor <iant@google.com>
7372
7373 PR 11805
7374 * layout.h (enum Output_section_order): Define.
7375 (class Layout): Update declarations.
7376 * layout.cc (Layout::get_output_section): Add order parameter.
7377 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7378 is_first_non_relro parameters. Change all callers.
7379 (Layout::choose_output_section): Likewise.
7380 (Layout::add_output_section_data): Likewise.
7381 (Layout::make_output_section): Likewise. Set order.
7382 (Layout::default_section_order): New function.
7383 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7384 * output.cc (Output_section::Output_section): Initialize order_.
7385 Don't initialize deleted fields.
7386 (Output_segment::Output_segment): Don't initialize deleted
7387 fields.
7388 (Output_segment::add_output_section_to_load): New function
7389 replacing add_output_section. Change all callers to call this or
7390 add_output_section_to_nonload.
7391 (Output_segment::add_output_section_to_nonload): New function.
7392 (Output_segment::remove_output_section): Rewrite.
7393 (Output_segment::add_initial_output_data): Likewise.
7394 (Output_segment::has_any_data_sections): Likewise.
7395 (Output_segment::is_first_section_relro): Likewise.
7396 (Output_segment::maximum_alignment): Likewise.
7397 (Output_segment::has_dynamic_reloc): New function replacing
7398 dynamic_reloc_count. Change all callers.
7399 (Output_segment::has_dynamic_reloc_list): New function replacing
7400 dynamic_reloc_count_list. Change all callers.
7401 (Output_segment::set_section_addresses): Rewrite.
7402 (Output_segment::set_offset): Rewrite.
7403 (Output_segment::find_first_and_last_list): Remove.
7404 (Output_segment::set_tls_offsets): Rewrite.
7405 (Output_segment::first_section_load_address): Likewise.
7406 (Output_segment::output_section_count): Likewise.
7407 (Output_segment::section_with_lowest_load_address): Likewise.
7408 (Output_segment::write_section_headers): Likewise.
7409 (Output_segment::print_sections_to_map): Likewise.
7410 * output.h (class Output_data): Remove dynamic_reloc_count_
7411 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7412 (Output_data::add_dynamic_reloc): Rewrite.
7413 (Output_data::has_dynamic_reloc): New function.
7414 (Output_data::dynamic_reloc_count): Remove.
7415 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7416 is_last_relro_, is_first_non_relro_, is_interp_,
7417 is_dynamic_linker_section_ fields. Add order and set_order
7418 functions. Remove is_relro_local, set_is_relro_local,
7419 is_last_relro, set_is_last_relro, is_first_non_relro,
7420 set_is_first_non_relro functions, is_interp, set_is_interp,
7421 is_dynamic_linker_section, and set_is_dynamic_linker_section
7422 functions.
7423 (class Output_segment): Change Output_data_list from std::list to
7424 std:;vector. Add output_lists_ field. Remove output_data_ and
7425 output_bss_ fields. Update declarations.
7426
3ff2ccb0
ILT
74272010-08-02 Ian Lance Taylor <iant@google.com>
7428
7429 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7430 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7431 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7432
88a4108b
ILT
74332010-08-02 Ian Lance Taylor <iant@google.com>
7434
7435 PR 11855
7436 * script.cc (Script_options::Script_options): Initialize
7437 symbol_definitions_ and symbol_references_.
7438 (Script_options::add_symbol_assignment): Update
7439 symbol_definitions_ and symbol_references_.
7440 (Script_options::add_symbol_reference): New function.
7441 (script_symbol): New function.
7442 * script.h (class Script_options): Add symbol_definitions_ and
7443 symbol_references_ fields.
7444 (Script_options::referenced_const_iterator): New type.
7445 (Script_options::referenced_begin): New function.
7446 (Script_options::referenced_end): New function.
7447 (Script_options::is_referenced): New function.
7448 (Script_options::any_unreferenced): New function.
7449 * script-c.h (script_symbol): Declare.
7450 * yyscript.y (exp): Call script_symbol.
7451 * symtab.cc: Include "script.h".
7452 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7453 Change all callers. Check symbols referenced by scripts.
7454 (Symbol_table::add_undefined_symbols_from_command_line): Add
7455 layout parameter. Change all callers.
7456 (Symbol_table::do_add_undefined_symbols_from_command_line):
7457 Likewise. Break out loop body. Check symbols referenced by
7458 scripts.
7459 (Symbol_table::add_undefined_symbol_from_command_line): New
7460 function broken out of
7461 do_add_undefined_symbols_from_command_line.
7462 * symtab.h (class Symbol_table): Update declarations.
7463 * archive.cc: Include "layout.h".
7464 (Archive::should_include_member): Add layout parameter. Change
7465 all callers. Check for symbol mentioned in expression.
7466 * archive.h (class Archive): Update declaration.
7467 * object.cc (Sized_relobj::do_should_include_member): Add layout
7468 parameter.
7469 * object.h (Object::should_include_member): Add layout parameter.
7470 Change all callers.
7471 (Object::do_should_include_member): Add layout parameter.
7472 (class Sized_relobj): Update declaration.
7473 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7474 parameter.
7475 * dynobj.h (class Sized_dynobj): Update declaration.
7476 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7477 layout parameter.
7478 * plugin.h (class Sized_pluginobj): Update declaration.
7479
5f1ab67a
ILT
74802010-08-02 Ian Lance Taylor <iant@google.com>
7481
7482 PR 11866
7483 * output.cc (Output_segment::set_offset): Search for the first and
7484 last sections rather than assuming that the list is in order.
7485 (Output_segment::find_first_and_last_list): New function.
7486 * output.h (class Output_segment): Update declarations.
7487 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7488 (relro_strip_test_SOURCES): New variable.
7489 (relro_strip_test_DEPENDENCIES): New variable.
7490 (relro_strip_test_LDFLAGS): New variable.
7491 (relro_strip_test_LDADD): New variable.
7492 (relro_strip_test.so): New target.
7493
a8df5856
ILT
74942010-08-02 Ian Lance Taylor <iant@google.com>
7495
7496 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7497 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7498 (Target_i386::got_tlsdesc_section): New function.
7499 (Target_i386::got_section): Create space for GOT entries for
7500 TLSDESC relocations.
7501 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7502 R_386_TLS_GOTDESC.
7503 (Target_i386::Scan::global): Likewise.
7504 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7505 using TLSDESC GOT.
7506 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7507 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7508 (Target_x86_64::got_tlsdesc_section): New function.
7509 (Target_x86_64::got_section): Create space for GOT entries for
7510 TLSDESC relocations.
7511 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7512 R_386_TLS_GOTDESC.
7513 (Target_x86_64::Scan::global): Likewise.
7514 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7515 using TLSDESC GOT.
7516
0c10a0a6
ILT
75172010-08-02 Ian Lance Taylor <iant@google.com>
7518
7519 * testsuite/final_layout.sh: Use dc to convert from hex to
7520 decimal.
7521
41cbeecc
ST
75222010-07-29 Sriraman Tallam <tmsriram@google.com>
7523
7524 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7525 paramter to the call to gold::gc_process_relocs.
7526 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7527 paramter to the call to gold::gc_process_relocs.
7528 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7529 parameter to the call to gold::gc_process_relocs.
7530 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7531 template parameter to the call to gold::gc_process_relocs.
7532 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7533 paramter to the call to gold::gc_process_relocs.
7534 * gc.h (get_embedded_addend_size): New function.
7535 (gc_process_relocs): Save the size of the reloc for use by ICF.
7536 * icf.cc (get_section_contents): Get the addend from the text section
7537 for SHT_REL relocation sections.
7538 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7539 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7540 * int_encoding.h (read_from_pointer): New overloaded function.
7541 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7542 * testsuite/icf_sht_rel_addend_test.sh: New file.
7543 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7544 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7545
6ea55b82
RW
75462010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7547
7548 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7549 * Makefile.in: Regenerate.
7550 * testsuite/Makefile.in: Regenerate.
7551
9691462b
ILT
75522010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7553
7554 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7555 * gold/testsuite/debug_msg.cc: Likewise.
7556 * gold/testsuite/odr_violation1.cc
7557 * gold/testsuite/odr_violation2.cc
7558
76897331
CC
75592010-07-21 Cary Coutant <ccoutant@google.com>
7560
7561 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7562 string, and length fields.
7563 (Output_merge_string::Merged_strings_list): New type.
7564 (Output_merge_string::Merged_strings_lists): New typedef.
7565 (Output_merge_string): Replace merged_strings_ with
7566 merged_strings_lists_.
7567 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7568 Merged_strings_list per input object and section. Don't store pointer
7569 to the string. Don't store length with each merged string entry.
7570 (Output_merge_string::finalize_merged_data): Loop over list of merged
7571 strings lists. Recompute length of each merged string.
7572
78384e8f
CC
75732010-07-15 Cary Coutant <ccoutant@google.com>
7574
7575 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7576 here.
7577
783659f9
ILT
75782010-07-14 Ian Lance Taylor <iant@google.com>
7579
7580 * descriptors.cc (Descriptors::open): Report correct name in error
7581 message.
7582
131687b4
DK
75832010-07-13 Doug Kwan <dougkwan@google.com>
7584
7585 * arm.cc (Arm_input_section::Arm_input_section): For a
7586 SHT_ARM_EXIDX section, always keeps the input sections.
7587 (Arm_input_section::set_exidx_section_link): New method.
7588 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7589 has_errors_ to false.
7590 (Arm_exidx_input_section::has_errors,
7591 Arm_exidx_input_section::set_has_errors): New methods.
7592 (Arm_exidx_input_section::has_errors_): New data member.
7593 (Arm_relobj::get_exidx_shndx_list): New method.
7594 (Arm_output_section::append_text_sections_to_list): Do not skip
7595 section without SHF_EXECINSTR.
7596 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7597 errors.
2e702c99 7598 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
7599 section header. Make error messages more verbose. Check for
7600 a non-executable section linked to an EXIDX section.
7601 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7602 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7603 check that there is no deferred EXIDX section if we exit early.
7604 Instead of not making an EXIDX section in case of an error, make one
7605 and set the has_errors flag of it.
7606 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7607 in a relocatable link.
7608 (Target_arm::do_relax): Look for the EXIDX output section instead of
7609 assuming that it is called .ARM.exidx.
2e702c99 7610 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
7611 section list. Do not check for SHF_EXECINSTR section flags but
7612 skip any input section with errors.
7613 * output.cc (Output_section::Output_section): Initialize
7614 always_keeps_input_sections_ to false.
7615 (Output_section::add_input_section): Check for
7616 always_keeps_input_sections_.
7617 * output.h (Output_section::always_keeps_input_sections,
7618 Output_section::set_always_keeps_input_sections): New methods.
7619 (Output_section::always_keeps_input_sections): New data member.
7620
69517287
RÁE
76212010-07-13 Rafael Espindola <espindola@google.com>
7622
7623 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7624 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7625
82742395
ILT
76262010-07-13 Philip Herron <herron.philip@googlemail.com>
7627 Ian Lance Taylor <iant@google.com>
7628
7629 * output.h (Output_section_lookup_maps::add_merge_section):
7630 Correct check of whether value was inserted.
7631 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7632 (Output_section_lookup_maps::add_relaxed_input_section):
7633 Likewise.
7634 * arm.cc (Target_arm::got_section): Remove used local os.
7635 * i386.cc (Target_i386::got_section): Likewise.
7636 * x86_64.cc (Target_x86_64::got_section): Likewise.
7637 * sparc.cc (Target_sparc::got_section): Likewise.
7638 (Target_sparc::relocate): Remove unused local have_got_offset.
7639 * powerpc.cc (Target_powerpc::relocate): Likewise.
7640
f2d707b5
ILT
76412010-07-13 Ian Lance Taylor <iant@google.com>
7642
241531d6
ILT
7643 * compressed_output.cc (zlib_decompress): Fix signature in
7644 !HAVE_ZLIB_H case.
7645
f2d707b5
ILT
7646 * archive.cc (Archive::include_member): Unlock an external member
7647 of a thin archive. Don't bother to delete an object we know is
7648 NULL.
7649
a2e47362
CC
76502010-07-12 Cary Coutant <ccoutant@google.com>
7651
7652 * compressed_output.cc (zlib_decompress): New function.
7653 (get_uncompressed_size): New function.
7654 (decompress_input_section): New function.
7655 * compressed_output.h (get_uncompressed_size): New function.
7656 (decompress_input_section): New function.
7657 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7658 Handle compressed debug sections.
7659 * layout.cc (is_compressed_debug_section): New function.
7660 (Layout::output_section_name): Map compressed section names to
7661 canonical names.
7662 * layout.h (is_compressed_debug_section): New function.
7663 (is_debug_info_section): Recognize compressed debug sections.
7664 * merge.cc: Include compressed_output.h.
7665 (Output_merge_data::do_add_input_section): Handle compressed
7666 debug sections.
7667 (Output_merge_string::do_add_input_section): Handle compressed
7668 debug sections.
7669 * object.cc: Include compressed_output.h.
7670 (Sized_relobj::Sized_relobj): Initialize new data members.
7671 (build_compressed_section_map): New function.
7672 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7673 * object.h (Object::section_is_compressed): New method.
7674 (Object::do_section_is_compressed): New method.
7675 (Sized_relobj::Compressed_section_map): New type.
7676 (Sized_relobj::do_section_is_compressed): New method.
7677 (Sized_relobj::compressed_sections_): New data member.
7678 * output.cc (Output_section::add_input_section): Handle compressed
7679 debug sections.
7680 * reloc.cc: Include compressed_output.h.
7681 (Sized_relobj::write_sections): Handle compressed debug sections.
7682
ce279a62
CC
76832010-07-08 Cary Coutant <ccoutant@google.com>
7684
7685 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7686 weak when resolving to a dynamic def.
7687 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7688 for weak undef/dynamic def cases. Adjust callers.
7689 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7690 undef_binding_weak_.
7691 (Symbol_table::sized_write_globals): Adjust symbol binding.
7692 (Symbol_table::sized_write_symbol): Add binding parameter.
7693 * symtab.h (Symbol::set_undef_binding): New method.
7694 (Symbol::is_undef_binding_weak): New method.
7695 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
7696 (Symbol_table::should_override): Add new parameter.
7697 (Symbol_table::sized_write_symbol): Add new parameter.
7698
7699 * testsuite/weak_undef_file1.cc: Add new test case.
7700 * testsuite/weak_undef_file2.cc: Fix header comment.
7701 * testsuite/weak_undef_test.cc: Add new test case.
7702
b2286c10
DK
77032010-06-29 Doug Kwan <dougkwan@google.com>
7704
7705 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
7706 Initialize USE_SYMBOL_.
7707 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
7708 definition.
7709 (Arm_reloc_property::uses_symbol_): New data member declaration.
7710 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
7711 uses symbol value and symbol is undefined but not weakly undefined.
7712
4802450a
RÁE
77132010-06-28 Rafael Espindola <espindola@google.com>
7714
7715 * plugin.cc (Plugin::load): Use dlerror.
7716
e5ca47ba
ILT
77172010-06-26 Jeffrey Yaskin <jyasskin@google.com>
7718
7719 * symtab.cc (detect_odr_violations): When reporting an ODR
7720 violation, report an object where the symbol is defined.
7721
8a75a161
DK
77222010-06-25 Doug Kwan <dougkwan@google.com>
7723
7724 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
7725 (Target_arm::section_may_have_icf_unsafe_pointers): New method
7726 definition.
7727 (Target_arm::Scan::local_reloc_may_be_function_pointer,
7728 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
7729 target hook to detect function points.
7730 (Target_arm::Scan::possible_function_pointer_reloc): New method.
7731 * icf.h (Icf::check_section_for_function_pointers): Change type of
7732 parameter SECTION_NAME to const reference to std::string. Use
7733 target hook to determine if section may have unsafe pointers.
7734 * target.h (Target::section_may_have_icf_unsafe_pointers): New
7735 method definition.
7736
42218b9f
RÁE
77372010-06-21 Rafael Espindola <espindola@google.com>
7738
7739 * fileread.cc (Input_file::find_fie): New
7740 (Input_file::open): Use Input_file::find_fie.
7741 * fileread.h (Input_file::find_fie): New
7742 * plugin.cc (set_extra_library_path): New.
7743 (Plugin::load): Add set_extra_library_path to the transfer vector.
7744 (Plugin_manager::set_extra_library_path): New.
7745 (Plugin_manager::add_input_file): Use the extra search path if set.
7746 (set_extra_library_path(): New.
7747 * plugin.h (Plugin_manager): Add set_extra_library_path and
7748 extra_search_path_.
7749
a0506cca
CC
77502010-06-19 Cary Coutant <ccoutant@google.com>
7751
7752 * layout.cc (gdb_sections): Add .debug_types.
7753 (lines_only_debug_sections): Likewise.
7754
6508b958
RÁE
77552010-06-18 Rafael Espindola <espindola@google.com>
7756
7757 * plugin.cc (add_input_file,add_input_library)
7758 (Plugin_manager::add_input_file): Make filename arguments const.
7759 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
7760 const.
7761
3e235302
DK
77622010-06-16 Doug Kwan <dougkwan@google.com>
7763
7764 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
7765 .ARM.attributes section if we have not merged any input
7766 attributes sections.
7767
106e8a6c
DK
77682010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7769
7770 * arm.cc: Allow combining objects with no EABI version
7771 information.
7772
91ff43fe
RÁE
77732010-06-15 Rafael Espindola <espindola@google.com>
7774
7775 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
7776
68ed838c
ILT
77772010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7778
7779 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
7780 (struct iovec): Correct !HAVE_READV definition.
7781
f3a2388f
CC
77822010-06-10 Cary Coutant <ccoutant@google.com>
7783
7784 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
7785 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
7786 reloc sections.
7787 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
7788
7789 PR 11683
7790 * symtab.h (Symbol::is_placeholder): New member function.
7791 * target-reloc.h (relocate_section): Check for placeholder symbols.
7792
7793 * testsuite/Makefile.am (plugin_test_8): New test.
7794 (plugin_test_9): New test.
7795 * testsuite/Makefile.in: Regenerate.
7796
e1df38aa
NC
77972010-06-09 Nick Clifton <nickc@redhat.com>
7798
7799 * yyscript.y (input_list_element): Allow strings prefixed with
7800 the '-' character. Treat these as libraries.
7801 * script.cc (script_add_library): New function. Adds a library
7802 specified by "-l<name>" found in an input script.
7803 * script-c.h: Add prototype for script_add_library.
7804
25bbe950
DK
78052010-06-07 Doug Kwan <dougkwan@google.com>
7806
7807 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
7808 Restrict stub-group size to be within long conditional branch
7809 range when working around cortex-A8 erratum.
7810
0f32ea4c
ILT
78112010-06-07 Damien Diederen <dd@crosstwine.com>
7812
7813 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
7814 #ifdef typo.
7815
8fe2a369
ST
78162010-06-03 Sriraman Tallam <tmsriram@google.com>
7817
7818 PR gold/11658
7819 * output.cc
7820 (Output_section::Input_section_sort_entry::compare_section_ordering):
7821 Change to return non-zero correctly.
7822 (Output_section::Input_section_sort_section_order_index_compare
7823 ::operator()): Change to fix ambiguity in comparisons.
7824
6e9ba2ca
ST
78252010-06-01 Sriraman Tallam <tmsriram@google.com>
7826
7827 * gold.h (is_wildcard_string): New function.
7828 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
7829 (Layout::layout_eh_frame): Ditto.
7830 (Layout::find_section_order_index): New method.
7831 (Layout::read_layout_from_file): New method.
7832 * layout.h (Layout::find_section_order_index): New method.
7833 (Layout::read_layout_from_file): New method.
7834 (Layout::input_section_position_): New private member.
7835 (Layout::input_section_glob_): New private member.
7836 * main.cc (main): Call read_layout_from_file here.
7837 * options.h (--section-ordering-file): New option.
7838 * output.cc (Output_section::input_section_order_specified_): New
7839 member.
7840 (Output_section::Output_section): Initialize new member.
7841 (Output_section::add_input_section): Add new parameter.
7842 Keep input sections when --section-ordering-file is used.
7843 (Output_section::set_final_data_size): Sort input sections when
7844 section ordering file is specified.
7845 (Output_section::Input_section_sort_entry): Add new parameter.
7846 Check sorting type.
7847 (Output_section::Input_section_sort_entry::compare_section_ordering):
7848 New method.
7849 (Output_section::Input_section_sort_compare::operator()): Change to
7850 consider section_order_index.
7851 (Output_section::Input_section_sort_init_fini_compare::operator()):
7852 Change to consider section_order_index.
7853 (Output_section::Input_section_sort_section_order_index_compare
7854 ::operator()): New method.
7855 (Output_section::sort_attached_input_sections): Change to sort
7856 according to section order when specified.
e1df38aa
NC
7857 (Output_section::add_input_section<32, true>): Add new parameter.
7858 (Output_section::add_input_section<64, true>): Add new parameter.
7859 (Output_section::add_input_section<32, false>): Add new parameter.
7860 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
7861 * output.h (Output_section::add_input_section): Add new parameter.
7862 (Output_section::input_section_order_specified): New
7863 method.
7864 (Output_section::set_input_section_order_specified): New method.
7865 (Input_section::Input_section): Initialize section_order_index_.
7866 (Input_section::section_order_index): New method.
7867 (Input_section::set_section_order_index): New method.
7868 (Input_section::section_order_index_): New member.
7869 (Input_section::Input_section_sort_section_order_index_compare): New
7870 struct.
7871 (Output_section::input_section_order_specified_): New member.
7872 * script-sections.cc (is_wildcard_string): Delete and move modified
7873 method to gold.h.
7874 (Output_section_element_input::Output_section_element_input): Modify
7875 call to is_wildcard_string.
7876 (Output_section_element_input::Input_section_pattern
7877 ::Input_section_pattern): Ditto.
7878 (Output_section_element_input::Output_section_element_input): Ditto.
7879 * testsuite/Makefile.am (final_layout): New test case.
7880 * testsuite/Makefile.in: Regenerate.
7881 * testsuite/final_layout.cc: New file.
7882 * testsuite/final_layout.sh: New file.
7883
3537c84b
RÁE
78842010-06-01 Rafael Espindola <espindola@google.com>
7885
7886 * plugin.cc (Plugin::load): Pass the output name to the plugin.
7887
105b6afd
RÁE
78882010-06-01 Rafael Espindola <espindola@google.com>
7889
7890 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
7891 visibility of symbols.
7892
29e11421
DK
78932010-05-27 Doug Kwan <dougkwan@google.com>
7894
7895 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
7896 from start of output section instead of address for a local symbol
7897 in a merged or relaxed section when doing a relocatable link.
7898
5e0f337e
RÁE
78992010-05-26 Rafael Espindola <espindola@google.com>
7900
703d02da 7901 PR 11604
5e0f337e
RÁE
7902 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7903 adding sections the garbage collector removed.
7904 * gold/testsuite/Makefile.am: Add test.
7905 * gold/testsuite/Makefile.in: Regenerate.
7906 * gold/testsuite/plugin_test_7.sh: New.
7907 * gold/testsuite/plugin_test_7_1.c: New.
7908 * gold/testsuite/plugin_test_7_2.c: New.
7909
f4187277
RÁE
79102010-05-26 Rafael Espindola <espindola@google.com>
7911
7912 * script-sections.cc (Output_section_definition::set_section_addresses):
7913 Check for --section-start.
7914
5c388529
DK
79152010-05-26 Doug Kwan <dougkwan@google.com>
7916
7917 * arm.cc (Arm_scan_relocatable_relocs): New class.
7918 (Target_arm::relocate_special_relocatable): New method.
7919 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7920 (Arm_relocate_functions::thumb_branch_common): Same.
7921 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7922 instead of Default_scan_relocatable_relocs.
7923 * target-reloc.h (relocate_for_relocatable): Let target handle
7924 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7925 * target.h (Sized_target::relocate_special_relocatable): New method.
7926
bca1c3ae
ILT
79272010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7928
7929 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7930
0439c796
DK
79312010-05-23 Doug Kwan <dougkwan@google.com>
7932
7933 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
7934 instead of a cast.
7935 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
7936 with a direct branch, not a conditional branch, to a stub.
7937 * merge.cc (Output_merge_base::record_input_section): New method
7938 defintion.
7939 (Output_merge_data::do_add_input_section): Record input section if
7940 keeps-input-sections flag is set.
7941 (Output_merge_string::do_add_input_section): Ditto.
7942 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
7943 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
7944 INPUT_SECTIONS_.
7945 (Output_merge_base::keeps_input_sections,
7946 Output_merge_base::set_keeps_input_sections,
7947 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
7948 method definitions.
7949 (Output_merge_base::Input_sections): New type declaration.
7950 (Output_merge_base::input_sections_begin,
7951 Output_merge_base::input_sections_end,
7952 Output_merge_base::do_set_keeps_input_sections): New method definitions.
7953 (Output_merge_base::bool keeps_input_sections_,
7954 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
7955 Output_merge_base::input_sections_): New data members.
7956 (Output_merge_data::do_set_keeps_input_sections): New method
7957 defintion.
7958 (Output_merge_string::do_set_keeps_input_sections): Ditto.
7959 * output.cc (Output_section::Input_section::relobj): Move method
7960 defintion from class declaration to here and handle merge sections.
7961 (Output_section::Input_section::shndx): Ditto.
7962 (Output_section::Output_section): Remove initializations of removed
7963 data members and initialize new data member LOOKUP_MAPS_.
7964 (Output_section::add_input_section): Set keeps-input-sections flag
7965 for a newly created merge output section as appropriate. Adjust code
7966 to use Output_section_lookup_maps class.
7967 (Output_section::add_relaxed_input_section): Adjst code for lookup
7968 maps code refactoring.
2e702c99 7969 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
7970 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
7971 class. If adding input section to a newly created merge output
7972 section fails, remove the new merge section.
7973 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 7974 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 7975 (Output_section::find_merge_section): Ditto.
0439c796 7976 (Output_section::build_lookup_maps): New method defintion.
2e702c99 7977 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
7978 Output_section_lookup_maps class.
7979 (Output_section::get_input_sections): Export merge sections. Adjust
7980 code to use Output_section_lookup_maps class.
7981 (Output_section:::add_script_input_section): Adjust code to use
7982 Output_section_lookup_maps class. Update lookup maps for merge
7983 sections also.
7984 (Output_section::discard_states): Use Output_section_lookup_maps.
7985 (Output_section::restore_states): Same.
7986 * output.h (Merge_section_properties): Move class defintion out of
7987 Output_section.
7988 (Output_section_lookup_maps): New class.
7989 (Output_section::Input_section::is_merge_section): New method
7990 defintion.
7991 (Output_section::Input_section::relobj): Move defintion out of class
7992 defintion. Declare method only.
7993 (Output_section::Input_section::shndx): Ditto.
7994 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 7995 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
7996 (Output_section::Merge_section_by_properties_map,
7997 Output_section::Output_section_data_by_input_section_map,
7998 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
7999 Remove types.
2e702c99 8000 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8001 KEEPS_INPUT_SECTIONS.
8002 (Output_section::build_lookup_maps): New method declaration.
8003 (Output_section::merge_section_map_,
8004 Output_section::merge_section_by_properties_map_,
8005 Output_section::relaxed_input_section_map_,
8006 Output_section::is_relaxed_input_section_map_valid_): Remove data
8007 members.
8008 (Output_section::lookup_maps_): New data member.
8009
76295588
L
80102010-05-21 Doug Kwan <dougkwan@google.com>
8011
8012 PR gold/11619
8013 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8014 avoid a compilation error.
8015
d103a984
RÁE
80162010-05-19 Rafael Espindola <espindola@google.com>
8017
8018 * script-sections.cc (Output_section_definition::allocate_to_segment):
8019 Update the phdrs_list even when the output section is NULL.
8020 * testsuite/Makefile.am: Add test.
8021 * testsuite/Makefile.in: Regenerate.
8022 * testsuite/script_test_9.cc: New.
8023 * testsuite/script_test_9.sh: New.
8024 * testsuite/script_test_9.t: New.
8025
6625d24e
DK
80262010-05-19 Doug Kwan <dougkwan@google.com>
8027
8028 * arm.cc (Arm_input_section::original_size): New method.
8029 (Arm_input_section::do_addralign): Add a cast.
8030 (Arm_input_section::do_output_offset): Remove static cast.
8031 (Arm_input_section::original_addralign,
8032 Arm_input_section::original_size_): Change type to uint32_t.
8033 (Arm_input_section::init): Add safe casts for section alignment
8034 and size.
8035 (Arm_input_section::set_final_data_size): Do not set address and
8036 offset of stub table.
8037 (Arm_output_section::fix_exidx_coverage): Change use of of
8038 Output_section::Simple_input_section to that of
8039 Output_section::Input_section.
8040 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8041 except for the first pass.
8042 * output.cc (Output_section::get_input_sections): Change type of
8043 input_sections to std::list<Input_section>.
8044 (Output_section::add_script_input_section): Rename from
8045 Output_section::add_simple_input_section. Change type of SIS
8046 parameter from Simple_input_section to Input_section.
8047 * output.h (Output_section::Simple_input_section): Remove class.
8048 (Output_section::Input_section): Change class visibility to public.
8049 (Output_section::Input_section::addralign): Use stored alignments
8050 for special input sections if set.
8051 (Output_section::Input_section::set_addralign): New method.
8052 (Output_section::get_input_sections): Change parameter type from
8053 list of Simple_input_section to list of Input_section.
8054 (Output_section::add_script_input_section): Rename from
8055 Output_section::add_simple_input_section. Change first parameter's
8056 type from Simple_input_section to Input_section and remove the
8057 second and third parameters.
8058 * script-sections.cc (Input_section::Input_section_list): Change
8059 type to list of Output_section::Input_section/
8060 (Input_section_info::Input_section_info): Change parameter type of
8061 INPUT_SECTION to Output_section::Input_section.
8062 (Input_section_info::input_section): Change return type.
8063 (Input_section_info::input_section_): Change type to
8064 Output_section::Input_section.
8065 (Output_section_element_input::set_section_addresses): Adjust code
8066 to use Output_section::Input_section instead of
8067 Output_section::Simple_input_section. Adjust code for renaming
8068 of Output_section::add_simple_input_section.
8069 (Orphan_output_section::set_section_addresses): Ditto.
8070
e1e82ea4
RW
80712010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8072
8073 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8074 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8075
91e75c8a
RÁE
80762010-05-18 Rafael Espindola <espindola@google.com>
8077
8078 * options.cc (General_options::finalize): Handle -nostdlib.
8079 * options.h (nostdlib): New option.
8080 * script.cc (script_add_search_dir): Handle -nostdlib.
8081
da59ad79
DK
80822010-05-12 Doug Kwan <dougkwan@google.com>
8083
8084 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8085 attributes section only if there no attributes section after merging.
8086 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8087 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8088 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8089 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8090 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8091 and arm_attr_merge_7.stdout.
8092 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8093 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8094 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8095 arm_attr_merge_7b.o): New rules.
8096 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8097 arm_attr_merge_7
8098 * testsuite/Makefile.in: Regenerate.
8099 * testsuite/arm_attr_merge.sh: New file.
8100 * testsuite/arm_attr_merge_[67][ab].s: Same.
8101
3e01a7fd
NC
81022010-05-05 Nick Clifton <nickc@redhat.com>
8103
8104 * po/es.po: Updated Spanish translation.
8105
7ad2014a
L
81062010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8107
8108 * Makefile.am (install-exec-local): Properly install gold as
8109 default cross linker.
8110 * Makefile.in: Regenerated.
8111
4fda8867
NC
81122010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8113 Nick Clifton <nickc@redhat.com>
8114
8115 * configure.ac (install_as_default): Define and set to false
8116 unless --enable-gold or --enable-gold=both/gold has been
8117 specified.
8118 * configure: Regenerate.
8119
8120 * Makefile.am (install-exec-local): Install the executable as
8121 'ld.gold'. If install_as_default is true then also install it as
8122 'ld'.
8123 * Makefile.in: Regenerated.
8124
bd288ea2
ILT
81252010-04-24 Ian Lance Taylor <iant@google.com>
8126
8127 * layout.cc (Layout::layout_reloc): In relocatable link don't
8128 combine reloc sections for grouped sections.
8129
ef38fd8a
ST
81302010-04-23 Sriraman Tallam <tmsriram@google.com>
8131
8132 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8133 sections that are not ordinary to icf.
8134 * icf.cc (get_section_contents): Handle relocation pointing to section
8135 with no object or shndx information.
8136 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8137 * testsuite/Makefile.in: Regenerate.
8138 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8139 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8140
f6973bdc
ILT
81412010-04-22 Ian Lance Taylor <iant@google.com>
8142
8143 * expression.cc (Expression::Expression_eval_info): Add
8144 result_alignment_pointer field.
8145 (Expression::eval_with_dot): Add result_alignment_pointer
8146 parameter. Change all callers.
8147 (Expression::eval_maybe_dot): Likewise.
8148 (class Binary_expression): Add alignment_pointer parameter to
8149 left_value and right_value. Change all callers.
8150 (BINARY_EXPRESSION): Set result alignment.
8151 (class Trinary_expression): Add alignment_pointer parameter to
8152 arg2_value and arg3_value. Change all callers.
8153 (Trinary_cond::value): Set result alignment.
8154 (Max_expression::value, Min_expression::value): Likewise.
8155 (Align_expression::value): Likewise.
8156 * script-sections.cc (class Sections_element): Add dot_alignment
8157 parameter to set_section_addresses virtual function. Update
8158 instantiations.
8159 (class Output_section_element): Likewise.
8160 (Script_sections::create_segments): Add dot_alignment parameter.
8161 Change all callers.
8162 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8163 (Script_sections::set_phdrs_clause_addresses): Likewise.
8164 * script-sections.h: Update declarations.
8165 * script.h: Update declarations.
8166 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8167 min_p_align.
8168 * testsuite/script_test_3.t: Set large alignment.
8169 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8170 segment has expected alignment.
8171
9c9c98a5
NC
81722010-04-22 Nick Clifton <nickc@redhat.com>
8173
8174 * po/gold.pot: Updated by the Translation project.
8175 * po/vi.po: Updated Vietnamese translation.
8176
2253bfba
L
81772010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8178
8179 * testsuite/Makefile.am (check_PROGRAMS): Add
8180 icf_virtual_function_folding_test.
8181 * testsuite/Makefile.in: Regenerated.
8182
85fdf906
AH
81832010-04-15 Andrew Haley <aph@redhat.com>
8184
8185 * options.h (merge_exidx_entries): New option.
8186 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8187 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8188 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8189 (Target_arm::merge_exidx_entries): New function.
8190 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8191 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8192 to Arm_exidx_fixup constructor.
8193 Add new arg, merge_exidx_entries.
8194 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8195 Arm_output_section::fix_exidx_coverage.
8196
ce97fa81
ST
81972010-04-18 Sriraman Tallam <tmsriram@google.com>
8198
8199 * icf.cc (get_section_contents): Check for preemptible functions.
8200 Ignore addend when appropriate.
8201 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8202 section folded.
8203 (add_from_relobj): Check for section folded.
8204 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8205 * symtab.h (should_add_dynsym_entry): Add new parameter.
8206 * target-reloc.h (scan_relocs): Check for section folded.
8207 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8208 Check reloc types for function pointers in shared objects.
8209 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8210 case.
8211 (icf_preemptible_functions_test): New test case.
8212 (icf_string_merge_test): New test case.
8213 * testsuite.Makefile.in: Regenerate.
8214 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8215 bar_glob. Refactor code.
8216 * testsuite/icf_preemptible_functions_test.cc: New file.
8217 * testsuite/icf_preemptible_functions_test.sh: New file.
8218 * testsuite/icf_string_merge_test.cc: New file.
8219 * testsuite/icf_string_merge_test.sh: New file.
8220 * testsuite/icf_virtual_function_folding_test.cc: New file.
8221 * testsuite/icf_virtual_function_folding_test.sh: New file.
8222
04ceb17c
DK
82232010-04-14 Doug Kwan <dougkwan@google.com>
8224
8225 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8226 for local symbol recounting if we remove a section due to ICF.
8227 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8228 there are no regular objects in input.
8229
153e7da4
DK
82302010-04-13 Doug Kwan <dougkwan@google.com>
8231
8232 * arm.cc (Arm_input_section::set_final_data_size): Compute
8233 accurate final data size instead of using current data size.
8234
4dbd9faf
DK
82352010-04-09 Doug Kwan <dougkwan@google.com>
8236
8237 * layout.cc (Layout::choose_output_section): Handle script section
8238 types.
8239 (Layout::make_output_section_for_script): Add section type parameter.
8240 Handle script section types.
8241 * layout.h (Layout::make_output_section_for_script): Add section
8242 type parameter.
8243 * output.cc (Output_section::Output_section): Initialize data member
8244 is_noload_.
8245 (Output_section::do_reset_address_and_file_offset): Do not set address
8246 to 0 if section is a NOLOAD section.
8247 * output.h (Output_section::is_noload): New method.
8248 (Output_section::set_is_noload): Ditto.
8249 (Output_section::is_noload_): New data member.
8250 * script-c.h (Script_section_type): New enum type.
8251 (struct Parser_output_section_header): Add new file section_type.
8252 * script-sections.cc (Sections_element::output_section_name): Add
8253 parameter for returning script section type.
8254 (Output_section_definition::output_section_name): Ditto.
8255 (Output_section_definition::section_type)P; New method.
8256 (Output_section_definiton::script_section_type_name): Ditto.
8257 (Output_section_definition::script_section_type_): New data member.
8258 (Output_section_definition::Output_section_definition): Initialize
8259 data member Output_section_definition::script_section_type_.
8260 (Output_section_definition::create_sections): Pass script section type
8261 to Layout::make_output_section_for_script.
8262 (Output_section_definition::output_section_name): Return script
8263 section type to caller.
8264 (Output_section_definition::set_section_address): Do not advance
8265 dot value and load address if section type is NOLOAD. Set address
8266 of NOLOAD sections regardless of section flags.
8267 (Output_section_definition::print): Print section type if it is
8268 not SCRIPT_SECTION_TYPE_NONE.
8269 (Output_section_definition::section_type): New method.
8270 (Output_section_definition::script_section_type_name): Ditto.
8271 (Script_sections::output_section_name): Add new parameter
8272 PSECTION_TYPE for returning script section type. Pass it to
8273 section elements. Handle discard sections.
8274 (Sort_output_sections::operator()): Handle NOLOAD sections.
8275 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8276 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8277 returning script section type.
8278 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8279 INFO and NOLOAD.
8280 * yyscript.y (union): Add new field SECTION_TYPE.
8281 (COPY, DSECT, INFO, NOLOAD): New tokens.
8282 (opt_address_and_section_type): Change type to output_section_header.
8283 (section_type): New non-terminal
8284 (section_header): Handle section type.
2253bfba 8285 (opt_address_and_section_type): Return section type value.
4dbd9faf 8286
721ea635
L
82872010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8288
8289 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8290 * testsuite/plugin_common_test_2.c (foo): Likewise.
8291
6bf924b0
DK
82922010-04-08 Doug Kwan <dougkwan@google.com>
8293
8294 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8295 Output_merge_data.
8296 * output.cc (Output_section::add_merge_input_section): Simplify
8297 code and return status of Output_merge_base::add_input_section.
e1df38aa 8298 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8299 returns true.
8300
24af6f92
DK
83012010-04-07 Doug Kwan <dougkwan@google.com>
8302
8303 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8304 if section is marked as containing instructions but has no mapping
8305 symbols.
8306 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8307 correct section index.
8308 (Arm_relobj::find_linked_text_section): Ditto.
8309
00698fc5
CC
83102010-04-07 Cary Coutant <ccoutant@google.com>
8311
8312 * archive.cc (include_member): Destroy Read_symbols_data object before
8313 releasing file.
8314 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8315 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8316 (Read_symbols_data::~Read_symbols_data) New destructor.
8317 (Section_relocs::Section_relocs) New constructor.
8318 (Section_relocs::~Section_relocs) New destructor.
8319 (Read_relocs_data::Read_relocs_data) New constructor.
8320 (Read_relocs_data::~Read_relocs_data) New destructor.
8321 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8322 pointers to NULL after deleting.
8323
7296d933
DK
83242010-04-07 Doug Kwan <dougkwan@google.com>
8325
8326 * arm.cc: Replace "endianity" with "endianness" in comments.
8327 (Arm_exidx_cantunwind): Ditto.
8328 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8329 (Arm_relobj::merge_flags_and_attributes): New method.
8330 (Arm_relobj::merge_flags_and_attributes_): New data member.
8331 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8332 (Arm_relobj::scan_sections_for_stubs): Ditto.
8333 (Arm_relobj::do_read_symbols): Check to see if we really want to
8334 merge processor-specific flags and attributes. Exit early if
8335 an object is empty except for section names and the undefined symbol.
8336 (Target_arm::do_finalize_sections): Move check for ELF format to
8337 Arm_relobj::do_read_symbols. Merge processor specific flags and
8338 attributes from a regular object only when we have determined that
8339 it is aapropriate. Do not create an .ARM.attributes section in
8340 output if there is no regular input object.
8341 (Target_arm::merge_processor_specific_flags): Check
8342 --warn-mismatch before printing any error.
8343 (Target_arm::merge_object_attributes): Ditto.
8344 * gold.cc (queue_middle_tasks): Handle the case in which there is
8345 no regular object in input.
8346 * options.cc (General_options::parse_EB): New method.
8347 (General_options::parse_EL): Same.
8348 (General_options::General_options): Initialize endianness_.
8349 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8350 New options.
8351 (General_options::Endianness): New enum.
8352 (General_options::endianness): New method.
8353 (General_options::endianness_): New data member.
8354 * parameters.cc (Parameters::set_options): Check target endianness.
8355 (Parameters::set_target_once): Ditto.
8356 (Parameters::check_target_endianness): New method.
8357 (parameters_force_valid_target): If either -EL or -EB is specified,
8358 use it to define endianness of default target.
8359 * parameters.h (Parameters::check_target_endianness): New method
8360 declaration.
8361 * target.h (class Target): Change "endianity" to "endianness"
8362 in comments.
8363
efc8d4f2
RW
83642010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8365
8366 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8367 * configure: Regenerate.
8368 * Makefile.in: Regenerate.
8369 * testsuite/Makefile.in: Regenerate.
8370
be234d88
CC
83712010-04-06 Cary Coutant <ccoutant@google.com>
8372
8373 gcc PR lto/42757
8374 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8375 prevailing definitions of common symbols.
8376 * testsuite/plugin_test_6.sh: New test case.
8377 * testsuite/plugin_common_test_1.c: New test case.
8378 * testsuite/plugin_common_test_2.c: New test case.
8379 * testsuite/Makefile.am (plugin_test_6): New test case.
8380 * testsuite/Makefile.in: Regenerate.
8381
bd32c6bd
NC
83822010-04-06 Nick Clifton <nickc@redhat.com>
8383
8384 * po/vi.po: New Vietnamese translation.
8385
323c532f
DK
83862010-03-30 Doug Kwan <dougkwan@google.com>
8387
8388 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8389
4fcd97eb
DK
83902010-03-25 Doug Kwan <dougkwan@google.com>
8391
8392 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8393 to avoid a conversion warning on a 32-bit host.
8394
4ebf39db
ILT
83952010-03-24 Ian Lance Taylor <iant@google.com>
8396
8397 * testsuite/script_test_3.t: Add a TLS segment.
8398 * testsuite/Makefile.am (check_PROGRAMS): Add
8399 tls_phdrs_script_test.
8400 (tls_phdrs_script_test_SOURCES): Define.
8401 (tls_phdrs_script_test_DEPENDENCIES): Define.
8402 (tls_phdrs_script_test_LDFLAGS): Define.
8403 (tls_phdrs_script_test_LDADD): Define.
8404 * testsuite/Makefile.in: Rebuild.
8405
4a599bdd
CC
84062010-03-23 Cary Coutant <ccoutant@google.com>
8407
8408 * fileread.cc (find_or_make_view): Fix comment.
8409
6c93b22c
ILT
84102010-03-23 Ian Lance Taylor <iant@google.com>
8411
8412 * script-sections.cc (class Orphan_section_placement): Define
8413 PLACE_TLS and PLACE_TLS_BSS.
8414 (Orphan_section_placement::Orphan_section_placement): Initialize
8415 new places.
8416 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8417 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8418 (tls_script_test_SOURCES): Define.
8419 (tls_script_test_DEPENDENCIES): Define.
8420 (tls_script_test_LDFLAGS): Define.
8421 (tls_script_test_LDADD): Define.
8422 * testsuite/Makefile.in: Rebuild.
8423
a2c7281b
DK
84242010-03-22 Doug Kwan <dougkwan@google.com>
8425
8426 * arm.cc (Arm_relocate_functions::abs8,
8427 Arm_relocate_functions::abs16): Use correct check for overflow
8428 specified in the ARM ELF specs.
8429 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8430 target of a BLX instruction specially.
8431 (Reloc_stub::stub_type_for_reloc): Ditto.
8432 (Relocate::relocate): Use symbolic names instead of numeric relocation
8433 codes to report error.
8434 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8435 workaround.
8436 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8437 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8438 thumb2_blx_out_of_range.stdout
8439 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8440 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8441 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8442 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8443 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8444 thumb2_blx_in_range, thumb2_blx_in_range.o,
8445 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8446 thumb2_blx_out_of_range.o): New rules.
2e702c99 8447 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
8448 thumb2_blx_in_range and thumb2_blx_out_of_range.
8449 * testsuite/Makefile.in: Regenerate.
8450 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8451 * testsuite/thumb_blx_in_range.s: New file.
8452 * testsuite/thumb_blx_out_of_range.s: New file.
8453
b0193076
RÁE
84542010-03-22 Rafael Espindola <espindola@google.com>
8455
8456 * archive.cc (Should_include): Move to archive.h.
8457 (should_include_member): Make it a member of Archive.
8458 (Lib_group): New.
8459 (Add_lib_group_symbols): New.
8460 * archive.h: Include options.h.
8461 (Archive_member): Moved from Archive.
8462 (Should_include): Moved from archive.cc.
8463 (Lib_group): New.
8464 (Add_lib_group_symbols): New.
8465 * dynobj.cc (do_should_include_member): New.
8466 * dynobj.h (do_should_include_member): New.
8467 * gold.cc (queue_initial_tasks): Update call to queue.
8468 * main.cc (main): Print lib group stats.
8469 * object.cc (do_should_include_member): New.
8470 * object.h: Include archive.h.
8471 (Object::should_include_member): New.
8472 (Object::do_should_include_member): New.
8473 (Sized_relobj::do_should_include_member): New.
8474 * options.cc (General_options::parse_start_lib): New.
8475 (General_options::parse_end_lib): New.
8476 (Input_arguments::add_file): Handle lib groups.
8477 (Input_arguments::start_group): Check we are not in a lib.
8478 (Input_arguments::start_lib): New.
8479 (Input_arguments::end_lib): New.
8480 * options.h (General_options): Add start_lib and end_lib.
8481 (Input_argument::lib_): New.
8482 (Input_argument::lib): New.
8483 (Input_argument::is_lib): New.
8484 (Input_file_lib): New.
8485 (Input_arguments::in_lib_): New.
8486 (Input_arguments::in_lib): New.
8487 (Input_arguments::start_lib): New.
8488 (Input_arguments::end_lib_): New.
8489 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8490 in unused members as preempted.
8491 (Sized_pluginobj::do_should_include_member): New.
8492 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8493 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8494 return the blocker.
8495 (Read_symbols::do_whole_lib_group): New.
8496 (Read_symbols::do_lib_group): New.
8497 (Read_symbols::do_read_symbols): Handle lib groups.
8498 (Read_symbols::get_name): Handle lib groups.
8499 * readsyms.h (Read_symbols): Add an archive member pointer.
8500 (Read_symbols::do_whole_lib_group): New.
8501 (Read_symbols::do_lib_group): New.
8502 (Read_symbols::member_): New.
8503 * script.cc (read_input_script): Update call to queue_soon.
8504
d099120c
DK
85052010-03-19 Doug Kwan <dougkwan@google.com>
8506
8507 * arm.cc (Stub_table::Stub_table): Initialize new data members
8508 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8509 (Stub_table::add_reloc_stub): Assign stub offset and update
8510 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8511 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8512 New data members.
2e702c99 8513 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
8514 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8515 instead of going over all reloc stubs.
2e702c99 8516 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
8517 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8518 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 8519 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
8520 Stringpool_template::offset_.
8521 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8522 Stringpool_template::offset_ to zero.
8523
1aa37384
DK
85242010-03-15 Doug Kwan <dougkwan@google.com>
8525
8526 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8527 offset_.
8528 (Stringpool_template::new_key_offset): New method.
8529 (Stringpool_template::add_string): Assign offsets when adding new
8530 strings.
8531 (Stringpool_template::set_string_offsets): Do not set string offsets
8532 when not optimizing.
8533 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8534 member size_.
2e702c99
RM
8535 (Chunked_vector::clear): Clear size_.
8536 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8537 (Chunked_vector::size): Return size_.
8538 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 8539 (Chunked_vector::size_): New data member.
1aa37384
DK
8540 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8541 (Stringpool_template::new_key_offset): New method declaration.
8542 (Stringpool_template::offset_): New data member.
8543
b672b057
RÁE
85442010-03-15 Rafael Espindola <espindola@google.com>
8545
8546 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8547 Add_symbols' constructor.
8548 * readsyms.h (Add_symbols): Remove the input_group member.
8549
b6848d3c
ILT
85502010-03-10 Ian Lance Taylor <iant@google.com>
8551
8552 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8553 target to ask whether a reference to a symbol requires a stack
8554 split.
8555 * target.h (Target::is_call_to_non_split): New function.
8556 (Target::do_is_call_to_non_split): Declare virtual function.
8557 * target.cc: Include "symtab.h".
8558 (Target::do_is_call_to_non_split): New function.
8559 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8560
a2a5469e
CC
85612010-03-10 Cary Coutant <ccoutant@google.com>
8562
8563 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8564 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8565 (File_read::open[2]): Add whole_file_view_ to list of views.
8566 (File_read::make_view): Remove test of whole_file_view_.
8567 (File_read::find_or_make_view): Create whole_file_view_ if
8568 necessary.
8569 (File_read::clear_views): Replace bool parameter with enum;
8570 adjust all callers. Don't delete views with permanent data;
8571 do delete cached views and views from archives if
8572 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8573 if clearing the corresponding view.
8574 * fileread.h (File_read::Clear_views_mode): New enum.
8575 (File_read::View::is_permanent_view): New method.
8576 (File_read::clear_views): Replace bool parameter
8577 with enum; adjust all callers.
8578 * options.h (General_options): Change keep_files_mapped option;
8579 add map_whole_files.
8580 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8581 releasing the file.
8582 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8583 the file.
8584
8861f32b
DM
85852010-03-10 David S. Miller <davem@davemloft.net>
8586
8587 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8588
d62d0f5f
ST
85892010-03-09 Sriraman Tallam <tmsriram@google.com>
8590
8591 * icf.cc (get_section_contents): Add '@' marker after processing the
8592 merge reloc.
8593
9177756d
DK
85942010-03-08 Doug Kwan <dougkwan@google.com>
8595
8596 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8597 due to a conversion warning.
8598 (Arm_relobj::update_output_local_symbol_count): Check for local
8599 symbol with unset output index.
8600
9e9e071b
ILT
86012010-03-05 Ian Lance Taylor <iant@google.com>
8602
8603 * options.h (class General_options): Add --spare-dynamic-tags.
8604 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8605 --spare-dynamic-tags.
8606
a81ee015
ILT
86072010-03-05 Ian Lance Taylor <iant@google.com>
8608
8609 * incremental.cc: Include "libiberty.h".
8610
44ec90b9
RO
86112010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8612
8613 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8614 function, is_info_ member.
8615 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8616 (Versions::Versions): Update caller.
8617 (Versions::define_base_version): Likewise.
8618 (Versions::add_def): Likewise.
8619
0897ed3b
ST
86202010-03-03 Sriraman Tallam <tmsriram@google.com>
8621
8622 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8623 (Scan::possible_function_pointer_reloc): New function.
8624 (Scan::local_reloc_may_be_function_pointer): Change to call
8625 possible_function_pointer_reloc.
8626 (Scan::global_reloc_may_be_function_pointer): Ditto.
8627 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8628 relocations in ".data.rel.ro._ZTV" section.
8629 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8630 * testsuite/icf_safe_so_test.cc: Ditto.
8631 * testsuite/icf_safe_test.cc: Ditto.
8632 * testsuite/icf_safe_test.sh: Ditto.
8633
d3bbad62
ILT
86342010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8635 Ian Lance Taylor <iant@google.com>
8636
8637 * target-reloc.h (relocate_section): Check the symbol table index
8638 for -1U before setting the local symbol index.
8639 (scan_relocatable_relocs): If copying the relocation, record that
8640 the local symbol is required.
8641 * object.h (Symbol_value::is_output_symtab_index_set): New
8642 function.
8643 (Symbol_value::may_be_discarded_from_output_symtab): New
8644 function.
8645 (Symbol_value::has_output_symtab_entry): New function.
8646 (Symbol_value::needs_output_symtab_entry): Remove.
8647 (Symbol_value::output_symtab_index): Make sure the symbol index is
8648 set.
8649 (Symbol_value::set_output_symtab_index): Make sure the symbol
8650 index is not set. Make sure the new index is valid.
8651 (Symbol_value::set_must_have_output_symtab_entry): New function.
8652 (Symbol_value::has_output_dynsym_entry): New function.
8653 (Symbol_value::set_output_dynsym_index): Make sure the new index
8654 is valid.
8655 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8656 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8657 local symbol if permitted.
8658 (Sized_relobj::do_finalize_local_symbols): Call
8659 is_output_symtab_index_set rather than needs_output_symtab_entry.
8660 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8661 rather than needs_output_symtab_entry. Call
8662 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8663 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8664 is_output_symtab_index_set rather than needs_output_symtab_entry.
8665 * testsuite/discard_locals_relocatable_test.c: New file.
8666 * testsuite/discard_locals_test.sh: Test -r.
8667 * testsuite/Makefile.am (check_DATA): Add
8668 discard_locals_relocatable_test1.syms,
8669 discard_local_relocatable_test2.syms.
8670 (MOSTLYCLEANFILES): Likewise. Also add
8671 discard_locals_relocatable_test1.lout and
8672 discard_locals_relocatable_test2.out.
8673 (discard_locals_relocatable_test1.syms): New target.
8674 (discard_locals_relocatable_test.o): New target.
8675 (discard_locals_relocatable_test1.out): New target.
8676 (discard_locals_relocatable_test2.syms): New target.
8677 (discard_locals_relocatable_test2.out): New target.
8678 (various): Add missing ../ld-new dependencies.
8679 * testsuite/Makefile.in: Rebuild.
8680
7e8ccf26
NC
86812010-03-03 Nick Clifton <nickc@redhat.com>
8682
8683 * po/fi.po: New Finnish translation.
8684
2a0ff005
DK
86852010-03-01 Doug Kwan <dougkwan@google.com>
8686
8687 * layout.cc (Layout::Layout): Force section types of .init_array*,
8688 .preinit_array* and .fini_array* sections.
8689 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8690 Fix check of return value of std::string::find.().
8691 (Output_section::Input_section_sort_compare::operator()): Remove
8692 comment about .init_array.
8693 (Output_section::Input_section_sort_init_fini_compare::operator()):
8694 New method.
8695 (Output_section::sort_attached_input_sections): Handle .init_array
8696 and .fini_array specially.
8697 * output.h (Output_section::Inut_section_sort_compare): Update
8698 comment.
8699 (Output_section::Input_section_sort_init_fini_compare): New struct.
8700
c3e4ae29
DK
87012010-02-26 Doug Kwan <dougkwan@google.com>
8702
8703 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
8704 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
8705 * testsuite/debug_msg.sh: Avoid matching source line number for
8706 use of global variable undef_int.
8707
2fd9ae7a
DK
87082010-02-26 Doug Kwan <dougkwan@google.com>
8709
8710 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
8711 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
8712 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
8713 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
8714 * options.cc (General_options::General_options): Initialize member
8715 fix_v4bx_.
8716 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
8717 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
8718 and rm_no_fix_v4bx.stdout
8719 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
8720 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
8721 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
8722 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
8723 and arm_no_fix_v4bx.
8724 * Makefile.in: Regenerate.
8725 * testsuite/arm_fix_v4bx.s: New file.
8726 * testsuite/arm_fix_v4bx.sh: Ditto.
8727
67ec7d0b
DK
87282010-02-24 Doug Kwan <dougkwan@google.com>
8729
8730 * arm.cc (Target_arm::got_section): Make the .got section the first
8731 non RELRO section in the data segment.
8732 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
8733 suffixes of section names.
8734
10165461
DK
87352010-02-24 Doug Kwan <dougkwan@google.com>
8736
8737 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
8738 flags and attributes merging if an input file is a binary file.
8739 * fileread.cc (Input_file::open): Record format of original file.
8740 * fileread.h (Input_file::Format): New enum type.
2e702c99 8741 (Input_file::Input_file): Initialize data member format_.
10165461
DK
8742 (Input_file::format): New method definition.
8743 (Input_file::format_):: New data member.
8744
4a54abbb
DK
87452010-02-24 Doug Kwan <dougkwan@google.com>
8746
8747 * arm.cc (Arm_output_data_got): New class.
8748 (ARM_TCB_SIZE): New constant
8749 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
8750 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
8751 If user uses a script with a SECTIONS clause, issue only a warning
8752 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 8753 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
8754 garbage collection.
8755 (Target_arm::got_mode_index_entry): Handle static linking.
8756 (Target_arm::Scan::local): Ditto.
8757 (Target_arm::Scan::global): Ditto.
8758 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
8759 all incorrectly implemented relocations.
e1df38aa 8760 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
8761 Arm_output_section::fix_exidx_coverage.
8762 * layout.cc (Layout::section_name_mapping): Remove trailing dots
8763 from ".ARM.exidx." and ".ARM.extab.".
8764
ca419a6f
ILT
87652010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8766
8767 * arm.cc (Target_arm::do_finalize_sections): Create attribute
8768 section if it does not already exist.
8769 * attributes.cc (Attributes_section_data::Attributes_section_data):
8770 Don't crash if size is zero.
8771
135b9c78
ILT
87722010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8773 Ian Lance Taylor <iant@google.com>
8774
8775 * gold.cc (queue_middle_tasks): If no input files were opened,
8776 exit.
8777 * workqueue.h (Task_function::Task_function): Assert that there is
8778 a blocker.
8779
bb0bfe4f
DK
87802010-02-22 Doug Kwan <dougkwan@google.com>
8781
8782 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
8783 * icf.cc (get_section_contents): Cast snprintf arguments to long long
8784 types to avoid warnings due to different uint64_t implementations
8785 on different hosts.
8786
2a2b6d42
DK
87872010-02-21 Doug Kwan <dougkwan@google.com>
8788
8789 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
8790 handling of the maximum backward branch offset.
2e702c99 8791 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
8792 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
8793 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 8794 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
8795 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
8796 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
8797 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
8798 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
8799 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
8800 thumb_bl_out_of_range thumb_bl_out_of_range.o,
8801 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
8802 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
8803 thumb2_bl_out_of_range.o): New rules.
8804 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
8805 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
8806 thumb2_bl_out_of_range
8807 * testsuite/Makefile.in: Regenerate.
8808 * testsuite/arm_bl_in_range.s: New file.
8809 * testsuite/arm_bl_out_of_range.s: Ditto.
8810 * testsuite/arm_branch_in_range.sh: Ditto.
8811 * testsuite/arm_branch_range.t: Ditto.
8812 * testsuite/thumb2_branch_range.t: Ditto.
8813 * testsuite/thumb_bl_in_range.s: Ditto.
8814 * testsuite/thumb_bl_out_of_range.s: Ditto.
8815 * testsuite/thumb_branch_range.t: Ditto.
8816
b487ad64
ST
88172010-02-20 Sriraman Tallam <tmsriram@google.com>
8818
8819 * gc.h (gc_process_relocs): Change vectors to point to the new list.
8820 Add reloc offset information.
8821 * icf.cc (get_section_contents): Change iterators to point to the new
8822 vectors. Add reloc offset information to the contents.
8823 * icf.h (Icf::Sections_reachable_info): New typedef.
8824 (Icf::Sections_reachable_list): New typedef.
8825 (Icf::Offset_info): New typedef.
8826 (Icf::Reloc_info): New struct typedef.
8827 (Icf::Reloc_info_list): New typedef.
8828 (Icf::symbol_reloc_list): Delete method.
8829 (Icf::addend_reloc_list): Delete method.
8830 (Icf::section_reloc_list): Delete method.
8831 (Icf::reloc_info_list): New method.
8832 (Icf::reloc_info_list_): New member.
8833
f96accdf
DK
88342010-02-19 Doug Kwan <dougkwan@google.com>
8835
8836 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
8837 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
8838 * arm.cc (Arm_relocation_functions): New forward declaration.
8839 (Target_arm::Target_arm): Initialize new data members
8840 got_mod_index_offset_ and tls_base_symbol_defined_.
8841 (Target_arm::Relocate::relocate_tls): New method.
8842 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
8843 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
8844 New methods.
2e702c99 8845 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
8846 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
8847 (Target_arm::got_mod_index_offset_,
8848 Target_arm::tls_base_symbol_defined_): New data members.
8849 (Target_arm::Scan::local, Target::Scan::global,
8850 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
8851 relocations.
8852
c8761b9a
DK
88532010-02-18 Doug Kwan <dougkwan@google.com>
8854
8855 * arm.cc (Arm_relobj::find_linked_text_section): New method.
8856 (Arm_relobj::make_exidx_input_section): Pass section index of linked
8857 text section as a parameter becuase some broken tools may not set
8858 the link in section header.
8859 (Target_arm::has_got_section): New method.
8860 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
8861 without any mapping symbol as data only. Remove warning.
8862 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
8863 link in its section header, try to discover the link by inspecting the
8864 REL31 relocation at the beginning of the section.
8865 (Target_arm::Scan::check_non_pic): Report name of offending relocation
8866 in error message.
8867 (Target_arm::Scan::global): Treat any reference to the symbol
8868 _GLOBAL_OFFSET_TABLE_ as a GOT access.
8869
21bb3914
ST
88702010-02-12 Sriraman Tallam <tmsriram@google.com>
8871
8872 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
8873 (Scan::global_reloc_may_be_function_pointer): New function.
8874 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8875 (Scan::global_reloc_may_be_function_pointer): New function.
8876 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8877 (Scan::global_reloc_may_be_function_pointer): New function.
8878 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
8879 (Scan::global_reloc_may_be_function_pointer): New function.
8880 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
8881 (Scan::global_reloc_may_be_function_pointer): New function.
8882 (Scan::possible_function_pointer_reloc): New function.
8883 (Target_x86_64::can_check_for_function_pointers): New function.
8884 * gc.h (gc_process_relocs): Scan relocation types to determine if
8885 function pointers were taken for targets that support it.
8886 * icf.cc (Icf::find_identical_sections): Include functions for
8887 folding in safe ICF whose pointer is not taken.
8888 * icf.h (Secn_fptr_taken_set): New typedef.
8889 (fptr_section_id_): New member.
8890 (section_has_function_pointers): New function.
8891 (set_section_has_function_pointers): New function.
8892 (check_section_for_function_pointers): New function.
8893 * options.h: Fix comment for safe ICF option.
8894 * target.h (can_check_for_function_pointers): New function.
8895 * testsuite/Makefile.am: Add icf_safe_so_test test case.
8896 Modify icf_safe_test for X86-64.
8897 * testsuite/Makefile.in: Regenerate.
8898 * testsuite/icf_safe_so_test.cc: New file.
8899 * testsuite/icf_safe_so_test.sh: New file.
8900 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8901 (main): Change to take pointer to function kept_func_3.
8902 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8903 folding is done correctly for X86-64.
8904
0da6fa6c
DM
89052010-02-12 David S. Miller <davem@davemloft.net>
8906
8907 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8908 is_symbolless parameter.
8909 (Output_reloc<SHT_REL>::is_symbolless): New.
8910 (Output_reloc<SHT_REL>::is_symbolless_): New.
8911 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8912 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8913 (Output_reloc<SHT_RELA>::is_symbolless): New.
8914 (Output_data_reloc::add_global): Handle is_symbolless.
8915 (Output_data_reloc::add_global_relative): Likewise.
8916 (Output_data_reloc::add_local): Likewise.
8917 (Output_data_reloc::add_local_relative): Likewise.
8918 (Output_data_reloc::add_symbolless_global_addend): New.
8919 (Output_data_reloc::add_symbolless_local_addend): New.
8920 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8921 is_symbolless.
8922 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8923 instead of ->is_relative_
8924 (Output_reloc::write): Likewise.
8925 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8926 (Output_reloc::write_rel): Simplify.
8927
8928 * sparc.cc (Target_sparc::Scan::local): Use
8929 ->add_symbolless_local_addend as needed.
8930 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8931 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8932 based upon relocation offset.
8933
e4782e83
DK
89342010-02-11 Doug Kwan <dougkwan@google.com>
8935
8936 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
8937 (Target_arm::Scan::global): Ditto. Also remove a comment before the
8938 beginning of function.
8939 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
8940 and MOVT_ABS relocations. Those are non issued in scanning. Fix
8941 parameter is_32bit in calls to should_apply_static_reloc.
8942 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
8943 (check_DATA): Add arm_abs_global.stdout.
8944 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
8945 arm_abs_global.stdout): New rules.
8946 (MOSTLLYCLEANFILES): Add arm_abs_global
8947 * Makefile.in: Regenerate.
8948 * testsuite/arm_abs_global.s: New file.
8949 * testsuite/arm_abs_global.sh: Ditto.
8950 * testsuite/arm_abs_lib.s: Ditto.
8951
93ceb764
ILT
89522010-02-11 Ian Lance Taylor <iant@google.com>
8953
8954 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
8955 Read_relocs task.
8956 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
8957 Allocate_commons_task first.
8958 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
8959 task, rather than symtab_lock_.
8960 (Gc_process_relocs::~Gc_process_relocs): New function.
8961 (Gc_process_relocs::is_runnable): Check this_blocker_.
8962 (Gc_process_relocs::locks): Use next_blocker_ rather than
8963 blocker_.
8964 (Scan_relocs::~Scan_relocs): New function.
8965 (Scan_relocs::is_runnable): Check this_blocker_ rather than
8966 symtab_lock_.
8967 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
8968 next_blocker_.
8969 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
8970 fields. Add this_blocker_ and next_blocker_ fields. Adjust
8971 constructor accordingly.
8972 (class Gc_process_relocs): Likewise.
8973 (class Scan_relocs): Likewise.
8974 * common.h (class Allocate_commons_task): Remove symtab_lock_
8975 field, and corresponding constructor parameter.
8976 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
8977 symtab_lock_.
8978 (Allocate_commons_task::locks): Likewise.
8979
114dfbe1
ILT
89802010-02-11 Ian Lance Taylor <iant@google.com>
8981
8982 * gold-threads.h (class Once): Define.
8983 (class Initialize_lock): Rewrite as child of Once.
8984 * gold-threads.cc (class Once_initialize): Define.
8985 (once_pointer_control): New static variable.
8986 (once_pointer, once_arg): New static variables.
8987 (c_run_once): New static function.
8988 (Once::Once, Once::run_once, Once::internal_run): New functions.
8989 (class Initialize_lock_once): Remove.
8990 (initialize_lock_control): Remove.
8991 (initialize_lock_pointer): Remove.
8992 (initialize_lock_once): Remove.
8993 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
8994 (Initialize_lock::initialize): Rewrite.
8995 (Initialize_lock::do_run_once): New function.
8996 * archive.cc (Archive::interpret_header): Only clear name if it is
8997 not already empty.
8998 * fileread.cc: Include "gold-threads.h"
8999 (file_counts_lock): New static variable.
9000 (file_counts_initialize_lock): Likewise.
9001 (File_read::release): Only increment counts when using --stats.
9002 Use a lock around the increment.
9003 * parameters.cc (class Set_parameters_target_once): Define.
9004 (set_parameters_target_once): New static variable.
9005 (Parameters::Parameters): Move here from parameters.h.
9006 (Parameters::set_target): Rewrite.
9007 (Parameters::set_target_once): New function.
9008 (Parameters::clear_target): Move here and rewrite.
9009 * parameters.h (class Parameters): Update declarations. Add
9010 set_parameters_target_once_ field.
9011 (Parameters::Parameters): Move to parameters.cc.
9012 (Parameters::clear_target): Likewise.
9013 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9014 task.
9015 (Start_group::~Start_group): New function.
9016 (Start_group::is_runnable): New function.
9017 (Start_group::locks, Start_group::run): New functions.
9018 (Finish_group::run): Change saw_undefined to size_t.
9019 * readsyms.h (class Start_group): Define.
9020 (class Finish_group): Change saw_undefined_ field to size_t.
9021 (Finish_group::Finish_group): Remove saw_undefined and
9022 this_blocker parameters. Change all callers.
9023 (Finish_group::set_saw_undefined): New function.
9024 (Finish_group::set_blocker): New function.
9025 * symtab.h (class Symbol_table): Change saw_undefined to return
9026 size_t. Change saw_undefined_ field to size_t.
9027 * target-select.cc (Set_target_once::do_run_once): New function.
9028 (Target_selector::Target_selector): Initialize set_target_once_
9029 field. Don't initialize lock_ and initialize_lock_ fields.
9030 (Target_selector::instantiate_target): Rewrite.
9031 (Target_selector::set_target): New function.
9032 * target-select.h (class Set_target_once): Define.
9033 (class Target_selector): Update declarations. Make
9034 Set_target_once a friend. Remove lock_ and initialize_lock_
9035 fields. Add set_target_once_ field.
9036
fa17a3f4
ILT
90372010-02-10 Ian Lance Taylor <iant@google.com>
9038
9039 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9040 queueing any tasks.
9041 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9042 (queue_middle_tasks): Add all blockers before queueing any tasks.
9043 (queue_final_tasks): Likewise.
9044 * token.h (Task_token::add_blockers): New function.
9045 * object.h (Input_objects::number_of_relobjs): New function.
9046
c7177d31
ILT
90472010-02-10 Ian Lance Taylor <iant@google.com>
9048
5de0e392
ILT
9049 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9050 shared, not if not position independent.
9051 * x86_64.cc (Relocate::relocate_tls): Likewise.
9052 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9053 (tls_pie_pic_test): New target.
9054 * testsuite/Makefile.in: Rebuild.
9055
c7177d31
ILT
9056 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9057 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9058 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9059 * testsuite/Makefile.in: Rebuild.
9060
684b268a
DM
90612010-02-09 David S. Miller <davem@davemloft.net>
9062
9063 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9064 R_SPARC_RELATIVE using ->add_local_relative().
9065 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9066
612a8d3d
DM
9067 * output.h (Output_data_dynamic::add_section_size): New method
9068 that takes two Output_data objects.
9069 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9070 entry param. Handle it in initializers.
9071 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9072 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9073 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9074 arg.
9075 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9076 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9077 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9078 for dynrel_includes_plt.
9079 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9080 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9081 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9082 before .rela.plt
9083 (Target_sparc::do_finalize_sections): Update to pass true for
9084 dynrel_includes_plt.
9085 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9086 output before .rela.plt
9087 (Target_powerpc::do_finalize_sections): Update to pass true for
9088 dynrel_includes_plt when 32-bit.
9089
cb1be87e
DK
90902010-02-08 Doug Kwan <dougkwan@google.com>
9091
9092 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9093 method.
9094 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9095 Arm_relobj::scan_section_for_cortex_a8_stubs,
9096 Arm_relobj::do_relocation_section): Instead of calling
9097 Output_section::output_address, use faster
9098 Arm_relobj::simple_input_section_output_address.
9099
705b5121
DM
91002010-02-08 David S. Miller <davem@davemloft.net>
9101
9102 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9103 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9104 relocation helper function.
9105
024c4466
DM
9106 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9107 just like R_SPARC_GOT{10,13,22}.
9108 (Target_sparc::Scan::local): Likewise.
9109 (Target_sparc::Relocate:relocate): Likewise.
9110
9109c078
ILT
91112010-02-06 Ian Lance Taylor <iant@google.com>
9112
9113 * configure.ac: Rewrite targetobjs duplicate removal code to use
9114 only shell constructs.
9115 * configure: Rebuild.
9116
cf846138
DK
91172010-02-05 Doug Kwan <dougkwan@google.com>
9118
9119 PR 11247
9120 * arm.cc (Arm_relobj::section_is_scannable): New method.
9121 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9122 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9123
6cfaf60b
DK
91242010-02-04 Doug Kwan <dougkwan@google.com>
9125
9126 PR 11247
9127 * arm-reloc-property.cc (cstdio): Include.
9128 * configure.ac (targetobjs): Remove duplicates.
9129 * configure: Regenerate.
9130 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9131 big and little endian version for a given address size.
9132
5c57f1be
DK
91332010-02-03 Doug Kwan <dougkwan@google.com>
9134
9135 * arm-reloc-property.cc
9136 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9137 definition.
9138 * arm-reloc-property.h
9139 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9140 New method definition.
9141 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9142 declaration.
9143 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9144 overflow to N.
9145 (GOT_PREL): Change implemented to Y.
9146 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9147 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9148 (Arm_relocate_functions::movw_abs_nc): Remove method.
9149 (Arm_relocate_functions::movt_abs): Ditto.
9150 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9151 (Arm_relocate_functions::thm_movt_abs): Ditto.
9152 (Arm_relocate_functions::movw_rel_nc): Ditto.
9153 (Arm_relocate_functions::movw_rel): Ditto.
9154 (Arm_relocate_functions::movt_rel): Ditto.
9155 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9156 (Arm_relocate_functions:thm_movw_rel): Ditto.
9157 (Arm_relocate_functions:thm_movt_rel): Ditto.
9158 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9159 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9160 New method definitions.
9161 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9162 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9163 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9164 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9165 (Target_arm::Relocate::relocate): Check for non-static or
9166 unimplemented relocation code and exit early. Change calls to
9167 Target_arm::reloc_uses_thumb_bit and
9168 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9169 instead. Refactor code to handle similar relocations to increase
9170 code sharing. Remove check for unsupported relocation code in switch
9171 statement.
9172 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9173 relocation property table to find out size. Change error message to
9174 print out the name of a relocation code instead of the numeric value.
9175 (Target_arm::scan_reloc_for_stub): Use relocation property table
9176 instead of calling Target_arm::reloc_uses_thumb_bit().
9177
218c5831
DK
91782010-02-02 Doug Kwan <dougkwan@google.com>
9179
9180 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9181 types of relaxed input section.
9182
0d31c79d
DK
91832010-02-02 Doug Kwan <dougkwan@google.com>
9184
9185 * Makefile.am (HFILES): Add arm-reloc-property.h.
9186 (DEFFILES): New.
2e702c99
RM
9187 (TARGETSOURCES): Add arm-reloc-property.cc
9188 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9189 (libgold_a_SOURCES): $(DEFFILES)
9190 * Makefile.in: Regenerate.
9191 * arm-reloc-property.cc: New file.
9192 * arm-reloc-property.h: New file.
9193 * arm-reloc.def: New file.
9194 * arm.cc: Update comments.
9195 (arm-reloc-property.h): New included header.
9196 (arm_reloc_property_table): New global variable.
9197 (Target_arm::do_select_as_default_target): New method definition.
9198 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9199 arm-reloc-property to targ_extra_obj.
9200 * parameters.cc (set_parameters_target): Call
9201 Target::select_as_default_target().
9202 * target.h (Target::select_as_default_target): New method definition.
9203 (Target::do_select_as_default_target): Same.
9204
546c7457
DK
92052010-02-01 Doug Kwan <dougkwan@google.com>
9206
9207 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9208 first_output_text_section_.
9209 (Arm_exidx_fixup::first_output_text_section): New method definition.
9210 (Arm_exidx_fixup::first_output_text_section_): New data member.
9211 (Arm_exidx_fixup::process_exidx_section): Record the first text
9212 output section seen.
9213 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9214 and entsize in output section header.
9215
11b861d5
DK
92162010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9217
9218 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9219 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9220 (Arm_relocate_functions::thm_alu11): New Method.
9221 (Arm_relocate_functions::thm_pc8): New Method.
9222 (Arm_relocate_functions::thm_pc12): New Method.
9223 (Target_arm::Scan::local): Handle the relocations.
9224 (Target_arm::Scan::global): Likewise.
9225 (Target_arm::Relocate::relocate): Likewise.
9226 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9227
c9a2c125
DK
92282010-01-29 Doug Kwan <dougkwan@google.com>
9229
9230 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9231 of relocation types as ld.
9232
1521477a
DK
92332010-01-29 Doug Kwan <dougkwan@google.com>
9234
9235 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9236 to public.
9237 (Arm_relocate_functions::thumb_branch_common): Ditto.
9238 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9239 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9240 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9241 Arm_relocate_functions::jump24): Remove.
9242 (Target_arm::Relocate::relocate): Adjust code to call
9243 Arm_relocation_functions::arm_branch_common and
9244 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9245 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9246
e7eca48c
DK
92472010-01-29 Doug Kwan <dougkwan@google.com>
9248
9249 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9250 output_local_symbol_count_needs_update_.
9251 (Arm_relobj::output_local_symbol_count_needs_update,
9252 Arm_relobj::set_output_local_symbol_count_needs_update,
9253 Arm_relobj::update_output_local_symbol_count): New methods.
9254 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9255 member.
9256 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9257 of pointed function as in a R_ARM_PREL31 relocation.
9258 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9259 for output local symbol count updating.
9260 (Target_arm::do_relax): Update output local symbol counts in objects
9261 if necessary.
9262 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9263
02961d7e
ILT
92642010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9265
9266 * arm.cc: Added support for the ARM relocations:
9267 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9268 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9269 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9270 movw_prel_nc).
9271 (Arm_relocate_functions::movw_rel): New method.
9272 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9273 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9274 thm_movw_prel_nc).
9275 (Arm_relocate_functions::thm_movw_rel): New method.
9276 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9277 thm_movt_prel).
9278 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9279 relocations.
9280 (Target_arm::Scan::global): Likewise.
9281 (Target_arm::Relocate::relocate): Likewise.
9282 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9283 Likewise.
9284
b10d2873
ILT
92852010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9286
9287 * arm.cc: Added support for ARM group relocations.
9288 (Target_arm::reloc_needs_sym_origin): New method.
9289 (Arm_relocate_functions::calc_grp_kn): New method.
9290 (Arm_relocate_functions::calc_grp_residual): New method.
9291 (Arm_relocate_functions::calc_grp_gn): New method.
9292 (Arm_relocate_functions::arm_grp_alu): New Method.
9293 (Arm_relocate_functions::arm_grp_ldr): New Method.
9294 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9295 (Arm_relocate_functions::arm_grp_ldc): New Method.
9296 (Target_arm::Scan::local): Handle the ARM group relocations.
9297 (Target_arm::Scan::global): Likewise.
9298 (Target_arm::Relocate::relocate): Likewise.
9299 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9300 Likewise.
9301
2b328d4e
DK
93022010-01-26 Doug Kwan <dougkwan@google.com>
9303
9304 * arm.cc (set): Include.
9305 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9306 pointer type.
2e702c99 9307 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9308 (Arm_output_section::append_text_sections_to_list): New method.
9309 (Arm_output_section::fix_exidx_coverage): Ditto.
9310 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9311 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9312 Relobj::set_section_offset() instead of
9313 Sized_relobj::invalidate_section_offset().
2e702c99 9314 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9315 parameter for section headers. Ignore relocation sections for
9316 unallocated sections and EXIDX sections.
9317 (Target_arm::fix_exidx_coverage): New method.
9318 (Target_arm::output_section_address_less_than): New type.
9319 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9320 linked text section instead of the EXIDX section.
9321 (Arm_output_section::create_stub_group): Add an assertion to check
9322 that this is not an EXIDX output section.
9323 (Arm_output_section::append_text_sections_to_list): New method.
9324 (Arm_output_section::fix_exidx_coverage): Ditto.
9325 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9326 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9327 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9328 first pass.
9329 (Target_arm::fix_exidx_coverage): New method.
9330 * object.h (Relobj::set_output_section): New method.
9331 (Sized_relobj::invalidate_section_offset): Remove method.
9332 (Sized_relobj::do_invalidate_section_offset): Remove method.
9333 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9334
c7f3c371
DK
93352010-01-25 Doug Kwan <dougkwan@google.com>
9336
9337 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9338 Fix warning due to signed and unsigned comparison on a 32-bit host.
9339
8923b24c
DK
93402010-01-22 Doug Kwan <dougkwan@google.com>
9341
9342 * arm.cc (Target_arm::do_relax): Record an output section for section
9343 offset adjustment it contains any stub table that has changed.
9344 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9345 offsets in an output section if necessary.
9346 * output.cc (Output_section::Output_section): Initialize
9347 section_offsets_need_adjustments_.
9348 (Output_section::add_input_section_for_script): Renamed to
9349 Output_section::add_simple_input_section.
9350 (Output_section::save_states): Add a comment.
9351 (Output_section::discard_states): New method defintion.
9352 (Output_section::adjust_section_offsets): Same.
9353 * output.h (Output_section::add_input_section_for_script): Renamed to
9354 Output_section::add_simple_input_section.
9355 (Output_section::discard_states): New method declaration.
9356 (Output_section::adjust_section_offsets): Same.
9357 (Output_section::section_offsets_need_adjustment,
9358 Output_section::set_section_offsets_need_adjustment): New method
9359 definitions.
9360 (Output_section::section_offsets_need_adjustment_): New data member.
9361 * script-sections.cc
9362 (Output_section_element_input::set_section_address): Adjust code for
9363 renaming of Output_section::add_input_section_for_script.
9364 (Orphan_output_section::set_section_address): Same.
9365
9b2fd367
DK
93662010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9367
9368 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9369 Fix_v4bx enum values .
9370 * gold/options.h (General_options): New option definitions.
9371 (General_options::fix_v4bx): New method.
9372 (General_options::Fix_v4bx): New enum.
9373 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9374 (General_options::parse_fix_v4bx_interworking): New method.
9375
80d0d023
DK
93762010-01-22 Doug Kwan <dougkwan@google.com>
9377
9378 * arm.cc (Arm_exidx_fixup): New class.
9379
af2cdeae
DK
93802010-01-21 Doug Kwan <dougkwan@google.com>
9381
9382 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9383 classes.
9384 (Arm_exidx_section_offset_map): New type.
9385
993d07c1
DK
93862010-01-21 Doug Kwan <dougkwan@google.com>
9387
9388 * arm.cc (Arm_exidx_input_section): New class.
9389 (Arm_relobj::exidx_input_section_by_link,
9390 Arm_relobj::exidx_input_section_by_shndx,
9391 Arm_relobj::make_exidx_input_section): New methods.
9392 (read_arm_attributes_section): Remove.
9393 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9394 information about them.
9395 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9396 to here.
9397
5ac169d4
DK
93982010-01-20 Doug Kwan <dougkwan@google.com>
9399
9400 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9401 Input_section_specifier to Section_id.
9402 (Target_arm::new_arm_input_section: Adjust code for change of key
9403 type.
9404 (Target_arm::find_arm_input_section): Ditto.
9405 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9406 (Section_id): Remove.
9407 (Garbage_collection::Section_id_hash): Remove.
9408 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9409 (Section_id): Remove.
9410 (Icf::Section_id_hash): Remove.
9411 * object.h (Section_id, Const_section_id, Section_id_hash,
9412 Const_section_id_hash): New type definitions.
9413 * output.cc (Output_section::add_relaxed_input_section): Change to
9414 use Const_section_id instead of Input_section_specifier as key type.
9415 (Output_section::add_merge_input_section): Ditto.
9416 (Output_section::build_relaxation_map): Change to use Section_id
9417 instead of Input_section_specifier as key type.
2e702c99 9418 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9419 Ditto.
9420 (Output_section::convert_input_sections_to_relaxed_sections): Change
9421 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9422 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9423 (Output_section::find_relaxed_input_section): Ditto.
9424 * output.h (Input_section_specifier): Remove class.
9425 (Output_section::Output_section_data_by_input_section_map): Change
9426 key type to Const_section_id.
9427 (Output_section::Output_relaxed_input_section_by_input_section_map):
9428 Ditto.
9429 (Output_section::Relaxation_map): Change key type to Section_id.
9430
a2162063
ILT
94312010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9432
9433 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9434 (class Arm_v4bx_stub): New class.
9435 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9436 (Stub_factory::make_arm_v4bx_stub): New method.
9437 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9438 (Stub_table::empty): Handle v4bx stubs.
9439 (Stub_table::add_arm_v4bx_stub): New method.
9440 (Stub_table::find_arm_v4bx_stub): New method.
9441 (Arm_relocate_functions::v4bx): New method.
9442 (Target_arm::fix_v4bx): New method.
9443 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9444 (Stub_table::relocate_stubs): Likewise.
9445 (Stub_table::do_write): Likewise.
9446 (Stub_table::update_data_size_and_addralign): Likewise.
9447 (Stub_table::finalize_stubs): Likewise.
9448 (Target_arm::Scan::local): Likewise.
9449 (Target_arm::Scan::global): Likewise.
9450 (Target_arm::do_finalize_sections): Likewise.
9451 (Target_arm::Relocate::relocate): Likewise.
9452 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9453 Likewise.
9454 (Target_arm::scan_reloc_for_stub): Likewise.
9455 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9456
5696ab0b
ILT
94572010-01-19 Ian Lance Taylor <iant@google.com>
9458
9459 * output.cc (Output_section_headers::do_sized_write): Write large
9460 segment count to sh_info field.
9461 (Output_file_header::do_sized_write): For large segment count,
9462 write PN_XNUM to e_phnum field.
9463
800d0f56
ILT
94642010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9465
9466 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9467 (Arm_relocate_functions::thm_jump8): New function.
9468 (Arm_relocate_functions::thm_jump11): New function.
9469 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9470 R_ARM_THM_JUMP11.
9471 (Target_arm::Scan::global): Likewise.
9472 (Target_arm::Relocate::relocate): Likewise.
9473 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9474 Likewise.
9475
41263c05
DK
94762010-01-14 Doug Kwan <dougkwan@google.com>
9477
9478 * arm.cc (map, utility): Include headers.
9479 (Target_arm::apply_cortex_a8_workaround): New method.
9480 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9481 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9482 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9483 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9484 the --[no-]fix-cortex-a8 command line options.
9485 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9486 (Target_arm::relocate_stub): Use addend in instruction template.
9487 * options.h (DEFINE_bool): Set the user-set flag.
9488 (General_options): Add --[no-]-fix-cortex options.
9489 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 9490 : Update fast look-up map after conversion.
41263c05 9491
459e9b03
ST
94922010-01-14 Sriraman Tallam <tmsriram@google.com>
9493
9494 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9495 in the first pass of do_layout.
9496
b521dfe4
DK
94972010-01-13 Doug Kwan <dougkwan@google.com>
9498
9499 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9500 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9501 apparent compiler problem of not folding static constant integral
9502 data members of elfcpp::Elf_sizes<32>.
9503
44272192
DK
95042010-01-13 Doug Kwan <dougkwan@google.com>
9505
9506 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9507 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9508 Arm_relobj::scan_section_for_cortex_a8_erratum,
9509 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9510 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9511 sections to scan for relocation stubs into a new method
9512 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9513 relocation and Cortex-A8 stub scanning.
9514 (Target_arm::do_relax): Force stubs to be after stubbed sections
9515 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 9516 the beginning of a new relaxation pass. Update a comment.
44272192
DK
9517 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9518
44b71ece
ILT
95192010-01-12 Ian Lance Taylor <iant@google.com>
9520
9521 * target-reloc.h (visibility_error): New inline function.
9522 (relocate_section): Call visibility_error.
9523 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9524 (MOSTLYCLEANFILES): Likewise.
9525 (protected_4_pic.o, protected_3.err): New targets.
9526 * testsuite/protected_4.cc: New file.
9527
a120bc7f
DK
95282010-01-12 Doug Kwan <dougkwan@google.com>
9529
9530 * arm.cc (Cortex_a8_reloc): New class.
9531 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9532 and cortex_a8_relocs_info_.
9533 (Target_arm::fix_cortex_a8): New method definition.
9534 (Target_arm::Cortex_a8_relocs_info): New type.
9535 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9536 New data member declarations.
9537 (Target_arm::scan_reloc_for_stub): Record information about
9538 relocations for THUMB branches that might be exempted from the
9539 Cortex-A8 workaround.
9540 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9541 at the beginning of a relaxation pass.
9542
20138696
DK
95432010-01-12 Doug Kwan <dougkwan@google.com>
9544
9545 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9546 (Arm_relobj::Mapping_symbol_position,
9547 Arm_reloj::Mapping_symbol_position_less,
9548 Arm_relobj::Mapping_symbols_info): New types.
9549 (Target_arm::is_mapping_symbol_name): New method definition.
9550 (Arm_relobj::do_count_local_symbols): Save information about mapping
9551 symbols.
9552
089d69dc
DK
95532010-01-11 Doug Kwan <dougkwan@google.com>
9554
9555 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9556 Arm_relocate_functions::thumb32_branch_upper,
9557 Arm_relocate_functions::thumb32_branch_lower,
9558 Arm_relocate_functions::thumb32_cond_branch_offset,
9559 Arm_relocate_functions::thumb32_cond_branch_upper,
9560 Arm_relocate_functions::thumb32_cond_branch_lower,
9561 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9562 branch offset encoding.
9563 (Arm_relocate_functions::thumb_branch_common): Use new branch
9564 offset encoding methods to avoid code duplication.
9565 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9566 (Stub_addend_reader::operator()): Use new branch encoding method
9567 to avoid code duplication.
9568
99e5bff2
DK
95692010-01-11 Doug Kwan <dougkwan@google.com>
9570
9571 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9572 (Target_arm::do_finalize_sections): Define special EXIDX section
9573 symbols only if referenced.
9574 * gc.h (Garbage_collection::add_reference): New method.
9575 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9576 code duplication.
9577
98e090bd
ILT
95782010-01-11 Ian Lance Taylor <iant@google.com>
9579
d0a91bd8
ILT
9580 * script.cc (Version_script_info::build_expression_list_lookup):
9581 Change complaing about duplicate wildcard match from error to
9582 warning.
9583
98e090bd
ILT
9584 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9585 of 2009-12-30.
9586 (Version_script_info::Version_script_info): Initialize globs_,
9587 default_version_, default_is_global_, and exact_. Don't
9588 initialize globals_ or locals_.
9589 (Version_script_info::build_lookup_tables): Build local symbols
9590 first.
9591 (Version_script_info::unquote): New function.
9592 (Version_script_info::add_exact_match): New function.
9593 (Version_script_info::build_expression_list_lookup): Remove lookup
9594 parameter. Add is_global parameter. Change all callers. Handle
9595 wildcard pattern specially. Unquote pattern. Call
9596 add_exact_match.
9597 (Version_script_info::get_name_to_match): New function.
9598 (Version_script_info::get_symbol_version): New function.
9599 (Version_script_info::get_symbol_version_helper): Remove.
9600 (Version_script_info::check_unmatched_names): Call unquote.
9601 * script.h (class Version_script_info): Change get_symbol_version
9602 to be non-inline and add is_global parameter; change all callers.
9603 Rewrite symbol_is_local. Update declarations. Define struct
9604 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9605 Remove globals_ and locals_ members. Add exact_, globs_,
9606 default_version_, is_global_.
9607 (Version_script_info::Glob): Remove pattern, add expression and
9608 is_global. Update constructor. Change all callers.
9609 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9610 default version.
9611 (Versions::symbol_section_contents): If a symbol is undefined, or
9612 defined in a dynamic object, set the version index to
9613 VER_NDX_LOCAL.
9614 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9615 symbol_is_local.
9616 (Symbol_table::add_from_pluginobj): Likewise.
9617 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9618
d56962d3
DK
96192010-01-11 Doug Kwan <dougkwan@google.com>
9620
9621 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9622 (incremental_dump_LDADD): Add linking option for libintl.
9623 * Makefile.in: Regenerate.
9624
94e6ee91
L
96252010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9626
9627 PR gold/11144
9628 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9629 instead of -Ds.
9630 * testsuite/Makefile.in: Regenerated.
9631
e96c574b
DK
96322010-01-10 Doug Kwan <dougkwan@google.com>
9633
9634 * options.h (DEFINE_var): Use parentheses around argument varname__
9635 in macro body to avoid any unintended subsequent substitutions.
9636
7198066b
ILT
96372010-01-10 Ian Lance Taylor <iant@google.com>
9638
ba4d53bf
ILT
9639 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9640 candidates before doing symbol resolution.
9641
7198066b
ILT
9642 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9643 ODR candidates if only one is weak.
9644
a2beed37
ILT
96452010-01-08 Ian Lance Taylor <iant@google.com>
9646
9647 * script.cc (Version_script_info::build_expression_list_lookup):
9648 Don't warn about ambiguous version, just record the ambiguity.
9649 (Version_script_info::get_symbol_version_helper): Give error if
9650 version is ambiguous.
9651
2fb7225c
DK
96522010-01-08 Doug Kwan <dougkwan@google.com>
9653
9654 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
9655 prev_data_size_ and prev_addralign_. Remove initializer for
9656 deleted data member has_been_changed_.
9657 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9658 to determine if the table is empty.
9659 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9660 Remove.
9661 (Stub_table::add_reloc_stub): Define method in class definition
9662 instead of just declaring it there.
9663 (Stub_table::add_cortex_a8_stub): New method definition.
9664 (Stub_table::update_data_size_and_addralign): Ditto.
9665 (Stub_table::finalize_stubs): Ditto.
9666 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9667 (Stub_table::do_addralign_): Return address alignment in the
9668 (Stub_table::do_reset_address_and_file_offset): Define method in
9669 class definition instead of declaring it there. Set current data
9670 size to be the data size of the previous pass.
9671 (Stub_table::set_final_data_size): Use current data size as the
9672 final data size.
9673 (Stub_table::relocate_stub): Change parameter type of stub from
9674 Reloc_stub pointer to Stub pointer.
9675 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9676 (Stub_table::Cortex_a8_stub_list): New typedef.
9677 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9678 Stub_table::prev_addralign_): New data member.
9679 (Arm_relobj::Arm_relobj): Initialize data member
9680 section_has_cortex_a8_workaround_.
9681 (Arm_relobj::section_has_cortex_a8_workaround,
9682 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9683 definitions.
9684 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9685 declarations.
9686 (Target_arm::relocate_stub): Change parameter type of stub from
9687 Reloc_stub pointer to Stub pointer.
9688 (Insn_template::size, Insn_template::alignment): Handle
9689 THUMB16_SPECIAL_TYPE.
9690 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9691 Stub_table::update_data_size_and_addralign,
9692 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
9693 definitions.
9694 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
9695 (Stub_table::do_write): Ditto.
9696 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 9697
880cd20d
ILT
96982010-01-08 Ian Lance Taylor <iant@google.com>
9699
9700 PR 11108
9701 * symtab.h (class Symbol): Remove fields is_target_special_ and
9702 has_plt_offset_. Add field is_defined_in_discarded_section_.
9703 (Symbol::is_defined_in_discarded_section): New function.
9704 (Symbol::set_is_defined_in_discarded_section): New function.
9705 (Symbol::has_plt_offset): Rewrite.
9706 (Symbol::set_plt_offset): Verify that new offset is not -1U.
9707 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
9708 Don't initialize is_target_special_ or has_plt_offset_.
9709 Initialize is_defined_in_discarded_section_.
9710 (Symbol_table::add_from_relobj): If appropriate, set
9711 is_defined_in_discarded_section.
9712 * resolve.cc (Symbol::override_base_with_special): Don't test
9713 is_target_special_. Change has_plt_offset_ to has_plt_offset().
9714 * target-reloc.h (relocate_section): Do special handling for
9715 symbols defined in discarded sections for global symbols as well
9716 as local symbols.
9717
2703e3eb
ILT
97182010-01-08 Ian Lance Taylor <iant@google.com>
9719
9720 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
9721 the SHT_SYMTAB case.
9722
339d40a3
ILT
97232010-01-08 Ian Lance Taylor <iant@google.com>
9724
9725 * object.cc (Sized_relobj::do_layout): Don't get confused if
9726 layout_eh_frame returns NULL.
9727
abecea76
ILT
97282010-01-08 Ian Lance Taylor <iant@google.com>
9729
9730 PR 11084
9731 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
9732 dynamic symbol table, use the normal symbol table.
9733 (Sized_dynobj::do_read_symbols): Remove assertion about type of
9734 symbol table.
9735
6b7dd3f3
ILT
97362010-01-08 Ian Lance Taylor <iant@google.com>
9737
9738 PR 11072
9739 * layout.cc (Layout::include_section): Remove .gnu_debuglink
9740 sections.
9741
36c50e63
L
97422010-01-08 H.J. Lu <hongjiu.lu@intel.com>
9743
9744 * version.cc (print_version): Change to "Copyright 2010".
9745
e291e7b9
ILT
97462010-01-08 Ian Lance Taylor <iant@google.com>
9747
9748 PR 10287
9749 PR 11063
9750 * i386.cc (class Target_i386): Change return type of plt_section
9751 to be non-const.
9752 (class Output_data_plt_i386): Add tls_desc_rel_ field.
9753 (Output_data_plt_i386::Output_data_plt_i386): Initialize
9754 tls_desc_rel_ field.
9755 (Output_data_plt_i386::rel_tls_desc): New function.
9756 (Target_i386::rel_tls_desc_section): New function.
9757 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
9758 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
9759 R_386_TLS_DESC reloc in rel_tls_desc_section.
9760 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
9761 Define struct Tlsdesc_info.
9762 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
9763 (Target_x86_64::do_reloc_symbol_index): New function.
9764 (Target_x86_64::add_tlsdesc_info): New function.
9765 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
9766 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
9767 tlsdesc_rel_ field.
9768 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
9769 all callers.
9770 (Output_data_plt_x86_64::rela_tlsdesc): New function.
9771 (Target_x86_64::rela_tlsdesc_section): New function.
9772 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
9773 handling.
9774 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
9775 (Target_x86_64::do_reloc_addend): New function.
9776 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
9777 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
9778 declarations. Define TARGET_CODE. Add arg field to u1_ union.
9779 (Output_reloc::type): New function.
9780 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
9781 (Output_reloc::is_target_specific): New function.
9782 (Output_reloc::target_arg): New function.
9783 (class Output_reloc) [SHT_RELA]: Add four new constructors for
9784 absolute relocs and target specific relocs.
9785 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
9786 add_target_specific.
9787 (class Output_data_reloc) [SHT_RELA]: Likewise.
9788 * output.cc (Output_reloc::Output_reloc): Add four new versions
9789 for absolute relocs and target specific relocs.
9790 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
9791 (Output_reloc::get_symbol_index): Likewise.
9792 (Output_reloc::local_section_offset): Check that local_sym_index_
9793 is not TARGET_CODE or 0.
9794 (Output_reloc::symbol_value): Likewise.
9795 (Output_reloc::write) [SHT_RELA]: Call target for target specific
9796 reloc.
9797 * target.h (class Target): Add reloc_symbol_index and reloc_addend
9798 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
9799 functions.
9800 * layout.cc (add_target_dynamic_tags): Use output section for
9801 DT_PLTRELSZ and DT_JMPREL.
9802
3a44184e
ILT
98032010-01-07 Ian Lance Taylor <iant@google.com>
9804
9805 PR 11061
9806 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
9807 function.
9808 (class Output_data_reloc_generic): Define.
9809 (class Output_data_reloc_base): Change base class to
9810 Output_data_reloc_generic. Change add() method to call
9811 bump_relative_reloc_count for a relative reloc. Remove
9812 sort_relocs_ field.
9813 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
9814 to sort_relocs().
9815 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
9816 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
9817 appropriate.
9818 * layout.h (class Layout): Update declaration.
9819
ea715a34
ILT
98202010-01-07 Ian Lance Taylor <iant@google.com>
9821
9822 * output.h (class Output_data): Add const version of
9823 output_section and do_output_section.
9824 (class Output_section_data): Add const version of
9825 do_output_section.
9826 (class Output_section): Likewise.
9827 * layout.cc (Layout::add_target_dynamic_tags): New function.
9828 * layout.h (class Layout): Update declarations.
9829 * arm.cc (Target_arm::do_finalize_sections): Use
9830 add_target_dynamic_tags.
9831 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9832 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9833 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9834 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9835
659948a4
ILT
98362010-01-07 Ian Lance Taylor <iant@google.com>
9837
9838 PR 11042
9839 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
9840 object as needed.
9841
9d3b86f6
ILT
98422010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
9843 Ian Lance Taylor <iant@google.com>
9844
9845 PR 11019
9846 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
9847 Xindex::read_symtab_xindex.
9848
bb0d3eb0
DK
98492010-01-07 Doug Kwan <dougkwan@google.com>
9850
9851 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
9852 (Insn_template::thumb16_bcond_insn): New method declaration.
9853 (Insn_template): Fix spelling.
9854 (Stub::thumb16_special): New method declaration.
9855 (Stub::do_write): Define virtual method which was previously pure
9856 virtual.
9857 (Stub::do_thumb16_special): New method declaration.
9858 (Stub::do_fixed_endian_write): New template member.
9859 (Reloc_stub::do_write): Remove.
9860 (Reloc_stub::do_fixed_endian_write): Remove.
9861 (Cortex_a8_stub): New class definition.
9862 (Stub_factory::make_cortex_a8_stub): New method definition.
9863 (Stub_factory::Stub_factory): Add missing static storage class
9864 qualifier for elf32_arm_stub_a8_veneer_blx.
9865
ffeef7df
ILT
98662010-01-07 Ian Lance Taylor <iant@google.com>
9867
dc3f80fe
ILT
9868 PR 10980
9869 * options.h (class General_options): Add --warn-unresolved-symbols
9870 and --error-unresolved-symbols.
9871 * errors.cc (Errors::undefined_symbol): Implement
9872 --warn-unresolved-symbols.
9873
ffeef7df
ILT
9874 * options.h (class General_options): Add -z text and -z textoff.
9875 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
9876
f1ec9ded
ST
98772010-01-06 Sriraman Tallam <tmsriram@google.com>
9878
9879 * gc.h (Garbage_collection::Cident_section_map): New typedef.
9880 (Garbage_collection::cident_sections): New function.
9881 (Garbage_collection::add_cident_section): New function.
9882 (Garbage_collection::cident_sections_): New member.
9883 (gc_process_relocs): Add references to sections whose names are C
9884 identifiers.
9885 * gold.h (cident_section_start_prefix): New constant.
9886 (cident_section_stop_prefix): New constant.
9887 (is_cident): New function.
9888 * layout.cc (Layout::define_section_symbols): Replace string constants
9889 with the newly defined constants.
9890 * object.cc (Sized_relobj::do_layout): Track sections whose names are
9891 C identifiers.
9892 * testsuite/Makefile.am: Add gc_orphan_section_test.
9893 * testsuite/Makefile.in: Regenerate.
9894 * testsuite/gc_orphan_section_test.cc: New file.
9895 * testsuite/gc_orphan_section_test.sh: New file.
9896
6eda8c29
ILT
98972010-01-06 Ian Lance Taylor <iant@google.com>
9898
b9674e17
ILT
9899 PR 10980
9900 * options.h (class General_options): Add --warn-shared-textrel.
9901 * layout.cc (Layout::finish_dynamic_section): Implement
9902 --warn-shared-textrel.
9903
6eda8c29
ILT
9904 PR 10980
9905 * options.h (class General_options): Add --warn-multiple-gp.
9906
32dcd44e
ILT
99072010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9908
9909 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9910 $(THREADSLIB) and $(LIBDL).
9911 * Makefile.in: Rebuild.
9912
a192ba05
ILT
99132010-01-06 Ian Lance Taylor <iant@google.com>
9914
9915 PR 10980
9916 * options.cc (General_options::parse_section_start): New function.
9917 (General_options::section_start): New function.
9918 (General_options::General_options): Initialize all members.
9919 * options.h: Include <map>
9920 (class General_options): Add --section-start. Add section_starts_
9921 member.
9922 * layout.cc (Layout::attach_allocated_section_to_segment): If
9923 --section-start was used, set the address of the segment. Remove
9924 local sort_sections.
9925 (Layout::relaxation_loop_body): If the address of the load segment
9926 has been set by --section-start, don't use it.
9927 * output.h (Output_segment::update_flags_for_output_section): New
9928 function.
9929 * output.cc (Output_segment::add_output_section): Call
9930 update_flags_for_output_section.
9931
dde3f402
ILT
99322010-01-05 Ian Lance Taylor <iant@google.com>
9933
62dfdd4d
ILT
9934 PR 10980
9935 * options.h (class General_options): Add --undefined-version.
9936 * script.cc (struct Version_expression): Add was_matched_by_symbol
9937 field.
9938 (Version_script_info::matched_symbol): New function.
9939 (Version_script_info::get_symbol_version_helper): Call
9940 matched_symbol.
9941 (Version_script_info::check_unmatched_names): New function.
9942 * script.h (class Version_script_info): Update declarations.
9943 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
9944
9c4ae156
ILT
9945 * options.h (class General_options): Use DEFINE_bool_alias for
9946 allow_multiple_definition.
9947 * resolve.cc (Symbol_table::should_override): Don't test
9948 allow_multiple_definition.
9949
dde3f402
ILT
9950 PR 10980
9951 * options.h (class General_options): Add --cref.
9952 * main.cc (main): Print cref table if --cref. Don't close mapfile
9953 until after printing cref table.
9954 * cref.cc: Include "symtab.h".
9955 (class Cref_inputs): Define Cref_table_compare and Cref_table.
9956 (Cref_table_compare::operator()): New function.
9957 (Cref_inputs::gather_cref): New function.
9958 (filecol): New static const.
9959 (Cref_inputs::print_cref): New function.
9960 (Cref::print_cref): New function.
9961 * cref.h: Include <cstdio>.
9962 (class Cref): Update declarations.
9963 * mapfile.h (Mapfile::file): New function.
9964 * object.h (class Object): Define Symbols. Declare virtual
9965 do_get_global_symbols.
9966 (Object::get_global_symbols): New function.
9967 * object.cc (Input_objects::add_object): Pass object to cref_ if
9968 --cref.
9969 (Input_objects::archive_start): Likewise.
9970 (Input_objects::archive_stop): Likewise.
9971 (Input_objects::print_cref): New function.
9972 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
9973 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
9974 --cref.
9975 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
9976 function.
9977 * plugin.h (class Sized_pluginobj): Update declarations.
9978
8781f709
ILT
99792010-01-05 Ian Lance Taylor <iant@google.com>
9980
9981 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
9982 to is_default_version. Rename insdef to insdefault.
9983 (Symbol_table::add_from_relobj): Rename def to is_default_version
9984 and local to is_forced_local.
9985 (Symbol_table::add_from_pluginobj): Likewise.
9986 (Symbol_table::add_from_dynobj): Likewise.
9987 (Symbol_table::define_special_symbol): Rename insdef to
9988 insdefault.
9989
fe35d28d
ILT
99902010-01-04 Ian Lance Taylor <iant@google.com>
9991
30bc8c46
ILT
9992 PR 10980
9993 * options.h (class General_options): Add
9994 --allow-multiple-definition and -z muldefs.
9995 * resolve.cc (Symbol_table::should_override): Don't warn about a
9996 multiple symbol definition if --allow-multiple-definition or -z
9997 muldefs.
9998
7eaea549
ILT
9999 PR 10980
10000 * options.h (class General_options): Add --add-needed and
10001 --copy-dt-needed-entries. Tweak --as-needed help entry.
10002 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10003 error if --copy-dt-needed-entries aka --add-needed is used and
10004 would cause a change in behaviour.
10005
fe35d28d
ILT
10006 PR 10980
10007 * options.h (class General_options): Add -G as a short version of
10008 --shared. Add no-op options -assert, -g, and -i.
10009
55a2bb35
ST
100102010-01-04 Sriraman Tallam <tmsriram@google.com>
10011
10012 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10013 check for .text or .gnu.linkonce.t sections.
10014 * icf.cc (Icf::find_identical_sections): Ditto.
10015 Change the detection for mangled function name within the section
10016 name.
10017 * icf.h (is_section_foldable_candidate): New function.
10018
719328e1
ILT
100192009-12-30 Ian Lance Taylor <iant@google.com>
10020
10021 PR 10980
10022 * options.h (class General_options): Permit two dashes with
10023 --retain-symbols-file.
10024
d7bb5745
ILT
100252009-12-30 Ian Lance Taylor <iant@google.com>
10026
403a15dd
ILT
10027 PR 10979
10028 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10029 don't put the file header and segment headers in the text
10030 segment.
10031
eda294df
ILT
10032 PR 10979
10033 * common.cc (Sort_commons::operator()): Stabilize sort when both
10034 entries are NULL.
10035 (Symbol_table::do_allocate_commons_list): When allocating common
10036 symbols, skip a symbol which is no longer common.
10037 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10038 an object before checking its type.
10039 * testsuite/common_test_2.c: New file.
10040 * testsuite/common_test_3.c: New file.
10041 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10042 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10043 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10044 (common_test_2_pic.o, common_test_2.so): New targets.
10045 (common_test_3_pic.o, common_test_3.so): New targets.
10046 * testsuite/Makefile.in: Rebuild.
10047
d7bb5745
ILT
10048 PR 10979
10049 * script.cc (read_input_script): If we see a new SECTIONS clause,
10050 and we have added an input section, give an error.
10051 * layout.h (class Layout): Add have_added_input_section function.
10052 Add have_added_input_section_ field.
10053 * layout.cc (Layout::Layout): Initialize
10054 have_added_input_section_.
10055 (Layout::layout): Set have_added_input_section_.
10056 (Layout::layout_eh_frame): Likewise.
10057
fc59c572
ILT
100582009-12-30 Ian Lance Taylor <iant@google.com>
10059
10060 PR 10931
10061 * options.h (class General_options): Add --sort-common option.
10062 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10063 * common.cc (Sort_common): Add sort_order parameter to
10064 constructor. Add sort_order_ field.
10065 (Sort_commons::operator): Check sort_order_.
10066 (Symbol_table::allocate_commons): Determine the sort order.
10067 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10068 Change all callers.
10069 (Symbol_table::do_allocate_commons_list): Likewise.
10070
1c74fab0
ILT
100712009-12-30 Ian Lance Taylor <iant@google.com>
10072
10073 PR 10916
10074 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10075 symbols from this object, don't change the visibility of an
10076 undefined symbol.
10077 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10078
6affe781
ILT
100792009-12-30 Ian Lance Taylor <iant@google.com>
10080
10081 PR 10861
10082 * script.h (class Version_script_info): Define Language enum.
10083 Update declarations. Define Glob, Exact, and Lookup types. Add
10084 new fields globals_, locals_, and is_finalized_.
10085 * script.cc: Various formatting fixes.
10086 (class Parser_closure): Change language_stack_ from a vector of
10087 std::string to one of Version_script_info::Language. Adjust all
10088 uses accordingly.
10089 (class Lazy_demangler): Remove.
10090 (struct Version_expression): Change language from std::string to
10091 Version_script_info::Language.
10092 (Version_script_info::Version_script_info): New function.
10093 (Version_script_info::~Version_script_info): Don't call clear.
10094 (Version_script_info::finalize): New function.
10095 (Version_script_info::build_lookup_tables): New function.
10096 (Version_script_info::build_expression_list_lookup): New
10097 function.
10098 (Version_script_info::get_symbol_version_helper): Rewrite to use
10099 lookup tables.
10100 (Version_script_info::print_expression_list): Adjust to use
10101 Version_script_info::Language.
10102 (script_push_lex_into_version_mode): Check that the version script
10103 has not been finalized.
10104 (version_script_push_lang): Change language string to
10105 Version_script_info::Language.
10106 * options.cc (Command_line::version_script): New function.
10107 * options.h (class General_options): Add finalize_dynamic_list
10108 function. Change version_script from declaration to definition.
10109 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10110 * testsuite/version_script.map: Remove duplicate def of foo.
10111 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10112 version_script.map.
10113 * testsuite/Makefile.in: Rebuild.
10114
818bf354
ILT
101152009-12-30 Ian Lance Taylor <iant@google.com>
10116
10117 PR 10843
10118 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10119 if the input symbol index is 0, make the output symbol index 0.
10120
ebcc8304
ILT
101212009-12-30 Ian Lance Taylor <iant@google.com>
10122
10123 PR 10670
10124 * options.h (class General_options): Add -x/--discard-all.
10125 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10126 --discard-all. If the local symbol needs a dynamic entry, check
10127 that before handling --discard-locals.
10128
176fe33f
ILT
101292009-12-30 Ian Lance Taylor <iant@google.com>
10130
bb321bb1
ILT
10131 PR 10450
10132 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10133 flags to PF_R.
10134 (Output_segment::add_output_section): Don't change the flags if
10135 the type is PT_TLS.
10136
176fe33f
ILT
10137 PR 10450
10138 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10139 GNU hash table if they need a dynamic value. Otherwise, don't add
10140 them if they are defined in a dynamic object or are forced local.
10141
e8cd95c7
ILT
101422009-12-29 Ian Lance Taylor <iant@google.com>
10143
1b81fb71
ILT
10144 PR 10450
10145 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10146 .gnu.hash table for a 32-bit target.
10147
8d6d383d
ILT
10148 PR 10450
10149 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10150 regular and a dynamic object only needs a dynamic symbol table
10151 entry if it is externally visible.
10152
e785ec03
ILT
10153 PR 10450
10154 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10155 constructor. Add global_offset_table_ field.
10156 (Target_i386::got_section): Set global_offset_table_.
10157 (Target_i386::do_finalize_sections): Set global_offset_table_
10158 size.
10159 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10160 in constructor. Add global_offset_table_ field.
10161 (Target_x86_64::got_section): Set global_offset_table_.
10162 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10163 size.
10164
1a2dff53
ILT
10165 * layout.cc (Layout::Layout): Initialize increase_relro_.
10166 (Layout::get_output_section): Add is_relro, is_last_relro, and
10167 is_first_non_relro parameters. Change all callers.
10168 (Layout::choose_output_section): Likewise.
10169 (Layout::add_output_section_data): Likewise.
10170 (Layout::make_output_section): Likewise.
10171 (Layout::set_segment_offsets): Clear increase_relro when using a
10172 linker script.
10173 * layout.h (class Layout): Add increase_relro method. Add
10174 increase_relro_ field. Update declarations.
10175 * output.cc (Output_section::Output_section): Initialize
10176 is_last_relro_ and is_first_non_relro_.
10177 (Output_segment::add_output_section): Group relro sections is
10178 do_sort is true. Handle is_last_relro and is_first_non_relro.
10179 (Output_segment::maximum_alignment): Remove relro handling.
10180 (Output_segment::set_section_addresses): Add increase_relro
10181 parameter. Change all callers. Add initial alignment to align
10182 relro sections on separate page. Remove old relro handling.
10183 (Output_segment::set_section_list_addresses): Remove in_relro
10184 parameter. Change all callers.
10185 (Output_segment::set_offset): Add increase parameter. Change all
10186 callers. Remove old relro handling.
10187 * output.h (class Output_section): Add new methods: is_last_relro,
10188 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10189 Add is_last_relro_ and is_first_non_relro_ fields.
10190 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10191 Create separate .got.plt section. Call increase_relro.
10192 * x86_64.cc (Target_x86_64::got_section): Likewise.
10193 * testsuite/relro_script_test.t: Add .got.plt.
10194
f0ba79e2
ILT
10195 PR 10450
10196 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10197 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10198 (Layout::finalize): Call set_dynamic_symbol_size.
10199 (Layout::set_dynamic_symbol_size): New function.
10200 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10201 set_dynamic_symbol_size.
10202
e8cd95c7
ILT
10203 PR 10450
10204 * output.h (class Output_section): Add is_entsize_zero_ field.
10205 * output.cc (Output_section::Output_section): Initialize
10206 is_entsize_zero_.
10207 (Output_section::set_entsize): If two different entsizes are
10208 requested, force it to zero.
10209 (Output_section::add_input_section): Set flags for .debug_str
10210 before updating section flags. Set entsize.
10211 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10212 and SHF_STRING if all input sections have those flags.
10213
3e1b9a8a
RÁE
102142009-12-29 Rafael Espindola <espindola@google.com>
10215
10216 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10217 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10218 reporting.
3e1b9a8a 10219
3dcad376
ST
102202009-12-29 Sriraman Tallam <tmsriram@google.com>
10221
10222 * options.cc (General_options::parse_version): Allow -v to exit
10223 without an error if there is nothing to link.
10224
084e2665
ILT
102252009-12-29 Ian Lance Taylor <iant@google.com>
10226
10227 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10228 using a version of gcc before 4.1.
10229 * configure: Rebuild.
10230
250acde3
CD
102312009-12-28 Chris Demetriou <cgd@google.com>
10232
10233 * attributes.cc (Output_attributes_section_data::do_write): Use
10234 std::vector::front rather than std::vector::data.
10235
99fff23b
ILT
102362009-12-28 Ian Lance Taylor <iant@google.com>
10237
10238 * symtab.h (class Symbol_table): Add enum Defined.
10239 * resolve.cc (Symbol_table::should_override): Add defined
10240 parameter. Change all callers. Test whether object is NULL
10241 before calling a method on it.
10242 (Symbol_table::report_resolve_problem): Add defined parameter.
10243 Change all callers.
10244 (Symbol_table::should_override_with_special): Likewise.
10245 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10246 parameter. Change all callers.
10247 (Symbol_table::do_define_in_output_data): Likewise.
10248 (Symbol_table::define_in_output_segment): Likewise.
10249 (Symbol_table::do_define_in_output_segment): Likewise.
10250 (Symbol_table::define_as_constant): Likewise.
10251 (Symbol_table::do_define_as_constant): Likewise.
10252 * script.h (class Symbol_assignment): Add is_defsym parameter to
10253 constructor; change all callers.
10254 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10255 parameter. Change all callers. Add is_defsym_ field.
10256 (class Parser_closure): Add parsing_defsym parameter to
10257 constructor; change all callers. Add parsing_defsym accessor
10258 function. Add parsing_defsym_ field.
10259
556bd683
ILT
102602009-12-28 Ian Lance Taylor <iant@google.com>
10261
10262 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10263 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10264
1782c879
ILT
102652009-12-23 Ian Lance Taylor <iant@google.com>
10266
10267 * i386.cc (Target_i386::do_calls_non_split): Recognize
10268 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10269 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10270 -fsplit-stack prologue when using %r11.
1782c879 10271
329ca2b1
ST
102722009-12-21 Sriraman Tallam <tmsriram@google.com>
10273
10274 * options.cc (General_options::parse_version): Make -v continue and do
10275 the link like GNU ld does.
10276
d675ff46
RÁE
102772009-12-17 Rafael Avila de Espindola <espindola@google.com>
10278
10279 * Makefile.am (CCFILES): Add timer.cc.
10280 (HFILES): Add timer.h.
10281 * configure.ac: Check for sysconf and times.
10282 * main.cc: include timer.h.
10283 (main): Use Timer instead of get_run_time.
10284 * timer.cc: New.
10285 * timer.h: New.
10286 * workqueue.cc: include timer.h.
10287 (Workqueue::find_and_run_task):
10288 Report user, sys and wall time.
10289 * Makefile.in: Regenerate.
10290 * config.in: Regenerate.
10291 * configure: Regenerate.
10292
d6344fb5
DK
102932009-12-16 Doug Kwan <dougkwan@google.com>
10294
10295 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10296 sections.
10297 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10298 relaxed input sections.
10299 * output.cc (Output_section::find_relaxed_input_section): Change
10300 return type to Output_relaxed_input_section pointer. Adjust code
10301 for new type of relaxed_input_section_map_.
10302 * output.h (Output_section::find_relaxed_input_section): Change
10303 return type to Output_relaxed_input_section pointer.
10304 (Output_section::Output_relaxed_input_section_by_input_section_map):
10305 New type.
10306 (Output_section::relaxed_input_section_map_): Change type to
10307 Output_section::Output_relaxed_input_section_by_input_section_map.
10308 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10309 input section.
10310
0e0d5469
ILT
103112009-12-15 Ian Lance Taylor <iant@google.com>
10312
10313 * layout.cc (Layout::create_shstrtab): Only write out after input
10314 sections if we are compressing debug sections.
10315
0649a889
ILT
103162009-12-15 Ian Lance Taylor <iant@google.com>
10317
10318 * archive.cc (Archive::add_symbols): Only look up a symbol without
10319 a version if there is, in fact, a version.
10320
2ea97941
ILT
103212009-12-14 Ian Lance Taylor <iant@google.com>
10322
10323 Revert -Wshadow changes, all changes from:
10324 2009-12-11 Doug Kwan <dougkwan@google.com>
10325 2009-12-11 Nick Clifton <nickc@redhat.com>
10326 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10327
b0eec2cc
DK
103282009-12-11 Doug Kwan <dougkwan@google.com>
10329
10330 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10331 due to -Wshadow.
10332 * attributes.cc (Object_attribute::size): Ditto.
10333 (Attributes_section_data::size): Ditto.
10334 (Attributes_section_data::Attributes_section_data): Ditto.
10335 (Output_attributes_section_data::do_write): Ditto.
10336 * attributes.h (Object_attribute::set_type): Ditto.
10337 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10338
91d6fa6a
NC
103392009-12-11 Nick Clifton <nickc@redhat.com>
10340
10341 * archive.cc: Fix shadowed variable warnings.
10342 * arm.cc: Likewise.
10343 * compressed_output.cc: Likewise.
10344 * compressed_output.h: Likewise.
10345 * configure: Likewise.
10346 * dwarf_reader.cc: Likewise.
10347 * dynobj.cc: Likewise.
10348 * dynobj.h: Likewise.
10349 * ehframe.cc: Likewise.
10350 * ehframe.h: Likewise.
10351 * errors.cc: Likewise.
10352 * expression.cc: Likewise.
10353 * fileread.cc: Likewise.
10354 * fileread.h: Likewise.
10355 * freebsd.h: Likewise.
10356 * i386.cc: Likewise.
10357 * icf.cc: Likewise.
10358 * incremental.h: Likewise.
10359 * layout.cc: Likewise.
10360 * layout.h: Likewise.
10361 * mapfile.cc: Likewise.
10362 * merge.cc: Likewise.
10363 * merge.h: Likewise.
10364 * object.cc: Likewise.
10365 * object.h: Likewise.
10366 * options.h: Likewise.
10367 * output.cc: Likewise.
10368 * output.h: Likewise.
10369 * parameters.cc: Likewise.
10370 * plugin.cc: Likewise.
10371 * powerpc.cc: Likewise.
10372 * reduced_debug_output.cc: Likewise.
10373 * reduced_debug_output.h: Likewise.
10374 * reloc.cc: Likewise.
10375 * reloc.h: Likewise.
10376 * resolve.cc: Likewise.
10377 * script-sections.cc: Likewise.
10378 * script.cc: Likewise.
10379 * script.h: Likewise.
10380 * sparc.cc: Likewise.
10381 * symtab.cc: Likewise.
10382 * symtab.h: Likewise.
10383 * target-select.cc: Likewise.
10384 * target-select.h: Likewise.
10385 * token.h: Likewise.
10386 * workqueue.cc: Likewise.
10387 * workqueue.h: Likewise.
10388 * x86_64.cc: Likewise.
10389
a0351a69
DK
103902009-12-10 Doug Kwan <dougkwan@google.com>
10391
10392 * arm.cc (attributes.h): New include.
10393 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10394 (Arm_relobj::~Arm_relobj): Delete object pointed by
10395 attributes_section_data_.
10396 (Arm_relobj::attributes_section_data): New method definition.
10397 (Arm_relobj::attributes_section_data_): New data member declaration.
10398 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10399 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10400 attributes_section_data_.
10401 (Arm_dynobj::attributes_section_data): New method definition.
10402 (Arm_dynobj::attributes_section_data_): New data member declaration.
10403 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10404 initialization value of may_use_blx_ to false.
2e702c99 10405 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10406 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10407 object attributes to compute results instead of hard-coding.
10408 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10409 Target_arm::get_secondary_compatible_arch,
10410 Target_arm::set_secondary_compatible_arch
10411 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10412 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10413 New method declarations.
10414 (Target_arm::get_aeabi_object_attribute): New method definition.
10415 (Target_arm::attributes_section_data_): New data member declaration.
10416 (read_arm_attributes_section): New template definition.
10417 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10418 (Arm_dynobj::do_read_symbols): Ditto.
10419 (Target_arm::do_finalize_sections): Merge attributes sections from
10420 input. Check for BLX use after attributes section merging.
10421 Fix __exidx_start and __exidx_end visibility. Create an
10422 .ARM.attributes section if necessary.
10423 (Target_arm::get_secondary_compatible_arch,
10424 Target_arm::set_secondary_compatible_arch,
10425 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10426 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10427 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10428 New method definitions.
10429
b59befec
ILT
104302009-12-09 Ian Lance Taylor <iant@google.com>
10431
10432 * plugin.cc (Plugin::load): Don't cast from void* to a function
10433 pointer.
10434
1276bc89
ILT
104352009-12-09 Ian Lance Taylor <iant@google.com>
10436
10437 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10438 information fields.
10439
2f2de248
L
104402009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10441
10442 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10443 Replace two_file_shared_1.so with two_file_shared_2.so.
10444 * testsuite/Makefile.in: Regenerated.
10445
4f787271
DK
104462009-12-08 Doug Kwan <dougkwan@google.com>
10447
10448 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10449 (HFILES): Add attributes.h and int_encoding.h.
10450 * Makefile.in: Regenerate.
10451 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10452 function definitions to int_encoding.cc
10453 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10454 prototypes to int_encoding.h
10455 * reduced_debug_output.cc (int_encoding.h): New include.
10456 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10457 function definitions to int_encoding.cc
10458 (insert_into_vector, read_from_pointer): Move template definitions to
10459 int_encoding.h
10460 * attributes.cc: New file.
10461 * attributes.h: New file.
10462 * int_encoding.cc: New file.
10463 * int_encoding.h: New file.
10464
20b52f1a
RÁE
104652009-12-07 Rafael Avila de Espindola <espindola@google.com>
10466
10467 PR gold/11055
10468 * incremental-dump.cc (dump_incremental_inputs): New.
10469 (main): Use dump_incremental_inputs.
10470
53d7974c
L
104712009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10472
10473 PR gold/10893
10474 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10475 checking elfcpp::STT_FUNC.
10476 (Target_i386::Relocate::relocate): Likewise.
10477 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10478
10479 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10480 symbols from shared libraries into normal FUNC symbols.
10481
10482 * symtab.h (Symbol): Add is_func and use it.
10483
05a352e6
DK
104842009-12-05 Doug Kwan <dougkwan@google.com>
10485
10486 * arm.cc (Target_arm::arm_info): Initialize new fields
10487 attributes_section and attributes_vendor.
10488 * i386.cc (Target_i386::i386_info): Same.
10489 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10490 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10491 fields attributes_section and attributes_vendor.
53d7974c 10492 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
10493 * target.h (Target::attributes_section, Target::attributes_vendor,
10494 Target::is_attributes_section, Target::attribute_arg_type,
10495 Target::attributes_order): New method definitions.
10496 (Target::Target_info::attributes_section,
10497 Target::Target_info::attributes_vendor): New fields.
10498 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10499 virtual method definitions.
10500 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10501 attributes_section and attributes_vendor.
10502 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10503
f4e5969c
DK
105042009-12-05 Doug Kwan <dougkwan@google.com>
10505
10506 * arm.cc: Update comments about interworking and stub generation.
10507 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10508 considered as non-PIC.
10509 (Arm_relocate_functions::base_abs): Fix formatting.
10510 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10511 of function to use GOT entry address instead of offset.
10512 (Target_arm::Scan::global): Issue an error if a symbol would need a
10513 PLT does not get one because it is untyped. Remove code to create
10514 dynamic symbols for relative branches.
10515 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10516 takes unsigned integer instead of boolean.
10517
1abce4a6
L
105182009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10519
10520 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10521 (two_file_test_LDADD): Likewise.
10522 (common_test_1_LDADD): Likewise.
10523 (exception_test_LDADD) Likewise.
10524 (weak_test_LDADD): Likewise.
10525 (many_sections_test_LDADD): Likewise.
10526 (initpri1_LDADD): Likewise.
10527 (script_test_1_LDADD): Likewise.
10528 (script_test_2_LDADD): Likewise.
10529 (justsyms_LDADD): Likewise.
10530 (binary_test_LDADD): Likewise.
10531 (large_LDADD): Likewise.
10532 * testsuite/Makefile.in: Regenerated.
10533
adcf2816 105342009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 10535
adcf2816
L
10536 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10537 (Symbol_table::override_with_special): Likewise.
10538 (Symbol_table::add_from_object): Likewise.
10539
28e67f5d
RÁE
105402009-12-04 Rafael Avila de Espindola <espindola@google.com>
10541
10542 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10543 Don't set the data_offset twice.
10544
ae10a101
RÁE
105452009-12-04 Rafael Avila de Espindola <espindola@google.com>
10546
10547 * testsuite/Makefile.in: Regenerate.
10548
f59f41f3
DK
105492009-12-03 Doug Kwan <dougkwan@google.com>
10550
10551 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10552 (Target_arm::do_finalize_sections): Add parameter for symbol table
10553 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10554 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10555 parameter for symbol table pointer.
10556 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10557 an additional parameter for a pointer to symbol table.
10558 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10559 parameter for a symbol table pointer.
10560 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10561 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10562 Ditto.
10563 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10564 parameter for a symbol table pointer.
10565
ca55d848
RÁE
105662009-12-03 Rafael Avila de Espindola <espindola@google.com>
10567
10568 * incremental.cc (Incremental_inputs_header)
10569 (Incremental_inputs_header_write, Incremental_inputs_entry)
10570 (Incremental_inputs_entry_write): Move ...
10571 * incremental.h (Incremental_inputs_header)
10572 (Incremental_inputs_header_write, Incremental_inputs_entry)
10573 (Incremental_inputs_entry_write): here.
10574
3aec4f9c
RÁE
105752009-12-02 Rafael Avila de Espindola <espindola@google.com>
10576
10577 * incremental.cc (make_sized_incremental_binary): Set the target.
10578 Error if it is incompatible.
10579 * output.h (Output_file): Add filename method.
10580
9c0ae74d
RÁE
105812009-12-02 Rafael Avila de Espindola <espindola@google.com>
10582
10583 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10584 from the get_* methods.
10585
a45500ae
RÁE
105862009-12-02 Rafael Avila de Espindola <espindola@google.com>
10587
10588 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10589 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10590 Write 0 for the data_offset of scripts.
10591
325e6408
RÁE
105922009-12-02 Rafael Avila de Espindola <espindola@google.com>
10593
10594 * testsuite/Makefile.am: Add the incremental_test.sh test.
10595 * testsuite/incremental_test.sh: New.
10596 * testsuite/incremental_test_1.c: New.
10597 * testsuite/incremental_test_2.c: New.
10598
954c3e2e
RÁE
105992009-12-01 Rafael Avila de Espindola <espindola@google.com>
10600
703d02da 10601 * incremental-dump.cc (main): Fix typos.
954c3e2e 10602
f8086623
RÁE
106032009-11-27 Rafael Avila de Espindola <espindola@google.com>
10604
10605 PR gold/11025
10606 * incremental-dump.cc (main): Use llu to print 64 bit values.
10607
3b0dd6ac
L
106082009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10609 H.J. Lu <hongjiu.lu@intel.com>
10610
10611 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10612 $(LIBDL).
10613 (incremental_dump_LDADD): Likewise.
10614 * Makefile.in: Regenerated.
10615
a6d1ef57 106162009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 10617
a6d1ef57
DK
10618 Revert:
10619
10620 2009-11-25 Doug Kwan <dougkwan@google.com>
10621
10622 * arm.cc (Target_arm::Target_arm): Move method definition
10623 outside of class definition. Add code to handle
10624 --target1-rel, --target1-abs and --target2= options.
10625 (Target_arm::get_reloc_reloc_type): Change method to be
10626 non-static and const.
10627 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10628 New data member declaration.
10629 (Target_arm::Scan::local, Target_arm::Scan::global,
10630 Target_arm::Relocate::relocate,
10631 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10632 Adjust call to Target_arm::get_real_reloc_type.
10633 (Target_arm::get_real_reloc_type): Use command line options
10634 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10635 * options.h (--target1-rel, --target1-abs, --target2): New
10636 ARM-only options.
10637
50aeb7d4
DK
106382009-11-25 Doug Kwan <dougkwan@google.com>
10639
10640 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10641 class definition. Add code to handle --target1-rel, --target1-abs
10642 and --target2= options.
10643 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10644 and const.
10645 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10646 member declaration.
10647 (Target_arm::Scan::local, Target_arm::Scan::global,
10648 Target_arm::Relocate::relocate,
10649 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10650 call to Target_arm::get_real_reloc_type.
10651 (Target_arm::get_real_reloc_type): Use command line options to
10652 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10653 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10654 options.
10655
51938283
DK
106562009-11-25 Doug Kwan <dougkwan@google.com>
10657
10658 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10659 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10660 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10661 formatting.
10662 (Arm_relocate_functions::thm_call): Replace body with a call to
10663 Arm_relocate_functions::thumb_branch_common.
10664 (Arm_relocate_functions::thm_jump24,
10665 Arm_relocate_functions::thm_xpc22): New method definitions.
10666 (Arm_relocate_functions::thumb_branch_common): New method definition.
10667 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10668 operator.
10669 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10670 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10671
e2b8f3c4
RÁE
106722009-11-24 Rafael Avila de Espindola <espindola@google.com>
10673
10674 * Makefile.am: Build incremental-dump
10675 * Makefile.in: Regenerate.
10676 * incremental-dump.cc: New.
10677 * incremental.cc (Incremental_inputs_header_data,
10678 Incremental_inputs_entry_data): Move to incremental.h
10679 * incremental.h: (Incremental_inputs_header_data,
10680 Incremental_inputs_entry_data): Move from incremental.cc
10681
bcba9aec
RÁE
106822009-11-24 Rafael Avila de Espindola <espindola@google.com>
10683
10684 * incremental.cc (Incremental_inputs_header,
10685 Incremental_inputs_header_write, Incremental_inputs_entry,
10686 Incremental_inputs_entry_write): Add a typedef with the data type.
10687
7c3afe08
RÁE
106882009-11-24 Rafael Avila de Espindola <espindola@google.com>
10689
10690 * incremental.cc (Incremental_inputs_header,
10691 Incremental_inputs_header_write, Incremental_inputs_entry,
10692 Incremental_inputs_entry_write): Update comment about which
10693 type has the filed descriptions.
10694
d204b6e9
DK
106952009-11-15 Doug Kwan <dougkwan@google.com>
10696
10697 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
10698 (Arm_relocate_functions::arm_branch_common): Change method defintion
10699 in class definition to a method declaration and update list of formal
10700 parameters.
10701 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
10702 Arm_relocation_functions::jump24): Adjust call to
10703 Arm_relocate_functions::arm_branch_common. Update list of formal
10704 parameters.
10705 (Arm_relocate_functions::xpc25): New method definition.
10706 (Arm_relocate_functions::arm_branch_common): Move method defintion
10707 out from class definition. Use stubs for mode-switching and extending
10708 branch ranges.
10709 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
10710 specially. Change code to enable use of stubs in ARM branches.
10711
43d12afe
DK
107122009-11-10 Doug Kwan <dougkwan@google.com>
10713
10714 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
10715 in method declaration.
10716 (Target_arm::relocate_stub): New method declaration.
10717 (Target_arm::default_target): Change to return a pointer instead of
10718 a const reference.
10719 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
10720 Target_arm::default_target.
10721 (Arm_Relobj::do_relocate_sections): Remove options paramater in
10722 method definition.
10723 (Target_arm::relocate_section): Adjust view.
10724 (Target_arm::relocate_stub): New method definition.
10725
ac33a407
DK
107262009-11-10 Doug Kwan <dougkwan@google.com>
10727
10728 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
10729 a format warning.
10730 * incremental.cc (open_incremental_binary): Initialized local
10731 variables to avoid warnings.
10732 * object.cc (make_elf_object): Ditto.
10733 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
10734 a format warning.
e1df38aa 10735
88ee28e9
L
10736009-11-09 H.J. Lu <hongjiu.lu@intel.com>
10737
10738 PR gold/10930
10739 * testsuite/plugin_test.c: Include "config.h".
10740
2daedcd6
DK
107412009-11-09 Doug Kwan <dougkwan@google.com>
10742
10743 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
10744 (arm_symbol_value): Remove.
10745 (Arm_relocate_functions::arm_branch_common,
10746 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
10747 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
10748 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
10749 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
10750 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
10751 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
10752 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
10753 Arm_relocate_functions::thm_mobw_abs_nc,
10754 Arm_relocate_functions::thm_mov_abs,
10755 Arm_relocate_functions::movw_prel_nc,
10756 Arm_relocate_functions::thm_movt_abs,
10757 Arm_relocate_functions::movt_prel,
10758 Arm_relocate_functions::thm_movw_prel_nc,
10759 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
10760 (Target_arm::Relocate::relocate): Only decompose address into two
10761 parts if relocation type uses the thumb-bit and pass the actual
10762 bit instead of a flag indicating that the thumb-bit is used. Adjust
10763 calls to methods in Arm_relocate_functions for this change.
10764
1276bc89 107652009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
10766
10767 PR 10925
10768 * reloc.cc: Instantiate
10769 Sized_relobj::initialize_input_to_output_maps and
10770 Sized_relobj:free_input_to_output_maps.
10771
e53ad1b5
ILT
107722009-11-06 Ian Lance Taylor <iant@google.com>
10773
10774 PR 10876
10775 * defstd.cc (in_segment): Set only_if_ref true for "end".
10776
eb44217c
DK
107772009-11-06 Doug Kwan <dougkwan@google.com>
10778
10779 * arm.cc (class Reloc_stub): Correct a comment.
10780 (Target_arm::Target_arm): Initialize arm_input_section_map_.
10781 (Target_arm::scan_section_for_stubs): New method declaration.
10782 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
10783 Change methods from private to protected.
10784 (Target_arm::do_may_relax): New method definition.
10785 (Target_arm::do_relax, Target_arm::group_sections,
10786 Target_arm::scan_reloc_for_stub,
10787 Target_arm::scan_reloc_section_for_stubs): New method declarations.
10788 (Target_arm::arm_input_section_map_): New data member declaration.
10789 (Target_arm::scan_reloc_for_stub,
10790 Target_arm::scan_reloc_section_for_stubs,
10791 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
10792 Target_arm::do_relax): New method definitions.
10793
5d329b7d
ILT
107942009-11-06 Mikolaj Zalewski <mikolaj@google.com>
10795
10796 * configure.ac: Check for (struct stat)::st_mtim
10797 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
10798 * config.in: Regenerate.
10799 * configure: Regenerate.
10800
96a0d71b
ILT
108012009-11-05 Ian Lance Taylor <iant@google.com>
10802
10803 PR 10910
10804 * output.cc (Output_segment::add_output_section): Add missing
10805 return statement.
10806
594c8e5e
ILT
108072009-11-04 Ian Lance Taylor <iant@google.com>
10808
10809 PR 10880
10810 * object.h (class Object): Add is_needed and set_is_needed
10811 methods. Add is_needed_ field. Make bool fields into bitfields.
10812 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
10813 defined in a dynamic object and referenced by a regular object,
10814 set is_needed for the dynamic object.
10815 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
10816 if the file is marked with as_needed and it is not needed.
10817
22b127cc
ILT
108182009-11-04 Ian Lance Taylor <iant@google.com>
10819
10820 PR 10887
10821 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
10822 tags if data is discarded by linker script.
10823 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10824 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10825 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10826 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10827
f5c870d2
ILT
108282009-11-04 Ian Lance Taylor <iant@google.com>
10829
10830 * layout.cc (Layout::get_output_section): Add is_interp and
10831 is_dynamic_linker_section parameters. Change all callers.
10832 (Layout::choose_output_section): Likewise.
10833 (Layout::make_output_section): Likewise.
10834 (Layout::add_output_section_data): Add is_dynamic_linker_section
10835 parameter. Change all callers.
10836 * layout.h (class Layout): Update declarations.
10837 * output.h (class Output_section): Add is_interp, set_is_interp,
10838 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
10839 Add is_interp_, is_dynamic_linker_section_ fields. Change
10840 generate_code_fills_at_write_ to a bitfield.
10841 * output.cc (Output_section::Output_sections): Initialize new
10842 fields.
10843 (Output_segment::add_output_section): Add do_sort parameter.
10844 Change all callers.
10845
1ae4d23b
ILT
108462009-11-03 Ian Lance Taylor <iant@google.com>
10847
10848 PR 10860
10849 * options.h (class General_options): Add --warn-common.
10850 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
10851 merging two common symbols.
10852 (Symbol_table::should_override): Handle --warn-common when merging
10853 a common symbol with a defined symbol. Use report_resolve_problem
10854 for multiple definitions.
10855 (Symbol_table::report_resolve_problem): New function.
10856 * symtab.h (class Symbol_table): Declare report_resolve_problem.
10857
55da9579
DK
108582009-11-03 Doug Kwan <dougkwan@google.com>
10859
10860 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
10861 stub_factory_.
10862 (Target_arm::stub_factory): New method definition.
10863 (Target_arm::new_arm_input_section,
10864 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
10865 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 10866 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
10867 New type definitions.
10868 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
10869 member declarations.
10870 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
10871 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
10872 New method definitions.
10873
37a9ac43
ILT
108742009-11-03 Ian Lance Taylor <iant@google.com>
10875
10876 * options.h (class General_options): Add --warn_constructors.
10877
b3d6a3d4
ILT
108782009-11-03 Ian Lance Taylor <iant@google.com>
10879
10880 PR 10893
10881 * defstd.cc (in_section): Add entries for __rel_iplt_start,
10882 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
10883
934b01dd
ILT
108842009-11-03 Ian Lance Taylor <iant@google.com>
10885
10886 PR 10895
10887 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
10888 --msgid-bugs-address.
10889 (install-pdf): New target.
10890 (install-data_yes): Look up one directory to find mkinstalldirs.
10891
03c1939b
L
108922009-11-03 H.J. Lu <hongjiu.lu@intel.com>
10893
10894 * po/Make-in (.po.gmo): Don't generate .gmo files in source
10895 tree.
10896
ebd95253
DK
108972009-10-30 Doug Kwan <dougkwan@google.com>
10898
10899 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10900
e9bbb538
DK
109012009-10-30 Doug Kwan <dougkwan@google.com>
10902
10903 * arm.cc (Stub_addend_reader): New struct template definition
10904 and partial specializations.
10905 (Stub_addend_reader::operator()): New method definition for a
10906 partially specialized template.
10907
d5b40221
DK
109082009-10-30 Doug Kwan <dougkwan@google.com>
10909
10910 * arm.cc (Arm_relobj::processor_specific_flags): New method
10911 definition.
10912 (Arm_relobj::do_read_symbols): New method declaration.
10913 (Arm_relobj::processor_specific_flags_): New data member declaration.
10914 (Arm_dynobj): New class definition.
10915 (Target_arm::do_finalize_sections): Add input_objects parameter.
10916 (Target_arm::do_adjust_elf_header): New method declaration.
10917 (Target_arm::are_eabi_versions_compatible,
10918 (Target_arm::merge_processor_specific_flags): New method declaration.
10919 (Target_arm::do_make_elf_object): New overloaded method definitions
10920 and declaration.
10921 (Arm_relobj::do_read_symbols): New method definition.
10922 (Arm_dynobj::do_read_symbols): Ditto.
10923 (Target_arm::do_finalize_sections): Add input_objects parameters.
10924 Merge processor-specific flags from all input objects.
10925 (Target_arm::are_eabi_versions_compatible,
10926 Target_arm::merge_processor_specific_flags,
10927 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10928 New method definitions.
10929 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10930 Input_objects pointer type parameter.
10931 * layout.cc (Layout::finalize): Pass input objects to target's.
10932 finalize_sections function.
10933 * output.cc (Output_file_header::do_sized_write): Set ELF file
10934 header's processor-specific flags.
10935 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
10936 Input_objects pointer type parameter.
10937 * sparc.cc (Target_sparc::do_finalize_sections): Same.
10938 * target.h (Input_objects): New forward class declaration.
10939 (Target::processor_specific_flags,
10940 Target::are_processor_specific_flags_sect): New method definitions.
10941 (Target::finalize_sections): Add input_objects parameter.
10942 (Target::Target): Initialize processor_specific_flags_ and
10943 are_processor_specific_flags_set_.
10944 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
10945 parameter.
10946 (Target::set_processor_specific_flags): New method definition.
10947 (Target::processor_specific_flags_,
10948 Target::are_processor_specific_flags_set_): New data member
10949 declarations.
10950 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
10951 Input_objects pointer type parameter.
10952
ebabffbd
DK
109532009-10-30 Doug Kwan <dougkwan@google.com>
10954
10955 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
10956
ad0f2072
ILT
109572009-10-28 Ian Lance Taylor <iant@google.com>
10958
10959 * object.h (class Relobj): Drop options parameter from
10960 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
10961 do_scan_relocs, do_relocate. Change all callers.
10962 (class Sized_relobj): Drop options parameters from
10963 do_gc_process_relocs, do_scan_relocs, do_relocate,
10964 do_relocate_sections, relocate_sections, emit_relocs_scan,
10965 emit_relocs_scan_reltype. Change all callers.
10966 (struct Relocate_info): Remove options field and all references to
10967 it.
10968 * reloc.h (class Read_relocs): Remove options constructor
10969 parameter and options_ field. Change all callers.
10970 (class Gc_process_relocs, class Scan_relocs): Likewise.
10971 (class Relocate_task): Likewise.
10972 * target-reloc.h (scan_relocs): Remove options parameter. Change
10973 all callers.
10974 (scan_relocatable_relocs): Likewise.
10975 * target.h (class Sized_target): Remove options parameter from
10976 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
10977 all callers.
10978 * gc.h (gc_process_relocs): Remove options parameter. Change all
10979 callers.
10980 * arm.cc: Update functions to remove options parameters.
10981 * i386.cc: Likewise.
10982 * powerpc.cc: Likewise.
10983 * sparc.cc: Likewise.
10984 * x86_64.cc: Likewise.
10985 * testsuite/testfile.cc: Likewise.
10986
8ffa3667
DK
109872009-10-28 Doug Kwan <dougkwan@google.com>
10988
10989 * arm.cc (Arm_relobj): New class definition.
e1df38aa 10990 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
10991 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
10992 New method definitions.
10993
40f36857
CC
109942009-10-28 Cary Coutant <ccoutant@google.com>
10995
10996 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
10997 (Plugin::cleanup_done_): New member.
10998 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
10999 (Plugin_manager::cleanup_done_): Remove.
11000 (Plugin_manager::add_input_file): Edit error message.
11001 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11002 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11003
2c849493
ILT
110042009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11005
11006 * fileread.cc: (File_read::View::~View): Use the new
11007 data_ownership_ filed.
11008 (File_read::~File_read): Dispose the new whole_file_view_.
11009 (File_read::open): Mmap the whole file if needed.
11010 (File_read::open): Use whole_file_view_ instead of contents_.
11011 (File_read::find_view): Use whole_file_view_ if applicable.
11012 (File_read::do_read): Use whole_file_view_ instead of contents_.
11013 (File_read::make_view): Use whole_file_view_ instead of contents_,
11014 update File_read::View::View call.
11015 (File_read::find_or_make_view): Update File_read::View::View
11016 call.
11017 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11018 remove contents_
11019 (File_read::View::Data_ownership): New enum.
11020 (File_read::View::View): Replace bool mapped_ with Data_ownership
11021 argument.
11022 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11023 (File_read::View::data_ownership_): New field.
11024 (File_read::contents_): Remove (replaced by whole_file_view_).
11025 (File_read::whole_file_view_): New field.
11026 * options.h (class General_options): Add --keep-files-mapped.
11027
24998053
CC
110282009-10-27 Cary Coutant <ccoutant@google.com>
11029
11030 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11031 * testsuite/Makefile.am (plugin_test_5): New test case.
11032 * testsuite/Makefile.in: Regenerate.
11033
72adc4fa
DK
110342009-10-25 Doug Kwan <dougkwan@google.com>
11035
11036 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11037 from private to protected to allow access by child class.
11038 (Sized_relobj::do_relocate_sections): New method declaration.
11039 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11040 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11041 Sized_relobj::relocate_sections. Instantiate template explicitly
11042 for different target sizes and endianity.
11043
07f508a2
DK
110442009-10-24 Doug Kwan <dougkwan@google.com>
11045
11046 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11047 (Arm_input_section::as_arm_input_section): New method.
11048 (Arm_output_section): New class definition.
11049 (Arm_output_section::create_stub_group,
11050 Arm_output_section::group_sections): New method definitions.
11051
10ad9fe5
DK
110522009-10-22 Doug Kwan <dougkwan@google.com>
11053
11054 * arm.cc (Arm_input_section): New class definition.
11055 (Arm_input_section::init, Arm_input_section:do_write,
11056 Arm_input_section::set_final_data_size,
11057 Arm_input_section::do_reset_address_and_file_offset): New method
11058 definitions.
11059
56ee5e00
DK
110602009-10-21 Doug Kwan <dougkwan@google.com>
11061
11062 * arm.cc (Stub_table, Arm_input_section): New forward class
11063 declarations.
11064 (Stub_table): New class defintion.
11065 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11066 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11067 New method definition.
11068
b569affa
DK
110692009-10-21 Doug Kwan <dougkwan@google.com>
11070
11071 * arm.cc: Update copyright comments.
11072 (Target_arm): New forward class template declaration.
11073 (Arm_address): New type.
11074 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11075 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11076 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11077 constants.
11078 (Insn_template): Same.
11079 (DEF_STUBS): New macro.
11080 (Stub_type): New enum type.
11081 (Stub_template): New class definition.
11082 (Stub): Same.
11083 (Reloc_stub): Same.
11084 (Stub_factory): Same.
11085 (Target_arm::Target_arm): Initialize may_use_blx_ and
11086 should_force_pic_veneer_.
11087 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11088 Target_arm::should_force_pic_veneer,
11089 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11090 Target_arm::using_thumb_only, Target_arm:;default_target): New
11091 method defintions.
11092 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11093 New data member declarations.
11094 (Insn_template::size, Insn_template::alignment): New method defintions.
11095 (Stub_template::Stub_template): New method definition.
11096 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11097 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11098 (Stub_factory::Stub_factory): New method definition.
11099 * gold.h (string_hash): New template.
11100 * output.h (Input_section_specifier::hash_value): Use
11101 gold::string_hash.
11102 (Input_section_specifier::string_hash): Remove.
11103 * stringpool.cc (Stringpool_template::string_hash): Use
11104 gold::string_hash.
11105
6c172549
DK
111062009-10-20 Doug Kwan <dougkwan@google.com>
11107
11108 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11109 symbols of relaxed input sections.
11110 * output.h (Output_section::find_relaxed_input_section): Make
11111 method public.
11112
c5617f2f
DK
111132009-10-16 Doug Kwan <dougkwan@google.com>
11114
11115 * dynobj.cc (Versions::Versions): Initialize version_script_.
11116 Only insert base version symbol definition for a shared object
11117 if version script defines any version versions.
11118 (Versions::define_base_version): New method definition.
11119 (Versions::add_def): Check that base version is not needed.
11120 (Versions::add_need): Define base version lazily.
11121 * dynobj.h (Versions::define_base_version): New method declaration.
11122 (Versions::needs_base_version_): New data member declaration.
11123 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11124 (check_DATA): Add no_version_test.stdout.
11125 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11126 New make rules.
11127 * testsuite/Makefile.in: Regenerate.
11128 * testsuite/no_version_test.c: New file.
11129 * testsuite/no_version_test.sh: Ditto.
11130
3c12dcdb
DK
111312009-10-16 Doug Kwan <dougkwan@google.com>
11132
11133 * expression.cc (class Segment_start_expression): New class definition.
11134 (Segment_start_expression::value): New method definition.
11135 (script_exp_function_segment_start): Return a new
11136 Segment_start_expression.
11137 * gold/script-c.h (script_saw_segment_start_expression): New function
11138 prototype.
11139 * script-sections.cc (Script_sections::Script_sections): Initialize
11140 SAW_SEGMENT_START_EXPRESSION_ to false.
11141 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11142 and -Tbbs options to specify section addresses if given in
11143 command line and no SEGMENT_START expression is seen in a script.
11144 * script-sections.h (Script_sections::saw_segment_start_expression,
11145 Script_sections::set_saw_segment_start_expression): New method
11146 definition.
11147 (Script_sections::saw_segment_start_expression_): New data member
11148 declaration.
11149 * script.cc (script_saw_segment_start_expression): New function.
11150 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11151 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11152 script_test_7.sh and script_test_8.sh.
11153 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11154 script_test_8.stdout.
11155 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11156 (script_test_6, script_test_6.stdout, script_test_7,
11157 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11158 * Makefile.in: Regenerate.
11159 * testsuite/script_test_6.sh: New file.
11160 * testsuite/script_test_6.t: Same.
11161 * testsuite/script_test_7.sh: Same.
11162 * testsuite/script_test_7.t: Same.
11163 * testsuite/script_test_8.sh: Same.
11164
64b1ae37
DK
111652009-10-16 Doug Kwan <dougkwan@google.com>
11166
11167 * output.cc (Output_segment::set_section_list_address): Cast
11168 expressions to unsigned long long type to avoid format warnings.
11169
661be1e2
ILT
111702009-10-15 Ian Lance Taylor <iant@google.com>
11171
12edd763 11172 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11173 dot assignment to script_sections_.
12edd763
ILT
11174 * script-sections.cc (Script_sections::add_dot_assignment):
11175 Initialize if necessary.
11176
68b6574b
ILT
11177 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11178 program headers with no load segment if there is a linker script.
11179
661be1e2
ILT
11180 * layout.cc (Layout::set_segment_offsets): Align the file offset
11181 to the segment aligment for -N or -n with no load segment.
11182 * output.cc (Output_segment::add_output_section): Don't crash if
11183 the first section is a TLS section.
11184 (Output_segment::set_section_list_addresses): Print an error
11185 message if the address moves backward in a linker script.
11186 * script-sections.cc
11187 (Output_section_element_input::set_section_addresses): Don't
11188 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11189 (Orphan_output_section::set_section_addresses): Likewise.
11190
f15f61a7
DK
111912009-10-15 Doug Kwan <dougkwan@google.com>
11192
11193 * layout.cc (Layout::finish_dynamic_section): Generate tags
11194 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11195 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11196 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11197
82bb573a
ILT
111982009-10-14 Ian Lance Taylor <iant@google.com>
11199
11200 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11201 fields.
11202 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11203 data_shdr fields of relinfo.
11204 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11205 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11206 R_386_TLS_LDO_32, adjust based on section flags.
11207 (Target_i386::Relocate::fix_up_ldo): Remove.
11208
374ad285
ILT
112092009-10-13 Ian Lance Taylor <iant@google.com>
11210
11211 Add support for -pie.
11212 * options.h (class General_options): Add -pie and
11213 --pic-executable.
11214 (General_options::output_is_position_independent): Test -pie.
11215 (General_options::output_is_executable): Return true if not shared
11216 and not relocatable.
11217 (General_options::output_is_pie): Remove.
11218 * options.cc (General_options::finalize): Reject incompatible uses
11219 of -pie.
11220 * gold.cc (queue_middle_tasks): A -pie link is not static.
11221 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11222 * symtab.cc (Symbol::final_value_is_known): Return false if
11223 output_is_position_independent.
11224 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11225 output_is_position_independent.
11226 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11227 output_is_position_independent.
11228 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11229 output_is_position_independent.
11230 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11231 two_file_pie_test.
11232 (basic_pie_test.o, basic_pie_test): New targets.
11233 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11234 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11235 (two_file_pie_test): New target.
11236 * testsuite/Makefile.in: Rebuild.
11237 * README: Remove note saying that -pie is not supported.
11238
c6585162
ILT
112392009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11240
11241 * options.h (class General_options): Add -init and -fini.
11242 * layout.cc (Layout::finish_dynamic_section): Emit
11243 given init and fini functions.
11244
032ce4e9
ST
112452009-10-13 Sriraman Tallam <tmsriram@google.com>
11246
11247 * gc.h (gc_process_relocs): Check if icf is enabled using new
11248 function.
11249 * gold.cc (queue_initial_tasks): Likewise.
11250 (queue_middle_tasks): Likewise.
11251 * object.cc (do_layout): Likewise.
11252 * symtab.cc (is_section_folded): Likewise.
11253 * main.cc (main): Likewise.
11254 * reloc.cc (Read_relocs::run): Likewise.
11255 (Sized_relobj::do_scan_relocs): Likewise.
11256 * icf.cc (is_function_ctor_or_dtor): New function.
11257 (Icf::find_identical_sections): Check if function is ctor or dtor when
11258 safe icf is chosen.
11259 * options.h (General_options::icf): Change option to be an enum.
11260 (Icf_status): New enum.
11261 (icf_enabled): New method.
11262 (icf_safe_folding): New method.
11263 (set_icf_status): New method.
11264 (icf_status_): New variable.
11265 * (options.cc) (General_options::finalize): Set icf_status_.
11266 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11267 icf_test and icf_keep_unique_test to use the --icf enum flag.
11268 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11269 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11270
f345227a
ST
112712009-10-12 Sriraman Tallam <tmsriram@google.com>
11272
11273 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11274 includes to gc.h and icf.h.
11275 * arm.cc: Include gc.h.
11276 * gold.cc: Likewise.
11277 * i386.cc: Likewise.
11278 * powerpc.cc: Likewise.
11279 * sparc.cc: Likewise.
11280 * x86_64.cc: Likewise.
11281 * gc.h: Include icf.h.
11282
1c7814ed
ILT
112832009-10-11 Ian Lance Taylor <iant@google.com>
11284
11285 * plugin.cc: Include "gold.h" before other header files.
11286
ae3b5189
CD
112872009-10-10 Chris Demetriou <cgd@google.com>
11288
11289 * options.h (Input_file_argument::Input_file_type): New enum.
11290 (Input_file_argument::is_lib_): Replace with...
11291 (Input_file_argument::type_): New member.
11292 (Input_file_argument::Input_file_argument): Take Input_file_type
11293 'type' rather than boolean 'is_lib' as second argument.
11294 (Input_file_argument::is_lib): Use type_.
11295 (Input_file_argument::is_searched_file): New function.
11296 (Input_file_argument::may_need_search): Handle is_searched_file.
11297 * options.cc (General_options::parse_library): Support -l:filename.
11298 (General_options::parse_just_symbols): Update for Input_file_argument
11299 changes.
11300 (Command_line::process): Likewise.
11301 * archive.cc (Archive::get_file_and_offset): Likewise.
11302 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11303 * script.cc (read_script_file, script_add_file): Likewise.
11304 * fileread.cc (Input_file::Input_file): Likewise.
11305 (Input_file::will_search_for): Handle is_searched_file.
11306 (Input_file::open): Likewise.
11307 * readsyms.cc (Read_symbols::get_name): Likewise.
11308 * testsuite/Makefile.am (searched_file_test): New test.
11309 * testsuite/Makefile.in: Regenerate.
11310 * testsuite/searched_file_test.cc: New file.
11311 * testsuite/searched_file_test_lib.cc: New file.
11312
f3048a1d
ILT
113132009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11314 Ian Lance Taylor <iant@google.com>
11315
11316 * descriptor.cc: Include <cstdio> and "binary-io.h".
11317 (Descriptors::open): Open the files in binary mode always.
11318 * script.cc (Lex::get_token): Treat \r as whitespace.
11319
d4780e57
ILT
113202009-10-09 Ian Lance Taylor <iant@google.com>
11321
11322 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11323
d9a893b8
ILT
113242009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11325 Ian Lance Taylor <iant@google.com>
11326
11327 * configure.ac: Check for readv function also.
11328 * fileread.cc (readv): Define if not HAVE_READV.
11329 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11330 does not exist.
11331 * config.in: Regenerate.
11332 * configure: Regenerate.
11333
c0a62865
DK
113342009-10-09 Doug Kwan <dougkwan@google.com>
11335
11336 * layout.cc (Layout::make_output_section): Call target hook to make
11337 ordinary output section.
11338 (Layout::finalize): Adjust parameter list of call the
11339 Target::may_relax().
11340 * layout.h (class Layout::section_list): New method.
11341 * merge.h (Output_merge_base::entsize): Change visibility to public.
11342 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11343 New methods.
11344 (Output_merge_string::do_is_string): New method.
11345 * object.cc (Sized_relobj::do_setup): renamed from
11346 Sized_relobj::set_up.
11347 * object.h (Sized_relobj::adjust_shndx,
11348 Sized_relobj::initializ_input_to_output_maps,
11349 Sized_relobj::free_input_to_output_maps): Change visibilities to
11350 protected.
11351 (Sized_relobj::setup): Virtualize.
11352 (Sized_relobj::do_setup): New method declaration.
11353 (Sized_relobj::invalidate_section_offset,
11354 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11355 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11356 * options.cc (parse_int): New function.
11357 * options.h (parse_int): New declaration.
11358 (DEFINE_int): New macro.
11359 (stub_group_size): New option.
11360 * output.cc (Output_section::Output_section): Initialize memebers
11361 merge_section_map_, merge_section_by_properties_map_,
11362 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11363 (Output_section::add_input_section): Handled deferred code-fill
11364 generation and remove an old comment.
11365 (Output_section::add_relaxed_input_section): New method definition.
11366 (Output_section::add_merge_input_section): Use merge section by
11367 properties map to speed to search. Update merge section maps
11368 as appropriate.
11369 (Output_section::build_relaxation_map): New method definition.
11370 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11371 Same.
11372 (Output_section::relax_input_section): Renamed to
11373 Output_section::convert_input_sections_to_relaxed_sections and change
11374 interface to take a vector of pointers to relaxed sections.
11375 (Output_section::find_merge_section,
11376 Output_section::find_relaxed_input_section): New method definitions.
11377 (Output_section::is_input_address_mapped,
11378 Output_section::output_offset, Output_section::output_address):
11379 Use output section data maps to speed up searching.
11380 (Output_section::find_starting_output_address): Add comments.
11381 (Output_section::do_write,
11382 Output_section::write_to_postprocessing_buffer): Do code-fill
11383 generation as appropriate.
11384 (Output_section::get_input_sections): Invalidate relaxed input section
11385 map.
11386 (Output_section::restore_states): Adjust type of checkpoint .
11387 Invalidate relaxed input section map.
11388 * output.h (Output_merge_base): New class declaration.
11389 (Input_section_specifier): New class defintion.
11390 (class Output_relaxed_input_section) Change base class to
11391 Output_section_data_build.
11392 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11393 base class initializer.
11394 (Output_section::add_relaxed_input_section): New method declaration.
11395 (Output_section::Input_section): Change visibility to protected.
2e702c99 11396 (Output_section::Input_section::relobj,
c0a62865
DK
11397 Output_section::Input_section::shndx): Handle relaxed input sections.
11398 Output_section::input_sections) Change visibility to protected. Also
11399 define overload to return a non-const pointer.
11400 (Output_section::Merge_section_properties): New class defintion.
11401 (Output_section::Merge_section_by_properties_map,
11402 Output_section::Output_section_data_by_input_section_map,
11403 Output_section::Relaxation_map): New types.
11404 (Output_section::relax_input_section): Rename method to
11405 Output_section::convert_input_sections_to_relaxed_sections and change
11406 interface to take a vector of relaxed section pointers.
11407 (Output_section::find_merge_section,
11408 Output_section::find_relaxed_input_section,
11409 Output_section::build_relaxation_map,
11410 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11411 New method declarations.
11412 (Output_section::merge_section_map_
11413 Output_section::merge_section_by_properties_map_,
11414 Output_section::relaxed_input_section_map_,
11415 Output_section::is_relaxed_input_section_map_valid_,
11416 Output_section::generate_code_fills_at_write_): New data members.
11417 * script-sections.cc
11418 (Output_section_element_input::set_section_addresses): Call
11419 current_data_size and addralign methods of relaxed input sections.
11420 (Orphan_output_section::set_section_addresses): Call current_data_size
11421 and addralign methods of relaxed input sections.
11422 * symtab.cc (Symbol_table::compute_final_value): Extract template
11423 from the body of Symbol_table::sized_finalize_symbol.
11424 (Symbol_table::sized_finalized_symbol): Call
11425 Symbol_table::compute_final_value.
11426 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11427 (Symbol_table::compute_final_value): New templated method declaration.
11428 * target.cc (Target::do_make_output_section): New method defintion.
11429 * target.h (Target::make_output_section): New method declaration.
11430 (Target::relax): Add more parameters for input objects, symbol table
11431 and layout. Adjust call to do_relax.
11432 (Target::do_make_output_section): New method declaration.
11433 (Target::do_relax): Add parameters for input objects, symbol table
11434 and layout.
11435
d446d6c4
ILT
114362009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11437
11438 * pread.c: Include stdio.h.
11439
bc06c745
ILT
114402009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11441
11442 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11443 defined.
11444
75aea3d0
ILT
114452009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11446
11447 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11448 Change read_shndx type to unsigned int.
11449 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11450 int.
11451 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11452 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11453 Change read_shndx type to unsigned int.
11454 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11455 int.
11456 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11457 * layout.cc (Layout::create_symtab_sections): Cast the result of
11458 local_symcount * symsize to off_t in the gold_assert.
11459
be8fcb75
ILT
114602009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11461
11462 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11463 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11464 R_ARM_BASE_ABS.
11465 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11466 (Arm_relocate_functions::thm_abs5): New function.
11467 (Arm_relocate_functions::abs12): New function.
11468 (Arm_relocate_functions::abs16): New function.
11469 (Arm_relocate_functions::base_abs): New function.
11470 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11471 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11472 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11473 R_ARM_BASE_ABS.
11474 (Scan::global): Likewise.
11475 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11476 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11477 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11478 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11479 R_ARM_BASE_ABS.
11480
c2a122b6
ILT
114812009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11482
11483 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11484 (Arm_relocate_functions::movt_prel): New function.
11485 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11486 (Arm_relocate_functions::thm_movt_prel): New function.
11487 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11488 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11489 (Scan::global, Relocate::relocate): Likewise.
11490 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11491
c4aa1e2d
ILT
114922009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11493
11494 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11495 Incremental_checker.
11496 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11497 unsigned int.
11498 (class Incremental_inputs_header): New class.
11499 (Incremental_inputs_header_writer): Edit comment.
11500 (Incremental_inputs_entry): New class.
11501 (Incremental_inputs_entry_writer): Edit comment.
11502 (Sized_incremental_binary::do_find_incremental_inputs_section):
11503 Add *strtab_shndx parameter, fill it.
11504 (Sized_incremental_binary::do_check_inputs): New method.
11505 (Incremental_checker::can_incrementally_link_output_file): Use
11506 Sized_incremental_binary::check_inputs.
11507 (Incremental_inputs::report_command_line): Save command line in
11508 command_line_.
11509 * incremental.h:
11510 (Incremental_binary::find_incremental_inputs_section): New
11511 method.
11512 (Incremental_binary::do_find_incremental_inputs_section): Add
11513 strtab_shndx parameter.
11514 (Incremental_binary::do_check_inputs): New pure virtual method.
11515 (Sized_incremental_binary::do_check_inputs): Declare.
11516 (Incremental_checker::Incremental_checker): Add incremental_inputs
11517 parameter, use it to initialize incremental_inputs_.
11518 (Incremental_checker::incremental_inputs_): New field.
11519 (Incremental_checker::command_line): New method.
11520 (Incremental_checker::inputs): New method.
11521 (Incremental_checker::command_line_): New field.
11522
c549a694
ILT
115232009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11524
11525 * incremental.cc: Include <cstdarg> and "target-select.h".
11526 (vexplain_no_incremental): New function.
11527 (explain_no_incremental): New function.
11528 (Incremental_binary::error): New method.
11529 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11530 method.
11531 (make_sized_incremental_binary): New function.
11532 (open_incremental_binary): New function.
11533 (can_incrementally_link_file): Add checks if output is ELF and has
11534 inputs section.
11535 * incremental.h: Include "elfcpp_file.h" and "output.h".
11536 (Incremental_binary): New class.
11537 (Sized_incremental_binary): New class.
11538 (open_incremental_binary): Declare.
11539 * object.cc (is_elf_object): Use
11540 elfcpp::Elf_recognizer::is_elf_file.
11541 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11542 * output.h (Output_file::filesize): New method.
11543
fd3c5f0b
ILT
115442009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11545
11546 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11547 New function.
11548 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11549 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11550 function.
11551 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11552 function.
11553 (Arm_relocate_functions::movw_abs_nc): New function.
11554 (Arm_relocate_functions::movt_abs): New function.
11555 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11556 (Arm_relocate_functions::thm_movt_abs): New function.
11557 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11558 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11559 (Scan::global): Likewise.
11560 (Relocate::relocate): Likewise.
11561 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11562
7f5309a5
ILT
115632009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11564
11565 * arm.cc (Arm_relocate_functions::got_prel) New function.
11566 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11567 (Relocate::relocate): Likewise.
11568 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11569
364c7fa5
ILT
115702009-10-06 Ian Lance Taylor <iant@google.com>
11571
11572 * options.h (class General_options): Define
11573 split_stack_adjust_size parameter.
11574 * object.h (class Object): Add uses_split_stack_ and
11575 has_no_split_stack_ fields. Add uses_split_stack and
11576 has_no_split_stack accessor functions. Declare
11577 handle_split_stack_section.
11578 (class Reloc_symbol_changes): Define.
11579 (class Sized_relobj): Define Function_offsets. Declare
11580 split_stack_adjust, split_stack_adjust_reltype, and
11581 find_functions.
11582 * object.cc (Object::handle_split_stack_section): New function.
11583 (Sized_relobj::do_layout): Call handle_split_stack_section.
11584 * dynobj.cc (Sized_dynobj::do_layout): Call
11585 handle_split_stack_section.
11586 * reloc.cc (Sized_relobj::relocate_sections): Call
11587 split_stack_adjust for executable sections in split_stack
11588 objects. Pass reloc_map to relocate_section.
11589 (Sized_relobj::split_stack_adjust): New function.
11590 (Sized_relobj::split_stack_adjust_reltype): New function.
11591 (Sized_relobj::find_functions): New function.
11592 * target-reloc.h: Include "object.h".
11593 (relocate_section): Add reloc_symbol_changes parameter. Change
11594 all callers.
11595 * target.h (class Target): Add calls_non_split method. Declare
11596 do_calls_non_split virtual method. Declare match_view and
11597 set_view_to_nop.
11598 * target.cc: Include "elfcpp.h".
11599 (Target::do_calls_non_split): New function.
11600 (Target::match_view): New function.
11601 (Target::set_view_to_nop): New function.
11602 * gold.cc (queue_middle_tasks): Give an error if mixing
11603 split-stack and non-split-stack objects with -r.
11604 * i386.cc (Target_i386::relocate_section): Add
11605 reloc_symbol_changes parameter.
11606 (Target_i386::do_calls_non_split): New function.
11607 * x86_64.cc (Target_x86_64::relocate_section): Add
11608 reloc_symbol_changes parameter.
11609 (Target_x86_64::do_calls_non_split): New function.
11610 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11611 parameter.
11612 * powerpc.cc (Target_powerpc::relocate_section): Add
11613 reloc_symbol_changes parameter.
11614 * sparc.cc (Target_sparc::relocate_section): Add
11615 reloc_symbol_changes parameter.
11616 * configure.ac: Call AM_CONDITIONAL for the default target.
11617 * configure: Rebuild.
11618 * testsuite/Makefile.am (TEST_AS): New variable.
11619 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11620 (check_DATA): Add split_i386 and split_x86_64 files.
11621 (SPLIT_DEFSYMS): Define.
11622 (split_i386_[1234n].o): New targets.
11623 (split_i386_[124]): New targets.
11624 (split_i386_[1234r].stdout): New targets.
11625 (split_x86_64_[1234n].o): New targets.
11626 (split_x86_64_[124]): New targets.
11627 (split_x86_64_[1234r].stdout): New targets.
11628 (MOSTLYCLEANFILES): Add new executables.
11629 * testsuite/split_i386.sh: New file.
11630 * testsuite/split_x86_64.sh: New file.
11631 * testsuite/split_i386_1.s: New file.
11632 * testsuite/split_i386_2.s: New file.
11633 * testsuite/split_i386_3.s: New file.
11634 * testsuite/split_i386_4.s: New file.
11635 * testsuite/split_i386_n.s: New file.
11636 * testsuite/split_x86_64_1.s: New file.
11637 * testsuite/split_x86_64_2.s: New file.
11638 * testsuite/split_x86_64_3.s: New file.
11639 * testsuite/split_x86_64_4.s: New file.
11640 * testsuite/split_x86_64_n.s: New file.
11641 * testsuite/testfile.cc (Target_test): Update relocation_section
11642 function.
11643 * testsuite/Makefile.in: Rebuild.
11644
e8a9fcda
ILT
116452009-10-06 Ian Lance Taylor <iant@google.com>
11646
11647 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11648 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11649 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11650 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11651 the address on ldo_addrs_.
11652 (Target_i386::Relocate::fix_up_ldo): New function.
11653
e99daf92
ILT
116542009-10-06 Rafael Espindola <espindola@google.com>
11655
11656 * plugin.cc (add_input_library): New.
11657 (Plugin::load): Add add_input_library to tv.
11658 (Plugin_manager::add_input_file): Add the is_lib argument.
11659 (add_input_file): Update call to Plugin_manager::add_input_file.
11660 (add_input_library): New.
11661 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11662
966d4097
DK
116632009-09-30 Doug Kwan <dougkwan@google.com>
11664
11665 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11666 symbol and call Symbol::may_need_copy_reloc to determine if
11667 a copy reloc is needed.
11668 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11669 nocopyreloc is given in command line.
11670 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11671 given in command line.
11672 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11673 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11674 of the removed Target_i386::may_need_copy_reloc.
11675 * options.h (copyreloc): New option with default value false.
11676 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11677 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11678 instead of the removed Target_powerpc::may_need_copy_reloc.
11679 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11680 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11681 instead of the removed Target_sparc::may_need_copy_reloc.
11682 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11683 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11684 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11685 instead of the removed Target_x86_64::may_need_copy_reloc.
11686
029ba973
ILT
116872009-09-30 Ian Lance Taylor <iant@google.com>
11688
11689 * object.h (class Object): Remove target_ field, and target,
11690 sized_target, and set_target methods.
11691 (Object::sized_target): Remove.
11692 (class Sized_relobj): Update declarations. Remove sized_target.
11693 * object.cc (Sized_relobj::setup): Remove target parameter.
11694 Change all callers.
11695 (Input_objects::add_object): Don't do anything with the target.
11696 (make_elf_sized_object): Add punconfigured parameter. Change all
11697 callers. Set or test parameter target.
11698 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
11699 Change all callers.
11700 * parameters.cc (Parameters::set_target): Change parameter type to
11701 be non-const.
11702 (Parameters::default_target): Remove.
11703 (set_parameters_target): Change parameter type to be non-const.
11704 (parameters_force_valid_target): New function.
11705 (parameters_clear_target): New function.
11706 * parameters.h (class Parameters): Update declarations. Remove
11707 default_target method. Add sized_target and clear_target
11708 methods. Change target_ to be non-const.
11709 (set_parameters_target): Update declaration.
11710 (parameters_force_valid_target): Declare.
11711 (parameters_clear_target): Declare.
11712 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
11713 as NULL if we aren't searching.
11714 (Add_symbols::run): Don't check for compatible target.
11715 * fileread.cc (Input_file::open_binary): Call
11716 parameters_force_valid_target.
11717 * gold.cc (queue_middle_tasks): Likewise.
11718 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
11719 set_target on object.
11720 * dynobj.h (class Sized_dynobj): Update declarations.
11721 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
11722 make_elf_object returns NULL.
11723 (Archive::include_member): Don't check whether object target is
11724 compatible.
11725 * output.cc (Output_section::add_input_section): Get target from
11726 parameters.
11727 (Output_section::relax_input_section): Likewise.
11728 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
11729 parameters.
11730 (Sized_relobj::do_scan_relocs): Likewise.
11731 (Sized_relobj::relocate_sections): Likewise.
11732 * resolve.cc (Symbol_table::resolve): Likewise.
11733 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
11734 parameter. Change all callers.
11735 (Symbol_table::add_from_object): Get target from parameters.
11736 (Symbol_table::add_from_relobj): Don't check object target.
11737 (Symbol_table::add_from_dynobj): Likewise.
11738 (Symbol_table::define_special_symbol): Get target from
11739 parameters.
11740 * symtab.h (class Symbol_table): Update declaration.
11741 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
11742 parameter. Change all callers. Clear parameter target.
11743 (Binary_test): Test target here.
11744 * testsuite/object_unittest.cc (gold_testsuite): Remove
11745 target_test_pointer parameter. Change all callers.
11746 (Object_test): Test target here.
11747
a6a22b83
ILT
117482009-09-26 Ian Lance Taylor <iant@google.com>
11749
11750 * testsuite/initpri1.c: Don't try to use constructor priorities if
11751 compiling with gcc before 4.3.
11752
6a8f49fe
ILT
117532009-09-22 Mikolaj Zalewski <mikolajz@google.com>
11754
11755 * testsuite/retain_symbols_file_test.sh (check_present): Change
11756 output file name to retain_symbols_file_test.stdout.
11757 (check_absent): Likewise.
11758
8c604651
CS
117592009-09-18 Craig Silverstein <csilvers@google.com>
11760
11761 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
11762 * options.cc: Include <cerrno> and <fstream>.
11763 (General_options::finalize): Parse -retain-symbols-file tag.
11764 * options.h: New flag.
11765 (General_options): New method should_retain_symbol, new
11766 variable symbols_to_retain.
11767 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
11768 should_retain_symbol map.
11769 * testsuite/Makefile.am (retain_symbols_file_test): New test.
11770 * testsuite/Makefile.in: Regenerate.
11771 * testsuite/retain_symbols_file_test.sh: New file.
11772
ca58b19f
NC
117732009-09-18 Nick Clifton <nickc@redhat.com>
11774
11775 * po/es.po: Updated Spanish translation.
11776
20e6d0d6
DK
117772009-09-17 Doug Kwan <dougkwan@google.com>
11778
11779 * debug.h (DEBUG_RELAXATION): New constant.
11780 (DEBUG_ALL): Add DEBUG_RELAXATION.
11781 (debug_string_to_enum): Add relaxation debug option.
11782 * layout.cc
11783 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
11784 Layout::Relaxation_debug_check::read_sections,
11785 Layout::Relaxation_debug_check::read_sections): New method definitions.
11786 (Layout::Layout): Initialize data members
11787 record_output_section_data_from_scrips_,
11788 script_output_section_data_list_ and relaxation_debug_check_.
11789 (Layout::save_segments, Layout::restore_segments,
11790 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11791 Layout::relaxation_loop_body): New method definitions.
11792 (Layout::finalize): Support relaxation. Move section layout code to
11793 Layout::relaxation_loop_body.
11794 (Layout::set_asection_address_from_script): Move code for orphan
11795 section placement out.
11796 (Layout::place_orphan_sections_in_script): New method definition.
11797 * layout.h (Output_segment_headers, Output_file_header):
11798 New forward class declarations.
11799 (Layout::~Layout): Define.
11800 (Layout::new_output_section_data_from_script): New method definition.
11801 (Layout::place_orphan_sections_in_script): New method declaration.
11802 (Layout::Segment_states): New type declaration.
11803 (Layout::save_segments, Layout::restore_segments,
11804 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11805 Layout::relaxation_loop_body): New method declarations.
11806 (Layout::Output_section_data_list): New type declaration.
11807 (Layout::Relaxation_debug_check): New class definition.
11808 (Layout::record_output_section_data_from_script_,
11809 Layout::script_output_section_data_list_, Layout::segment_states_,
11810 Layout::relaxation_debug_check_): New data members.
11811 * output.cc: (Output_section_headers::do_size): New method definition.
11812 (Output_section_headers::Output_section_headers): Move size
11813 computation to Output_section_headers::do_size.
11814 (Output_segment_headers::do_size): New method definition.
e1df38aa 11815 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
11816 Output_file_header::do_size and call it.
11817 (Output_file_header::do_size): New method definition.
11818 (Output_data_group::Output_data_group): Adjust call to
11819 Output_section_data.
11820 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
11821 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 11822 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
11823 RELAXED_INPUT_SECTION_CODE.
11824 (Output_section::Output_section): Initialize data member checkpoint_.
11825 (Output_section::~Output_section): Delete checkpoint object pointed
11826 by checkpoint_.
11827 (Output_section::add_input_section): Always add an Input_section if
11828 relaxing.
11829 (Output_section::add_merge_input_section): Add assert.
11830 (Output_section::relax_input_section): New method definition.
11831 (Output_section::set_final_data_size): Set load address to zero for
11832 an unallocated section.
11833 (Output_section::do_address_and_file_offset_have_reset_values):
11834 New method definition.
11835 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
11836 Handle relaxed input section.
11837 (Output_section::sort_attached_input_sections): Checkpoint input
11838 section list lazily.
11839 (Output_section::get_input_sections): Change type of input_sections to
11840 list of Simple_input_section pointers. Checkpoint input section list
11841 lazily. Also handle relaxed input sections.
11842 (Output_section::add_input_section_for_script): Take a reference to
11843 a Simple_input_section object instead of Relobj pointer and section
11844 index as parameter. Handle relaxed input sections.
11845 (Output_section::save_states, Output_section::restore_states): New
11846 method definitions.
11847 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
11848 (Output_data::is_data_size_fixed): New method definition.
11849 (Output_data::reset_addresss_and_file_offset): Do not reset data size
11850 if it is fixed.
11851 (Output_data::address_and_file_offset_have_reset_values): New method
11852 definition.
11853 (Output_data::do_address_and_file_offset_have_reset_values): New method
11854 definition.
11855 (Output_data::set_data_size): Check that data size is not fixed.
11856 (Output_data::fix_data_size): New method definition.
11857 (Output_data::is_data_size_fixed_): New data member.
11858 (Output_section_headers::set_final_data_size): New method definition.
11859 (Output_section_headers::do_size): New method declaration.
11860 (Output_segment_headers::set_final_data_size): New method definition.
11861 (Output_segment_headers::do_size): New method declaration.
11862 (Output_file_header::set_final_data_size)::New method definition.
11863 (Output_file_header::do_size)::New method declaration.
11864 (Output_section_data::Output_section_data): Add new parameter
11865 is_data_size_fixed and use it to fix data size.
11866 (Output_data_const::Output_data_const): Adjust call to base class
11867 constructor and fix data size.
11868 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
11869 base class constructor and fix data size.
11870 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
11871 base class constructor and fix data size.
11872 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
11873 class constructor and fix data size.
11874 (Output_data_group::set_final_data_size): New method definition.
11875 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
11876 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
11877 class constructor and fix data size.
11878 (Output_relaxed_input_section): New class definition.
11879 (Output_section::Simple_input_section): New class definition.
11880 (Output_section::get_input_sections): Adjust parameter list.
11881 (Output_section::add_input_section_for_script): Same.
11882 (Output_section::save_states, Output_section::restore_states,
11883 Output_section::do_address_and_file_offset_have_reset_values,
11884 (Output_section::Input_section::Input_section): Handle
11885 RELAXED_INPUT_SECTION_CODE. Add new overload for
11886 Output_relaxed_input_section.
11887 (Output_section::Input_section::is_input_section,
11888 Output_section::Input_section::set_output_section): Handle relaxed
11889 input section.
11890 (Output_section::Input_section::is_relaxed_input_section,
11891 Output_section::Input_section::output_section_data,
11892 Output_section::Input_section::relaxed_input_section): New method
11893 definitions.
11894 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
11895 value.
11896 (Output_section::Input_section::u1_): Update comments.
11897 (Output_section::Input_section::u2_): Add new union member poris.
11898 (Output_section::Checkpoint_output_section): New classs definition.
11899 (Output_section::relax_input_section): New method declaration.
11900 (Output_section::checkpoint_): New data member.
11901 (Output_segment): Update comments.
11902 (Output_segment::Output_segment): Un-privatize copy constructor.
11903 (Output_segment::operator=): Un-privatize.
11904 * script-sections.cc (Output_section_element::Input_section_list):
11905 Change element type to Output_section::Simple_input_section.
11906 (Output_section_element_dot_assignment::set_section_addresses):
11907 Register output section data for relaxation clean up.
11908 (Output_data_exression::Output_data_expression): Adjust call to base
11909 constructor to fix data size.
11910 (Output_section_element_data::set_section_addresses): Register
11911 Output_data_expression object for relaxation clean up.
11912 (struct Input_section_info): Replace Relobj pointer and section index
11913 pair with Output_section::Simple_input_section and Convert struct to a
11914 class.
11915 (Input_section_sorter::operator()): Adjust access to
e1df38aa 11916 Input_section_info data member to use accessors.
20e6d0d6
DK
11917 (Output_section_element_input::set_section_addresses): Use layout
11918 parameter. Adjust code to use Output_section::Simple_input_section
11919 and Input_secction_info classes. Register filler for relaxation
11920 clean up.
11921 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11922 and section index pair with Output_section::Simple_input_section
11923 class. Adjust code accordingly.
11924 (Phdrs_element::release_segment): New method definition.
11925 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11926 segment list.
11927 (Script_sections::release_segments): New method definition.
11928 * gold/script-sections.h (Script_sections::release_segments): New
11929 method declaration.
11930 * gold/target.h (Target::may_relax, Target::relax,
11931 Target::do_may_relax, Target::do_relax): New method definitions.
11932
5e445df6
ILT
119332009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11934
11935 * arm.cc (has_signed_unsigned_overflow): New function.
11936 (Arm_relocate_functions::abs8): New function.
11937 (Target_arm::Scan::local): Handle R_ARM_ABS8.
11938 (Target_arm::Scan::global): Likewise.
11939 (Target_arm::relocate::relocate): Likewise.
11940 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11941 Likewise.
11942
8c604651 119432009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
11944
11945 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
11946 * testsuite/Makefile.in: Regenerate.
11947
1e9cc1c2
NC
119482009-09-11 Nick Clifton <nickc@redhat.com>
11949
11950 * po/gold.pot: Updated by the Translation project.
11951
6a89f575
CC
119522009-09-08 Cary Coutant <ccoutant@google.com>
11953
11954 * output.cc (Output_file::open): Add execute permission to empty file.
11955 * testsuite/Makefile.am (permission_test): New test.
11956 * testsuite/Makefile.in: Regenerate.
11957
fdcac5af
ILT
119582009-09-02 Ian Lance Taylor <iant@google.com>
11959
11960 * output.cc (Output_file::resize): Call map_no_anonymous rather
11961 than map.
11962
44453f85
ILT
119632009-09-01 Mikolaj Zalewski <mikolajz@google.com>
11964
11965 * gold.cc: Include "incremental.h".
11966 (queue_initial_tasks): Call Incremental_checker methods.
11967 * incremental.cc: Include "output.h".
11968 (Incremental_checker::can_incrementally_link_output_file): New
11969 method.
11970 * incremental.h (Incremental_checker): New class.
11971
11972 * output.cc (Output_file::open_for_modification): New method.
11973 (Output_file::map_anonymous): Changed return type to bool. Record
11974 map in base_ field.
11975 (Output_file::map_no_anonymous): New method, broken out of map.
11976 (Output_file::map): Use map_no_anonymous and map_anonymous.
11977 * output.h (class Output_file): Update declarations.
11978
293c1386
CC
119792009-08-24 Cary Coutant <ccoutant@google.com>
11980
11981 * options.h (Command_line::Pre_options): New class.
11982 (Command_line::pre_options): New member.
11983 * options.cc (gold::options::ready_to_register): New variable.
11984 (One_option::register_option): Do nothing if not registering options.
11985 Assert if same short option registered twice.
11986 (General_options::General_options): Turn off option registration when
11987 done constructing.
11988 (Command_line::Pre_options::Pre_options): New constructor.
11989
f773f3d2
CC
119902009-08-24 Cary Coutant <ccoutant@google.com>
11991
06a73cfe
CC
11992 * options.h (General_options::no_keep_memory): Remove incorrect
11993 short option.
f773f3d2 11994
a15af8e2
RW
119952009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11996
11997 * Makefile.am (am__skiplex, am__skipyacc): New.
11998 * Makefile.in: Regenerate.
11999
c462b41b
RW
120002009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12001
14ec8efd
RW
12002 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12003 (INCLUDES): ... this.
12004 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12005 (AM_CPPFLAGS): Renamed from ...
12006 (INCLUDE): ... this.
12007 * Makefile.in, testsuite/Makefile.in: Regenerate.
12008
81ecdfbb
RW
12009 * Makefile.in: Regenerate.
12010 * aclocal.m4: Likewise.
12011 * config.in: Likewise.
12012 * configure: Likewise.
12013 * testsuite/Makefile.in: Likewise.
12014
c462b41b
RW
12015 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12016 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12017 * Makefile.in: Regenerate.
12018 * testsuite/Makefile.in: Regenerate.
12019
2da73f13
CC
120202009-08-19 Cary Coutant <ccoutant@google.com>
12021
12022 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12023 symbols in shared libraries overridden by hidden or internal symbols
12024 in the main program.
12025
2db70501
CD
120262009-08-19 Chris Demetriou <cgd@google.com>
12027
12028 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12029 checking source file names in error messages.
12030
f733487b
DK
120312009-08-18 Doug Kwan <dougkwan@google.com>
12032
12033 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12034 an elcpp::Ehdr as parameter. Adjust call to set_target.
12035 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12036 an elfcpp::Ehdr as parameter.
12037 * object.cc (Object::set_target): Remove the version that looks up
12038 a target and sets it.
12039 (Sized_relobj::setup): Take a Target object instead of
12040 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12041 (make_elf_sized_object): Find target and ask target to
12042 make an ELF object.
12043 * object.h: (Object::set_target): Remove the version that looks up
12044 a target and sets it.
12045 (Sized_relobj::setup): Take a Target object instead of
12046 an elfcpp:Ehdr as parameter.
12047 * target.cc: Include dynobj.h.
12048 (Target::do_make_elf_object_implementation): New.
2e702c99 12049 (Target::do_make_elf_object): New.
f733487b
DK
12050 * target.h (Target::make_elf_object): New template declaration.
12051 (Target::do_make_elf_object): New method declarations.
12052 (Target::do_make_elf_object_implementation): New template declaration.
12053
cc70f101
ILT
120542009-08-14 Ian Lance Taylor <iant@google.com>
12055
12056 * gold.h (FUNCTION_NAME): Define.
12057 (gold_unreachable): Use FUNCTION_NAME.
12058
ef5e0cb1
ST
120592009-08-12 Sriraman Tallam <tmsriram@google.com>
12060
12061 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12062 symbol in the --keep-unique list is not found.
12063
48c187ce
ST
120642009-08-12 Sriraman Tallam <tmsriram@google.com>
12065
12066 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12067 been maked as --keep-unique.
12068 (Icf::unfold_section): New function.
12069 * icf.h (Icf::unfold_section): New function.
12070 * options.h (General_options::keep_unique): New option.
12071 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12072 * testsuite/Makefile.in: Regenerate.
12073 * testsuite/icf_keep_unique_test.sh: New file.
12074 * testsuite/icf_keep_unique_test.cc: New file.
12075
645afe0c
CC
120762009-08-12 Cary Coutant <ccoutant@google.com>
12077
12078 PR 10471
12079 * resolve.cc (Symbol_table::resolve): Check for references from
12080 dynamic objects to hidden and internal symbols.
12081 * testsuite/Makefile.am (hidden_test.sh): New test.
12082 * testsuite/Makefile.in: Regenerate.
12083 * testsuite/hidden_test.sh: New script.
12084 * testsuite/hidden_test_1.c: New test source.
12085 * testsuite/hidden_test_main.c: New test source.
12086
11af873f
DK
120872009-08-11 Doug Kwan <dougkwan@google.com>
12088
12089 * arm.cc: Update comments.
12090 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12091 segment to locate the .ARM.exidx section if present.
12092
b9f7d72d
DK
120932009-08-09 Doug Kwan <dougkwan@google.com>
12094
12095 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12096 patch.
12097
ddd3c53c
ST
120982009-08-07 Sriraman Tallam <tmsriram@google.com>
12099 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12100 compiler warnings.
12101
27721062
ST
121022009-08-06 Sriraman Tallam <tmsriram@google.com>
12103
12104 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12105 valid tls_segment only for non-debug-section relocations.
12106 * testsuite/Makefile.am: Add gc_tls_test.
12107 * testsuite/Makefile.in: Regenerate.
12108 * testsuite/gc_tls_test.cc: New file.
12109 * testsuite/gc_tls_test.sh: New file.
12110
ef15dade 121112009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12112
ef15dade
ST
12113 * icf.cc: New file.
12114 * icf.h: New file.
12115 * Makefile.am (CCFILES): Add icf.cc.
12116 (HFILES): Add icf.h
12117 * Makefile.in: Regenerate.
12118 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12119 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12120 section, symbol and addend information for the relocs.
12121 * gold.cc (queue_middle_tasks): Call identical code folding.
12122 * gold.h: Add defines for multimap.
12123 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12124 to the call of finalize_local_symbols.
12125 * main.cc (main): Create object of class Icf.
12126 * object.cc (Sized_relobj::do_layout): Allow this function to be
12127 called twice during icf.
12128 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12129 to sections marked as identical by icf.
12130 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12131 when available.
12132 (Sized_relobj::do_section_entsize): New function.
12133 * object.h (Object::section_entsize): New function.
12134 (Object::do_section_entsize): New pure virtual function.
12135 (Relobj::finalize_local_symbols): Add new parameter.
12136 (Relobj::do_section_entsize): New function.
12137 * options.h (General_options::icf): New option.
12138 (General_options::icf_iterations): New option.
12139 (General_options::print_icf_sections): New option.
12140 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12141 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12142 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12143 icf.
12144 * symtab.cc (Symbol_table::is_section_folded): New function.
12145 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12146 to sections marked as identical by icf.
12147 * symtab.h (Symbol_table::set_icf): New function.
12148 (Symbol_table::icf): New function.
12149 (Symbol_table::is_section_folded): New function.
12150 (Symbol_table::icf_): New data member.
12151 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12152 * testsuite/Makefile.am: Add commands to build icf_test.
12153 * testsuite/Makefile.in: Regenerate.
12154 * testsuite/icf_test.sh: New file.
12155 * testsuite/icf_test.cc: New file.
12156
c3b65ac4
CD
121572009-07-24 Chris Demetriou <cgd@google.com>
12158
12159 * layout.cc (is_compressible_debug_section): Fix incorrect
12160 comment about compressed section names.
12161
1caf2c51
ILT
121622009-07-20 Ian Lance Taylor <ian@airs.com>
12163
12164 PR 10419
12165 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12166
1ef4d87f
ILT
121672009-07-16 Ian Lance Taylor <iant@google.com>
12168
12169 PR 10400
12170 * layout.h: #include <map>.
12171 (class Kept_section): Change from struct to class. Add accessors
12172 and setters. Add section size to Comdat_group mapping. Change
12173 Comdat_group to std::map. Add is_comdat_ field. Add
12174 linkonce_size field in union.
12175 (class Layout): Update declaration of find_or_add_kept_section.
12176 Don't declare find_kept_object.
12177 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12178 parameter. Add object, shndx, is_comdat, and is_group_name
12179 parameters. Change all callers. Adjust for new Kept_section.
12180 (Layout::find_kept_object): Remove.
12181 * object.cc (Sized_relobj::include_section_group): Update use of
12182 Kept_section. Rename secnum to shndx. Only record
12183 Kept_comdat_section if sections are the same size.
12184 (Sized_relobj::include_linkonce_section): Update use of
12185 Kept_section. Only record Kept_comdat_section if sections are the
12186 same size. Set size of linkonce section.
12187 (Sized_relobj::map_to_kept_section): Update call to
12188 get_kept_comdat_section.
12189 * object.h (class Sized_relobj): Rename fields in
12190 Kept_comdat_section to drop trailing underscores; change object
12191 field to Relobj*. Change Kept_comdat_section_table to store
12192 struct rather than pointer.
12193 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12194 Add kept_object and kept_shndx parameters. Change all callers.
12195 (Sized_relobj::get_kept_comdat_section): Change return type to
12196 bool. Add kept_object and kept_shndx parameters. Change all
12197 callers.
12198 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12199 Layout::find_or_add_kept_section.
12200
37c3b7b0
ILT
122012009-07-09 Ian Lance Taylor <iant@google.com>
12202
12203 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12204 Reserve space in the hash table.
12205
98fa85cb
ILT
122062009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12207
12208 * fileread.cc (File_read::get_mtime): New method.
12209 * fileread.h (Timespec): New structure.
12210 (File_read::get_mtime): New method.
12211 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12212 Renamed from timestamp_nsec.
12213 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12214 Elf_Xword.
e1df38aa 12215 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12216 timestamp_nsec.
e1df38aa 12217 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12218 (Incremental_inputs::report_obejct): Save mtime; style fix.
12219 (Incremental_inputs::report_script): Save mtime; style fix.
12220 (Incremental_inputs::finalize_inputs): Style fix.
12221 (Incremental_inputs::finalize): Style fix.
12222 (Incremental_inputs::create_input_section_data): Store inputs
12223 mtime.
12224 * incremental.h (Incremental_inputs::report_script): Add mtime
12225 argument.
12226 (Incremental_inputs::Input_info::Input_info): Intialize only one
12227 union member.
12228 (Incremental_inputs::Input_info::archive): Move to nameless
12229 union.
12230 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12231 (Incremental_inputs::Input_info::script): Move to nameless union.
12232 (Incremental_inputs::mtime): New field.
12233 * script.cc (read_input_script): Pass file mtime to
12234 Incremental_input.
12235 * script.h (Script_info::inputs): Style fix.
12236
c9d70757
ILT
122372009-07-01 Ian Lance Taylor <ian@airs.com>
12238
12239 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12240 instead of 32.
12241
9c547ec3
ILT
122422009-06-24 Ian Lance Taylor <iant@google.com>
12243
12244 PR 10156
12245 * layout.cc (Layout::choose_output_section): If we find an
12246 existing section, update the flags.
12247 (Layout::create_notes): New function, broken out of
12248 Layout::finalize.
12249 (Layout::finalize): Don't create note sections.
12250 (Layout::create_note): Don't crash if linker script discards
12251 section.
12252 (Layout::create_gold_note): Likewise.
12253 (Layout::create_build_id): Likewise. Don't set
12254 after_input_sections on the section.
12255 (Layout::create_executable_stack_info): Remove target parameter.
12256 Change caller.
12257 * layout.h (class Layout): Declare create_notes. Update
12258 declaration of create_executable_stack_info.
12259 * gold.cc (queue_middle_tasks): Call create_notes.
12260 * output.cc (Output_section::update_flags_for_input_section): Move
12261 here from output.h. If SHF_ALLOC flag is newly set, mark address
12262 invalid.
12263 * output.h (Output_data::mark_address_invalid): New function.
12264 (class Output_section): Only declare, not define,
12265 update_flags_for_input_section. Remove set_flags.
12266
55458500
ILT
122672009-06-24 Ian Lance Taylor <iant@google.com>
12268
12269 * script-sections.cc (Output_section_definition::
12270 set_section_addresses): Rename shadowing local load_address to
12271 laddr.
12272
1307d6cd
ILT
122732009-06-24 Ian Lance Taylor <iant@google.com>
12274
12275 PR 10244
12276 * reloc.cc (relocate_sections): Skip empty relocation sections.
12277
ec3f783e
ILT
122782009-06-23 Ian Lance Taylor <iant@google.com>
12279
12280 PR 10156
12281 * layout.cc (Layout::create_note): Use choose_output_section
12282 rather than make_output_section.
12283
459c9f1c
ILT
122842009-06-23 Ian Lance Taylor <iant@google.com>
12285
12286 PR 10237
12287 * options.cc (General_options::parse_V): Set printed_version_.
12288 (General_options::General_options): Initialize printed_version_.
12289 * options.h (class General_options): Add printed_version_ field.
12290 * gold.cc (queue_initial_tasks): If there are no input files,
12291 don't give a fatal error if we printed the version information.
12292 (queue_middle_tasks): If using -r with a shared object, give a
12293 fatal error rather than an ordinary error.
12294
1518dc8f
ILT
122952009-06-23 Ian Lance Taylor <iant@google.com>
12296
12297 PR 10219
12298 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12299 (Layout::make_output_section): Set have_stabstr_section_ if we see
12300 a .stab*str section.
12301 (Layout::finalize): Call link_stabs_sections.
12302 (Layout::link_stabs_sections): New file.
12303 * layout.h (class Layout): Add have_stabstr_section_ field.
12304 Declare link_stabs_sections.
12305
3d857b98
DK
123062009-06-23 Doug Kwan <dougkwan@google.com>
12307
12308 * Makefile.am (libgold_a_LIBADD): New.
12309 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12310 * Makefile.in: Regenerate.
3d857b98
DK
12311 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12312 * configure: Regenerate.
12313 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12314 * fileread.cc: Include sys/state.h
12315 * gold.h: Declare memmem and strndup if found missing.
12316 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12317
0639a6f6
ILT
123182009-06-23 Ian Lance Taylor <iant@google.com>
12319
12320 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12321 * configure: Rebuild.
12322
8d63875c
ILT
123232009-06-23 Ian Lance Taylor <iant@google.com>
12324
12325 PR 10147
12326 * object.cc (Object::section_contents): Don't try to get a view if
12327 the section has length zero.
12328 (Object::handle_gnu_warning_section): If the section is empty, use
12329 the name of the section as the warning.
12330
f7c8a183
ILT
123312009-06-23 Ian Lance Taylor <iant@google.com>
12332
12333 PR 10133
12334 * stringpool.h (class Stringpool_template): Add optimize_ field.
12335 (Stringpool_template::set_optimize): New function.
12336 * stringpool.cc (Stringpool_template::Stringpool_template):
12337 Initialize optimize_ field.
12338 (Stringpool_template::set_string_offsets): Test local optimize
12339 fild rather than parameter.
12340 * layout.cc (Layout::Layout): Call set_optimize on the section
12341 name stringpool.
12342
e6a307ba
ILT
123432009-06-22 Ian Lance Taylor <iant@google.com>
12344
12345 PR 10030
12346 * yyscript.y: Parse TARGET.
12347 * script.cc (script_set_target): New function.
12348 * script-c.h (script_set_target): Declare.
12349 * options.cc (General_options::string_to_object_format): Rename
12350 from string_to_object_format in anonymous namespace. Change
12351 callers.
12352 * options.h (class General_options): Declare
12353 string_to_object_format.
12354
3ee173de
ILT
123552009-06-22 Ian Lance Taylor <iant@google.com>
12356
12357 * script-sections.cc (Script_sections::create_segments): Don't put
12358 program headers in a PT_LOAD segment if -n or -N.
12359
123602009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12361
12362 PR 10141
12363 * options.h (class General_options): Add -z lazy and -z now. Sort
12364 -z options into alphabetical order.
12365 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12366
cd6739a1 123672009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12368
12369 * layout.cc (Layout::make_output_section): Call
12370 Target::new_output_section.
12371 (Layout::attach_allocated_section_to_segment): Put large section
12372 sections in a separate load segment with the large segment flag
12373 set.
12374 (Layout::segment_precedes): Sort large data segments after other
12375 load segments.
12376 (align_file_offset): New static function.
12377 (Layout::set_segment_offsets): Use align_file_offset.
12378 * output.h (class Output_section): Add is_small_section_ and
12379 is_large_section_ fields.
12380 (Output_section::is_small_section): New function.
12381 (Output_section::set_is_small_section): New function.
12382 (Output_section::is_large_section): New function.
12383 (Output_section::set_is_large_section): New function.
12384 (Output_section::is_large_data_section): New function.
12385 (class Output_segment): Add is_large_data_segment_ field.
12386 (Output_segment::is_large_data_segment): New function.
12387 (Output_segment::set_is_large_data_segment): New function.
12388 * output.cc (Output_section::Output_section): Initialize new
12389 fields.
12390 (Output_segment::Output_segment): Likewise.
12391 (Output_segment::add_output_section): Add assertion that large
12392 data sections always go in large data segments. Force small data
12393 sections to the end of the list of data sections. Force small BSS
12394 sections to the start of the list of BSS sections. For large BSS
12395 sections to the end of the list of BSS sections.
12396 * symtab.h (class Symbol): Declare is_common_shndx.
12397 (Symbol::is_defined): Check Symbol::is_common_shndx.
12398 (Symbol::is_common): Likewise.
12399 (class Symbol_table): Define enum Commons_section_type. Update
12400 declarations. Add small_commons_ and large_commons_ fields.
12401 * symtab.cc (Symbol::is_common_shndx): New function.
12402 (Symbol_table::Symbol_table): Initialize new fields.
12403 (Symbol_table::add_from_object): Put small and large common
12404 symbols in the right list.
12405 (Symbol_table::sized_finalized_symbol): Check
12406 Symbol::is_common_shndx.
12407 (Symbol_table::sized_write_globals): Likewise.
12408 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12409 common symbol lists. Don't call do_allocate_commons_list if the
12410 list is empty.
12411 (Symbol_table::do_allocate_commons_list): Remove is_tls
12412 parameter. Add comons_section_type parameter. Change all
12413 callers. Handle small and large common symbols.
12414 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12415 Symbol::is_common_shndx.
12416 * resolve.cc (symbol_to_bits): Likewise.
12417 * target.h (Target::small_common_shndx): New function.
12418 (Target::small_common_section_flags): New function.
12419 (Target::large_common_shndx): New function.
12420 (Target::large_common_section_flags): New function.
12421 (Target::new_output_section): New function.
12422 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12423 small_common_section_flags, and large_common_section_flags
12424 fields.
12425 (Target::do_new_output_section): New virtual function.
12426 * arm.cc (Target_arm::arm_info): Initialize new fields.
12427 * i386.cc (Target_i386::i386_info): Likewise.
12428 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12429 Likewise.
12430 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12431 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12432 (Target_x86_64::do_new_output_section): New function.
12433 * configure.ac: Define conditional MCMODEL_MEDIUM.
12434 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12435 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12436 (large_LDFLAGS): Define.
12437 * testsuite/large.c: New file.
12438 * testsuite/testfile.cc (Target_test::test_target_info):
12439 Initialize new fields.
12440 * configure, testsuite/Makefile.in: Rebuild.
12441
bb04269c
DK
124422009-06-05 Doug Kwan <dougkwan@google.com>
12443
12444 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 12445 * Makefile.in: Regenerate.
bb04269c
DK
12446 * i386.cc (class Target_i386): Define new virtual method to
12447 override do_is_local_label_name in parent.
12448 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12449 local symbols if --discard-locals or -X is given.
12450 * options.h (class General_options): Declare new options
12451 '--discard-locals' and '-X' for discarding locals.
12452 * target.h (class Target): Define new methods is_local_label_name.
12453 Declare new virtual method do_is_local_label_name.
12454 * target.cc: New file.
12455 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12456 (check_SCRIPTS): Add discard_locals_test.sh.
12457 (check_DATA): Add discard_local_tests.syms.
12458 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12459 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12460 * testsuite/Makefile.in: Regenerate.
12461 * testsuite/discard_locals_test.c: New file.
12462 * testsuite/discard_locals_test.sh: Same.
12463
805bb01c
DK
124642009-06-05 Doug Kwan <dougkwan@google.com>
12465
12466 * object.cc (Sized_relobj::Sized_relobj): Initialize
12467 discarded_eh_frame_shndx_ to -1U.
12468 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12469 section.
12470 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12471 a discarded .eh_frame section.
12472 (Sized_relobj::do_finalize_local_symbols): Ditto.
12473 * object.h (class Sized_relobj): Declare new member
12474 discarded_eh_frame_shndx_.
12475 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12476 (local_labels_test.o, local_labels_test): New rules.
12477 * testsuite/Makefile.in: Regenerate.
12478
1dcd334d
DK
124792009-06-04 Doug Kwan <dougkwan@google.com>
12480
12481 * layout.cc (Layout::section_name_mapping): Add mapping for
12482 special ARM sections.
12483
96d49306
DK
124842009-06-03 Doug Kwan <dougkwan@google.com>
12485
12486 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12487 (utils::has_overflow): Same.
12488
dff16297
ILT
124892009-06-03 Ian Lance Taylor <iant@google.com>
12490
12491 * layout.cc (Layout::section_name_mapping): New array, replacing
12492 Layout::linkonce_mapping.
12493 (Layout::section_name_mapping_count): New variable, replacing
12494 Layout::linkonce_mapping_count.
12495 (Layout::linkonce_output_name): Remove.
12496 (Layout::output_section_name): Rewrite.
12497 * layout.h (class Layout): Rename Linkonce_mapping to
12498 Section_name_mapping, linkonce_mapping to section_name_mapping,
12499 linkonce_mapping_count to section_name_mapping_count. Don't
12500 declare linkonce_output_name.
12501
c121c671
DK
125022009-06-03 Doug Kwan <dougkwan@google.com>
12503
12504 * gold/arm.cc (namespace utils): New.
12505 (Target_arm::reloc_is_non_pic): Define new method.
12506 (class Arm_relocate_functions): New.
12507 (Target_arm::Relocate::relocate): Handle relocation types used by
12508 Android.
12509
07800fab
ILT
125102009-06-03 Ian Lance Taylor <iant@google.com>
12511
12512 * arm.cc (Target_arm::scan::global): Use || instead of |.
12513
c121c671
DK
125142009-06-02 Doug Kwan <dougkwan@google.com>
12515
12516 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12517 issued_non_pic_error_.
12518 (class Target_arm::Scan): Declare new method check_non_pic.
12519 Define new method symbol_needs_plt_entry.
12520 Declare new data member issued_non_pic_error_.
12521 (class Target_arm::Relocate): Declare new method
12522 should_apply_static_reloc.
12523 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12524 (Target_arm::Scan::check_non_pic): Define new method.
12525 (Target_arm::Scan::local): Handle a small subset of reloc types used
12526 by Android.
12527 (Target_arm::Scan::local): Same.
12528 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12529
b19b0c6d
ILT
125302009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12531
12532 * incremental.cc (Incremental_inputs::report_command_line): Filter
12533 out --incremental-* options.
12534
94cdfcff
DK
125352009-05-29 Doug Kwan <dougkwan@google.com>
12536
12537 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12538 template class.
12539 (class Target_arm): Update comment.
12540 (Target_arm::Target_arm): Initialize new data members GOT_,
12541 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12542 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12543 and Target_arm::rel_dyn_section.
12544 Declare new_enum Target_arm::Got_type.
12545 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12546 and DYNBSS_.
12547 Update commments for member do_dynsym_value.
12548 (Target_arm::got_size, Target_arm::plt_section,
12549 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12550 new methods inside class defintion.
12551 (Target_arm::got_section): Define new method.
12552 (Target_arm::rel_dyn_section): Same.
12553 (Output_data_plt_arm): New template class.
12554 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12555 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12556 (Output_data_plt_arm::add_entry): Same.
12557 (Output_data_plt_arm::first_plt_entry): Define new
12558 static data member for PLT instruction template.
12559 (Output_data_plt_arm::plt_entry): Same.
12560 (Output_data_plt_arm::do_write): Define new method.
12561 (Target_arm::make_plt_entry): Same.
12562 (Target_arm::do_finalize_sections): Same.
12563 (Target_arm::do_dynsym_value): Same.
12564
4a657b0d
DK
125652009-05-28 Doug Kwan <dougkwan@google.com>
12566
12567 * Makefile.am (TARGETSOURCES): Add arm.cc.
12568 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12569 * Makefile.in: Regenerate.
12570 * arm.cc: New file.
12571 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12572
e7ae8c36
DK
125732009-05-26 Doug Kwan <dougkwan@google.com>
12574
12575 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12576 (General_options::check_excluded_libs): Strip off directories in
12577 archive name before matching like GNU ld does.
12578 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12579 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12580 (exclude_libs_test_LDFLAGS): Add linker option
12581 -Wl,--exclude-libs,libexclude_libs_test_3
12582 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12583 an explicit archive without using -l.
12584 (alt/libexclude_libs_test_3.a): New make rule.
12585 * testsuite/Makefile.in: Regenerate.
12586 * testsuite/exclude_libs_test.c : Declare lib3_default().
12587 (main): Call it.
12588 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12589 * exclude_libs_test_3.c: New file.
12590
f12e7348
NC
125912009-05-26 Nick Clifton <nickc@redhat.com>
12592
12593 * po/id.po: New Indonesian translation.
12594 * po/gold.pot: Updated template file.
12595
4daadc0d
ST
125962009-05-22 Sriraman Tallam <tmsriram@google.com>
12597
e1df38aa 12598 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
12599 gc_comdat_test files. Add -Wl,--gc-sections to build
12600 gc_comdat_test.
12601 * testsuite/Makefile.in: Regenerate.
12602 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12603
531813ad
ST
126042009-05-21 Sriraman Tallam <tmsriram@google.com>
12605
12606 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12607 kept comdat section was garbage collected.
12608 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12609 * testsuite/Makefile.in: Regenerate.
12610 * testsuite/gc_comdat_test.sh: New file.
12611 * testsuite/gc_comdat_test_1.cc: New file.
12612 * testsuite/gc_comdat_test_2.cc: New file.
12613
65514900
CC
126142009-05-19 Doug Kwan <dougkwan@google.com>
12615
12616 * archive.cc (Archive::Archive): Move constructor from archive.h
12617 to here. Initialize no_export_.
12618 (Archive::get_elf_object_for_member): Set no_export flag of object.
12619 * archive.h (Archive::Archive): Move constructor body to
12620 archive.cc.
12621 (Archive::no_export): New method.
12622 (Archive::no_export_): New field.
12623 * object.h (Object::Object): Initialize no_export_ to false.
12624 (Object::no_export, Object::set_no_export): New methods.
12625 (Object::no_export_): New field.
12626 * options.cc (General_options::parse_exclude_libs): New method.
12627 (General_options::check_excluded_libs) Same.
12628 * options.h (exclude_libs): New option.
12629 (General_options::check_excluded_libs): New method declaration.
12630 (General_options::excluded_libs_): New field.
12631 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12632 default or protected visibility if an object has no-export flag set.
12633 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12634 (check_SCRIPTS): Add exclude_libs_test.sh.
12635 (check_DATA): Add exclude_libs_test.syms.
12636 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12637 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12638 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12639 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12640 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12641 libexclude_libs_test_2.a): New rules.
12642 * testsuite/Makefile.in: Regenerate.
12643 * testsuite/exclude_libs_test.c: New file.
12644 * testsuite/exclude_libs_test.sh: Ditto.
12645 * testsuite/exclude_libs_test_1.c: Ditto.
12646 * testsuite/exclude_libs_test_2.c: Ditto.
12647
1b77ea50
ILT
126482009-05-15 Ian Lance Taylor <iant@google.com>
12649
12650 * configure.ac: Check for declarations for cases where libiberty.h
12651 checks HAVE_DECL_xxx.
12652 * configure, config.in: Rebuild.
12653
072fe7ce
ILT
126542009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12655
12656 * gold.h (Incremental_argument_list): Remove (invalid) forward
12657 declaration.
12658 * incremental.cc (Incremental_inputs::report_achive): New method.
12659 (Incremental_inputs::report_object): New method.
12660 (Incremental_inputs::report_script): New method.
12661 (Incremental_inputs::finalize_inputs): New method.
12662 (Incremental_inputs::finalize): Call finalize_inputs().
12663 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12664 Create inputs entries.
12665 * incremental.h (Incremental_input_type): New enum.
12666 (Incremental_inputs::Incremental_input): Initialize new fields.
12667 (Incremental_inputs::report_inputs): New method.
12668 (Incremental_inputs::report_achive): New method.
12669 (Incremental_inputs::report_object): New method.
12670 (Incremental_inputs::report_script): New method.
12671 (Incremental_inputs::finalize_inputs): New method.
12672 (Incremental_inputs::Input_info): New struct.
12673 (Incremental_inputs::Input_info_map): New typedef.
12674 (Incremental_inputs::lock_): New field.
12675 (Incremental_inputs::Inputs_): New field.
12676 (Incremental_inputs::Inputs_map): New field.
12677 * main.cc (main): Call Incremental_input::report_inputs.
12678 * options.h (Input_argument_list): Typedef moved from
12679 Input_arguments.
12680 (Input_file_group::Files): Remove, use ::Input_argument_list.
12681 (Input_file_group::Input_argument_list): Remove, use
12682 ::Input_argument_list.
12683 * plugin.cc (Plugin_manager::add_input_file): Add error in
12684 incremental build.
12685 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12686 functions.
12687 * script.cc (read_input_script): Call
12688 Incremental_input::report_script.
12689 * script.h (Script_info): New class.
12690
b0481b0b
ILT
126912009-04-27 Ian Lance Taylor <iant@google.com>
12692
12693 * x86_64.cc (do_adjust_output_section): Set entsize to
12694 plt_entry_size.
12695
b22a5a41 126962009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
12697
12698 * output.cc (Output_file::close): After short writes, continue
12699 writing from the correct offset in the buffer being written.
12700
40fde488
CD
127012009-04-23 Chris Demetriou <cgd@google.com>
12702
12703 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
12704 * configure: Regenerate.
12705 * config.in: Regenerate.
12706 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
12707 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
12708
3ce2c28e
ILT
127092009-04-21 Mikolaj Zalewski <mikolajz@google.com>
12710
12711 * incremental.cc (Incremental_inputs_header_data): Renamed from
12712 Incremental_input_header_data.
12713 (Incremental_inputs_header_data::data_size): New field.
12714 (Incremental_inputs_header_data::put_input_file_count): Renamed
12715 from input_file_count.
12716 (Incremental_inputs_header_data::put_command_line_offset): Renamed
12717 from command_line_offset.
12718 (Incremental_inputs_header_data::put_reserved): Renamed from
12719 put_reserved.
12720 (Incremental_inputs_entry_data): Renamed from
12721 Incremental_input_entry_data.
12722 (Incremental_inputs_entry_data::data_size): New field.
12723 (Incremental_inputs::report_command_line): New method.
12724 (Incremental_inputs::finalize): New method.
12725 (Incremental_inputs::create_incremental_inputs_data): New method.
12726 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
12727 * incremental.h: New file.
12728 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 12729 (Layout::finalize): Create incremental inputs section in
3ce2c28e 12730 incremental builds.
703d02da 12731 (Layout::create_incremental_info_sections): New method.
3ce2c28e 12732 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
12733 (Layout::create_incremental_info_sections): New method.
12734 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
12735 * main.cc (main): Notify Incremental_input of the command line.
12736
e55bde5e
ILT
127372009-04-01 Ian Lance Taylor <iant@google.com>
12738 Mikolaj Zalewski <mikolajz@google.com>
12739
12740 * gold.h (reserve_unordered_map): Define, three versions, one for
12741 each version of Unordered_map.
12742 * layout.cc (Layout::Layout): Remove options parameter. Add
12743 number_of_input_files parameter. Don't initialize options_.
12744 Initialize number_of_input_files_ and resized_signatures_. Move
12745 sections_are_attached_.
12746 (Layout::layout_group): Reserve space for group_signatures_.
12747 (Layout::find_or_add_kept_section): Change name parameter to be a
12748 reference. Resize signatures_ map when it gets large enough.
12749 (Layout::layout_eh_frame): Use parameters->options() instead of
12750 this->options_.
12751 (Layout::make_output_section): Likewise.
12752 (Layout::attach_allocated_section_to_segment): Likewise.
12753 (Layout::finalize, Layout::create_executable_stack): Likewise.
12754 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
12755 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
12756 * layout.h (class Layout): Update declarations. Remove options_
12757 field. Add number_of_input_files_ and resized_signatures_
12758 fields. Move sections_are_attached_ field.
12759 * main.cc (main): Pass number of input files to Layout
12760 constructor. Don't pass options.
12761
154b857c
ILT
127622009-03-30 Ian Lance Taylor <iant@google.com>
12763
12764 * ffsll.c (ffsll): Correct implementation.
12765
2f35ab9b
ILT
127662009-03-27 Ian Lance Taylor <iant@google.com>
12767
fd03461a
ILT
12768 * ffsll.c: New file.
12769 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
12770 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
12771 * ftruncate.c (ftruncate): Declare before definition.
12772 * mremap.c (mremap): Likewise.
12773 * pread.c (pread): Likewise.
12774 * configure, Makefile.in, config.in: Rebuild.
12775
2f35ab9b
ILT
12776 * mremap.c: New file.
12777 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
12778 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
12779 (mremap): Declare if HAVE_MREMAP is not defined.
12780 * configure, Makefile.in, config.in: Rebuild.
12781
33aea2fd
CC
127822009-03-27 Cary Coutant <ccoutant@google.com>
12783
12784 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
12785 position independent.
12786 * sparc.cc (Target_sparc::check_non_pic): Likewise.
12787 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
12788
6d479619
CC
127892009-03-24 Cary Coutant <ccoutant@google.com>
12790
12791 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
12792 an executable.
12793 (needs_dynamic_reloc): Likewise.
12794
afc06bb8
ILT
127952009-03-24 Ian Lance Taylor <iant@google.com>
12796
12797 * yyscript.y (file_cmd): Recognize EXTERN.
12798 (extern_name_list, extern_name_list_body): New nonterminals.
12799 * script.cc (script_add_extern): Define.
12800 * script-c.h (script_add_extern): Declare.
12801
f6060a4d
ILT
128022009-03-24 Rafael Avila de Espindola <espindola@google.com>
12803
12804 * object.cc (is_elf_object): Define.
12805 * object.h (is_elf_object): Declare.
12806 * archive.cc (Archive::get_elf_object_for_member): Call
12807 is_elf_object.
33aea2fd 12808 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 12809
26736d8e
ILT
128102009-03-24 Elliott Hughes <enh@google.com>
12811
12812 * output.cc (Output_file::map_anonymous): Define.
12813 (Output_file::map): Use map_anonymous. If the regular mmap fails,
12814 try an anonymous one. Report the size if the mmap fails.
12815 * output.h (class Output_file): Declare map_anonymous.
12816
22fd9730
ILT
128172009-03-24 Ian Lance Taylor <iant@google.com>
12818
12819 * target-select.cc (instantiate_target): Don't acquire the lock if
12820 the instantiated_target_ field has already been set.
12821
cb010894
ILT
128222009-03-23 Ian Lance Taylor <iant@google.com>
12823
7f055c20
ILT
12824 * gold-threads.h (class Initialize_lock): Define.
12825 * gold-threads.cc (class Initialize_lock_once): Define.
12826 (initialize_lock_control): New static variable.
12827 (initialize_lock_pointer): New static variable.
12828 (initialize_lock_once): New static function.
12829 (Initialize_lock::Initialize_lock): Define.
12830 (Initialize_lock::initialize): Define.
12831 * target-select.h: Include "gold-threads.h".
12832 (class Target_selector): Add lock_ and initialize_lock_ fields.
12833 Don't define instantiate_target, just declare it.
12834 * target-select.cc (Target_selector::Target_selector): Initialize
12835 new fields.
12836 (Target_selector::instantiate_target): Define.
12837 * descriptors.h: Include "gold-threads.h".
12838 (class Descriptors): Add initialize_lock_ field.
12839 * descriptors.cc (Descriptors::Descriptors): Initialize new
12840 field.
12841 (Descriptors::open): Use initialize_lock_ field
12842 * errors.h (class Errors): Add initialize_lock_ field.
12843 * errors.cc (Errors::Errors): Initialize new field.
12844 (Errors::initialize_lock): Use initialize_lock_ field.
12845 * powerpc.cc (class Target_selector_powerpc): Remove
12846 instantiated_target_ field. In do_recognize call
12847 instantiate_target rather than do_instantiate_target. In
12848 do_instantiate_target just allocate a new target.
12849 * sparc.cc (class Target_selector_sparc): Likewise.
12850
36959681
ILT
12851 * freebsd.h: New file.
12852 * i386.cc: Include "freebsd.h".
12853 (Target_i386): Derive from Target_freebsd rather than
12854 Sized_target.
12855 (Target_selector_i386): Derive from Target_selector_freebsd rather
12856 than Target_selector.
12857 * x86_64.cc: Include "freebsd.h".
12858 (Target_x86_64): Derive from Target_freebsd rather than
12859 Sized_target.
12860 (Target_selector_x86_64): Derive from Target_selector_freebsd
12861 rather than Target_selector.
12862 * target.h (class Target): Add adjust_elf_header and
12863 do_adjust_elf_header.
12864 * output.cc (Output_file_header:: do_sized_write): Call target
12865 adjust_elf_header routine.
12866 * configure.tgt: Set targ_osabi.
12867 * configure.ac: Define GOLD_DEFAULT_OSABI.
12868 * parameters.cc (Parameters::default_target): Pass
12869 GOLD_DEFAULT_OSABI to select_target.
12870 * target-select.h (class Target_selector): Make instantiate_target
12871 protected rather than private.
12872 * Makefile.am (HFILES): Add freebsd.h.
12873 * configure, Makefile.in, config.in: Rebuild.
12874
cb010894
ILT
12875 * merge.cc (do_add_input_section): Correct pend value. Change
12876 message about last entry not being null terminated from error to
12877 warning.
12878
0e879927
ILT
128792009-03-20 Mikolaj Zalewski <mikolajz@google.com>
12880
12881 * incremental.cc: New file.
12882 * Makefile.am (CCFILES): Add incremental.cc.
12883 * Makefile.in: Rebuild.
12884
41105937
PP
128852009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
12886
12887 * layout.cc (Layout::output_section_name): Preserve names
12888 of '.note.' sections.
e1df38aa 12889
60439920
ILT
128902009-03-19 Ian Lance Taylor <iant@google.com>
12891
12892 * descriptors.cc (Descriptors::open): Check that the options are
12893 valid before using them.
12894
0d371ad3
ILT
128952009-03-18 Ian Lance Taylor <iant@google.com>
12896
12897 * script-sections.h: Include <list>.
12898 (class Script_sections): Change Sections_elements from std::vector
12899 to std::list. Typedef public Elements_iterator. Add
12900 orphan_section_placement_, data_segment_align_start_, and
12901 saw_data_segment_align_ fields. Remove data_segment_align_index_
12902 field.
12903 * script-sections.cc (class Orphan_section_placement): New class.
12904 (class Sections_element): Add virtual functions is_relro and
12905 orphan_section_init. Remove virtual function place_orphan_here.
12906 (class Output_section_definition): Add is_relro and
12907 orphan_section_init. Remove place_orphan_here.
12908 (class Orphan_output_section): Likewise.
12909 (Script_sections::Script_sections): Update for field changes.
12910 (Script_sections::data_segment_align): Set saw_data_segment_align_
12911 and data_segment_align_start_, not data_segment_align_index.
12912 (Script_sections::data_segment_relro_end): Check
12913 saw_data_segment_align_. Use data_segment_align_start_ rather
12914 than data_segment_align_index_.
12915 (Script_sections::place_orphan): Rewrite to use
12916 Orphan_section_placement.
12917
9201d894
ILT
129182009-03-17 Ian Lance Taylor <iant@google.com>
12919
9c5b8369
ILT
12920 * archive.cc (Archive::add_symbols): Check for a version attached
12921 to the symbol name in the archive map.
12922 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12923 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12924 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12925 (ver_test_11.a): New target.
12926 * testsuite/Makefile.in: Rebuild.
12927
9201d894
ILT
12928 * configure.ac: Check for chsize and posix_fallocate. Replace
12929 ftruncate.
12930 * ftruncate.c: New file, from gnulib.
12931 * output.cc (posix_fallocate): Define dummy version if not
12932 HAVE_POSIX_FALLOCATE.
12933 (Output_file::map): Call posix_fallocate rather than lseek and
12934 write.
12935 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
12936 * configure, Makefile.in, config.in: Rebuild.
12937
ef4ab7a8 129382009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 12939
ef4ab7a8
PP
12940 * layout.h (Layout::create_note): Add section_name parameter.
12941 * layout.cc (Layout::create_note): Likewise.
12942 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 12943
8c500701
ILT
129442009-03-17 Ian Lance Taylor <iant@google.com>
12945
e85b18e1
ILT
12946 * descriptors.cc: Include "options.h".
12947 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
12948 (Descriptors::open): Always use O_CLOEXEC when opening a new
12949 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
12950 then set FD_CLOEXEC.
12951
9efe6174
ILT
12952 * sparc.cc (class Target_sparc): Add has_got_section.
12953 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
12954 make sure we have a GOT section.
12955
12956 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
12957 (Target_sparc::Scan::local): Likewise.
12958 (Target_sparc::Scan::global): Likewise.
12959 (Target_sparc::Relocate::relocate): Likewise.
12960 (Target_sparc::Relocate::relocate_tls): Likewise.
12961
8c500701
ILT
12962 * symtab.cc (Symbol_table::define_default_version): New function,
12963 broken out of add_from_object.
12964 (Symbol_table::add_from_object): Call define_default_version.
12965 (Symbol_table::define_special_symbol): Add resolve_oldsym
12966 parameter. Change all callers. If the version for a symbol comes
12967 from a version script, resolve it with the symbol with the same
12968 name with no version. Also add the symbol without a version if
12969 appropriate.
12970 (do_define_in_output_data): If resolving with oldsym, don't delete
12971 sym.
12972 (do_define_in_output_segment): Likewise.
12973 (do_define_as_constant): Likewise.
12974 * symtab.h (class Symbol_table): Update declarations.
12975
f1ed28fb
ILT
129762009-03-13 Ian Lance Taylor <iant@google.com>
12977
15f8229b
ILT
12978 * readsyms.cc (Read_symbols::incompatible_warning): New function.
12979 (Read_symbols::requeue): New function.
12980 (Read_symbols::do_read_symbols): If make_elf_object fails because
12981 the target type is not configured, and the file was searched for,
12982 issue a warning and retry with the next directory.
12983 (Add_symbols::run): If the file has an incompatible format, and
12984 it was searched for, requeue the Read_symbols task. On error,
12985 release the object.
12986 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
12987 dirindex parameter to constructor. Change all callers. Declare
12988 incompatible_warning and requeue.
12989 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
12990 input_argument_ and input_group_ fields. Add them to
12991 constructor. Change all callers.
12992 (class Read_script): Add dirindex_ field. Add it to constructor.
12993 Change all callers.
12994 * archive.cc (Archive::setup): Remove input_objects parameter.
12995 Change all callers.
12996 (Archive::get_file_and_offset): Likewise.
12997 (Archive::read_all_symbols): Likewise.
12998 (Archive::read_symbols): Likewise.
12999 (Archive::get_elf_object_for_member): Remove input_objects
13000 parameter. Add punconfigured parameter. Change all callers.
13001 (Archive::add_symbols): Change return type to bool. Check return
13002 value of include_member.
13003 (Archive::include_all_members): Likewise.
13004 (Archive::include_member): Change return type to bool. Return
13005 false if first included object has incompatible target. Set
13006 included_member_ field.
13007 (Add_archive_symbols::run): If add_symbols returns false, requeue
13008 Read_symbols task.
13009 * archive.h (class Archive): Add included_member_ field.
13010 Initialize it in constructor. Add input_file and searched_for
13011 methods. Update declarations.
13012 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13013 input_argument_ fields. Add them to constructor. Change all
13014 callers.
13015 * script.cc: Include "target-select.h".
13016 (class Parser_closure): Add skip_on_incompatible_target_ and
13017 found_incompatible_target_ fields. Add
13018 skip_on_incompatible_target parameter to constructor. Change all
13019 callers. Add methods skip_on_incompatible_target,
13020 clear_skip_on_incompatible_target, found_incompatible_target, and
13021 set_found_incompatible_target.
13022 (read_input_script): Add dirindex parameter. Change all callers.
13023 If parser finds an incompatible target, requeue Read_symbols
13024 task.
13025 (script_set_symbol): Clear skip_on_incompatible_target in
13026 closure.
13027 (script_add_assertion, script_parse_option): Likewise.
13028 (script_start_sections, script_add_phdr): Likewise.
13029 (script_check_output_format): New function.
13030 * script.h (read_input_script): Update declaration.
13031 * script-c.h (script_check_output_format): Declare.
13032 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13033 (ignore_cmd): Remove OUTPUT_FORMAT.
13034 * fileread.cc (Input_file::Input_file): Add explicit this.
13035 (Input_file::will_search_for): New function.
13036 (Input_file::open): Add pindex parameter. Change all callers.
13037 * fileread.h (class Input_file): Add input_file_argument method.
13038 Declare will_search_for. Update declarations.
13039 * object.cc (make_elf_object): Add punconfigured parameter.
13040 Change all callers.
13041 * object.h (class Object): Make input_file public. Add
13042 searched_for method.
13043 (make_elf_object): Update declaration.
13044 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13045 restart search.
13046 * dirsearch.h (class Dirsearch): Update declaration.
13047 * options.h (class General_options): Add --warn-search-mismatch.
13048 * parameters.cc (Parameters::is_compatible_target): New function.
13049 * parameters.h (class Parameters): Declare is_compatible_target.
13050 * workqueue.cc (Workqueue::add_blocker): New function.
13051 * workqueue.h (class Workqueue): Declare add_blocker.
13052
f1ed28fb
ILT
13053 * fileread.cc (Input_file::open): Remove options parameter.
13054 Change all callers.
13055 (Input_file::open_binary): Likewise.
13056 * script.cc (read_input_script): Likewise.
13057 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13058 options parameter from constructor. Change all callers.
13059 (class Read_script): Likewise.
13060 * fileread.h (class Input_file): Update declarations.
13061 * script.h (read_input_script): Update declaration.
13062
34dd024a
NC
130632009-03-10 Nick Clifton <nickc@redhat.com>
13064
13065 * po/es.po: New Spanish translation.
13066
6d71b17c
CC
130672009-03-06 Cary Coutant <ccoutant@google.com>
13068
13069 * options.cc (parse_short_option): Keep dash_z from registering itself.
13070
031cdbed
ILT
130712009-03-03 Ian Lance Taylor <iant@google.com>
13072
13073 PR 9918
13074 * target-reloc.h (relocate_section): Pass output_section to
13075 relocate.
13076 * i386.cc (Target_i386::should_apply_static_reloc): Add
13077 output_section parameter. Change all callers.
13078 (Target_i386::Relocate::relocate): Add output_section parameter.
13079 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13080 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13081 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13082 * testsuite/two_file_shared.sh: New script.
13083 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13084 (check_DATA): Add two_file_shared.dbg.
13085 (two_file_shared.dbg): New target.
13086 * testsuite/Makefile.in: Rebuild.
13087
15d5fa16
ILT
130882009-03-01 Ian Lance Taylor <iant@google.com>
13089
13090 * configure.ac: Check for byteswap.h.
13091 * configure: Rebuild.
13092 * config.in: Rebuild.
13093
8a4c0b0d
ILT
130942009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13095
13096 * layout.cc (Layout::find_or_add_kept_section): New function.
13097 (Layout::add_comdat): Removed.
13098 * layout.h (struct Kept_section): Move out of class Layout.
13099 Remove trailing underscores from field names. Add group_sections
13100 field. Rename group_ field to is_group. Change all uses.
13101 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13102 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13103 comdat_groups_ field.
13104 (Sized_relobj::include_section_group): Use
13105 find_or_add_kept_section and Kept_section::group_sections.
13106 (Sized_relobj::include_linkonce_section): Likewise.
13107 * object.cc (class Sized_relobj): Don't define Comdat_group or
13108 Comdat_group_table. Remove find_comdat_group and
13109 add_comdat_group. Remove comdat_groups_ field.
13110 * plugin.cc (include_comdat_group): Use
13111 Layout::find_or_add_kept_section.
13112
b4ecf66b
ILT
131132009-02-28 Ian Lance Taylor <iant@google.com>
13114
14359ca0
ILT
13115 * README: --gc-sections and map files are now supported. Document
13116 some build requirements.
13117
b4ecf66b
ILT
13118 PR 6992
13119 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13120 relocatable link set the value of the section symbol to zero.
13121 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13122 relocatable link don't include the section address in the local
13123 symbol value.
13124
0602e05a
ILT
131252009-02-27 Ian Lance Taylor <iant@google.com>
13126
fd9d194f
ILT
13127 PR 6811
13128 * options.h (class Search_directory): Add is_system_directory.
13129 (class General_options): Declare is_in_system_directory.
13130 * options.cc (get_relative_sysroot): Make static.
13131 (get_default_sysroot): Make static.
13132 (General_optoins::is_in_system_directory): New function.
13133 * fileread.cc (Input_file::is_in_system_directory): New function.
13134 * fileread.h (class Input_file): Declare is_in_system_directory.
13135 * object.h (class Object): Add is_in_system_directory.
13136 (class Input_objects): Remove system_library_directory_ field.
13137 * object.cc (Input_objects::add_object): Don't set
13138 system_library_directory_.
13139 (input_objects::found_in_system_library_directory): Remove.
13140 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13141 parameter. Change all callers.
13142 (Symbol_table::sized_write_globals): Likewise.
13143 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13144 Call Object::is_in_system_directory.
13145 * symtab.h (class Symbol_table): Update declarations.
13146
61edd21f
ILT
13147 PR 5990
13148 * descriptors.h (Open_descriptor): Add is_on_stack field.
13149 * descriptors.cc (Descriptors::open): If the descriptor is on the
13150 top of the stack, remove it. Initialize is_on_stack field.
13151 (Descriptors::release): Only add pod to stack if it is not on the
13152 stack already.
13153 (Descriptors::close_some_descriptor): Clear stack_next and
13154 is_on_stack fields.
13155
e29e076a
ILT
13156 PR 7091
13157 * output.cc (Output_section::find_starting_output_address): Rename
13158 from starting_output_address; add PADDR parameter; change return
13159 type.
13160 * output.h (class Output_section): Declare
13161 find_starting_output_address instead of starting_output_address.
13162 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13163 section symbol for which we can't find a merge section.
13164
0602e05a
ILT
13165 PR 9836
13166 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13167 hidden or internal, force the symbol to be local.
13168 * resolve.cc (Symbol::override_visibility): Define.
13169 (Symbol::override_base): Use override_visibility.
13170 (Symbol_table::resolve): Likewise.
13171 (Symbol::override_base_with_special): Likewise.
13172 (Symbol_table::override_with_special): If the visibility is hidden
13173 or internal, force the symbol to be local.
13174 * symtab.h (class Symbol): Add set_visibility and
13175 override_visibility.
13176 * testsuite/ver_test_1.sh: New file.
13177 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13178 (check_DATA): Add ver_test_1.syms.
13179 (ver_test_1.syms): New target.
13180 * testsuite/Makefile.in: Rebuild.
13181
401a9a73
CC
131822009-02-25 Cary Coutant <ccoutant@google.com>
13183
13184 * layout.cc (Layout::choose_output_section): Don't rename sections
13185 when using a linker script that has a SECTIONS clause.
13186 * Makefile.in: Regenerate.
13187
13188 * testsuite/Makefile.am (script_test_5.sh): New test case.
13189 * testsuite/Makefile.in: Regenerate.
13190 * testsuite/script_test_5.cc: New file.
13191 * testsuite/script_test_5.sh: New file.
13192 * testsuite/script_test_5.t: New file.
13193
f488e4b0
CC
131942009-02-13 Rafael Avila de Espindola <espindola@google.com>
13195
13196 * archive.cc (Archive::include_member): Update calls to add_symbols.
13197 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13198 the Layout argument.
13199 * dynobj.h (do_add_symbols): Add the Layout argument.
13200 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13201 Layout argument.
13202 * object.h (Object::add_symbols): Add the Layout argument.
13203 (Object::do_add_symbols): Add the Layout argument.
13204 (Sized_relobj::do_add_symbols): Add the Layout argument.
13205 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13206 Unify the two versions.
13207 (Add_plugin_symbols): Remove.
13208 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13209 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13210 (Add_plugin_symbols): Remove.
13211 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13212 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13213 (Add_symbols::run): Make it work with Pulginobj.
13214
89dd1680
ILT
132152009-02-06 Ian Lance Taylor <iant@google.com>
13216
13217 * object.cc (Sized_relobj::do_layout): Make info message start
13218 with lower case letter.
13219
266d0a74
ILT
132202009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13221
602b464e
ILT
13222 * binary.cc: Fix file comment.
13223
266d0a74
ILT
13224 * options.h (enum Incremental_disposition): Define.
13225 (class General_options): Add new options: --incremental,
13226 --incremental_changed, --incremental_unchanged,
13227 --incremental_unknown. Add incremental_disposition_ and
13228 implicit_incremental_ fields.
13229 (General_options::incremental_disposition): New function.
13230 (class Position_dependent_options): Add incremental_disposition
13231 option.
13232 (Position_dependent_options::copy_from_options): Set incremental
13233 dispositions.
13234 * options.cc (General_options::parse_incremental_changed): New
13235 function.
2e702c99
RM
13236 (General_options::parse_incremental_unchanged): New function.
13237 (General_options::parse_incremental_unknown): New function.
13238 (General_options::General_options): Initialize new fields
266d0a74 13239 incremental_disposition_ and implicit_incremental_.
2e702c99 13240 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13241 without --incremental.
13242
f073bbf7
CD
132432009-02-06 Chris Demetriou <cgd@google.com>
13244
13245 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13246 pointer and to report location as the file name associated with
13247 the symbol.
13248 (gold_undefined_symbol_at_location): New function to replace the
13249 old gold_undefined_symbol functionality.
13250 * target-reloc.h (relocate_section): Update to use
13251 gold_undefined_symbol_at_location.
13252 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13253 Call gold_undefined_symbol function rather than gold_error.
13254 * errors.h (Errors::undefined_symbol): Take location as a
13255 string, rather than calculating it from a relocation.
13256 * errors.cc (Errors::fatal): Print "fatal error:" before the
13257 formatted message.
13258 (Errors::error, Errors::error_at_location): Print "error: "
13259 before the formatted message.
13260 (Errors::undefined_symbol): Take location as a string, rather
13261 than calculating it from a relocation.
13262 (gold_undefined_symbol_at_location): New function akin to
13263 old gold_undefined_symbol, calculates location from relocation.
13264 (gold_undefined_symbol): Change to take only a Symbol pointer
13265 and to report location as the file name associated with the symbol.
13266 * testsuite/debug_msg.sh: Update for changed error messages.
13267 * testsuite/undef_symbol.sh: Likewise.
13268
8e94a90c
ILT
132692009-02-04 Duncan Sands <baldrick@free.fr>
13270
13271 PR 9812
13272 * reduced_debug_output.h
13273 (Output_reduced_debug_abbrev_section::failed): Use format for
13274 gold_warning.
13275 (Output_reduced_debug_info_section::faild): Likewise.
13276
88a0e15b
ILT
132772009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13278
13279 * script.cc (Lazy_demangler): New class.
2e702c99 13280 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13281 symbol only once.
13282
5efc7cd2
CC
132832009-01-29 Cary Coutant <ccoutant@google.com>
13284
13285 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13286 to __tls_get_addr.
13287 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13288
e0ebcf42
ILT
132892009-01-28 Ian Lance Taylor <iant@google.com>
13290
5efc7cd2 13291 * version.cc (version_string): Bump to 1.9.
75fe7426 13292
e0ebcf42
ILT
13293 * gold.h: Include <cstring> and <stdint.h>.
13294 * version.cc: Include <cstdio>.
13295 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13296 warning.
13297 * reduced_debug_output.cc (insert_into_vector): Rename from
13298 Insert_into_vector; change all callers. Use Swap_unaligned to
13299 avoid aliasing issue; remove union since it is unnecessary.
13300
8e2813be 133012009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13302
13303 * Makefile.am (CCFILES): Add gc.cc.
13304 (HFILES): Add gc.h.
13305 * Makefile.in: Regenerate.
13306 * gold.cc (Gc_runner): New class.
13307 (queue_initial_tasks): Call garbage collection related tasks
13308 when corresponding options are invoked.
13309 (queue_middle_gc_tasks): New function.
13310 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13311 processed early before laying out sections during garbage collection.
13312 * gold.h (queue_middle_gc_tasks): New function.
13313 (is_prefix_of): Move from "layout.cc".
13314 * i386.cc (Target_i386::gc_process_relocs): New function.
13315 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13316 * main.cc (main): Create object of class "Garbage_collection".
13317 * object.cc (Relobj::copy_symbols_data): New function.
13318 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13319 (Sized_relobj::do_layout): Allow this function to be called twice
13320 during garbage collection and defer layout of section during the
6d03d481
ST
13321 first call.
13322 * object.h (Relobj::get_symbols_data): New function.
13323 (Relobj::is_section_name_included): New function.
13324 (Relobj::copy_symbols_data): New function.
13325 (Relobj::set_symbols_data): New function.
13326 (Relobj::get_relocs_data): New function.
13327 (Relobj::set_relocs_data): New function.
13328 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13329 (Relobj::gc_process_relocs): New function.
13330 (Relobj::do_gc_process_relocs): New pure virtual function.
13331 (Relobj::sd_): New data member.
13332 (Sized_relobj::is_output_section_offset_invalid): New function.
13333 (Sized_relobj::do_gc_process_relocs): New function.
13334 * options.h (General_options::gc_sections): Modify to not be a no-op.
13335 (General_options::print_gc_sections): New option.
13336 * plugin.cc (Plugin_finish::run): Remove function call to
13337 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13338 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13339 * reloc.cc (Read_relocs::run): Add task to process relocs and
13340 determine unreferenced sections when doing garbage collection.
13341 (Gc_process_relocs): New class.
13342 (Sized_relobj::do_gc_process_relocs): New function.
13343 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13344 sections that are garbage collected.
13345 * reloc.h (Gc_process_relocs): New class.
13346 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13347 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13348 symbols whose corresponding sections are garbage collected.
13349 (Symbol_table::Symbol_table): Add new parameter for the garbage
13350 collection object.
13351 (Symbol_table::gc_mark_undef_symbols): New function.
13352 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13353 (Symbol_table::gc_mark_dyn_syms): New function.
13354 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13355 as garbage.
13356 (Symbol_table::add_from_object): Likewise.
13357 (Symbol_table::add_from_relobj): When building shared objects, do not
13358 treat externally visible symbols as garbage.
13359 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13360 table information for static and relocatable links.
13361 * symtab.h (Symbol_table::set_gc): New function.
13362 (Symbol_table::gc): New function.
13363 (Symbol_table::gc_mark_undef_symbols): New function.
13364 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13365 (Symbol_table::gc_mark_dyn_syms): New function.
13366 (Symbol_table::gc_): New data member.
e1df38aa 13367 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13368 function.
13369 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13370 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13371
3b293544
CF
133722009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13373
13374 * options.h (General_options::gc_sections): Define as a no-op for now.
13375 (General_options::no_keep_memory): Ditto.
13376 (General_options::Bshareable): Define.
13377 * options.cc (General_options::finalize): Honor -Bshareable.
13378
83d22aa8
AS
133792009-01-20 Andreas Schwab <schwab@suse.de>
13380
13381 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13382 read the value in the contents, since we don't use it. Use the
13383 template endianness when writing.
13384 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13385
cd536b21
AS
133862009-01-19 Andreas Schwab <schwab@suse.de>
13387
13388 * configure.tgt (powerpc64-*): Fix targ_obj.
13389
99e9a495
ILT
133902009-01-15 Ian Lance Taylor <iant@google.com>
13391
13392 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13393 local symbols when stripping all symbols.
13394
bbbfea06
CC
133952009-01-14 Cary Coutant <ccoutant@google.com>
13396
99e9a495 13397 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13398
0f7c0701
CC
133992009-01-14 Cary Coutant <ccoutant@google.com>
13400
13401 * archive.cc (Archive::get_elf_object_for_member): Remove call
13402 to File_read::claim_for_plugin.
13403 * descriptors.cc (Descriptors::open): Remove reference to
13404 is_claimed.
13405 (Descriptors::claim_for_plugin): Remove.
13406 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13407 (Descriptors::is_claimed): Remove.
13408 (claim_descriptor_for_plugin): Remove.
13409 * fileread.cc (File_read::claim_for_plugin): Remove.
13410 * fileread.h (File_read::claim_for_plugin): Remove.
13411 (File_read::descriptor): Reopen descriptor if necessary.
13412 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13413 (Plugin_manager::all_symbols_read): Add task parameter. Change
13414 all callers.
13415 (Plugin_manager::get_input_file): New function.
13416 (Plugin_manager::release_input_file): New function.
13417 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13418 corresponding data member.
13419 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13420 and pass to base constructor. Change all callers.
13421 (get_input_file, release_input_file): New functions.
13422 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13423 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13424 (Plugin_manager::all_symbols_read): Add task parameter.
13425 (Plugin_manager::get_input_file): New function.
13426 (Plugin_manager::release_input_file): New function.
13427 (Plugin_manager::task_): New data member.
13428 (Pluginobj::Pluginobj): Add filesize parameter.
13429 (Pluginobj::filename): New function.
13430 (Pluginobj::descriptor): New function.
13431 (Pluginobj::filesize): New function.
13432 (Pluginobj::filesize_): New data member.
13433 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13434 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13435 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13436
13437 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13438 with archive libraries.
13439 * testsuite/Makefile.in: Regenerate.
13440 * testsuite/plugin_test.c (struct sym_info): New type.
13441 (get_input_file, release_input_file): New static variables.
13442 (onload): Capture new transfer vector entries.
13443 (claim_file_hook): Stop reading at end of file according to filesize.
13444 Factor out parsing of readelf output into separate function.
13445 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13446 APIs and get the source file name from the symbol table. Convert
13447 source file name to corresponding object file name. Print info
13448 message when adding new input files.
13449 (parse_readelf_line): New function.
13450 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13451 * testsuite/plugin_test_2.sh: Likewise.
13452 * testsuite/plugin_test_3.sh: Likewise.
13453 * testsuite/plugin_test_4.sh: New test case.
13454
62a6d109
ILT
134552009-01-07 Ian Lance Taylor <iant@google.com>
13456
13457 * version.cc (version_string): Bump to 1.8.
13458
483620e8
CC
134592008-12-23 Cary Coutant <ccoutant@google.com>
13460
13461 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13462 * plugin.cc (Plugin_manager::finish): Rename as
13463 layout_deferred_objects. Move cleanup to separate function.
13464 (Plugin_manager::cleanup): New function.
13465 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13466 separately.
13467 * plugin.h (Plugin_manager::finish): Rename as
13468 layout_deferred_objects.
13469 (Plugin_manager::cleanup): New function.
13470 (Plugin_manager::cleanup_done): New field.
13471
d66a9eb3
CC
134722008-12-23 Cary Coutant <ccoutant@google.com>
13473
13474 * plugin.cc (is_visible_from_outside): New function.
13475 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13476 so we don't return "IR only" status for exported symbols or -r links.
13477
13478 * testsuite/Makefile.am (plugin_test_3): New test case.
13479 * testsuite/Makefile.in: Regenerate.
13480 * testsuite/plugin_test_3.sh: New file.
13481
5995b570
CC
134822008-12-22 Cary Coutant <ccoutant@google.com>
13483
13484 * object.cc (Sized_relobj::layout_section): New function.
13485 (Sized_relobj::do_layout): Defer layout of input sections until after
13486 plugin has provided replacement files.
13487 (Sized_relobj::do_layout_deferred_sections): New function.
13488 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13489 (Relobj::layout_deferred_sections): New function.
13490 (Relobj::do_layout_deferred_sections): New function.
13491 (Sized_relobj::do_layout_deferred_sections): New function.
13492 (Sized_relobj::layout_section): New function.
13493 (Sized_relobj::Deferred_layout): New structure.
13494 (Sized_relobj::deferred_layout_): New field.
13495 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13496 Change all callers. Layout deferred sections.
13497 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13498 references.
13499 (Plugin_hook::run): Move code from do_plugin_hook inline.
13500 (Plugin_hook::do_plugin_hook): Remove.
13501 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13502 (Plugin_manager::finish): Renamed, was cleanup.
13503 (Plugin_manager::should_defer_layout): New function.
13504 (Plugin_manager::add_deferred_layout_object): New function.
13505 (Plugin_manager::Deferred_layout_list): New type.
13506 (Plugin_manager::deferred_layout_objects_): New field.
13507 (Plugin_hook::do_plugin_hook): Remove.
13508
ee769c88
ILT
135092008-12-17 Ian Lance Taylor <iant@google.com>
13510
13511 * options.h (class General_options): Add --no case for
13512 --export-dynamic.
13513
abc8dcba
CC
135142008-12-16 Cary Coutant <ccoutant@google.com>
13515
13516 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13517 vector.
13518 (Plugin_manager::claim_file): Create plugin object even if
13519 plugin did not call the add_symbols callback.
13520 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13521 asking for more symbols than were added.
13522 * testsuite/Makefile.am (plugin_test_1): Add test case with
13523 no global symbols.
13524 (empty.syms): New target.
13525 * testsuite/Makefile.in: Regenerate.
13526 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13527 message. Don't call add_symbols if no globals.
13528 (all_symbols_read_hook): Don't provide replacement for empty
13529 claimed file.
13530
b0074644
ILT
135312008-12-12 Ian Lance Taylor <iant@google.com>
13532
68943102
ILT
13533 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13534 r_type == 0 for a local symbol with r_sym == 0.
13535 (scan_relocatable_relocs): Pass r_sym to
13536 local_non_section_strategy.
13537 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13538 r_sym parameter.
13539
b0074644
ILT
13540 * configure.ac: Update test for TLS descriptors: they are
13541 supported as of glibc 2.9.
13542 * configure: Rebuild.
13543
c2508178
ILT
135442008-12-11 Ian Lance Taylor <iant@google.com>
13545
13546 PR 7091
13547 * target-reloc.h (Default_scan_relocatable_relocs): For each
13548 function, map r_type == 0 to RELOC_DISCARD.
13549
2756a258
CC
135502008-12-10 Cary Coutant <ccoutant@google.com>
13551
13552 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13553 object to override a kept COMDAT group from a plugin object.
13554
bb6f53d3
ILT
135552008-12-09 Ian Lance Taylor <iant@google.com>
13556
fbc558e1
ILT
13557 PR 7088
13558 * yyscript.y (file_cmd): Handle INPUT.
13559
bb6f53d3
ILT
13560 * testsuite/initpri1.c: Change all declarations to be full
13561 prototypes by adding void, to avoid compiler warnings.
13562
4674ecfc
CC
135632008-12-05 Rafael Avila de Espindola <espindola@google.com>
13564
13565 * options.cc (General_options::parse_plugin_opt): New.
13566 (General_options::add_plugin): The argument now is just the filename.
13567 (General_options::add_plugin_option): New.
13568 * options.h (plugin_opt): New.
13569 (add_plugin): Change argument name.
13570 (add_plugin_option): New.
13571 * plugin.cc (Plugin::load): Don't parse the plugin option.
13572 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13573 (Plugin::add_option): New.
13574 (Plugin::args_): Change type.
13575 (Plugin::filename_): New.
13576 (Plugin_manager::add_plugin_option): New.
13577 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13578 * testsuite/Makefile.in: Regenerate.
13579
fd06b4aa
CC
135802008-12-05 Cary Coutant <ccoutant@google.com>
13581
13582 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13583 Handle --strip-lto-sections option.
13584 * options.h (strip_lto_sections): New option.
13585
6c52134c
CC
135862008-12-01 Cary Coutant <ccoutant@google.com>
13587
13588 * plugin.cc (ld_plugin_message): Change format parameter to const.
13589 Fix mismatch between new[] and delete.
13590
a45248e0
CC
135912008-11-14 Cary Coutant <ccoutant@google.com>
13592
13593 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13594 instead of -1U.
13595
c82fbeee
CS
135962008-11-05 Craig Silverstein <csilvers@google.com>
13597
13598 * options.cc (General_options::parse_dynamic_list): New function.
13599 * options.h (General_options): New flags dynamic_list,
13600 dynamic_list_data, dynamic_list_cpp_new, and
13601 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13602 (General_options::in_dynamic_list): New function.
13603 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13604 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13605 (Lex::can_continue_name): Likewise.
13606 (yylex): Likewise.
13607 (read_script_file): New parameter script_options.
13608 (read_dynamic_list): New function.
13609 (Script_options::define_dynamic_list): New function.
13610 (dynamic_list_keyword_parsecodes): New variable.
13611 (dynamic_list_keywords): New variable.
13612 * script.h (Script_options::define_dynamic_list): New function
13613 prototype.
13614 (read_dynamic_list): New function prototype.
13615 * symtab.cc (strprefix): New macro.
13616 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13617 dynamic_list_data, dynamic_list_cpp_new, and
13618 dynamic_list_cpp_typeinfo.
13619 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13620 (dynamic_list_expr): New rule.
13621 (dynamic_list_nodes): Likewise.
13622 (dynamic_list_node): Likewise.
13623 * testsuite/Makefile.am (dynamic_list): New test.
13624 * testsuite/Makefile.in: Regenerated.
13625 * testsuite/dynamic_list.t: New file.
13626 * testsuite/dynamic_list.sh: New file.
13627
e0bb29a5
CS
136282008-11-05 Craig Silverstein <csilvers@google.com>
13629
13630 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13631 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13632 (t11_last): Likewise.
13633 * testsuite/ver_test_6.c (main): Likewise.
13634
4e1e25e0
CC
136352008-10-07 Cary Coutant <ccoutant@google.com>
13636
13637 * options.c (General_options::finalize): Add check for -static and
13638 -shared.
13639 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13640 is not empty.
13641
92f03fcb
CC
136422008-10-02 Cary Coutant <ccoutant@google.com>
13643
13644 * plugin.cc (make_sized_plugin_object): Fix conditional
13645 compilation to work when not all targets are enabled.
13646
fbd8a257
CC
136472008-09-29 Cary Coutant <ccoutant@google.com>
13648
13649 * archive.cc (Archive::get_file_and_offset): Use filename instead
13650 of name to get library path.
13651 (Archive::include_member): Unlock external member of a thin archive.
13652
13653 * testsuite/Makefile.am (TEST_AR): New variable.
13654 (thin_archive_test_1): New test.
13655 (thin_archive_test_2): New test.
81636b3f
CC
13656 * testsuite/Makefile.in: Regenerate.
13657 * testsuite/thin_archive_main.cc: New file.
13658 * testsuite/thin_archive_test_1.cc: New file.
13659 * testsuite/thin_archive_test_2.cc: New file.
13660 * testsuite/thin_archive_test_3.cc: New file.
13661 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 13662
eff45813
CC
136632008-09-29 Cary Coutant <ccoutant@google.com>
13664
13665 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13666 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13667 instead of -1U.
13668 (Sized_relobj::do_finalize_local_symbols): Likewise.
13669 (Sized_relobj::map_to_kept_section): Likewise.
13670 * object.h (Sized_relobj::invalid_address): New constant.
13671 (Sized_relobj::do_output_section_offset): Check for invalid_address
13672 and return -1ULL.
13673 * output.cc (Output_reloc::local_section_offset): Use constant
13674 invalid_address instead of -1U.
13675 (Output_reloc::get_address): Likewise.
13676 (Output_section::output_address): Change -1U to -1ULL.
13677 * output.h (Output_reloc::invalid_address): New constant.
13678 * reloc.cc (Sized_relobj::write_sections): Use constant
13679 invalid_address instead of -1U.
13680 (Sized_relobj::relocate_sections): Likewise.
13681 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13682 values for merge sections.
13683 * target-reloc.h (relocate_for_relocatable): Use constant
13684 invalid_address instead of -1U.
13685
89fc3421
CC
136862008-09-19 Cary Coutant <ccoutant@google.com>
13687
13688 Add plugin functionality for link-time optimization (LTO).
13689 * configure.ac (plugins): Add --enable-plugins option.
13690 * configure: Regenerate.
13691 * config.in: Regenerate.
13692 * Makefile.am (LIBDL): New variable.
13693 (CCFILES): Add plugin.cc.
13694 (HFILES): Add plugin.h.
13695 (ldadd_var): Add LIBDL.
13696 * Makefile.in: Regenerate.
13697
13698 * archive.cc: Include "plugin.h".
13699 (Archive::setup): Don't preread archive symbols when using a plugin.
13700 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
13701 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
13702 files.
13703 (Archive::include_member): Add symbols from plugin objects.
13704 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
13705 * descriptors.cc (Descriptors::open): Check for file descriptors
13706 abandoned by plugins.
13707 (Descriptors::claim_for_plugin): New function.
13708 * descriptors.h (Descriptors::claim_for_plugin): New function.
13709 (Open_descriptor::is_claimed): New field.
13710 (claim_descriptor_for_plugin): New function.
13711 * fileread.cc (File_read::claim_for_plugin): New function.
13712 * fileread.h (File_read::claim_for_plugin): New function.
13713 (File_read::descriptor): New function.
13714 * gold.cc: Include "plugin.h".
13715 (queue_initial_tasks): Add task to call plugin hooks for generating
13716 new object files.
13717 * main.cc: Include "plugin.h".
13718 (main): Load plugin libraries.
13719 * object.h (Pluginobj): Declare.
13720 (Object::pluginobj): New function.
13721 (Object::do_pluginobj): New function.
13722 (Object::set_target): New function.
13723 * options.cc: Include "plugin.h".
13724 (General_options::parse_plugin): New function.
13725 (General_options::General_options): Initialize plugins_ field.
13726 (General_options::add_plugin): New function.
13727 * options.h (Plugin_manager): Declare.
13728 (General_options): Add --plugin option.
13729 (General_options::has_plugins): New function.
13730 (General_options::plugins): New function.
13731 (General_options::add_plugin): New function.
13732 (General_options::plugins_): New field.
13733 * plugin.cc: New file.
13734 * plugin.h: New file.
13735 * readsyms.cc: Include "plugin.h".
13736 (Read_symbols::do_read_symbols): Check for archive before checking
13737 for ELF file. Call plugin hooks to claim files.
13738 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
13739 from a real object file; force override when processing replacement
13740 files.
13741 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
13742 (Symbol::init_base_object): Likewise.
13743 (Symbol::init_base_output_data): Likewise.
13744 (Symbol::init_base_output_segment): Likewise.
13745 (Symbol::init_base_constant): Likewise.
13746 (Symbol::init_base_undefined): Likewise.
13747 (Symbol::output_section): Assert that object is not a plugin.
13748 (Symbol_table::add_from_pluginobj): New function.
13749 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
13750 undefined.
13751 (Symbol_table::sized_write_globals): Likewise.
13752 (Symbol_table::add_from_pluginobj): Instantiate template.
13753 * symtab.h (Sized_pluginobj): Declare.
13754 (Symbol::in_real_elf): New function.
13755 (Symbol::set_in_real_elf): New function.
13756 (Symbol::in_real_elf_): New field.
13757 (Symbol_table::add_from_pluginobj): New function.
13758
13759 * testsuite/Makefile.am (AM_CFLAGS): New variable.
13760 (LIBDL): New variable.
13761 (LDADD): Add LIBDL.
13762 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
13763 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
13764 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
13765 (MOSTLYCLEANFILES): Likewise.
13766 * testsuite/Makefile.in: Regenerate.
13767 * testsuite/plugin_test.c: New file.
13768 * testsuite/plugin_test_1.sh: New file.
13769 * testsuite/plugin_test_2.sh: New file.
13770
de31bda5
ILT
137712008-09-16 Ian Lance Taylor <iant@google.com>
13772
9c2d0ef9
ILT
13773 * target-reloc.h (relocate_section): Check whether a symbol is
13774 defined by the ABI before reporting an undefined symbol error.
13775 * target.h (Target::is_defined_by_abi): Make parameter const.
13776 (Target::do_is_defined_by_abi): Likewise.
13777 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
13778 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
13779 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
13780 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
13781 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
13782 * testsuite/Makefile.in: Rebuild.
13783
de31bda5
ILT
13784 * fileread.cc (make_view): Add casts to avoid warning.
13785
9fa33bee
AO
137862008-09-16 Alexandre Oliva <aoliva@redhat.com>
13787
13788 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
13789 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13790
183fd0e3
AO
137912008-09-16 Alexandre Oliva <aoliva@redhat.com>
13792
13793 * options.h (General_options::output_is_executable): New.
13794 (General_options::output_is_pie): New.
13795 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
13796 for shared libraries.
13797 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13798
7be8330a
CD
137992008-09-11 Chris Demetriou <cgd@google.com>
13800
13801 * options.h (origin): New -z option.
13802 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
13803 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
13804 in DT_FLAGS_1.
13805
a9caad02
CC
138062008-09-05 Cary Coutant <ccoutant@google.com>
13807
13808 * fileread.cc (File_read::make_view): Add check for attempt to map
13809 beyond end of file.
13810
ae6dce4d
CC
138112008-09-05 Cary Coutant <ccoutant@google.com>
13812
13813 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
13814 explicit instantiations.
13815
d7ab2a47
KVH
138162008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
13817
13818 PR gold/6858
13819 * options.cc (General_options::finalize): Allow undefined symbols
13820 in shlibs if linking -shared.
13821
13822 PR gold/6859
13823 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
13824 symbols as not needing a dynsym entry.
13825
1e52a9c1
CS
138262008-08-20 Craig Silverstein <csilvers@google.com>
13827
13828 * fileread.cc (File_read::open): Do not lock the file unless it
13829 was successfully opened.
13830
d85c80a3
CC
138312008-08-14 Cary Coutant <ccoutant@google.com>
13832
13833 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
13834 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
13835 * testsuite/tls_test.cc (struct int128): 128-bit struct
13836 for testing TLS relocs with non-zero addend.
13837 (v12): New TLS variable.
13838 (t12): New test.
13839 (t_last): Add check for v12.
13840 * testsuite/tls_test.h (t12): New function.
13841 * testsuite/tls_test_main.cc (thread_routine): Call new test.
13842
2d924fd9
ILT
138432008-08-13 Ian Lance Taylor <iant@google.com>
13844
13845 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
13846 set tls_segment_ or relro_segment_.
13847 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
13848 when appropriate.
13849 * output.h (Output_section::clear_is_relro): New function.
13850 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
13851 sections specially even when output_data_ is empty.
13852 (Output_segment::maximum_alignment): When first section is relro,
13853 only force alignment for PT_LOAD segments.
13854 * script.cc (script_data_segment_align): New function.
13855 (script_data_segment_relro_end): New function.
13856 * script-c.h (script_data_segment_align): Declare.
13857 (script_data_segment_relro_end): Declare.
13858 * script-sections.h (class Script_sections): Declare
13859 data_segment_align and data_segment_relro_end. Add fields
13860 segment_align_index_ and saw_relro_end_.
13861 * script-sections.cc (class Sections_element): Add set_is_relro
13862 virtual function. Add new bool* parameter to place_orphan_here.
13863 Add get_output_section virtual function.
13864 (class Output_section_definition): Add set_is_relro. Add new
13865 bool* parameter to place_orphan_here. Add get_output_section.
13866 Add is_relro_ field.
13867 (Output_section_definition::Output_section_definition): Initialize
13868 evaluated_address_, evaluated_load_address, evaluated_addralign_,
13869 and is_relro_ fields.
13870 (Output_section_definition::place_orphan_here): Add is_relro
13871 parameter.
13872 (Output_section_definition::set_section_addresses): Set relro for
13873 output section.
13874 (Output_section_definition::alternate_constraint): Likewise.
13875 (class Orphan_output_section): Add new bool* parameter to
13876 place_orphan_here. Add get_output_section.
13877 (Orphan_output_section::place_orphan_here): Add is_relro
13878 parameter.
13879 (Script_sections::Script_sections): Initialize
13880 data_segment_align_index_ and saw_relro_end_.
13881 (Script_sections::data_segment_align): New function.
13882 (Script_sections::data_segment_relro_end): New function.
13883 (Script_sections::place_orphan): Set or clear is_relro.
13884 (Script_sections::set_section_addresses): Force alignment of first
13885 TLS section.
13886 * yyscript.y (exp): Call script_data_segment_align and
13887 script_data_segment_relro_end.
13888 * testsuite/relro_script_test.t: New file.
13889 * testsuite/relro_test.cc (using_script): Declare.
13890 (t1, t2): Test using_script.
13891 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
13892 (relro_script_test_SOURCES): Define.
13893 (relro_script_test_DEPENDENCIES): Define.
13894 (relro_script_test_LDFLAGS): Define.
13895 (relro_script_test_LDADD): Define.
13896 (relro_script_test.so): New target.
13897 * testsuite/Makefile.in: Rebuild.
13898
f827c9a9
CC
138992008-08-06 Cary Coutant <ccoutant@google.com>
13900
13901 * archive.cc (Archive::total_archives, Archive::total_members)
13902 (Archive::total_members_loaded): New variables.
13903 (Archive::setup): Add parameter. Add option to preread
13904 archive symbols.
13905 (Archive::read_armap): Add counter.
13906 (Archive::get_file_and_offset): New function.
13907 (Archive::get_elf_object_for_member): New function.
13908 (Archive::read_all_symbols): New function.
13909 (Archive::read_symbols): New function.
13910 (Archive::add_symbols): Add counters.
13911 (Archive::include_all_members): Use armap to find members if it's
13912 already built.
13913 (Archive::include_member): Skip reading symbols if already read.
13914 Factored code into Archive::get_file_and_offset and
13915 Archive::get_elf_object_for_member. Changed call to
13916 Mapfile::report_include_archive_member.
13917 (Archive::print_stats): New function.
13918 * archive.h: Declare Object and Read_symbols_data classes.
13919 (Archive::Archive): Add initializers for new members.
13920 (Archive::setup): Add parameter.
13921 (Archive::print_stats): New function.
13922 (Archive::total_archives, Archive::total_members)
13923 (Archive::total_members_loaded): New variables.
13924 (Archive::get_file_and_offset): New function.
13925 (Archive::get_elf_object_for_member): New function.
13926 (Archive::read_all_symbols): New function.
13927 (Archive::read_symbols): New function.
13928 (Archive::Archive_member): New class.
13929 (Archive::members_): New member.
13930 (Archive::num_members_): New member.
13931 * main.cc: Include archive.h.
13932 (main): Call Archive::print_stats.
13933 * mapfile.cc (Mapfile::report_include_archive_member): Delete
13934 archive parameter; member_name is now the fully-decorated name.
13935 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
13936 * options.h: (General_options): Add --preread-archive-symbols option.
13937 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
13938 Archive::setup.
13939
de4c45bd
ILT
139402008-08-04 Ian Lance Taylor <iant@google.com>
13941
13942 * symtab.h (Symbol::use_plt_offset): New function.
13943 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
13944 * powerpc.cc (Relocate::relocate): Likewise.
13945 * sparc.cc (Relocate::relocate): Likewise.
13946 * x86_64.cc (Relocate::relocate): Likewise.
13947 * testsuite/weak_plt.sh: New test.
13948 * testsuite/weak_plt_main.cc: New test.
13949 * testsuite/weak_plt_shared.cc: New test.
13950 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
13951 (check_PROGRAMS): Add weak_plt.
13952 (check_DATA): Add weak_plt_shared.so.
13953 (weak_plt_main_pic.o, weak_plt): New targets.
13954 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
13955 * testsuite/Makefile.in: Rebuild.
13956
13957 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
13958 gcctestdir/ld.
13959 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
13960 * testsuite/Makefile.in: Rebuild.
13961
323ee3f4
AM
139622008-08-04 Alan Modra <amodra@bigpond.net.au>
13963
13964 * Makefile.am (POTFILES.in): Set LC_ALL=C.
13965 * Makefile.in: Regenerate.
13966 * po/POTFILES.in: Regenerate.
13967
7c07ecec
ILT
139682008-07-29 Ian Lance Taylor <iant@google.com>
13969
13970 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
13971 symbols before other symbols.
13972 * testsuite/script_test_2.cc (test_addr): Declare.
13973 (test_addr_alias): Declare.
13974 (main): Check that test_addr and test_addr_alias have the right
cd536b21 13975 values.
7c07ecec
ILT
13976 * testsuite/script_test_2.t: Define test_addr_alias and
13977 test_addr.
13978
5778530e
ILT
139792008-07-24 Ian Lance Taylor <iant@google.com>
13980
2a00e4fb
ILT
13981 PR 5990
13982 * descriptors.cc: New file.
13983 * descriptors.h: New file.
13984 * gold-threads.h (class Hold_optional_lock): New class.
13985 * fileread.cc: Include "descriptors.h".
13986 (File_read::~File_read): Release descriptor rather than closing
13987 it.
13988 (File_read::open) [file]: Call open_descriptor rather than open.
13989 Set is_descriptor_opened_.
13990 (File_read::open) [memory]: Assert that descriptor is not open.
13991 (File_read::reopen_descriptor): New function.
13992 (File_read::release): Release descriptor.
13993 (File_read::do_read): Make non-const. Reopen descriptor.
13994 (File_read::read): Make non-const.
13995 (File_read::make_view): Reopen descriptor.
13996 (File_read::do_readv): Likewise.
13997 * fileread.h (class File_read): Add is_descriptor_opened_ field.
13998 Update declarations.
13999 * layout.cc: Include "descriptors.h".
14000 (Layout::create_build_id): Use open_descriptor rather than open.
14001 * output.cc: Include "descriptors.h".
14002 (Output_file::open): Use open_descriptor rather than open.
14003 * archive.cc (Archive::const_iterator): Change Archive to be
14004 non-const.
14005 (Archive::begin, Archive::end): Make non-const.
14006 (Archive::count_members): Likewise.
14007 * archive.h (class Archive): Update declarations.
14008 * object.h (Object::read): Make non-const.
14009 * Makefile.am (CCFILES): Add descriptors.cc.
14010 (HFILES): Add descriptors.h.
14011 * Makefile.in: Rebuild.
14012
801647d1
ILT
14013 PR 6716
14014 * gold.h: Always include <clocale>. Add Solaris workarounds
14015 following code in binutils/sysdep.h.
14016
5edd166e
ILT
14017 PR 6048
14018 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14019 this->eh_frame_hdr_ is NULL before using it.
14020
c89ad728
ILT
14021 * dynobj.cc (Versions::Versions): Update comment.
14022
aa86f06b
ILT
14023 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14024 the base version name.
14025
5778530e
ILT
14026 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14027 array size plus one.
14028 (Stringpool_template::set_string_offsets): Subtract one from key
14029 before using it as an array index.
14030 (Stringpool_template::get_offset_with_length): Likewise.
14031 (Stringpool_template::write_to_buffer): Likewise.
14032 * stringpool.h (Stringpool_template::get_offset_from_key):
14033 Likewise.
14034
057ead22
ILT
140352008-07-23 Ian Lance Taylor <iant@google.com>
14036
7f649c59
ILT
14037 PR 6658
14038 * object.h (Merged_symbol_value::value): Do our best to handle a
14039 negative addend.
14040
057ead22
ILT
14041 PR 6647
14042 * script.cc (Version_script_info::get_versions): Don't add empty
14043 version tag to return value.
14044 (Version_script_info::get_symbol_version_helper): Change return
14045 type to bool. Add pversion parameter. Change all callers.
14046 (script_register_vers_node): Don't require a non-NULL tag.
14047 * script.h (class Version_script_info): Update declarations.
14048 (Version_script_info::get_symbol_version): Change return type to
14049 bool. Add version parameter. Change all callers.
14050 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14051 handling. Handle an empty version from a version script.
14052 (Symbol_table::define_special_symbol): Likewise.
14053 * testsuite/ver_test_10.script: New file.
14054 * testsuite/ver_test_10.sh: New file.
14055 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14056 (check_DATA): Add ver_test_10.syms.
14057 (ver_test_10.syms, ver_test_10.so): New target.
14058 * testsuite/Makefile.in: Rebuild.
14059
58e54ac2
CD
140602008-07-23 Simon Baldwin <simonb@google.com>
14061
14062 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14063 to zero for undefined symbols from dynamic libraries.
14064
95d14cd3
ILT
140652008-07-23 Ian Lance Taylor <iant@google.com>
14066
14067 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14068 Change all callers.
14069 * symtab.h (class Symbol_table): Update declaration.
14070 * testsuite/ver_test_9.cc: New file.
14071 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14072 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14073 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14074 (ver_test_9.so, ver_test_9.o): New targets.
14075 * testsuite/Makefile.in: Rebuild.
14076
92de84a6
ILT
140772008-07-22 Ian Lance Taylor <iant@google.com>
14078
34810851
ILT
14079 * options.h (class General_options): Define --check-sections.
14080 * layout.cc (Layout::set_segment_offsets): Handle
14081 --check-sections.
14082
af6156ef
ILT
14083 * options.h (class General_options): Define -n/--nmagic and
14084 -N/--omagic.
14085 * options.cc (General_options::finalize): For -n/--nmagic or
14086 -N/--omagic, set -static.
14087 * layout.cc (Layout::attach_allocated_section_to_segment): If
14088 -N/--omagic, don't put read-only and read-write sections in
14089 different segments.
14090 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14091 finding a read-only segment.
14092 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14093 don't set the minimum segment alignment to the common page size,
14094 and don't set the file offset to the address modulo the page size.
14095 * script-sections.cc (Script_sections::create_segments): If
14096 -n/--omagic, don't put read-only and read-write sections in
14097 different segments.
14098
92de84a6
ILT
14099 * cref.cc: New file.
14100 * cref.h: New file.
14101 * options.h (class General_options): Add --print-symbol-counts.
14102 * main.cc (main): Issue defined symbol report if requested.
14103 * archive.cc (Archive::interpret_header): Make into a const member
14104 function.
14105 (Archive::add_symbols): Call Input_objects::archive_start and
14106 archive_stop.
14107 (Archive::const_iterator): Define new class.
14108 (Archive::begin, Archive::end): New functions.
14109 (Archive::include_all_members): Rewrite to use iterator.
14110 (Archive::count_members): New function.
14111 * archive.h (class Archive): Update declarations.
14112 (Archive::filename): New function.
14113 * object.cc: Include "cref.h".
14114 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14115 (Sized_relobj::do_get_global_symbol_counts): New function.
14116 (Input_objects::add_object): Add object to cross-referencer.
14117 (Input_objects::archive_start): New function.
14118 (Input_objects::archive_stop): New function.
14119 (Input_objects::print_symbol_counts): New function.
14120 * object.h: Declare Cref and Archive.
14121 (Object::get_global_symbol_counts): New function.
14122 (Object::do_get_global_symbol_counts): New pure virtual function.
14123 (class Sized_relobj): Add defined_count_ field. Update
14124 declarations.
14125 (class Input_objects): Add cref_ field. Update constructor.
14126 Update declarations.
14127 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14128 defined_count_.
14129 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14130 symbol counts.
14131 (Sized_dynobj::do_get_global_symbol_counts): New function.
14132 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14133 defined_count_. Update declarations. Define Symbols typedef.
14134 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14135 parameter. Change all callers.
14136 (Symbol_table::add_from_dynobj): Add sympointers and defined
14137 parameters. Change all callers.
14138 * symtab.h (class Symbol_table): Update declarations.
14139 * Makefile.am (CCFILES): Add cref.cc.
14140 (HFILES): Add cref.h.
14141 * Makefile.in: Rebuild.
14142
3f7c5e1d
CD
141432008-07-22 Simon Baldwin <simonb@google.com>
14144
14145 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14146 to zero when writing undefined symbols.
14147
e0b64032
ILT
141482008-07-22 Ian Lance Taylor <iant@google.com>
14149
14150 * output.cc (Output_section::add_input_section): Don't try to
14151 merge empty merge sections.
14152
096b02cf
CS
141532008-07-21 Craig Silverstein <csilvers@google.com>
14154
14155 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14156 Include symbol version in error message.
cd536b21 14157
1d1f116d
CD
141582008-07-20 Chris Demetriou <cgd@google.com>
14159
cd536b21 14160 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14161 (RANDOM_SEED_CFLAGS): New substituted variable.
14162 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14163 * configure: Rebuild.
14164 * Makefile.in: Likewise.
14165 * testsuite/Makefile.in: Likewise.
14166
a18f591e
ILT
141672008-07-18 Ian Lance Taylor <iant@google.com>
14168
14169 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14170 where we see NAME/NULL and NAME/VERSION as separate symbols.
14171 * testsuite/ver_test_main.cc (main): Call t4.
14172 (t4, t4_2a): Define.
14173 * testsuite/ver_test_2.cc (t4_2): Define.
14174 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14175 * testsuite/ver_test_4.cc (t4_2a): Define.
14176 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14177 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14178
c6e3f6ed
ILT
141792008-07-17 Ian Lance Taylor <iant@google.com>
14180
14181 * dynobj.cc (Versions::add_def): If we give an error about a
14182 missing version, go ahead and create the version anyhow.
14183
ef9beddf
ILT
141842008-07-10 Ian Lance Taylor <iant@google.com>
14185
14186 Handle output sections with more than 0x7fffffff bytes.
14187 * object.h (class Relobj): Change map_to_output_ to
14188 output_sections_, and just keep a section pointer. Change all
14189 uses. Move comdat group support to Sized_relobj.
14190 (Relobj::is_section_specially_mapped): Remove.
14191 (Relobj::output_section): Remove poff parameter. Change all
14192 callers.
14193 (Relobj::output_section_offset): New function.
14194 (Relobj::set_section_offset): Rewrite.
14195 (Relobj::map_to_output): Remove.
14196 (Relobj::output_sections): New function.
14197 (Relobj::do_output_section_offset): New pure virtual function.
14198 (Relobj::do_set_section_offset): Likewise.
14199 (class Sized_relobj): Add section_offsets_ field. Add comdat
14200 group support from Relobj. Update declarations.
14201 (Sized_relobj::get_output_section_offset): New function.
14202 (Sized_relobj::do_output_section_offset): New function.
14203 (Sized_relobj::do_set_section_offset): New function.
14204 * object.cc (Relobj::output_section_address): Remove.
14205 (Sized_relobj::Sized_relobj): Initialize new fields.
14206 (Sized_relobj::include_section_group): Cast find_kept_object to
14207 Sized_relobj.
14208 (Sized_relobj::include_linkonce_section): Likewise.
14209 (Sized_relobj::do_layout): Use separate arrays for output section
14210 and output offset.
14211 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14212 output_sections.
14213 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14214 output_sections and section_offsets.
14215 (Sized_relobj::write_local_symbols): Likewise.
14216 (map_to_kept_section): Compute output address directly.
14217 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14218 output_sections and section_offsets.
14219 (Sized_relobj::write_sections): Likewise.
14220 (Sized_relobj::relocate_sections): Likewise.
14221 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14222 * output.h (class Output_reloc): Update declarations. Change
14223 u2_.relobj to Sized_relobj*.
14224 (class Output_data_reloc): Change add functions to use
14225 Sized_relobj*.
14226 * output.cc (Output_reloc::Output_reloc): Change relobj to
14227 Sized_relobj*.
14228 (Output_reloc::local_section_offset): Change return type to
14229 Elf_Addr. Use get_output_section_offset.
14230 (Output_reloc::get_address): Likewise.
14231 (Output_section::is_input_address_mapped): Don't call
14232 is_section_specially_mapped.
14233 (Output_section::output_offset): Likewise.
14234 (Output_section::output_address): Likewise.
14235 (Output_section::starting_output_address): Likewise.
14236 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14237 parameter to Sized_relobj*.
14238 (Copy_relocs::need_copy_reloc): Likewise.
14239 (Copy_relocs::save): Likewise.
14240 * copy-relocs.h (class Copy_relocs): Update declarations.
14241 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14242 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14243 * target-reloc.h (relocate_for_relocatable): Change
14244 offset_in_output_section type to Elf_Addr. Change code that uses
14245 it as well.
14246 * layout.cc (Layout::layout): Always set *off.
14247 * mapfile.cc (Mapfile::print_input_section): Use
14248 output_section_offset.
14249 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14250 Sized_relobj*.
14251 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14252 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14253 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14254
5cb66f97
ILT
142552008-07-03 Ian Lance Taylor <iant@google.com>
14256
14257 * layout.cc (Layout::include_section): Do not discard unrecognized
14258 SHT_STRTAB sections.
14259
afe47622
CS
142602008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14261
14262 * script.cc (Lex::can_continue_name): Make '?' allowable in
14263 version-script names.
14264 * testsuite/version_script.map: Change glob pattern to use '?'
14265
5adf9721
ILT
142662008-06-30 Manish Singh <yosh@gimp.org>
14267
14268 PR 6585
14269 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14270 Correct typo.
14271
e6fde208
ILT
142722008-06-30 Ian Lance Taylor <iant@google.com>
14273
14274 PR 6660
14275 PR 6682
14276 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14277 versions]: Don't try to read the value in the contents, since we
14278 don't use it. Use the template endianness when writing.
14279
3f2e6a2d
CC
142802008-06-25 Cary Coutant <ccoutant@google.com>
14281
14282 * fileread.cc (File_read::make_view): Assert on zero-length view.
14283 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14284 symbol table when there are no symbols to read.
14285
c43d3a48
CS
142862008-06-23 Craig Silverstein <csilvers@google.com>
14287
14288 * version.cc (version_string): Bump to 1.7
14289
5f494ea0
CS
142902008-06-18 Craig Silverstein <csilvers@google.com>
14291
14292 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14293 constant 0xFFFF to type Valtype.
14294 (Powerpc_relocate_functions::rel16_ha): Likewise.
14295
c42e122e
ILT
142962008-06-17 Ian Lance Taylor <iant@google.com>
14297
f34787f8
ILT
14298 * output.h (Output_section::Input_section): Initialize p2align_ to
14299 zero for Output_section_data constructors.
14300 (Output_section::Input_section::addralign): If not an input
14301 section, return the alignment of the Output_section_data.
14302 * testsuite/copy_test.cc: New file.
14303 * testsuite/copy_test_1.cc: New file.
14304 * testsuite/copy_test_2.cc: New file.
14305 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14306 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14307 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14308 (copy_test_1_pic.o, copy_test_1.so): New targets.
14309 (copy_test_2_pic.o, copy_test_2.so): New targets.
14310 * testsuite/Makefile.in: Rebuild.
14311
c42e122e
ILT
14312 * script-sections.cc (Script_sections::place_orphan): Initialize
14313 local variable exact.
14314
ce3ac18a
DE
143152008-06-13 David Edelsohn <edelsohn@gnu.org>
14316
14317 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14318
42cacb20
DE
143192008-06-12 David Edelsohn <edelsohn@gnu.org>
14320 David S. Miller <davem@davemloft.net>
14321
14322 * powerpc.cc: New file.
14323 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14324 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14325 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14326 * Makefile.in: Rebuild.
14327
7b308235
ILT
143282008-06-09 Ian Lance Taylor <iant@google.com>
14329
14330 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14331 <exception>.
14332 (throwing, orig_terminate): New static variables.
14333 (terminate_handler): New static function.
14334 (t2): Set terminate handler.
14335
f0b886e3
ILT
143362008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14337
14338 PR 6584
cd536b21 14339 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14340 alignment.
14341
3e90f135
CC
143422008-05-30 Cary Coutant <ccoutant@google.com>
14343
14344 * archive.cc (Archive::include_all_members) Correct to step
14345 over symbol table and extended name table in thin archives.
14346
e09ad04a
ILT
143472008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14348
14349 PR 6407
14350 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14351 calculation.
14352
62b01cb5
ILT
143532008-05-28 Caleb Howe <cshowe@google.com>
14354
14355 * reduced_debug_output.cc: New file.
14356 * reduced_debug_output.h: New file.
92de84a6 14357 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14358 * options.cc (General_options::finalize): Add strip_debug_non_line
14359 to the strip heirarchy.
14360 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14361 fields.
14362 * layout.cc: Include "reduced_debug_output.h".
14363 (Layout::Layout): Initialize new fields.
14364 (line_only_debug_sections): New static array.
14365 (is_lines_only_debug_sections): New static inline function.
14366 (Layout::include_section): Handle --strip-debug-non-line.
14367 (Layout::make_output_section): If --strip-debug-non-line, build
14368 new output sections for .debug_abbrev and .debug_info.
14369 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14370 gold. Warn about possible overflow.
14371 (read_signed_LEB_128): Likewise.
14372 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14373 (read_signed_LEB_128): Declare.
14374 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14375 (HFILES): Add reduced_debug_output.h.
14376 * Makefile.in: Rebuild.
14377
7d9e3d98
ILT
143782008-05-21 Ian Lance Taylor <iant@google.com>
14379
14380 * mapfile.cc: New file.
14381 * mapfile.h: New file.
14382 * options.h (class General_options): Add -M/--print-map and -Map.
14383 * options.cc (General_options::finalize): Make -M equivalent to
14384 -Map -.
14385 * main.cc: Include <cstdio> and "mapfile.h".
14386 (main): Open mapfile if requested.
14387 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14388 constructor. Change caller.
14389 (queue_initial_tasks): Add mapfile parameter. Change caller.
14390 (queue_middle_tasks): Likewise.
14391 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14392 declarations.
14393 * archive.cc: Include "mapfile.h".
14394 (Archive::add_symbols): Add mapfile parameter. Change all
14395 callers. Pass mapfile, symbol, and reason to include_member.
14396 (Archive::include_all_members): Add mapfile parameter. Change all
14397 callers.
14398 (Archive::include_member): Add mapfile, sym, and why parameters.
14399 Change all callers. Report inclusion to map file.
14400 * archive.h: Include "fileread.h".
14401 (class Archive): Update declarations.
14402 (Archive::file): New const method.
14403 (class Add_archive_symbols): Add mapfile_ field. Update
14404 constructor. Change all callers.
14405 * readsyms.h (class Read_symbols): Likewise.
14406 (class Finish_group): Likewise.
14407 (class Read_script): Likewise.
14408 * common.cc: Include "mapfile.h".
14409 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14410 all callers.
14411 (Symbol_table::do_allocate_commons): Likewise.
14412 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14413 symbol allocation to mapfile.
14414 * common.h (class Allocate_commons_task): Add mapfile_ field.
14415 Update constructor. Change all callers.
14416 * symtab.h (class Symbol_table): Update declarations.
14417 * layout.cc: Include "mapfile.h".
14418 (Layout_task_runner::run): Print information to mapfile.
14419 (Layout::create_gold_note): Change Output_data_fixed_space to
14420 Output_data_zero_fill.
14421 (Layout::create_build_id): Likewise.
14422 (Layout::print_to_mapfile): New function.
14423 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14424 constructor. Change caller.
14425 (class Layout): Declare print_to_mapfile.
14426 * output.cc (Output_section::Input_section::print_to_mapfile): New
14427 function.
14428 (Output_section::add_input_section): If producing a map, always
14429 add to input_sections_ list.
14430 (Output_section::do_print_to_mapfile): New function.
14431 (Output_segment::print_sections_to_mapfile): New function.
14432 (Output_segment::print_section_list_to_mapfile): New function.
14433 * output.h: Include "mapfile.h".
14434 (Output_data::print_to_mapfile): New function.
14435 (Output_data::do_print_to_mapfile): New virtual function.
14436 (Output_segment_headers::do_print_to_mapfile): New function.
14437 (Output_file_header::do_print_to_mapfile): New function.
14438 (Output_data_const::do_print_to_mapfile): New function.
14439 (class Output_data_const_buffer): Add map_name_ field. Update
14440 constructor. Change all callers. Add do_print_to_mapfile
14441 function.
14442 (class Output_data_fixed_space): Likewise.
14443 (class Output_data_space): Likewise.
14444 (class Output_data_zero_fill): New class.
14445 (Output_data_strtab::do_print_to_mapfile): New function.
14446 (Output_data_reloc_base::do_print_to_mapfile): New function.
14447 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14448 (Output_data_group::do_print_to_mapfile): New function.
14449 (Output_data_got::do_print_to_mapfile): New function.
14450 (Output_data_dynamic::do_print_to_mapfile): New function.
14451 (Output_symtab_xindex::do_print_to_mapfile): New function.
14452 (class Output_section): Declare do_print_to_mapflie. Declare
14453 print_to_mapfile in Input_section.
14454 (class Output_segment): Declare new functions.
14455 * object.h (Sized_relobj::symbol_count): New function.
14456 * script-sections.cc
14457 (Output_section_element_dot_assignment::set_section_addresses):
14458 Change Output_data_fixed_space to Output_data_zero_fill.
14459 (Output_data_expression::do_print_to_mapfile): New function.
14460 * script.cc (read_input_script): Add mapfile parameter. Change
14461 all callers.
14462 * script.h (read_input_script): Update declaration.
14463 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14464 (Eh_frame::do_print_to_mapfile): New function.
14465 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14466 (Output_merge_string::do_print_to_mapfile): New function.
14467 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14468 function.
14469 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14470 function.
14471 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14472 function.
14473 * Makefile.am (CCFILES): Add mapfile.cc.
14474 (HFILES): Add mapfile.h.
14475 * Makefile.in: Rebuild.
14476
9f1d377b
ILT
144772008-05-19 Ian Lance Taylor <iant@google.com>
14478
14479 * options.h (class General_options): Add -z relro.
14480 * layout.cc (Layout::Layout): Initialize relro_segment_.
14481 (Layout::add_output_section_data): Return the output section.
14482 (Layout::make_output_section): Rcognize relro sections and mark
14483 them appropriately.
14484 (Layout::attach_allocated_section_to_segment): Put relro sections
14485 in a PT_GNU_RELRO segment.
14486 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14487 section as relro.
14488 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14489 PT_TLS segments.
14490 (Layout::linkonce_mapping): Map d.rel.ro.local to
14491 .data.rel.ro.local.
14492 (Layout::output_section_name): Us .data.rel.ro.local for any
14493 section which begins with that.
14494 * layout.h (class Layout): Update add_output_section_data
14495 declaration. Add relro_segment_ field.
14496 * output.cc (Output_section::Output_section): Initialize is_relro_
14497 and is_relro_local_ fields.
14498 (Output_segment::add_output_section): Group relro sections.
14499 (Output_segment::is_first_section_relro): New function.
14500 (Output_segment::maximum_alignment): If there is a relro section,
14501 align the segment to the common page size.
14502 (Output_segment::set_section_addresses): Track whether we are
14503 looking at relro sections. If the last section is a relro
14504 section, align to the common page size.
14505 (Output_segment::set_section_list_addresses): Add in_relro
14506 parameter. Change all callers. Align to the page size when
14507 moving from relro to non-relro section.
14508 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14509 segment.
14510 * output.h (class Output_section): Add is_relro_ and
14511 is_relro_local_ fields.
14512 (Output_section::is_relro): New function.
14513 (Output_section::set_is_relro): New function.
14514 (Output_section::is_relro_local): New function.
14515 (Output_section::set_is_relro_local): New function.
14516 (class Output_segment): Update declarations.
14517 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14518 * sparc.cc (Target_sparc::got_section): Likewise.
14519 * x86_64.cc (Target_x86_64::got_section): Likewise.
14520 * testsuite/relro_test_main.cc: New file.
14521 * testsuite/relro_test.cc: New file.
14522 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14523 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14524 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14525 (relro_test.so, relro_test_pic.o): New targets.
14526 * testsuite/Makefile.in: Rebuild.
14527
a984ee1d
ILT
145282008-05-16 Ian Lance Taylor <iant@google.com>
14529
01676dcd
ILT
14530 * output.cc (Output_segment::add_output_section): Remove front
14531 parameter.
14532 * output.h (class Output_segment): Remove
14533 add_initial_output_section and overloaded add_output_section.
14534 Update declaration of remaining add_output_section.
14535 * layout.cc (Layout::create_interp): Call add_output_section
14536 rather than add_initial_output_section.
14537 (Layout::finish_dynamic_section): Likewise.
14538
497897f9
ILT
14539 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14540 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14541 know the dynamic type.
14542 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14543 field. Initialize it in constructor.
14544 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14545 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14546 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14547 reloc.
14548
a984ee1d
ILT
14549 * output.cc (Output_reloc::get_address): Change return type to
14550 Elf_Addr.
14551 * output.h (class Output_reloc): Update get_address declaration.
14552 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14553 for section addresses.
14554
55ba0940
ILT
145552008-05-09 Ian Lance Taylor <iant@google.com>
14556
14557 PR 6493
14558 * gold.cc (gold_nomem): Use return value of write.
14559
75517b77
ILT
145602008-05-08 Ian Lance Taylor <iant@google.com>
14561
14562 * symtab.c (Symbol::init_base_output_data): Add version
14563 parameter. Change all callers.
14564 (Symbol::init_base_output_segment): Likewise.
14565 (Symbol::init_base_constant): Likewise.
14566 (Symbol::init_base_undefined): Likewise.
14567 (Sized_symbol::init_output_data): Likewise.
14568 (Sized_symbol::init_output_segment): Likewise.
14569 (Sized_symbol::init_constant): Likewise.
14570 (Sized_symbol::init_undefined): Likewise.
14571 (Symbol_table::do_define_in_output_data): If the new symbol has a
14572 version, mark it as the default.
14573 (Symbol_table::do_define_in_output_segment): Likewise.
14574 (Symbol_table::do_define_as_constant): Likewise.
14575 * symtab.h (class Symbol): Update declarations.
14576 (class Sized_symbol): Likewise.
14577 * resolve.cc (Symbol::override_version): New function.
c42e122e 14578 (Symbol::override_base): Call override_version.
75517b77
ILT
14579 (Symbol::override_base_with_special): Likewise.
14580 * testsuite/ver_script_8.script: New file.
14581 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14582 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14583 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14584 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14585
f1f70eae
ILT
145862008-05-06 Ian Lance Taylor <iant@google.com>
14587
f3e9c5c5
ILT
14588 PR 6049
14589 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14590 functions.
14591 (class General_options): Remove existing --undefined, and add
14592 --no-undefined instead. Add new --undefined as synonym for -u.
14593 * archive.cc (Archive::add_symbols): Check whether symbol was
14594 named with -u.
14595 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14596 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14597 all uses. Add IS_UNDEFINED. Update declarations to split
14598 different versions of init_base. Declare init_base_undefined.
14599 (Symbol::is_defined): Handle IS_UNDEFINED.
14600 (Symbol::is_undefined): Likewise.
14601 (Symbol::is_weak_undefined): Call is_undefined.
14602 (Symbol::is_absolute): Handle IS_CONSTANT.
14603 (class Sized_symbol): Update declarations to split different
14604 versions of init. Declare init_undefined.
14605 (class Symbol_table): Declare new functions.
14606 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14607 Change all callers.
14608 (Symbol::init_base_output_data): Likewise.
14609 (Symbol::init_base_output_segment): Likewise.
14610 (Symbol::init_base_constant): Likewise.
14611 (Symbol::init_base_undefined): New function.
14612 (Sized_symbol::init_object): Rename from init. Change all
14613 callers.
14614 (Sized_symbol::init_output_data): Likewise.
14615 (Sized_symbol::init_output_segment): Likewise.
14616 (Sized_symbol::init_constant): Likewise.
14617 (Sized_symbol::init_undefined): New function.
14618 (Symbol_table::add_undefined_symbols_from_command_line): New
14619 function.
14620 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14621 function.
14622 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14623 (Symbol::output_section): Likewise.
14624 (Symbol::set_output_section): Likewise.
14625 (Symbol_table::sized_finalize_symbol): Likewise.
14626 (Symbol_table::sized_write_globals): Likewise.
14627 * resolve.cc (Symbol_table::should_override): Likewise.
14628 (Symbol::override_base_with_special): Likewise.
14629
8bdcdf2c
ILT
14630 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14631 symbol, change it to have default visibility.
14632 * testsuite/protected_1.cc: New file.
14633 * testsuite/protected_2.cc: New file.
14634 * testsuite/protected_3.cc: New file.
14635 * testsuite/protected_main_1.cc: New file.
14636 * testsuite/protected_main_2.cc: New file.
14637 * testsuite/protected_main_3.cc: New file.
14638 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14639 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14640 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14641 (protected_1.so): New target.
14642 (protected_1_pic.o, protected_2_pic.o): New targets.
14643 (protected_3_pic.o): New target.
14644 (check_PROGRAMS): Add protected_2.
14645 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14646 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14647 * testsuite/Makefile.in: Rebuild.
14648
2b706932
ILT
14649 * options.h (DEFINE_var): Add set_user_set_##varname__.
14650 (DEFINE_bool_alias): New macro.
14651 (class General_options): Define -Bstatic using DEFINE_bool_alias
14652 rather than DEFINE_special. Add --undefined as an alias for -z
14653 defs.
14654 * options.cc (General_options::parse_Bstatic): Remove.
14655
d82a5bcc
ILT
14656 * options.h (class General_options): Add --fatal-warnings.
14657 * main.cc (main): Implement --fatal-warnings.
14658 * errors.h (Errors::warning_count): New function.
14659
f1f70eae
ILT
14660 * options.h (class General_options): Add -Bsymbolic-functions.
14661 * symtab.h (Symbol::is_preemptible): Check for
14662 -Bsymbolic-functions.
14663
8825ac63
ILT
146642008-05-05 Ian Lance Taylor <iant@google.com>
14665
d98bc257
ILT
14666 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14667 as noVARNAME rather than no-VARNAME.
14668 (class General_options): Add option -z combreloc.
14669 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14670 get_address.
14671 (Output_reloc::sort_before) [SHT_REL]: New function.
14672 (Output_reloc::sort_before) [SHT_RELA]: New function.
14673 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14674 Sort_relocs_comparison.
14675 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14676 parameter. Change all callers.
14677 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14678 sort_relocs parameter. Change all callers.
14679 * output.cc (Output_reloc::get_address): New function, broken out
14680 of write_rel.
14681 (Output_reloc::write_rel): Call it.
14682 (Output_reloc::compare): New function.
14683 (Output_data_reloc_base::do_write): Optionally sort relocs.
14684
60b2b4e7
ILT
14685 * configure.ac: If targ_extra_obj is set, link it in.
14686 * configure.tgt: Initialize all variables.
14687 (x86_64*): Set targ_extra_obj and targ_extra_size.
14688 * configure: Rebuild.
14689
8825ac63
ILT
14690 * object.cc (Sized_relobj::include_section_group): Adjust section
14691 indexes read from group data. Build vector to pass to
14692 layout_group.
14693 * layout.cc (Layout::layout_group): Add flags and shndxes
14694 parameters. Remove contents parameter. Change caller. Update
14695 explicit instantiations.
14696 * layout.h (class Layout): Update layout_group declaration.
14697 * output.cc (Output_data_group::Output_data_group): Add flags and
14698 input_shndxes parameters. Remove contents parameter. Change
14699 caller.
14700 (Output_data_group::do_write): Change input_sections_ to
14701 input_shndxes_.
14702 * output.h (class Output_data_group): Update constructor
14703 declaration. Rename input_sections_ to input_shndxes_.
14704 * testsuite/many_sections_test.cc: Add template.
14705
e94cf127
CC
147062008-04-30 Cary Coutant <ccoutant@google.com>
14707
4418b2d5
CC
14708 * target-reloc.h (relocate_section): Fix dead-pointer bug.
14709
e94cf127
CC
14710 * layout.cc (Layout::include_section): Refactored check for debug
14711 info section.
14712 (Layout::add_comdat): Add new parameters. Change type
14713 of signature parameter. Add object and shndx to signatures table.
14714 (Layout::find_kept_object): New function.
14715 * layout.h: Include <cstring>.
14716 (Layout::is_debug_info_section): New function.
14717 (Layout::add_comdat): Add new parameters.
14718 (Layout::find_kept_object): New function.
14719 (Layout::Kept_section): New struct.
14720 (Layout::Signatures): Change type of map range.
14721 * object.cc (Relobj::output_section_address): New function.
14722 (Sized_relobj::include_section_group): Add new parameters. Change
14723 calls to Layout::add_comdat. Change to build table of kept comdat
14724 groups and table mapping discarded sections to kept sections.
14725 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
14726 (Sized_relobj::do_layout): Change calls to include_section_group and
14727 include_linkonce_section.
14728 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
14729 value to zero when section is discarded.
14730 (Sized_relobj::map_to_kept_section): New function.
14731 * object.h (Relobj::output_section_address): New function.
14732 (Relobj::Comdat_group): New type.
14733 (Relobj::find_comdat_group): New function.
14734 (Relobj::Comdat_group_table): New type.
14735 (Relobj::Kept_comdat_section): New type.
14736 (Relobj::Kept_comdat_section_table): New type.
14737 (Relobj::add_comdat_group): New function.
14738 (Relobj::set_kept_comdat_section): New function.
14739 (Relobj::get_kept_comdat_section): New function.
14740 (Relobj::comdat_groups_): New field.
14741 (Relobj::kept_comdat_sections_): New field.
14742 (Symbol_value::input_value): Update comment.
14743 (Sized_relobj::map_to_kept_section) New function.
14744 (Sized_relobj::include_linkonce_section): Add new parameter.
14745 * target-reloc.h (Comdat_behavior): New type.
14746 (get_comdat_behavior): New function.
14747 (relocate_section): Add code to map a discarded section to the
14748 corresponding kept section when applying a relocation.
14749
e4e5049b
CS
147502008-04-30 Craig Silverstein <csilvers@google.com>
14751
14752 * dwarf_reader.cc (next_generation_count): New static var.
14753 (Addr2line_cache_entry): New struct.
14754 (addr2line_cache): New static var.
14755 (Dwarf_line_info::one_addr2line): Added caching.
14756 (Dwarf_line_info::clear_addr2line_cache): New function.
14757 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
14758 cache-size parameter.
14759 (Dwarf_line_info::one_addr2line_cache): New function.
14760 * symtab.cc (Symbol_table::detect_odr_violations): Pass
14761 new cache-size argument to one_addr2line(), and clear cache.
14762
d09e9154
CC
147632008-04-28 Cary Coutant <ccoutant@google.com>
14764
14765 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
14766 R_386_PC8 relocations.
14767
7ef73768
ILT
147682008-04-23 Ian Lance Taylor <iant@google.com>
14769
55438702
ILT
14770 * object.cc (Sized_relobj::include_section_group): Check for
14771 invalid section group.
14772
c165fb93
ILT
14773 * object.cc (make_elf_object): Correct test for 64-bit ELF file
14774 header size.
14775
7ef73768
ILT
14776 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
14777 than read for file header.
14778 * archive.cc (Archive::include_member): Likewise.
14779
6194aaab
L
147802008-04-23 Paolo Bonzini <bonzini@gnu.org>
14781
14782 * aclocal.m4: Regenerate.
14783 * configure: Regenerate.
14784
d491d34e
ILT
147852008-04-19 Ian Lance Taylor <iant@google.com>
14786
5ea2bac6
ILT
14787 * version.cc (version_string): Bump to 1.6.
14788
7bc3e21a
ILT
14789 * testsuite/Makefile.am (many_sections_r_test): New target.
14790 (many_sections_r_test_SOURCES): Remove.
14791 (many_sections_r_test_DEPENDENCIES): Remove.
14792 (many_sections_r_test_LDFLAGS): Remove.
14793 (many_sections_r_test_LDADD): Remove.
14794
7fcd3aa9
ILT
14795 * object.cc (Sized_relobj::do_add_symbols): Always pass
14796 local_symbol_count_ to add_from_relobj.
14797
4c94d6ae
ILT
14798 * testsuite/Makefile.am (many_sections_check.h): Only check one in
14799 every thousand variables.
14800 * testsuite/Makefile.in: Rebuild.
14801
d491d34e
ILT
14802 * object.cc (Xindex::initialize_symtab_xindex): New function.
14803 (Xindex::read_symtab_xindex): New function.
14804 (Xindex::sym_xindex_to_shndx): New function.
14805 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
14806 available.
14807 (Sized_relobj::do_initialize_xindex): New function.
14808 (Sized_relobj::do_read_symbols): Adjust section links.
14809 (Sized_relobj::symbol_section_and_value): Add is_ordinary
14810 parameter. Change all callers.
14811 (Sized_relobj::include_section_group): Adjust section links and
14812 symbol section indexes.
14813 (Sized_relobj::do_layout): Adjust section links.
14814 (Sized_relobj::do_count_local_symbols): Adjust section links and
14815 symbol section indexes.
14816 (Sized_relobj::do_finalize_local_symbols): Distinguish between
14817 ordinary and special symbols.
14818 (Sized_relobj::write_local_symbols): Add symtab_xindex and
14819 dynsym_xindex parameters. Change all callers. Adjust section
14820 links. Use SHN_XINDEX when needed.
14821 (Sized_relobj::get_symbol_location_info): Adjust section links.
14822 Don't get fooled by special symbols.
14823 * object.h (class Xindex): Define.
14824 (class Object): Add xindex_ parameter. Declare virtual functoin
14825 do_initialize_xindex.
14826 (Object::adjust_sym_shndx): New function.
14827 (Object::set_xindex): New protected function.
14828 (class Symbol_value): Add is_ordinary_shndx_ field.
14829 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
14830 (Symbol_value::value): Assert ordinary section.
14831 (Symbol_value::initialize_input_to_output_map): Likewise.
14832 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
14833 Change all callers.
14834 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
14835 all callers.
14836 (class Sized_relobj): Update declarations.
14837 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
14838 parameter. Change all callers.
14839 (Sized_relobj::adjust_shndx): New function.
14840 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
14841 field.
14842 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
14843 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
14844 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
14845 (Sized_dynobj::read_dynsym_section): Adjust section links.
14846 (Sized_dynobj::read_dynamic): Likewise.
14847 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
14848 section links.
14849 (Sized_dynobj::do_initialize_xindex): New function.
14850 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
14851 do_initialize_xindex.
14852 (Sized_dynobj::adjust_shndx): New function.
14853 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
14854 dynsym_xindex_ fields.
14855 (Layout::finalize): Add a call to set_section_indexes before
14856 creating the symtab sections.
14857 (Layout::set_section_indexes): Don't do anything if the section
14858 already has a section index.
14859 (Layout::create_symtab_sections): Add shnum parameter. Change
14860 caller. Create .symtab_shndx section if needed.
14861 (Layout::create_shdrs): Add shstrtab_section parameter. Change
14862 caller.
14863 (Layout::allocated_output_section_count): New function.
14864 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
14865 needed.
14866 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
14867 fields. Update declarations.
14868 (Layout::symtab_xindex): New function.
14869 (Layout::dynsym_xindex): New function.
14870 (class Write_symbols_task): Add layout_ field.
14871 (Write_symbols_task::Write_symbols_task): Add layout parameter.
14872 Change caller.
14873 * output.cc (Output_section_headers::Output_section_headers): Add
14874 shstrtab_section parameter. Change all callers.
14875 (Output_section_headers::do_sized_write): Store overflow values
14876 for section count and section string table section index in
14877 section header zero.
14878 (Output_file_header::do_sized_write): Check for overflow of
14879 section count and section string table section index.
14880 (Output_symtab_xindex::do_write): New function.
14881 (Output_symtab_xindex::endian_do_write): New function.
14882 * output.h (class Output_section_headers): Add shstrtab_section_.
14883 Update declarations.
14884 (class Output_symtab_xindex): Define.
14885 (Output_section::has_out_shndx): New function.
14886 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
14887 field.
14888 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
14889 Change all callers.
14890 (Sized_symbol::init): Likewise.
14891 (Symbol::output_section): Check for ordinary symbol.
14892 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
14893 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
14894 callers.
14895 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
14896 Change all callers. Simplify handling of symbols from sections
14897 not included in the link.
14898 (Symbol_table::add_from_dynobj): Handle ordinary symbol
14899 distinction.
14900 (Weak_alias_sorter::operator()): Assert that symbols are
14901 ordinary.
14902 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14903 distinction.
14904 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14905 parameters. Change all callers.
14906 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14907 symbol distinction. Use SHN_XINDEX when needed.
14908 (Symbol_table::write_section_symbol): Add symtab_xindex
14909 parameter. Change all callers.
14910 (Symbol_table::sized_write_section_symbol): Likewise. Use
14911 SHN_XINDEX when needed.
14912 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14913 declarations.
14914 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14915 (Symbol::is_defined): Check is_ordinary.
14916 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14917 (Symbol::is_absolute, Symbol::is_common): Likewise.
14918 (class Sized_symbol): Update declarations.
14919 (class Symbol_table): Update declarations.
14920 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14921 parameters. Change all callers.
14922 (Sized_symbol::override): Likewise.
14923 (Symbol_table::override): Likewise.
14924 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14925 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14926 is_ordinary, and orig_st_shndx parameters. Change all callers.
14927 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14928 to be in an ordinary section.
14929 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14930 object and is_ordinary parameters. Change all callers.
14931 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14932 Change all callers. Don't add undefined or non-ordinary symbols
14933 to reloc_map_.
14934 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
14935 Change all callers.
14936 * dwarf_reader.h (class Sized_dwarf_line_info): Update
14937 declarations.
14938 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
14939 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
14940 (Sized_relobj::relocate_sections): Likewise.
14941 * target-reloc.h (scan_relocs): Adjust section symbol index.
14942 (scan_relocatable_relocs): Likewise.
14943 * i386.cc (Scan::local): Check for ordinary symbols.
14944 * sparc.cc (Scan::local): Likewise.
14945 * x86_64.cc (Scan::local): Likewise.
14946 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
14947 to symbol_section_and_value.
14948 * testsuite/many_sections_test.cc: New file.
14949 * testsuite/Makefile.am (BUILT_SOURCES): Define.
14950 (check_PROGRAMS): Add many_sections_test.
14951 (many_sections_test_SOURCES): Define.
14952 (many_sections_test_DEPENDENCIES): Define.
14953 (many_sections_test_LDFLAGS): Define.
14954 (BUILT_SOURCES): Add many_sections_define.h.
14955 (many_sections_define.h): New target.
14956 (BUILT_SOURCES): Add many_sections_check.h.
14957 (many_sections_check.h): New target.
14958 (check_PROGRAMS): Add many_sections_r_test.
14959 (many_sections_r_test_SOURCES): Define.
14960 (many_sections_r_test_DEPENDENCIES): Define.
14961 (many_sections_r_test_LDFLAGS): Define.
14962 (many_sections_r_test_LDADD): Define.
14963 (many_sections_r_test.o): New target.
14964 * testsuite/Makefile.in: Rebuild.
14965
c5818ff1
CC
149662008-04-17 Cary Coutant <ccoutant@google.com>
14967
14968 * errors.cc (Errors::info): New function.
14969 (gold_info): New function.
14970 * errors.h (Errors::info): New function.
14971 * gold.h (gold_info): New function.
14972 * object.cc (Input_objects::add_object): Print trace output.
14973 * options.cc (options::parse_set): New function.
14974 (General_options::parse_wrap): Deleted.
14975 (General_options::General_options): Deleted initializer.
14976 * options.h (options::String_set): New typedef.
14977 (options::parse_set): New function.
14978 (DEFINE_set): New macro.
14979 (General_options::wrap): Changed to use DEFINE_set. Changed
14980 callers of any_wrap_symbols and is_wrap_symbol.
14981 (General_options::trace, General_options::trace_symbol):
14982 New options.
14983 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
14984 (General_options::wrap_symbols_): Deleted.
14985 * symtab.cc (Symbol_table::add_from_object): Print trace output.
14986
b5be4a7c
DM
149872008-04-17 David S. Miller <davem@davemloft.net>
14988
14989 * options.cc (General_options::parse_V): New function.
14990 * options.h: Add entries for -V and -Qy.
14991
155a0dd7
ILT
149922008-04-17 Ian Lance Taylor <iant@google.com>
14993
14994 * common.cc (Symbol_table::allocate_commons): Remove options
14995 parameter. Change caller.
14996 (Symbol_table::do_allocate_commons): Remove options parameter.
14997 Change caller. Just call do_allocate_commons_list twice.
14998 (Symbol_table::do_allocate_commons_list): New function, broken out
14999 of do_allocate_commons.
15000 * common.h (class Allocate_commons_task): Remove options_ field.
15001 Update constructor.
15002 * symtab.cc (Symbol_table::Symbol_table): Initialize
15003 tls_commons_.
15004 (Symbol_table::add_from_object): Put TLS common symbols on
15005 tls_commons_ list.
15006 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15007 which are IN_OUTPUT_DATA.
15008 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15009 allocate_commons and do_allocate_commons declarations. Declare
15010 do_allocate_commons_list.
15011 * gold.cc (queue_middle_tasks): Update creation of
15012 Allocate_commons_task to not pass options.
15013 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15014 (TLS_TEST_C_FLAGS): New variable.
15015 (tls_test_c_pic.o): New target.
15016 (tls_test_shared.so): Link in tls_test_c_pic.o.
15017 (tls_test_c_pic_ie.o): New target.
15018 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15019 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15020 (tls_test_c.o): New target.
15021 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15022 (tls_pic_test_LDADD): Likewise.
15023 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15024 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15025 (tls_test_c_gnu2.o): New target.
15026 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15027 tls_test_c_gnu2.o.
15028 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15029 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15030 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15031 * testsuite/tls_test.cc: Include "config.h".
15032 (t_last): Call t11_last.
15033 * testsuite/tls_test.h (t11, t11_last): Declare.
15034 * testsuite/tls_test_c.c: New file.
15035 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15036 * configure.ac: Check for OpenMP support.
15037 * configure, config.in, Makefile.in: Rebuild.
15038 * testsuite/Makefile.in: Rebuild.
15039
edfbb029
CC
150402008-04-16 Cary Coutant <ccoutant@google.com>
15041
15042 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15043 (Target_i386::tls_base_symbol_defined_): New field.
15044 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15045 (Target_i386::Scan::global): Likewise.
15046 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15047 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15048 (Target_x86_64::tls_base_symbol_defined_): New field.
15049 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15050 (Target_x86_64::Scan::global): Likewise.
15051
f3c69fca
CC
150522008-04-16 Cary Coutant <ccoutant@google.com>
15053
15054 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15055 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15056 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15057 building shared libraries.
15058 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15059 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15060 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15061 * testsuite/Makefile.in: Rebuild.
15062 * testsuite/weak_undef.h: New file.
15063 * testsuite/weak_undef_file1.cc: Add extra test cases.
15064 * testsuite/weak_undef_file2.cc: Likewise.
15065 * testsuite/weak_undef_test.cc: Likewise.
15066
7c414435
DM
150672008-04-16 David S. Miller <davem@davemloft.net>
15068
32b769e1
DM
15069 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15070 Add issued_non_pic_error_ field. Declare check_non_pic.
15071 (Target_sparc::Scan::check_non_pic): New function.
15072 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15073 (Target_sparc::Scan::global): Likewise.
15074
11936fb1
DM
15075 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15076 * configure: Rebuild.
15077
7c414435
DM
15078 * options.h (DEFINE_enable): New macro.
15079 (new_dtags): New enable option.
15080 (initfirst, interpose, loadfltr, nodefaultlib,
15081 nodelete, nodlopen, nodump): New -z options.
15082 * layout.cc (Layout:finish_dynamic_section): If new
15083 dtags enabled, emit DT_RUNPATH. Also, emit a
15084 DT_FLAGS_1 containing any specified -z flags.
15085
85c7bf8b
ILT
150862008-04-16 Ian Lance Taylor <iant@google.com>
15087
12c0daef
ILT
15088 * copy-relocs.cc: New file.
15089 * copy-relocs.h: New file.
15090 * reloc.cc: Remove Copy_relocs code.
15091 * reloc.h: Likewise.
15092 * reloc-types.h (struct Reloc_types) [both versions]: Add
15093 get_reloc_addend_noerror.
15094 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15095 variants of add_global which take an addend which must be zero.
15096 * i386.cc: Include "copy-relocs.h".
15097 (class Target_i386): Change type of copy_relocs_ to variable,
15098 update initializer.
15099 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15100 Change all callers.
15101 (Target_i386::do_finalize_sections): Change handling of
15102 copy_relocs_.
15103 * sparc.cc: Include "copy-relocs.h".
15104 (class Target_sparc): Change type of copy_relocs_ to variable,
15105 update initializer.
15106 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15107 Change all callers.
15108 (Target_sparc::do_finalize_sections): Change handling of
15109 copy_relocs_.
15110 * x86_64.cc: Include "copy-relocs.h".
15111 (class Target_x86_64): Change type of copy_relocs_ to variable,
15112 update initializer.
15113 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15114 class. Change all callers.
15115 (Target_x86_64::do_finalize_sections): Change handling of
15116 copy_relocs_.
15117 * Makefile.am (CCFILES): Add copy-relocs.cc.
15118 (HFILES): Add copy-relocs.h.
15119
4f4995b6
ILT
15120 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15121
85c7bf8b
ILT
15122 * testsuite/script_test_4.sh: Permit leading zeroes.
15123
4f2a9edd
ILT
151242008-04-15 Ian Lance Taylor <iant@google.com>
15125
e6188289
ILT
15126 * script-sections.cc (Script_sections::create_segments): Use
15127 header_size_adjustment even when there is enough room for the
15128 headers.
15129 * testsuite/script_test_4.sh: New file.
15130 * testsuite/script_test_4.t: New file.
15131 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15132 (check_DATA): Add script_test_4.stdout.
15133 (MOSTLYCLEANFILES): Likewise.
15134 (script_test_4): New target.
15135 (script_test_4.stdout): New target.
15136 * testsuite/Makefile.in: Rebuild.
15137
4f2a9edd
ILT
15138 * sparc.cc: Add definitions for Output_data_plt_sparc class
15139 constants.
15140
f5314dd5
DM
151412008-04-14 David S. Miller <davem@davemloft.net>
15142
15143 * sparc.cc: New file.
15144 * Makefile.am (TARGETSOURCES): Add sparc.cc
15145 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15146 * configure.tgt: Document targ_extra_size and
15147 targ_extra_big_endian. Add entries for sparc-* and
15148 sparc64-*.
15149 * configure.ac: Handle targ_extra_size and
15150 targ_extra_big_endian.
15151 * Makefile.in: Rebuild.
15152 * configure: Likewise.
15153 * po/POTFILES.in: Likewise.
15154 * po/gold.pot: Likewise.
15155
154e0e9a
ILT
151562008-04-14 Ian Lance Taylor <iant@google.com>
15157
15158 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15159 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15160 in the name/type/flags to section mapping. Don't call
15161 allocate_output_section.
15162 (Layout::choose_output_section): Change parameter from adjust_name
15163 to is_input_section. Don't permit input sections after sections
15164 are attached to segments. Don't call allocate_output_section.
15165 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15166 not write_enable_output_section.
15167 (Layout::make_output_section): Don't push to
15168 unattached_section_list_ nor call attach_to_segment. Call
15169 attach_section_to_segment if sections are attached.
15170 (Layout::attach_sections_to_segments): New function.
15171 (Layout::attach_section_to_segment): New function.
15172 (Layout::attach_allocated_section_to_segment): Rename from
15173 attach_to_segment. Remove flags parameter.
15174 (Layout::allocate_output_section): Remove function.
15175 (Layout::write_enable_output_section): Remove function.
15176 * layout.h (class Layout): Update for above changes. Add new
15177 field sections_are_attached_.
15178 * output.h (Output_section::update_flags_for_input_section): New
15179 function.
15180 * output.cc (Output_section::add_input_section): Call
15181 update_flags_for_input_section.
15182 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15183
009a67a2
CC
151842008-04-11 Cary Coutant <ccoutant@google.com>
15185
15186 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15187 thought unnecessary.
15188 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15189
759b1a24
ILT
151902008-04-11 Ian Lance Taylor <iant@google.com>
15191
15192 * output.h (class Output_section_data): Remove inline definition
15193 of set_addralign.
15194 * output.cc (Output_section_data::set_addralign): New function.
15195
c2b45e22
CC
151962008-04-11 Cary Coutant <ccoutant@google.com>
15197
15198 Add support for TLS descriptors for i386 and x86_64.
15199 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15200 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15201 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15202 GOT_TYPE_TLS_DESC.
15203 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15204 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15205 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15206 relocations.
15207 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15208 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15209 Fix problem with initial-exec relocations.
15210 (Target_i386::Relocate::relocate_tls): Likewise.
15211 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15212 relaxation.
15213 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15214 support for section-plus-offset dynamic table entries.
15215 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15216 (Output_data_dynamic::Dynamic_entry): Add support for
15217 section-plus-offset dynamic table entries.
15218 (Output_data_dynamic::Classification): Likewise.
15219 (Output_data_dynamic::classification_): Renamed offset_.
15220 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15221 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15222 (Target_x86_64::make_plt_section): New function.
15223 (Target_x86_64::reserve_tlsdesc_entries): New function.
15224 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15225 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15226 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15227 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15228 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15229 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15230 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15231 add extra PLT entry for TLS descriptors.
15232 (Output_data_plt_x86_64::got_): New field.
15233 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15234 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15235 fields.
15236 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15237 descriptors.
15238 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15239 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15240 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15241 R_386_TLS_DESC_CALL relocations.
15242 (Target_x86_64::Scan::global): Likewise.
15243 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15244 for TLS descriptors.
15245 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15246 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15247 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15248 GD-to-IE relaxation.
15249 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15250 and TLS_DESCRIPTORS.
15251 * Makefile.in: Rebuild.
15252 * configure: Rebuild.
15253 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15254 (tls_test_shared2.so): New target.
15255 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15256 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15257 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15258 (tls_shared_gd_to_ie_test_LDADD): New variable.
15259 (tls_shared_gnu2_gd_to_ie_test): New target.
15260 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15261 New targets.
15262 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15263 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15264 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15265 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15266 (tls_shared_gnu2_test): New target.
15267 (tls_test_gnu2_shared.so): New target.
15268 (tls_shared_gnu2_test_SOURCES): New variable.
15269 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15270 (tls_shared_gnu2_test_LDFLAGS): New variable.
15271 (tls_shared_gnu2_test_LDADD): New variable.
15272 * testsuite/Makefile.in: Rebuild.
15273 * testsuite/Makefile.
15274
83bfb6b7
ILT
152752008-04-11 Ian Lance Taylor <iant@google.com>
15276
15277 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15278 justsyms.t.
15279 * testsuite/Makefile.in: Rebuild.
15280
15281 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15282 long.
15283 * testsuite/script_test_2.cc (main): Adjust test.
15284
706e1f5e
ILT
152852008-04-11 David S. Miller <davem@davemloft.net>
15286 Ian Lance Taylor <iant@google.com>
15287
15288 * options.h (General_options): Add entries for '-Y' and
15289 '-relax'.
15290 * options.cc (General_options:finalize): If -Y was used, add those
15291 entries to the library path instead of the default "/lib" and
15292 "/usr/lib".
15293
7c98e6bb
DM
152942008-04-11 David S. Miller <davem@davemloft.net>
15295
15296 * testsuite/justsyms.t: Start at 0x100.
15297 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15298 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15299 long.
15300 * testsuite/script_test_2.cc: Adjust string and section length
15301 checks.
7c98e6bb 15302
99a37bfd
ILT
153032008-04-09 Ian Lance Taylor <iant@google.com>
15304
2cefc357
ILT
15305 PR gold/5996
15306 * script-sections.cc (Sections_element::allocate_to_segment): Add
15307 orphan parameter.
15308 (Output_section_definition::allocate_to_segment): Likewise.
15309 (Orphan_output_section::allocate_to_segment): Likewise.
15310 (Script_sections::attach_sections_using_phdrs_clause): Don't
15311 propagate non-PT_LOAD segments to orphan sections.
15312 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15313 readelf rather than objdump.
15314 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15315 .interp section and PT_INTERP segment are the same size.
15316 * testsuite/Makefile.in: Rebuild.
15317
99a37bfd
ILT
15318 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15319 aliases for symbols defined in the same object.
15320 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15321 (weak_alias_test_SOURCES): New variable.
15322 (weak_alias_test_DEPENDENCIES): New variable.
15323 (weak_alias_test_LDFLAGS): New variable.
15324 (weak_alias_test_LDADD): New variable.
15325 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15326 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15327 (weak_alias_test_3.o): New target.
15328 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15329 * testsuite/weak_alias_test_main.cc: New file.
15330 * testsuite/weak_alias_test_1.cc: New file.
15331 * testsuite/weak_alias_test_2.cc: New file.
15332 * testsuite/weak_alias_test_3.cc: New file.
15333
780e49c5
ILT
153342008-04-08 Ian Lance Taylor <iant@google.com>
15335
cdb0b8f5
ILT
15336 * options.h (class General_options): Add --noinhibit-exec option.
15337 * main.cc (main): Check --noinhibit-exec.
15338
0864d551
ILT
15339 * options.h (class General_options): Define --wrap as a special
15340 option. Add wrap_symbols_ field.
15341 (General_options::any_wrap_symbols): New function.
15342 (General_options::is_wrap_symbol): New function.
15343 * options.cc (General_options::parse_wrap): New function.
15344 (General_options::General_options): Initialize wrap_symbols_.
15345 * symtab.cc (Symbol_table::wrap_symbol): New function.
15346 (Symbol_table::add_from_object): Handle --wrap.
15347 * symtab.h (class Symbol_table): Declare wrap_symbol.
15348 * target.h (Target::wrap_char): New function.
15349 (Target::Target_info): Add wrap_char field.
15350 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15351 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15352 * testsuite/testfile.cc (Target_test::test_target_info):
15353 Likewise.
15354
789aa6de
ILT
15355 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15356 there is one.
15357
2c38906f
ILT
15358 * layout.h (class Layout): Add added_eh_frame_data_ field.
15359 * layout.cc (Layout::Layout): Initialize new field.
15360 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15361 output section until we find a section we merged successfully.
15362 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15363 that the size be non-zero.
15364
780e49c5
ILT
15365 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15366 qualifier.
15367
7fcd0256
ILT
153682008-04-08 Craig Silverstein <csilvers@google.com>
15369
15370 * configure.ac: Export new conditional variable HAVE_ZLIB.
15371 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15372 on HAVE_ZLIB.
15373 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15374 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15375
6835af53
ILT
153762008-04-07 Ian Lance Taylor <iant@google.com>
15377
e24f324c
ILT
15378 * version.cc (version_string): Set to "1.5".
15379
a036edd8
ILT
15380 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15381 Add issued_non_pic_error_ field. Declare check_non_pic.
15382 (Target_x86_64::Scan::check_non_pic): New function.
15383 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15384 (Target_x86_64::Scan::global): Likewise.
15385
624f8810
ILT
15386 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15387 addend parameter. Change caller. Handle merge sections.
15388 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15389 Address to Addend. Don't add in the result of
15390 local_section_offset, pass down the addend and use the returned
15391 value.
15392 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15393 Update declarations of local_section_offset and symbol_value.
15394 * testsuite/two_file_test_1.cc (t18): New function.
15395 * testsuite/two_file_test_2.cc (f18): New function.
15396 * testsuite/two_file_test_main.cc (main): Call t18.
15397 * testsuite/two_file_test.h (t18, f18): Declare.
15398
6835af53
ILT
15399 * configure.ac: Don't test for objdump, c++filt, or readelf.
15400 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15401 conditionals.
15402 (TEST_READELF): New variable.
15403 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15404 (check_PROGRAMS): Add two_file_strip_test.
15405 (two_file_strip_test): New target.
15406 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15407 (two_file_same_shared_strip_test_SOURCES): New variable.
15408 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15409 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15410 (two_file_same_shared_strip_test_LDADD): New variable.
15411 (two_file_shared_strip.so): New target.
15412 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15413 (ver_test_5.syms, ver_test_7.syms): Likewise.
15414 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15415 (strip_test_3.stdout): Use TEST_OBJDUMP.
15416 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15417
86925eef
CC
154182008-04-04 Cary Coutant <ccoutant@google.com>
15419
15420 * symtab.h (Symbol::is_weak_undefined): New function.
15421 (Symbol::is_strong_undefined): New function.
15422 (Symbol::is_absolute): New function.
15423 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15424 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15425 absolute symbols.
15426 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15427 (weak_undef_test): New target.
15428 * testsuite/Makefile.in: Rebuild.
15429 * testsuite/weak_undef_file1.cc: New file.
15430 * testsuite/weak_undef_file2.cc: New file.
15431 * testsuite/weak_undef_test.cc: New file.
15432
126f3ece
ILT
154332008-04-03 Craig Silverstein <csilvers@google.com>
15434
15435 * compressed_output.h (class Output_compressed_section): Use
15436 unsigned buffer.
15437 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15438 add zlib header.
15439 (zlib_compressed_suffix): Removed.
15440 (Output_compressed_section::set_final_data_size): Use unsigned
15441 buffers.
15442 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15443 Fix linker invocation.
15444 (flagstest_o_specialfile_and_compress_debug_sections):
15445 Likewise.
15446 * testsuite/Makefile.in: Regenerated.
15447
deae2a14
DM
154482008-04-02 David S. Miller <davem@davemloft.net>
15449
15450 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15451 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15452
70752818
ILT
154532008-04-02 Craig Silverstein <csilvers@google.com>
15454
15455 * TODO: New file.
15456
39d0cb0e
ILT
154572008-04-02 Ian Lance Taylor <iant@google.com>
15458
15459 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15460 parameters. Update for new key type to views_. Change all
15461 callers.
15462 (File_read::read): Adjust for byteshift in returned view.
15463 (File_read::add_view): New function, broken out of
15464 find_and_make_view.
15465 (File_read::make_view): New function, broken out of
15466 find_and_make_view.
15467 (File_read::find_or_make_view): Add offset and aligned
15468 parameters. Rewrite accordingly. Change all callers.
15469 (File_read::get_view): Add offset and aligned parameters. Adjust
15470 for byteshift in return value.
15471 (File_read::get_lasting_view): Likewise.
15472 * fileread.h (class File_read): Update declarations.
15473 (class File_read::View): Add byteshift_ field. Add byteshift to
15474 constructor. Add byteshift method.
15475 * archive.h (Archive::clear_uncached_views): New function.
15476 (Archive::get_view): Add aligned parameter. Change all callers.
15477 * object.h (Object::get_view): Add aligned parameter. Change all
15478 callers.
15479 (Object::get_lasting_view): Likewise.
15480
15481 * fileread.cc (File_read::release): Don't call clear_views if
15482 there are multiple objects.
15483 * fileread.h (File_read::clear_uncached_views): New function.
15484 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15485 on the archive.
15486
a1207466
CC
154872008-03-31 Cary Coutant <ccoutant@google.com>
15488
15489 Add thin archive support.
15490 * archive.cc (Archive::armagt): New const.
15491 (Archive::setup): Remove task parameter and calls to unlock.
15492 (Archive::unlock_nested_archives): New function.
15493 (Archive::read_header): Add nested_off parameter. Change
15494 all callers.
15495 (Archive::interpret_header): Likewise.
15496 (Archive::include_all_members): Change to handle thin
15497 archives.
15498 (Archive::include_member): Likewise.
15499 * archive.h (Archive::Archive): Add new parameters and
15500 initializers.
15501 (Archive::armagt): New const.
15502 (Archive::setup): Remove task parameter.
15503 (Archive::unlock_nested_archives): New function.
15504 (Archive::read_header): Add nested_off parameter.
15505 (Archive::interpret_header): Likewise.
15506 (Archive::Nested_archive_table): New typedef.
15507 (Archive::is_thin_archive_): New field.
15508 (Archive::nested_archives_): New field.
15509 (Archive::options_): New field.
15510 (Archive::dirpath_): New field.
15511 (Archive::task_): New field.
15512 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15513 for thin archives. Pass additional parameters to
15514 Archive::Archive. Unlock the archive file after calling
15515 Archive::setup.
cd536b21 15516
479f6503
ILT
155172008-03-29 Ian Lance Taylor <iant@google.com>
15518
686c8caf
ILT
15519 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15520 version symbol to be local.
15521 * testsuite/ver_test_4.sh: New file.
15522 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15523 (check_DATA): Add ver_test_4.syms.
15524 (ver_test_4.syms): New target.
15525 * testsuite/Makefile.in: Rebuild.
15526
ab794b6b
ILT
15527 * output.cc
15528 (Output_section::Input_section_sort_entry::has_priority): New
15529 function.
15530 (Output_section::Input_section_sort_entry::match_file_name): New
15531 function.
15532 (Output_section::Input_section_sort_entry::match_section_name):
15533 Remove.
15534 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15535 Remove.
15536 (Output_section::Input_section_sort_entry::match_section_file):
15537 Remove.
15538 (Output_section::Input_section_sort_compare::operator()): Rewrite
15539 using new Input_section_sort_entry functions. Sort crtbegin and
15540 crtend first. Sort sections with no priority before sections with
15541 a priority.
15542 * testsuite/initpri1.c (d3): Check j != 4.
15543 (cd5): New constructor/destructor function.
15544 (main): Check j != 2.
15545
479f6503
ILT
15546 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15547 new symbol when resolving, don't call set_is_default.
15548 * testsuite/ver_test_7.cc: New file.
15549 * testsuite/ver_test_7.sh: New file.
15550 * testsuite/Makefile.am (ver_test_7.so): New target.
15551 (ver_test_7.o): New target.
15552 (check_SCRIPTS): Add ver_test_7.sh.
15553 (check_DATA): Add ver_test_7.syms.
15554 (ver_test_7.syms): New target.
15555
2fd32231
ILT
155562008-03-28 Ian Lance Taylor <iant@google.com>
15557
15558 * layout.cc (Layout::layout): If we see an input section with a
15559 name that needs sorting, set the must_sort flag for the output
15560 section.
15561 (Layout::make_output_section): If the name of the output section
15562 indicates that it might require sorting, set the may_sort flag.
15563 * output.h (Output_section::may_sort_attached_input_sections): New
15564 function.
15565 (Output_section::set_may_sort_attached_input_sections): New
15566 function.
15567 (Output_section::must_sort_attached_input_sections): New
15568 function.
15569 (Output_section::set_must_sort_attached_input_sections): New
15570 function.
15571 (class Output_section): Declare Input_section_sort_entry. Define
15572 Input_section_sort_compare. Declare
15573 sort_attached_input_sections. Add new fields:
15574 may_sort_attached_input_sections_,
15575 must_sort_attached_input_sections_,
15576 attached_input_sections_are_sorted_.
15577 * output.cc (Output_section::Output_section): Initialize new
15578 fields.
15579 (Output_section::add_input_section): Add an entry to
15580 input_sections_ if may_sort or must_sort are true.
15581 (Output_section::set_final_data_size): Call
15582 sort_attached_input_sections if necessary.
15583 (Output_section::Input_section_sort_entry): Define new class.
15584 (Output_section::Input_section_sort_compare::operator()): New
15585 function.
15586 (Output_section::sort_attached_input_sections): New function.
15587 * configure.ac: Check whether the compiler supports constructor
15588 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15589 * testsuite/initpri1.c: New file.
15590 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15591 CONSTRUCTOR_PRIORITY.
15592 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15593 (initpri1_LDFLAGS): New variable.
15594 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15595
18e6b24e
ILT
155962008-03-27 Ian Lance Taylor <iant@google.com>
15597
49bdd526
ILT
15598 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15599 * testsuite/common_test_1.c: New file.
15600 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15601 (common_test_1_SOURCES): New variable.
15602 (common_test_1_DEPENDENCIES): New variable.
15603 (common_test_1_LDFLAGS): New variable.
15604
18e6b24e
ILT
15605 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15606 and commons_ correctly when NAME/VERSION does not override
15607 NAME/NULL.
15608 * testsuite/ver_test_6.c: New file.
15609 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15610 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15611 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15612
04bf7072
ILT
156132008-03-26 Ian Lance Taylor <iant@google.com>
15614
5871526f
ILT
15615 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15616 of an undefined symbol from a version script.
15617 * testsuite/Makefile.am (ver_test_5.so): New target.
15618 (ver_test_5.o): New target.
15619 (check_SCRIPTS): Add ver_test_5.sh.
15620 (check_DATA): Add ver_test_5.syms.
15621 (ver_test_5.syms): New target.
15622 * testsuite/ver_test_5.cc: New file.
15623 * testsuite/ver_test_5.script: New file.
15624 * testsuite/ver_test_5.sh: New file.
15625 * Makefile.in, testsuite/Makefile.in: Rebuild.
15626
04bf7072
ILT
15627 PR gold/5986
15628 Fix problems building gold with gcc 4.3.0.
15629 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15630 (gold_error_at_location, gold_warning_at_location): Use it.
15631 * configure.ac: Check whether we can compile and use a template
15632 function with a printf attribute.
15633 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15634 when jumping over bytes.
15635 * object.cc: Instantiate Object::read_section_data.
15636 * debug.h: Include <cstring>
15637 * dwarf_reader.cc: Include <algorithm>
15638 * main.cc: Include <cstring>.
15639 * options.cc: Include <cstring>.
15640 * output.cc: Include <cstring>.
15641 * script.cc: Include <cstring>.
15642 * script.h: Include <string>.
15643 * symtab.cc: Include <cstring> and <algorithm>.
15644 * target-select.cc: Include <cstring>.
15645 * version.cc: Include <string>.
15646 * testsuite/testmain.cc: Include <cstdlib>.
15647 * configure, config.in: Rebuild.
15648
874c5b28
ILT
156492008-03-25 Ian Lance Taylor <iant@google.com>
15650
819d6c3a
ILT
15651 * options.cc: Include "../bfd/bfdver.h".
15652 (options::help): Print bug reporting address.
15653
f4b2c6f5
ILT
15654 * version.cc (print_version): Adjust output for current value of
15655 BFD_VERSION_STRING.
15656
15657 * NEWS: New file.
15658
e96caa79
ILT
15659 * options.cc (options::help): Print list of supported targets.
15660 * target-select.h: Include <vector>.
15661 (class Target_selector): Make machine_, size_, and is_big_endian_
15662 fields const. Add bfd_name_ and instantiated_target_ fields.
15663 (Target_selector::Target_selector): Add bfd_name parameter.
15664 (Target_selector::recognize): Make non-virtual, call
15665 do_recognize.
15666 (Target_selector::recognize_by_name): Make non-virtual, call
15667 do_recognize_by_name.
15668 (Target_selector::supported_names): New function.
15669 (Target_selector::bfd_name): New function.
15670 (Target_selector::do_instantiate_target): New pure virtual
15671 function.
15672 (Target_selector::do_recognize): New virtual function.
15673 (Target_selector::do_recognize_by_name): New virtual function.
15674 (Target_selector::instantiate_target): New private function.
15675 (supported_target_names): Declare.
15676 * target-select.cc (Target_selector::Target_selector): Update for
15677 new parameter and fields.
15678 (select_target_by_name): Check that the name matches before
15679 calling recognize_by_name.
15680 (supported_target_names): New function.
15681 * i386.cc (class Target_selector_i386): Update Target_selector
15682 constructor call. Remove recognize and recognize_by_name. Add
15683 do_instantiate_target.
15684 * x86_64.cc (class Target_selector_x86_64): Likewise.
15685 * testsuite/testfile.cc (class Target_selector_test): Update for
15686 changes to Target_selector.
15687
874c5b28
ILT
15688 * README: Rewrite, with some notes on unsupported features.
15689
0a65a3a7
CC
156902008-03-24 Cary Coutant <ccoutant@google.com>
15691
15692 * i386.cc (Target_i386::Got_type): New enum declaration.
15693 (Target_i386::Scan::local): Updated callers of Output_data_got
15694 member functions.
15695 (Target_i386::Scan::global): Likewise.
15696 (Target_i386::Relocate::relocate): Likewise.
15697 (Target_i386::Relocate::relocate_tls): Likewise.
15698 * object.h (Got_offset_list): New class.
15699 (Sized_relobj::local_has_got_offset): Added got_type parameter.
15700 (Sized_relobj::local_got_offset): Likewise.
15701 (Sized_relobj::set_local_got_offset): Likewise.
15702 (Sized_relobj::local_has_tls_got_offset): Removed.
15703 (Sized_relobj::local_tls_got_offset): Removed.
15704 (Sized_relobj::set_local_tls_got_offset): Removed.
15705 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
15706 * output.cc (Output_data_got::add_global): Added got_type parameter.
15707 (Output_data_got::add_global_with_rel): Likewise.
15708 (Output_data_got::add_global_with_rela): Likewise.
15709 (Output_data_got::add_global_pair_with_rel): New function.
15710 (Output_data_got::add_global_pair_with_rela): New function.
15711 (Output_data_got::add_local): Added got_type parameter.
15712 (Output_data_got::add_local_with_rel): Likewise.
15713 (Output_data_got::add_local_with_rela): Likewise.
15714 (Output_data_got::add_local_pair_with_rel): New function.
15715 (Output_data_got::add_local_pair_with_rela): New function.
15716 (Output_data_got::add_global_tls): Removed.
15717 (Output_data_got::add_global_tls_with_rel): Removed.
15718 (Output_data_got::add_global_tls_with_rela): Removed.
15719 (Output_data_got::add_local_tls): Removed.
15720 (Output_data_got::add_local_tls_with_rel): Removed.
15721 (Output_data_got::add_local_tls_with_rela): Removed.
15722 * output.h (Output_data_got::add_global): Added got_type parameter.
15723 (Output_data_got::add_global_with_rel): Likewise.
15724 (Output_data_got::add_global_with_rela): Likewise.
15725 (Output_data_got::add_global_pair_with_rel): New function.
15726 (Output_data_got::add_global_pair_with_rela): New function.
15727 (Output_data_got::add_local): Added got_type parameter.
15728 (Output_data_got::add_local_with_rel): Likewise.
15729 (Output_data_got::add_local_with_rela): Likewise.
15730 (Output_data_got::add_local_pair_with_rel): New function.
15731 (Output_data_got::add_local_pair_with_rela): New function.
15732 (Output_data_got::add_global_tls): Removed.
15733 (Output_data_got::add_global_tls_with_rel): Removed.
15734 (Output_data_got::add_global_tls_with_rela): Removed.
15735 (Output_data_got::add_local_tls): Removed.
15736 (Output_data_got::add_local_tls_with_rel): Removed.
15737 (Output_data_got::add_local_tls_with_rela): Removed.
15738 * resolve.cc (Symbol::override_base_with_special): Removed
15739 reference to has_got_offset_ field.
15740 * symtab.cc (Symbol::init_fields): Replaced initialization
15741 of got_offset_ with got_offsets_. Removed initialization
15742 of has_got_offset_
53fcba31 15743 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
15744 (Symbol::got_offset): Likewise.
15745 (Symbol::set_got_offset): Likewise.
15746 (Symbol::has_tls_got_offset): Removed.
15747 (Symbol::tls_got_offset): Removed.
15748 (Symbol::set_tls_got_offset): Removed.
15749 (Symbol::got_offset_): Removed.
15750 (Symbol::tls_mod_got_offset_): Removed.
15751 (Symbol::tls_pair_got_offset_): Removed.
15752 (Symbol::got_offsets_): New field.
15753 (Symbol::has_got_offset): Removed.
15754 (Symbol::has_tls_mod_got_offset): Removed.
15755 (Symbol::has_tls_pair_got_offset): Removed.
15756 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
15757 (Target_x86_64::Scan::local): Updated callers of Output_data_got
15758 member functions.
15759 (Target_x86_64::Scan::global): Likewise.
15760 (Target_x86_64::Relocate::relocate): Likewise.
15761 (Target_x86_64::Relocate::relocate_tls): Likewise.
15762
bd52eafb
BE
157632008-03-25 Ben Elliston <bje@au.ibm.com>
15764
15765 * yyscript.y: Fix spelling error in comment.
15766
8b105e34
ILT
157672008-03-24 Ian Lance Taylor <iant@google.com>
15768
8ed814a9
ILT
15769 * options.h (class General_options): Define build_id option.
15770 * layout.h (class Layout): Declare write_build_id, create_note,
15771 create_build_id. Add build_id_note_ member.
15772 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
15773 "libiberty.h", "md5.h", "sha1.h".
15774 (Layout::Layout): Initialize eh_frame_data_,
15775 eh_frame_hdr_section_, and build_id_note_.
15776 (Layout::finalize): Call create_build_id.
15777 (Layout::create_note): New function, broken out of
15778 Layout::create_gold_note.
15779 (Layout::create_gold_note): Call create_note.
15780 (Layout::create_build_id): New function.
15781 (Layout::write_build_id): New function.
15782 (Close_task_runner::run): Call write_build_id.
15783
8b105e34
ILT
15784 * x86_64.cc: Correct license to GPLv3.
15785
086a1841
ILT
157862008-03-23 Ian Lance Taylor <iant@google.com>
15787
15788 * options.cc: Include "demangle.h".
15789 (parse_optional_string): New function.
15790 (parse_long_option): Handle takes_optional_argument.
15791 (parse_short_option): Update dash_z initializer. Handle
15792 takes_optional_argument.
15793 (General_options::General_options): Initialize do_demangle_.
15794 (General_options::finalize): Set do_demangle_. Handle demangling
15795 style.
15796 * options.h (parse_optional_string): Declare.
15797 (struct One_option): Add optional_arg field. Update constructor.
15798 Update call constructor calls. Add takes_optional_argument
15799 function.
15800 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
15801 (DEFINE_optional_string): Define.
15802 (General_options::demangle): Change from DEFINE_bool to
15803 DEFINE_optional_string.
15804 (General_options::no_demangle): New function.
15805 (General_options::do_demangle): New function.
15806 (General_options::set_do_demangle): New function.
15807 (General_options::execstack_status_): Move definition to end of
15808 class definition.
15809 (General_options::static_): Likewise.
15810 (General_options::do_demangle_): New field.
15811 * object.cc (big_endian>::get_symbol_location_info): Call
15812 Options::do_demangle, not Options::demangle.
15813 * symtab.cc (demangle): Likewise.
15814
cbb93e63
ILT
158152008-03-22 Ian Lance Taylor <iant@google.com>
15816
15817 * gold.h: Include <cstddef> and <sys/types.h>
15818 * options.h: Include <cstring>.
15819
ec531623
ILT
158202008-03-21 Ian Lance Taylor <iant@google.com>
15821
15822 * Added source code to GNU binutils.
752937aa 15823\f
4b95cf5c 15824Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
15825
15826Copying and distribution of this file, with or without modification,
15827are permitted in any medium without royalty provided the copyright
15828notice and this notice are preserved.
15829
15830Local Variables:
15831mode: change-log
15832left-margin: 8
15833fill-column: 74
15834version-control: never
15835End:
This page took 1.10297 seconds and 4 git commands to generate.