daily update
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
053a4d68
JY
12014-07-02 Jing Yu <jingyu@google.com>
2
3 * aarch64.cc: New file
4 * Makefile.am (TARGETSOURCES): Add aarch64.cc
5 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
6 * Makefile.in: Regenerate.
7 * configure.tgt: Add entries for aarch64*.
8 * configure.ac: Likewise.
9 * configure: Likewise.
10
7b549045
AM
112014-06-27 Alan Modra <amodra@gmail.com>
12
13 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
14
cb818dbf
CC
152014-06-24 Cary Coutant <ccoutant@google.com>
16
17 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
18 sections.
19 (Dwo_file::sized_read_unit_index): Likewise.
20
9810d34d
SS
212014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
22
23 * mips.cc: New file.
24 * Makefile.am (TARGETSOURCES): Add mips.cc
25 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
26 * configure.tgt: Add entries for mips*.
27 * configure.ac: Likewise.
28 * Makefile.in: Regenerate.
29 * configure: Likewise.
30
9baa787b
CC
312014-06-09 Cary Coutant <ccoutant@google.com>
32
33 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
34 unit_length is within section bounds.
35
8f89af0a
CC
362014-06-09 Cary Coutant <ccoutant@google.com>
37
38 PR gold/16980
39 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
40 map.
41
a47622ac
AM
422014-06-07 Alan Modra <amodra@gmail.com>
43
44 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
45
4320c691
CC
462014-06-06 Cary Coutant <ccoutant@google.com>
47
48 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
49 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
50 (Dwarf_pubnames_table::read_header): Likewise.
51 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
52 .debug_gnu_pubtypes.
53
270c9937
JB
542014-06-05 Joel Brobecker <brobecker@adacore.com>
55
56 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
57 * Makefile.in, configure: Regenerate.
58
397998fc
AM
592014-06-03 Alan Modra <amodra@gmail.com>
60
61 * powerpc.cc (addis_12_2): Define.
62 (Stub_table::do_write): Support fusion on ELFv2 stubs.
63
61f5c66f
AM
642014-06-03 Alan Modra <amodra@gmail.com>
65
66 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
67 st_other output.
68
f6971787
AM
692014-06-02 Alan Modra <amodra@gmail.com>
70
71 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
72 Only ignore relocs on ELFv1.
73 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
74
f6fb8322
CC
752014-05-30 Cary Coutant <ccoutant@google.com>
76
77 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
78 * testsuite/Makefile.in: Regenerate.
79 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
80
c23dd342
L
812014-05-27 H.J. Lu <hongjiu.lu@intel.com>
82
83 PR gold/16945
84 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
85 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
86
5fe7ffdc
AM
872014-05-15 Alan Modra <amodra@gmail.com>
88
89 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
90 Compare FDE contents with DW_CFA_nop rather than 0.
91
a82bef93
ST
922014-05-13 Sriraman Tallam <tmsriram@google.com>
93
94 * symtab.h (may_need_copy_reloc): Remove check for position independent
95 code.
96 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
97 position independence before pc absolute may_need_copy_reloc call.
98 Add check for executable output befor pc relative may_need_copy_reloc
99 call.
100 * i386.cc: Ditto.
101 * arm.cc: Ditto.
102 * sparc.cc: Ditto.
103 * tilegx.cc: Ditto.
104 * powerpc.cc: Add check for no position independence before
105 may_need_copy_reloc calls.
106 * testsuite/pie_copyrelocs_test.cc: New file.
107 * testsuite/pie_copyrelocs_shared_test.cc: New file.
108 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 109 * Makefile.in: Regenerate.
a82bef93 110
53c66605
ML
1112014-05-08 Martin Liška <mliska@suse.cz>
112
113 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
114
57b2284c
CC
1152014-05-06 Cary Coutant <ccoutant@google.com>
116
117 PR gold/16900
118 * i386.cc (Output_data_got_plt_i386): New class.
119 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
120 parameter. Change all callers.
121 (Output_data_plt_i386::layout_): Remove.
122 (Output_data_plt_i386::got_plt_): Change type.
123 (Target_i386::got_plt_): Change type. Change all references.
124 (Target_i386::got_section): Create instance of new class.
125 (Output_data_got_plt_i386::do_write): New function.
126 * x86_64.cc (Output_data_got_plt_x86_64): New class.
127 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
128 parameter. Change all callers.
129 (Output_data_plt_x86_64::layout_): Remove.
130 (Output_data_plt_x86_64::got_plt_): Change type.
131 (Target_x86_64::got_plt_): Change type. Change all references.
132 (Target_x86_64::got_section): Create instance of new class.
133 (Output_data_got_plt_x86_64::do_write): New function.
134 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
135 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
136 class.
137
6b97515d 1382014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 139
6b97515d
CC
140 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
141 if we have pubnames/pubtypes.
142
d1bddd3c
CC
1432014-05-02 Cary Coutant <ccoutant@google.com>
144
5fe7ffdc
AM
145 * defstd.cc (in_segment): Define __ehdr_start here...
146 * layout.cc (Layout::finalize): ...Instead of here. Set the
147 output segment when known.
148 * resolve.cc (Symbol::override_base_with_special): Remember
149 the original binding.
150 * symtab.cc (Symbol::set_output_segment): New function.
151 (Symbol::set_undefined): New function.
152 * symtab.h (Symbol::is_weak_undefined): Check original undef
153 binding.
154 (Symbol::is_strong_undefined): New function.
155 (Symbol::set_output_segment): New function.
156 (Symbol::set_undefined): New function.
157 * target-reloc.h (is_strong_undefined): Remove.
158 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
159 Check for hidden undefs.
160 (relocate_section): Call Symbol::is_strong_undefined.
161
162 * testsuite/Makefile.am (ehdr_start_test_1)
163 (ehdr_start_test_2, ehdr_start_test_3)
164 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
165 * testsuite/Makefile.in: Regenerate.
166 * testsuite/ehdr_start_def.cc: New source file.
167 * testsuite/ehdr_start_test.cc: New source file.
168 * testsuite/ehdr_start_test.t: New linker script.
169 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 170
7849f6d8
CC
1712014-04-23 Cary Coutant <ccoutant@google.com>
172
bf2cc635 173 PR gold/16870
7849f6d8
CC
174 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
175
99fd8cff
CC
1762014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
177
178 * layout.cc (Layout::include_section): Allow a target to decide
179 whether to include a section.
180 * target.h (Target::should_include_section): New function.
181 (Target::do_should_include_section): New function.
182
91f43acd
CC
1832014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
184
185 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
186 inline into ...
187 (Copy_relocs::emit): ... here.
188 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
189 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
190 (Copy_reloc_entry::entries_): Change from private to protected.
191
c4eb27e1
ST
1922014-04-02 Sriraman Tallam <tmsriram@google.com>
193
194 * icf.cc (get_section_contents): Replace copies of reloc
195 vectors with const references.
196
ae447ddd
CC
1972014-04-02 Cary Coutant <ccoutant@google.com>
198
199 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
200 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
201 * configure: Regenerate.
202 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
203 -fno-use-linker-plugin.
204 (LINK1, CXXLINK1): Add it to the link command.
205 * testsuite/Makefile.in: Regenerate.
206
fa47fa92
AM
2072014-03-12 Alan Modra <amodra@gmail.com>
208
209 * Makefile.in: Regenerate.
210
9b12c500
CC
2112014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
212
213 * symtab.h (Symbol::set_nonvis): New function.
214
beacaa96
CC
2152014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
216
217 * symtab.cc (Sized_symbol<32>::init_output_data):
218 Instantiate the template.
219 (Sized_symbol<64>::init_output_data): Likewise.
220
800d9823
CC
2212014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
222
223 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
224 adjust dynamic symbol value.
225 * target.h (Target::adjust_dyn_symbol): New function.
226 (Target::do_adjust_dyn_symbol): New function.
227
918fc1f8 2282014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 229
918fc1f8
CC
230 * output.cc (Output_data_dynamic::Dynamic_entry::write):
231 Get the value of DYNAMIC_CUSTOM dynamic entry.
232 * output.h (Output_data_dynamic::add_custom): New function.
233 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
234 dynamic entry.
235 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
236 * target.h (Target::dynamic_tag_custom_value): New function.
237 (Target::do_dynamic_tag_custom_value): New function.
238
98ff9231
CC
2392014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
240
241 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
242 dynsym indexes.
243 * target.h (Target::has_custom_set_dynsym_indexes): New function.
244 (Target::do_has_custom_set_dynsym_indexes): New function.
245 (Target::set_dynsym_indexes): New function.
246 (Target::do_set_dynsym_indexes): New function.
247
b80eed39
AM
2482014-03-07 Alan Modra <amodra@gmail.com>
249
250 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
251 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
252 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
253 (Powerpc_relocate_functions::has_overflow_bitfield,
254 overflowed): Use the above.
255 (Target_powerpc::Relocate::relocate): Correct overflow checking
256 for a number of relocations. Modify overflow test for 16-bit
257 fields in instructions to signed/unsigned according to whether
258 the field takes a signed or unsigned value.
259
4b95cf5c
AM
2602014-03-05 Alan Modra <amodra@gmail.com>
261
262 Update copyright years.
263
45965137
AM
2642014-03-05 Alan Modra <amodra@gmail.com>
265
266 * powerpc.cc (Target_powerpc::Scan::local, global): Support
267 R_PPC64_ADDR64_LOCAL.
268 (Target_powerpc::Relocate::relocate): Likewise.
269
2c80b753
AM
2702014-03-03 Alan Modra <amodra@gmail.com>
271
272 * dwp.cc (print_version): Update copyright year to current.
273
c1c69e83
AM
2742014-02-10 Alan Modra <amodra@gmail.com>
275
276 * po/gold.pot: Regenerate.
277
dd0c4e70
CC
2782014-02-06 Cary Coutant <ccoutant@google.com>
279
280 Fix problem where -u is ignored when a weak undef is seen.
281
282 * archive.cc (Library_base::should_include_member): Reorder
283 code to check for -u option if a weak undef has already been seen.
284 * testsuite/Makefile.am (weak_undef_test_2): New test case.
285 * testsuite/Makefile.in: Regenerate.
286 * testsuite/weak_undef_file3.cc: New file.
287 * testsuite/weak_undef_file4.cc: New file.
288 * testsuite/weak_undef_test_2.cc: New file.
289
1a221d3d
CC
2902014-02-05 Cary Coutant <ccoutant@google.com>
291
292 Fix issues with gold undefined symbol diagnostics.
293
294 PR binutils/15435
295 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
296 check to here.
297 * target-reloc.h (is_strong_undefined): New function.
298 (relocate_section): Move undef vtable symbol check from here.
299 Check for is_strong_undefined.
300
e889f0a4 3012014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 302
e889f0a4
CC
303 Fix problems with the --dynamic-list option.
304
305 PR gold/13577
306 * options.cc (General_options::parse_dynamic_list):
307 Set have_dynamic_list_.
308 (General_options::General_options): Initialize have_dynamic_list_.
309 (General_options::finalize): Turn off -Bsymbolic and
310 -Bsymbolic-functions if --dynamic-list provided.
311 * options.h (General_options::have_dynamic_list): New function.
312 (General_options::have_dynamic_list_): New data member.
313 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
314 correctly.
5fe7ffdc 315
e889f0a4
CC
316 PR gold/16530
317 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
318 in --dynamic-list, mark it.
5fe7ffdc 319
e889f0a4
CC
320 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
321 (dynamic_list_2): New test case.
322 * testsuite/Makefile.in: Regenerate.
323 * testsuite/dynamic_list_2.cc: New file.
324 * testsuite/dynamic_list_2.t: New file.
325 * testsuite/dynamic_list_lib1.cc: New file.
326 * testsuite/dynamic_list_lib2.cc: New file.
327 * testsuite/gc_dynamic_list_test.c: New file.
328 * testsuite/gc_dynamic_list_test.sh: New file.
329 * testsuite/gc_dynamic_list_test.t: New file.
330
ec673e64
CC
3312014-01-28 Cary Coutant <ccoutant@google.com>
332
333 Add .gdb_index version 7 support.
334
335 * gold/dwarf_reader.cc: include <utility> (for make_pair).
336 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
337 debug sections.
338 (Dwarf_ranges_table::read_ranges_table): Likewise.
339 (Dwarf_pubnames_table::read_section): Check for GNU-style
340 sections, and for compressed debug sections.
341 (Dwarf_pubnames_table::read_header): Compute end address of table.
342 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
343 for end of list by offset, not by offset == 0.
344 (Dwarf_info_reader::do_read_string_table): Check for compressed
345 debug sections.
346 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
347 Initialize new data members.
348 (Dwarf_pubnames_table::next_name): return flag_byte.
349 (Dwarf_pubnames_table::end_of_table_): New data member.
350 (Dwarf_pubnames_table::is_gnu_style_): New data member.
351 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
352 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
353 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
354 read skeleton type unit DIEs.
355 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
356 (Gdb_index::do_write): Write flag_byte.
357 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
358 (Gdb_index::Cu_vector): Store flags along with cu indexes.
359 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
360 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
361
221fd5d5
L
3622014-01-08 H.J. Lu <hongjiu.lu@intel.com>
363
364 * version.cc (print_version): Update copyright year to 2014.
365
6c09fb0b
ILT
3662013-12-19 Dimitry Andric <dimitry@andric.com>
367
368 * stringpool.cc (Stringpool_template::reserve): Add
369 HAVE_UNORDERED_MAP case.
370 * stringpool.cc (Stringpool_template::print_stats): Likewise.
371
8356f2d0
CC
3722013-12-18 Cary Coutant <ccoutant@google.com>
373
374 * configure.ac: Check for <unordered_set> and <unordered_map>.
375 * config.in: Regenerate.
376 * configure: Regenerate.
377 * system.h: Use <unordered_set> and <unordered_map> if available.
378
f2c7d7ee
RM
3792013-12-10 Roland McGrath <mcgrathr@google.com>
380
381 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
382 with $(INSTALL_PROGRAM_ENV).
383 * Makefile.in: Regenerate.
384
6632e8cc
CC
3852013-11-22 Cary Coutant <ccoutant@google.com>
386
387 * configure.ac: Add check for which library is needed for
388 dlopen.
389 * configure: Regenerate.
390
0c075858
CC
3912013-11-22 Cary Coutant <ccoutant@google.com>
392
393 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
394 assembler.
395 * testsuite/Makefile.in: Regenerate.
396
f49fe902
L
3972013-11-17 H.J. Lu <hongjiu.lu@intel.com>
398
399 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
400 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
401 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
402 (Target_x86_64<size>::Scan::local): Likewise.
403 (Target_x86_64<size>::Scan::global): Likewise.
404 (Target_x86_64<size>::Relocate::relocate): Likewise.
405 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
406 Likewise.
407 (Target_x86_64<size>::Scan::check_non_pic(): Handle
408 R_X86_64_PC32_BND.
409
410 * testsuite/Makefile.am (check_PROGRAMS): Add
411 exception_x86_64_bnd_test.
412 (exception_x86_64_bnd_test_SOURCES): New macro.
413 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
414 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
415 (exception_x86_64_bnd_test_LDADD): Likewise.
416 (exception_x86_64_bnd_1.o): New rule.
417 (exception_x86_64_bnd_2.o): Likewise.
418 * testsuite/Makefile.in: Regenerated.
419
9055360d
AM
4202013-11-15 Alan Modra <amodra@gmail.com>
421
422 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
423 accessor.
424 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
425 Only call ppc64_local_entry_offset for 64-bit. Restrict
426 symval_for_branch lookup to ELFv1.
427 (Stub_table::add_plt_call_entry): Use unsigned int off.
428 (Output_data_glink::Address, invalid_address): New.
429 (Output_data_glink::add_eh_frame): Move out of line. Add
430 support for ELFv2.
431 (Output_data_glink::add_global_entry, find_global_entry,
432 global_entry_address): New functions.
433 (Output_data_glink::global_entry_stubs_, end_branch_table_,
434 ge_size): New variables.
435 (Output_data_glink::set_final_data_size): Add global entry
436 stub sizing.
437 (Output_data_glink::do_write): Write global entry stubs.
438 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
439 parameter. Return true for ELFv2. Adjust callers.
440 (Target_powerpc::Scan::local, global): Restrict opd lookup to
441 ELFv1. Similarly for ifunc and dynamic relocation processing
442 specific to ELFv1. Recognize that symbols are defined on
443 their plt entries for ELFv2.
444 (Target_powerpc::symval_for_branch): Assert if called for
445 ELFv2 or ppc32.
446 (Target_powerpc::Relocate::relocate): Use global entry plt
447 stub for symbol value if such exists on ELFv2.
448 (Target_powerpc::Relocate::relocate): Don't call
449 symval_for_branch when ELFv2. Do adjust for local entry
450 offset when ELFv2.
451 (Target_powerpc::do_dynsym_value): Set symbols to global entry
452 plt stub for ELFv2.
453 (Target_powerpc::do_plt_address_for_global): Similarly.
454
cafdd569
CC
4552013-11-14 Cary Coutant <ccoutant@google.com>
456
457 Revert patch -- this did not fix the problem, and there is
458 no race there.
459
460 2013-11-14 Cary Coutant <ccoutant@google.com>
461
462 PR gold/14860
463 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
464 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
465 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
466 updating fde_offsets_.
467 (Eh_frame_hdr::lock_): New data member.
468
94e49e16
CC
4692013-11-14 Cary Coutant <ccoutant@google.com>
470
471 * dwp.cc (Dwo_file_entry): New type.
472 (File_list): Use Dwo_file_entry.
473 (Dwo_file::verify): New function.
474 (Dwo_file::verify_dwo_list): New function.
475 (Dwo_file::sized_verify_dwo_list): New function.
476 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
477 list.
478 (Dwp_options): New enum type.
479 (dwp_options): Add --verify-only.
480 (usage): Likewise.
481 (main): Likewise.
482 * dwp.h (gold_info): Add declaration.
483
7cdd7d57
CC
4842013-11-14 Cary Coutant <ccoutant@google.com>
485
486 PR gold/14860
487 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
488 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
489 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
490 updating fde_offsets_.
491 (Eh_frame_hdr::lock_): New data member.
492
1d946cb3
CC
4932013-11-06 Cary Coutant <ccoutant@google.com>
494
495 PR gold/15758
496 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
497 before reloc sections.
498
4f65b40e
AM
4992013-11-04 Alan Modra <amodra@gmail.com>
500
501 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
502 (Symbol::needs_dynamic_reloc): Test new flag.
503 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
504 (Target_powerpc::Scan::get_reference_flags): Add target param.
505 Return FUNC_DESC_ABI for 64-bit ELFv1.
506 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
507 call.
508 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
509 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
510
908794a9
CC
5112013-10-31 Cary Coutant <ccoutant@google.com>
512
513 Restore support for dwp v2 DWARF package file format.
514
515 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
516 tu_length parameter. Adjust all callers.
517 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
518 * dwp.cc: Include dwarf.h.
519 (Section_bounds): New struct type.
520 (Unit_set): New struct type.
521 (Dwo_file::Dwo_file): Initialize new data member.
522 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
523 Combine and rename to...
524 (Dwo_file::read_unit_index): ...this.
525 (Dwo_file::sized_read_compunit_index)
526 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
527 (Dwo_file::sized_read_unit_index): ...this.
528 (Dwo_file::copy_section): Remove section_name, is_str_offsets
529 parameters; add section_id parameter.
530 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
531 (Dwo_file::add_unit_set): ...this.
532 (Dwo_file::shndx_map_): Remove.
533 (Dwo_file::sect_offsets_): New data member.
534 (Dwp_output_file::Dwp_output_file): Initialize new data members.
535 (Dwp_output_file::add_section): Rename to...
536 (Dwp_output_file::add_contribution): ...this.
537 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
538 (Dwp_output_file::add_tu_set): Likewise.
539 (Dwp_output_file::Contribution): New type.
540 (Dwp_output_file::Section::contributions): New data member.
541 (Dwp_output_file::Cu_or_tu_set): Remove.
542 (Dwp_output_file::Section::Section): New ctor.
543 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
544 (Dwp_output_file::Dwp_index::Section_table): New type.
545 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
546 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
547 parameter.
548 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
549 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
550 (Dwp_output_file::Dwp_index::section_table): New member function.
551 (Dwp_output_file::Dwp_index::section_table_end): New member function.
552 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
553 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
554 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
555 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
556 (Dwp_output_file::Dwp_index::section_table_): New data member.
557 (Dwp_output_file::Dwp_index::section_mask_): New data member.
558 (Dwp_output_file::add_output_section): New member function.
559 (Dwp_output_file::write_new_section): New member function.
560 (Dwp_output_file::write_contributions): New member function.
561 (Dwp_output_file::section_id_map_): New data member.
562 (class Dwo_id_info_reader): Remove.
563 (class Unit_reader): New class.
564 (get_dwarf_section_name): New function.
565 (Dwo_file::read_executable): Adjust initializations of class data.
566 (Dwo_file::read): Add support for v2 package file format.
567 (Dwo_file::read_unit_index): Likewise.
568 (Dwo_file::sized_read_unit_index): Likewise.
569 (Dwo_file::copy_section): Likewise.
570 (Dwo_file::add_unit_set): Likewise.
571 (Dwp_output_file::add_output_section): Likewise.
572 (Dwp_output_file::add_contribution): Likewise.
573 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
574 for empty slot.
575 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
576 file format.
577 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
578 slot.
579 (Dwp_output_file::initialize): Remove unused function.
580 (Dwp_output_file::finalize): Add support for v2 package file format.
581 (Dwp_output_file::write_index): Likewise.
582 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
583 function prototype.
584
2500c017
CC
5852013-10-31 Cary Coutant <ccoutant@google.com>
586
587 * configure.ac: Fix check for -fmerge-constants.
588 * configure.ac: Regenerate.
589
dd0845d7
RM
5902013-10-30 Roland McGrath <mcgrathr@google.com>
591
592 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
593 Correct 9-byte nop sequence to match what the assembler generates.
594
b4f7960d
AM
5952013-10-30 Alan Modra <amodra@gmail.com>
596
597 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
598 ppc64_local_entry_offset, ppc64_local_entry_offset,
599 do_read_symbols): New functions.
600 (Powerpc_relobj::e_flags_, st_other_): New vars.
601 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
602 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
603 (Powerpc_relobj::e_flags_): New var.
604 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
605 and adjust for ELFv2.
606 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
607 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
608 (Powerpc_dynobj::do_find_special_sections): Likewise.
609 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
610 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
611 to ELFv2 local entry.
612 (Target_powerpc::do_relax): No thread safe barriers needed for
613 ELFv2.
614 (Output_data_plt_powerpc::initial_plt_entry_size_,
615 plt_entry_size): Delete. Replace all uses with
616 first_plt_entry_offset() and plt_entry_size().
617 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
618 reserved_size parm. Update callers.
619 (Output_data_plt_powerpc::entry_count): Update.
620 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
621 and use Target_powerpc::first_plt_entry_offset().
622 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
623 rename to plt_entry_size.
624 (Output_data_plt_powerpc::add_ifunc_entry,
625 add_local_ifunc_entry): Adjust reloc for ELFv2.
626 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
627 (glink_eh_frame_fde_64v2): New.
628 (Stub_table::plt_call_size): Support ELFv2 sizing.
629 (Output_data_glink::add_eh_frame): Use the new FDE.
630 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
631 (Stub_table::do_write): Write ELFv2 stubs and glink.
632 (Target_powerpc::Relocate::relocate): Replaces nop after call
633 with ld 2,24(1) and adjust local offset destination for ELFv2.
634
f9c6b907
AM
6352013-10-30 Alan Modra <amodra@gmail.com>
636
637 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
638 (Target_powerpc::Scan::global, local): Likewise.
639 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
640 on all ppc64 @h and @ha relocs.
641
e84fe78f
AM
6422013-10-14 Alan Modra <amodra@gmail.com>
643
644 * output.h (Output_data_got::add_constant): Tidy.
645 (Output_data_got::add_constant_pair): New function.
646 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
647 methods used so as to first call reserve_ent().
648
679e4abf
RM
6492013-10-11 Roland McGrath <mcgrathr@google.com>
650
44dcb735
RM
651 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
652 add_got_entry and add_got_entry_pair.
653
13323c49
RM
654 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
655 (HAVE_PUBNAMES): Likewise.
656 * configure: Regenerate.
657
1496b446
RM
658 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
659 * testsuite/Makefile.in: Regenerate.
660
cc84c10b
RM
661 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
662 Remove const from declaration.
663 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
664 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
665 * output.h (Output_file_header): Remove const from member target_
666 and corresponding constructor argument.
667 * output.cc (Output_file_header::Output_file_header): Update prototype.
668 (Output_file_header::do_sized_write): Use this->target_ in place
669 of parameters()->target().
670
52f66a2c
RM
671 * testsuite/undef_symbol.cc (Foo::get_a): New method.
672
2b64b551
RM
673 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
674 * configure: Regenerate.
675 * Makefile.in: Regenerate.
676 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
677 * testsuite/merge_string_literals_2.c: Likewise.
678 * testsuite/Makefile.am
679 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
680 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
681 literal -fmerge-constants.
682 * testsuite/Makefile.in: Regenerate.
683
43819297
RM
684 * i386.cc (Target_i386): Remove unused member dynbss_.
685 * arm.cc (Target_arm): Likewise.
686 * powerpc.cc (Target_powerpc): Likewise.
687 * sparc.cc (Target_sparc): Likewise.
688 * tilegx.cc (Target_tilegx): Likewise.
689 * x86_64.cc (Target_x86_64): Likewise.
690 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
691 type_signature_, type_offset_.
692 * plugin.h (Plugin_hook): Remove unused member layout_.
693 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
694 mapfile_.
695 (Read_member): Remove unused members input_objects_, symtab_,
696 mapfile_, layout_.
697 (Check_library): Remove unused member symtab_.
698 * archive.h (Lib_group): Remove unused member lib_.
699 * archive.cc (Lib_group::Lib_group): Update initializer.
700 * incremental.h (Incremental_binary): Remove unused member target_.
701 (Incremental_script_entry): Removed unused member script_.
702 * layout.h (Write_symbols_task): Remove unused member input_objects_.
703 * icf.h (Icf): Remove unused member num_tracked_relocs.
704
39d9ead7
RM
705 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
706 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
707 its only use.
708 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
709
679e4abf
RM
710 * archive.h: Use struct rather than class for forward declaration
711 of Read_symbols_data.
712
54de2ea6
CC
7132013-10-07 Cary Coutant <ccoutant@google.com>
714
715 PR gold/16010
716 * testsuite/Makefile.am (icf_test): Fix dependencies.
717 (icf_safe_test): Likewise.
718 (icf_safe_so_test): Likewise.
719 (large_symbol_alignment): Add empty _LDADD rule.
720 * testsuite/Makefile.in: Regenerate.
721
b14016f0
L
7222013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
723
724 PR gold/15927
725 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
726 relocation for R_X86_64_32 on x32.
727
eb426534
RM
7282013-08-27 Roland McGrath <mcgrathr@google.com>
729
730 * output.cc (Output_segment::set_section_addresses): Take new
731 Target* argument. If target->isolate_execinstr() and the segment
732 is executable and starts at a target->abi_pagesize() boundary,
733 pad its end out to a target->abi_pagesize() boundary with code fill.
734 * output.h (Output_segment::set_section_addresses): Update decl.
735 * layout.h (Layout::check_output_data_for_reset_values): Take new
736 argument RELAX_OUTPUTS.
737 (Layout): New member relax_output_list_.
738 (Layout::add_relax_output): New method.
739 * layout.cc (Layout::Layout): Update constructor.
740 (Layout::reset_relax_output): New method.
741 (Layout::clean_up_after_relaxation): Call it.
742 (Layout::prepare_for_relaxation): Update caller.
743 (Layout::set_segment_offsets): Update callers of set_section_addresses.
744 Call reset_relax_output before re-processing segments for
745 isolate_execinstr case.
746 (Layout::write_data): Handle relax_output_list_.
747 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
748 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
749
9aff4b7a
NC
7502013-08-23 Yuri Chornoivan <yurchor@ukr.net>
751
752 PR binutils/15834
753 * object.h: Fix typos.
754
93f8221c
RM
7552013-08-16 Roland McGrath <mcgrathr@google.com>
756
757 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
758 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
759
e44c3715
CC
7602013-08-07 Cary Coutant <ccoutant@google.com>
761
762 Revert support for v2 DWP files:
763
764 2013-03-01 Cary Coutant <ccoutant@google.com>
765
766 Add dwp support for v2 DWARF package file format.
767 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
768 tu_length parameter. Adjust all callers.
769 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
770 * dwp.cc: Include dwarf.h.
771 (Section_bounds): New struct type.
772 (Unit_set): New struct type.
773 (Dwo_file::Dwo_file): Initialize new data member.
774 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
775 Combine and rename to...
776 (Dwo_file::read_unit_index): ...this.
777 (Dwo_file::sized_read_compunit_index)
778 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
779 (Dwo_file::sized_read_unit_index): ...this.
780 (Dwo_file::copy_section): Remove section_name, is_str_offsets
781 parameters; add section_id parameter.
782 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
783 (Dwo_file::add_unit_set): ...this.
784 (Dwo_file::shndx_map_): Remove.
785 (Dwo_file::sect_offsets_): New data member.
786 (Dwp_output_file::Dwp_output_file): Initialize new data members.
787 (Dwp_output_file::add_section): Rename to...
788 (Dwp_output_file::add_contribution): ...this.
789 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
790 (Dwp_output_file::add_tu_set): Likewise.
791 (Dwp_output_file::Contribution): New type.
792 (Dwp_output_file::Section::contributions): New data member.
793 (Dwp_output_file::Cu_or_tu_set): Remove.
794 (Dwp_output_file::Section::Section): New ctor.
795 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
796 (Dwp_output_file::Dwp_index::Section_table): New type.
797 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
798 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
799 parameter.
800 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
801 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
802 (Dwp_output_file::Dwp_index::section_table): New member function.
803 (Dwp_output_file::Dwp_index::section_table_end): New member function.
804 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
805 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
806 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
807 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
808 (Dwp_output_file::Dwp_index::section_table_): New data member.
809 (Dwp_output_file::Dwp_index::section_mask_): New data member.
810 (Dwp_output_file::add_output_section): New member function.
811 (Dwp_output_file::write_new_section): New member function.
812 (Dwp_output_file::write_contributions): New member function.
813 (Dwp_output_file::section_id_map_): New data member.
814 (class Dwo_id_info_reader): Remove.
815 (class Unit_reader): New class.
816 (get_dwarf_section_name): New function.
817 (Dwo_file::read_executable): Adjust initializations of class data.
818 (Dwo_file::read): Add support for v2 package file format.
819 (Dwo_file::read_unit_index): Likewise.
820 (Dwo_file::sized_read_unit_index): Likewise.
821 (Dwo_file::copy_section): Likewise.
822 (Dwo_file::add_unit_set): Likewise.
823 (Dwp_output_file::add_output_section): Likewise.
824 (Dwp_output_file::add_contribution): Likewise.
825 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
826 for empty slot.
827 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
828 file format.
829 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
830 slot.
831 (Dwp_output_file::initialize): Remove unused function.
832 (Dwp_output_file::finalize): Add support for v2 package file format.
833 (Dwp_output_file::write_index): Likewise.
834 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
835 function prototype.
836
c6905c28
CC
8372013-07-31 Cary Coutant <ccoutant@google.com>
838
839 * object.cc (Sized_relobj::do_output_section_address): New function.
840 (Sized_relobj): Instantiate explicitly.
841 * object.h (Object::output_section_address): New function.
842 (Object::do_output_section_address): New function.
843 (Sized_relobj::do_output_section_address): New function.
844 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
845
8462013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 847 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
848
849 * parameters.cc (Parameters::entry): Return target-specific entry
850 symbol name.
851 * target.h (Target::entry_symbol_name): New function.
852 (Target_info::entry_symbol_name): New data member.
853
854 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
855 * i386.cc (Target_i386::i386_info): Likewise.
856 (Target_i386_nacl::i386_nacl_info): Likewise.
857 * sparc.cc (Target_sparc::sparc_info): Likewise.
858 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
859 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
860 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
861 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
862
234d4ab8
SA
8632013-07-22 Sterling Augustine <saugustine@google.com>
864
865 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
866 Convert parameter shndx to local variable. Add parameters symtab
867 and symtab_size. Scan over section names. Find relocation
868 section corresponding to current section. Create and initialize
869 reloc_mapper_ and reloc_type_.
870 (Dwarf_pubnames_table::read_header): Add assertion. Change
871 unit_length to off_t. Initialize member unit_length_. Fill in field
872 cu_offset_.
873 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
874 Initialize new fields unit_length_ and cu_offset_.
875 (Dwarf_pubnames_table::read_section): Update prototype.
876 (Dwarf_pubnames_table::cu_offset): New member function.
877 (Dwarf_pubnames_table::subsection_size): Likewise.
878 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
879 New fields.
880 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
881 member functions public.
882 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
883 Update comment. Rework logic. Move repeated parts to...
884 (Gdb_index_info_reader::read_pubtable): ...here. New function.
885 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
886 pubtypes_table_, and stmt_list_offset.
887 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
888 Gdb_index::find_pubtype_offset,
889 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
890 (Gdb_index::pubnames_read): Update prototype and rework logic.
891 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
892 Forward declare.
893 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
894 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
895 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
896 Gdb_index::map_pubtable_to_dies):
897 Declare functions.
898 (Gdb_index::pubnames_read): Update declaration.
899 (Gdb_index::Pubname_offset_map): New type.
900 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
901 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
902 Gdb_index::stmt_list_offset): Declare.
903 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
904 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
905 Gdb_index::pubtypes_offset_): Remove.
906
a3ed37d8
RM
9072013-07-19 Roland McGrath <mcgrathr@google.com>
908
909 * options.h (General_options): Add -Trodata-segment option.
910 * parameters.cc (Parameters::check_rodata_segment): New function.
911 (Parameters::set_target_once): Call it.
912 * parameters.h (Parameters): Declare it (private member function).
913 * layout.cc (load_seg_unusable_for_headers): New function, broken
914 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
915 then validate rodata segment rather than text segment.
916 (relaxation_loop_body): Call that.
917 (is_text_segment): New function. Don't admit a non-executable
918 segment if TARGET->isolate_execinstr().
919 (set_segment_offsets): Call it. Honor -Trodata-segment option.
920
eb5b4ded
CC
9212013-07-15 Shawn Landden <shawnlandden@gmail.com>
922
923 PR gold/15070
924 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
925 * nacl.h (Sniff_file::View::View): Request aligned view.
926
4d5effb9
CC
9272013-07-11 Cary Coutant <ccoutant@google.com>
928
929 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
930 correct BRLT entry size.
931
ba8ca3e7
AM
9322013-07-03 Alan Modra <amodra@gmail.com>
933
934 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
935 comment.
936
267257d2
CC
9372013-07-01 Cary Coutant <ccoutant@google.com>
938
939 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
940 reloc_type_.
941 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
942 (Dwarf_ranges_table::lookup_reloc): New function.
943 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
944 reloc_type_.
945 (Dwarf_ranges_table::lookup_reloc): New function.
946 (Dwarf_ranges_table::reloc_type_): New data member.
947
06f30c9d
CC
9482013-06-27 Jing Yu <jingyu@google.com>
949
950 PR gold/15662
951 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
952 function.
953 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
954 (Target_powerpc::do_relax): Call the above.
955
a2d7bf59
AM
9562013-06-27 Cary Coutant <ccoutant@google.com>
957
958 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
959 on garbage collected .opd section.
960
9612013-06-27 Alan Modra <amodra@gmail.com>
962
963 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
964 is non-zero.
965 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
966 (Target_powerpc::do_function_location): Likewise for loc->shndx.
967
32364e50
CC
9682013-06-14 Cary Coutant <ccoutant@google.com>
969
970 * resolve.cc (Symbol::override_base): Don't override st_type
971 from plugin placeholder symbols.
972 (Symbol_table::resolve): Likewise.
973 (Symbol_table::should_override): Don't complain about TLS mismatch
974 if the TO symbol is a plugin placeholder.
975 * testsuite/Makefile.am (plugin_test_tls): New test.
976 * testsuite/Makefile.in: Regenerate.
977 * testsuite/plugin_test_tls.sh: New test script.
978 * testsuite/two_file_test_2_tls.cc: New test source.
979 * testsuite/two_file_test_tls.cc: New test source.
980
7fb47cc9
CC
9812013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
982
983 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
984 the maximum segment alignment is larger than the page size.
985 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
986 correctly aligns the symbols with large alignemnt.
987 * testsuite/Makefile.in: Regenerate.
988 * testsuite/large_symbol_alignment.cc: New file.
989
6934001a
CC
9902013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
991 Sriraman Tallam <tmsriram@google.com>
992
993 * options.h (sort_section): New option.
994 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
995 Rename from Input_section_sort_section_name_special_ordering_compare.
996 (Input_section_sort_section_name_compare): New struct.
997 * output.cc (Output_section::Input_section_sort_section_name_compare::
998 operator()): New function.
999 (Output_section::sort_attached_input_sections): Use new sort function
1000 for .text if --sort-section=name is specified.
1001 * layout.cc (Layout::make_output_section):
1002 Add sorting by name when --sort-section=name is specified.
1003 * testsuite/Makefile.am (text_section_grouping): Test option
1004 --sort-section=name.
1005 * testsuite/Makefile.in: Regenerate.
1006 * testsuite/section_sorting_name.cc: New file.
1007 * testsuite/section_sorting_name.sh: New file.
1008
93acabad
CC
10092013-05-21 Cary Coutant <ccoutant@google.com>
1010
1011 * symtab.h (Symbol::is_cxx_vtable): New function.
1012 * target-reloc.h (relocate_section): Check for vtable symbol.
1013 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1014 * testsuite/Makefile.in: Regenerate.
1015 * testsuite/missing_key_func.cc: New test source.
1016 * testsuite/missing_key_func.sh: New test script.
1017
60e8b3fc
CC
10182013-05-21 Cary Coutant <ccoutant@google.com>
1019
2b64b551
RM
1020 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1021 type of enclosing symbol.
1022 (Relocate_info::location): Check symbol type when describing symbol.
1023 * object.h (Symbol_location_info): Remove unused line_number;
1024 add enclosing_symbol_type.
1025 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1026
9df9de2c
CC
10272013-05-13 Cary Coutant <ccoutant@google.com>
1028
2b64b551
RM
1029 * configure.ac: Export DEFAULT_TARGET.
1030 * configure: Regenerate.
1031 * Makefile.in: Regenerate.
1032 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1033 * testsuite/Makefile.in: Regenerate.
1034 * testsuite/debug_msg.sh: Delete duplicate tests.
1035 Don't check undef_int error message match for powerpc where the
1036 source file and line number aren't available.
9df9de2c 1037
bbc5ae17
RM
10382013-05-10 Roland McGrath <mcgrathr@google.com>
1039
1040 * options.h (General_options): Add --rosegment-gap option.
1041 * options.cc (finalize): --rosegment-gap implies --rosegment.
1042 * layout.cc (set_segment_offsets): Let user option override
1043 target->rosegment_gap().
1044
0c6e6c39
RM
10452013-05-10 Roland McGrath <mcgrathr@google.com>
1046
1047 * options.h (General_options): Remove leading space from help
1048 messages for -nostdlib and --rosegment.
1049
cde7cb01
MR
10502013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1051
1052 PR ld/15365
1053 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1054
f31ae5b8
AM
10552013-05-03 Alan Modra <amodra@gmail.com>
1056
1057 * merge.cc (Output_merge_string::do_add_input_section): Correct
1058 scan for number of strings. Rename vars to avoid shadowing.
1059 Include missing terminator in input_size_.
1060
d3a7cd45
L
10612013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1062
1063 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1064 Restore empty string handling.
1065
6ad3daba
CC
10662013-05-01 Cary Coutant <ccoutant@google.com>
1067
1068 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1069 uninitialized warning.
1070
e31908b6
CC
10712013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1072
1073 * output.cc (Output_section::add_merge_input_section): Allow
1074 to merge sections if the alignment is more than character size.
1075 * merge.h (Output_merge_string::Output_merge_string): Remove
1076 assert.
1077 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1078 only not-null strings. Check the alignment of strings.
1079 * stringpool.h
1080 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1081 alignment as the argument.
1082 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1083 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1084 Align non-zero length strings according to the addralign_.
1085 (Stringpool_template<Stringpool_char>::set_string_offsets):
1086 Updating offsets according to the given alignment.
1087 * testsuite/Makefile.am (text_section_grouping): Test if string
1088 literals are getting merged.
1089 * testsuite/Makefile.in: Regenerate.
1090 * testsuite/merge_string_literals_1.c: New file.
1091 * testsuite/merge_string_literals_2.c: Ditto.
1092 * testsuite/merge_string_literals.sh: Ditto.
1093
0e804863
ILT
10942013-04-26 Ian Lance Taylor <iant@google.com>
1095
1096 * target-reloc.h (relocate_section): If the reloc offset is out of
1097 range, pass VIEW as NULL to relocate.relocate.
1098 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1099 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1100 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1101 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1102 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1103 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1104
e7c5ea40
CC
11052013-04-26 Geoff Pike <gpike@chromium.org>
1106
1107 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1108 * layout.cc (Hash_task): New class.
1109 (Layout::queue_build_id_tasks): New function.
1110 (Layout::write_build_id): Handle single-thread portion of build ID
1111 computation. (In some cases, all of it is single-threaded.) Replace
1112 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1113 functionality in fewer lines of code.
1114 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1115 * options.h (General_options): make "--build-id" default to tree
1116 rather than sha1. Add two new options related to --build-id=tree:
1117 --build-id-chunk-size-for-treehash and
1118 --build-id-min-file-size-for-treehash.
1119 * Makefile.am: add testing of --build-id=tree and related new options
1120 (these tests will be invoked by "make check").
1121 * Makefile.in: Regenerate.
1122
49926cd0
AM
11232013-04-25 Alan Modra <amodra@gmail.com>
1124
1125 * configure.tgt: Add powerpcle and powerpc64le.
1126
a4034750
AM
11272013-04-22 Alan Modra <amodra@gmail.com>
1128
1129 PR gold/15355
1130 * layout.cc (Layout::segment_precedes): Allow more than one
1131 segment with the same type and flags.
1132
e79c84aa
CC
11332013-04-15 Cary Coutant <ccoutant@google.com>
1134
1135 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1136 allocate space in file for BSS sections.
1137
2199fbe7
CC
11382013-04-15 Cary Coutant <ccoutant@google.com>
1139
1140 * script-sections.cc (Orphan_output_section): Reset address
1141 to zero after each orphaned section for relocatable links.
1142
502e8a84
CC
11432013-04-15 Cary Coutant <ccoutant@google.com>
1144
a4034750
AM
1145 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1146 section starting address for relocatable link.
1147 * testsuite/Makefile.am (script_test_11): New test.
1148 * testsuite/Makefile.in: Regenerate.
1149 * testsuite/script_test_11.c: New source file.
1150 * testsuite/script_test_11.t: New linker script.
502e8a84 1151
0cfdc767
AM
11522013-04-13 Alan Modra <amodra@gmail.com>
1153
1154 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1155 owner when sections are not adjacent and exceed group size.
1156 (Target_powerpc::group_sections): Handle corner case.
1157 (Target_powerpc::Branch_info::make_stub): Handle case where
1158 stub table doesn't exist due to branches in non-exec sections.
1159 (Target_powerpc::Relocate::relocate): Likewise.
1160
6830ee24
AM
11612013-04-11 Alan Modra <amodra@gmail.com>
1162
1163 PR gold/15354
1164 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1165 .branch_lt to match bfd ld. Adjust comments throughout file.
1166
54a3d865
ILT
11672013-04-04 Ian Lance Taylor <iant@google.com>
1168
1169 GCC PR c++/56840
1170 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1171 sections before checking whether they are included in the link.
1172
9993ba11
ST
11732013-03-29 Sriraman Tallam <tmsriram@google.com>
1174
1175 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1176 object before calling the plugin claim_file handler. Pass the elf
1177 object of the archive to the plugin. Delete the elf object if the
1178 plugin claims the file.
1179
ebacd51e
AM
11802013-03-21 Alan Modra <amodra@gmail.com>
1181
1182 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1183 segment when omagic.
1184
117be58f
AM
11852013-03-21 Alan Modra <amodra@gmail.com>
1186
1187 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1188 comparison warning.
1189 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1190 uninitialized" warning.
1191
32e2b61d
AM
11922013-03-20 Alan Modra <amodra@gmail.com>
1193
1194 * symtab.h (Symbol::clear_version): New function.
1195 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1196 is_needed by weak references. Clear version for symbols defined
1197 in as-needed objects that are not needed.
1198
b3ccdeb5
AM
11992013-03-15 Alan Modra <amodra@gmail.com>
1200
1201 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1202 static and public. Add report_err param. Return false for data refs.
1203 (Target_powerpc::rela_dyn_section): New overloaded function.
1204 (Target_powerpc::plt_, iplt_): Elucidate.
1205 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1206 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1207 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1208 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1209 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1210 push_branch and make_plt_entry for ifunc syms when
1211 reloc_needs_plt_for_ifunc.
1212 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1213 for ifunc unless reloc_needs_plt_for_ifunc.
1214
ad3d8a2f
AM
12152013-03-15 Alan Modra <amodra@gmail.com>
1216
1217 * gc.h (gc_process_relocs): Don't look through function descriptors.
1218 * icf.cc (get_section_contents): Do so here instead.
1219
4d9aa155
AM
12202013-03-13 Alan Modra <amodra@gmail.com>
1221
1222 * powerpc.cc (is_branch_reloc): Forward declare.
1223 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1224 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1225 false for 64-bit, true for 32-bit non-branch relocs.
1226 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1227 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1228 nm output.
1229 (icf_safe_test): Generate linker map file as well as nm output.
1230 (icf_safe_so_test): Likewise.
1231 * testsuite/Makefile.in: Regenerate.
1232 * testsuite/icf_test.sh: Parse linker map file to determine
1233 section folding.
1234 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1235 * testsuite/icf_safe_so_test.sh: Likewise.
1236 (X86_32_or_ARM_specific_safe_fold): Merge into..
1237 (arch_specific_safe_fold): ..this.
1238 (X86_64_specific_safe_fold): Delete unused function.
1239
57420c20
AM
12402013-03-12 Alan Modra <amodra@gmail.com>
1241
1242 * gc.h (gc_process_relocs): Look through function descriptors
1243 to determine shndx, symvalue and addend used by ICF. Tidy
1244 variable duplication.
1245
dc3714f3
AM
12462013-03-11 Alan Modra <amodra@gmail.com>
1247
1248 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1249 * layout.cc (Layout_task_runner::run): ..to here.
1250 * symtab.h (struct Symbol_location): Extract from..
1251 (class Symbol_table): ..here.
1252 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1253 * target.h (class Target): Add function_location and
1254 do_function_location functions.
1255 (class Sized_target): Add do_function_location.
1256 * object.h (class Sized_relobj_file): Move find_shdr..
1257 (class Object): ..to here.
1258 * object.cc: Likewise. Update to suit. Instantiate.
1259 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1260 * powerpc.cc (class Powerpc_dynobj): New.
1261 (Target_powerpc::do_function_location): New function.
1262 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1263 (Powerpc_dynobj::do_read_symbols): New function.
1264 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1265
956b03bb
ILT
12662013-03-08 Ian Lance Taylor <iant@google.com>
1267
1268 * options.cc (General_options::string_to_object_format): Accept
1269 "default".
1270
4bead2d5
AM
12712013-03-08 Alan Modra <amodra@gmail.com>
1272
1273 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1274 pointer to Post_fde.
1275 (struct Post_fde): Move definition to here..
1276 * ehframe.cc (struct Post_fde): ..from here.
1277 (Cie::write): Don't alloc Post_fde.
1278 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1279
02e60bf7
AM
12802013-03-07 Alan Modra <amodra@gmail.com>
1281
1282 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1283 relocation referencing .LC0.
1284 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1285
8343f03a
AM
12862013-03-07 Alan Modra <amodra@gmail.com>
1287
1288 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1289 always_inline. Add assembly for powerpc to avoid GOT.
1290
3366d57c
AM
12912013-03-07 Alan Modra <amodra@gmail.com>
1292
1293 * testsuite/script_test_10.sh: Don't test .bss section
1294 header number.
1295
6c77229c
AM
12962013-03-06 Alan Modra <amodra@gmail.com>
1297
1298 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1299 (Target_powerpc::symval_for_branch): Add symtab param. Update
1300 all callers. Handle folded sections.
1301 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1302 to Powerpc_relobj.
1303 (Global_symbol_visitor_opd::operator()): Likewise.
1304
a39e4af6
AM
13052013-03-04 Alan Modra <amodra@gmail.com>
1306
1307 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1308 * testsuite/Makefile.in: Regenerate.
1309
d5834edb
CC
13102013-03-01 Cary Coutant <ccoutant@google.com>
1311
1312 Add dwp support for v2 DWARF package file format.
1313 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1314 tu_length parameter. Adjust all callers.
1315 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1316 * dwp.cc: Include dwarf.h.
1317 (Section_bounds): New struct type.
1318 (Unit_set): New struct type.
1319 (Dwo_file::Dwo_file): Initialize new data member.
1320 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1321 Combine and rename to...
1322 (Dwo_file::read_unit_index): ...this.
1323 (Dwo_file::sized_read_compunit_index)
1324 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1325 (Dwo_file::sized_read_unit_index): ...this.
1326 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1327 parameters; add section_id parameter.
1328 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1329 (Dwo_file::add_unit_set): ...this.
1330 (Dwo_file::shndx_map_): Remove.
1331 (Dwo_file::sect_offsets_): New data member.
1332 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1333 (Dwp_output_file::add_section): Rename to...
1334 (Dwp_output_file::add_contribution): ...this.
1335 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1336 (Dwp_output_file::add_tu_set): Likewise.
1337 (Dwp_output_file::Contribution): New type.
1338 (Dwp_output_file::Section::contributions): New data member.
1339 (Dwp_output_file::Cu_or_tu_set): Remove.
1340 (Dwp_output_file::Section::Section): New ctor.
1341 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1342 (Dwp_output_file::Dwp_index::Section_table): New type.
1343 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1344 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1345 parameter.
1346 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1347 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1348 (Dwp_output_file::Dwp_index::section_table): New member function.
1349 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1350 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1351 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1352 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1353 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1354 (Dwp_output_file::Dwp_index::section_table_): New data member.
1355 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1356 (Dwp_output_file::add_output_section): New member function.
1357 (Dwp_output_file::write_new_section): New member function.
1358 (Dwp_output_file::write_contributions): New member function.
1359 (Dwp_output_file::section_id_map_): New data member.
1360 (class Dwo_id_info_reader): Remove.
1361 (class Unit_reader): New class.
1362 (get_dwarf_section_name): New function.
1363 (Dwo_file::read_executable): Adjust initializations of class data.
1364 (Dwo_file::read): Add support for v2 package file format.
1365 (Dwo_file::read_unit_index): Likewise.
1366 (Dwo_file::sized_read_unit_index): Likewise.
1367 (Dwo_file::copy_section): Likewise.
1368 (Dwo_file::add_unit_set): Likewise.
1369 (Dwp_output_file::add_output_section): Likewise.
1370 (Dwp_output_file::add_contribution): Likewise.
1371 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1372 for empty slot.
1373 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1374 file format.
1375 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1376 slot.
1377 (Dwp_output_file::initialize): Remove unused function.
1378 (Dwp_output_file::finalize): Add support for v2 package file format.
1379 (Dwp_output_file::write_index): Likewise.
1380 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1381 function prototype.
1382
a68a081d
CC
13832013-03-01 Cary Coutant <ccoutant@google.com>
1384
1385 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1386 function into class definition in header file.
1387 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1388 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1389 New function.
1390 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1391
9d5781f8
AM
13922013-02-28 Alan Modra <amodra@gmail.com>
1393
1394 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1395 * target.cc (Target::do_plt_fde_location): New function.
1396 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1397 accessor function, and constructor param.
1398 (struct Post_fde, Post_fdes): Declare.
1399 (Cie::write): Add post_fdes param.
1400 * ehframe.cc (Fde::write): Use plt_fde_location.
1401 (struct Post_fde): Define.
1402 (Cie::write): Stash FDEs added post merge mapping.
1403 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1404 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1405 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1406 other FDEs.
1407 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1408 (Target_powerpc::has_glink): New function.
1409 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1410 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1411 glink_eh_frame_fde_32, default_fde): New data.
1412 (Stub_table::eh_frame_added_): New var.
1413 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1414 Make const.
1415 (Stub_table::add_eh_frame): New function.
1416 (Output_data_glink::add_eh_frame): New function.
1417 (Target_powerpc::make_glink_section): Call add_eh_frame.
1418
214383dd
ILT
14192013-02-15 Ian Lance Taylor <iant@google.com>
1420
1421 * options.h (DEFINE_uint64_alias): Define.
1422 (class General_options): Add -Ttext-segment as an alias for
1423 -Ttext.
1424
91c2b899
AM
14252013-02-15 Alan Modra <amodra@gmail.com>
1426
1427 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1428 (Stub_table::do_write): ..here, two places.
1429 (Stub_table::plt_call_size): Use it here too.
1430
20e2a8aa
ILT
14312013-02-11 Ian Lance Taylor <iant@google.com>
1432
1433 * descriptors.cc (Descriptors::close_all): New function.
1434 * descriptors.h (class Descriptors): Declare close_all.
1435 (close_all_descriptors): New inline function.
1436 * plugin.cc: Include "descriptors.h".
1437 (Plugin_manager::cleanup): Call close_all_descriptors.
1438
8952bc69
AM
14392013-02-06 Alan Modra <amodra@gmail.com>
1440
1441 * README: Update coding style link.
1442
29bd8b6b
CC
14432013-01-28 Cary Coutant <ccoutant@google.com>
1444
a4034750
AM
1445 * dwp.cc (File_list): New typedef.
1446 (Dwo_name_info_reader): New class.
1447 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1448 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1449 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1450 (Dwo_file::read_executable): New function.
1451 (Dwo_file::read): Move common setup code to ...
1452 (Dwo_file::make_object): ... here.
1453 (dwp_options): Add --exec/-e.
1454 (usage): Likewise.
1455 (main): Likewise.
29bd8b6b 1456
c6ac678d
ST
14572013-01-24 Sriraman Tallam <tmsriram@google.com>
1458
1459 * layout.cc (Layout::layout): Check for option text_reorder.
1460 (Layout::make_output_section): Ditto.
1461 * options.h (text_reorder): New option.
1462 * output.cc (Input_section_sort_compare): Remove special ordering
1463 of section names.
1464 (Output_section::
1465 Input_section_sort_section_name_special_ordering_compare::
1466 operator()): New function.
1467 (Output_section::sort_attached_input_sections): Use new sort function
1468 for .text.
1469 * output.h (Input_section_sort_section_name_special_ordering_compare):
1470 New struct.
1471 * testsuite/Makefile.am (text_section_grouping): Test option
1472 --no-text-reorder
1473 * testsuite/Makefile.in: Regenerate.
1474 * testsuite/text_section_grouping.sh: Check order of functions without
1475 default text reordering.
1476
50701cc1
MF
14772013-01-18 Mike Frysinger <vapier@gentoo.org>
1478
1479 * options.h (General_options): Change default to true for new_dtags.
1480
b1b00fcc
MF
14812013-01-18 Mike Frysinger <vapier@gentoo.org>
1482
1483 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1484 when enable_new_dtags is false. Only add DT_RUNPATH when
1485 enable_new_dtags is true.
1486
ec5b8187
AM
14872013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1488
1489 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1490 used in declaration and definition consistent.
1491 (Target_powerpc::symval_for_branch): Ditto.
1492
a880d4c4
ST
14932013-01-16 Sriraman Tallam <tmsriram@google.com>
1494
1495 * testsuite/plugin_final_layout.cc: Fix comment.
1496
7c381248
ST
14972013-01-16 Sriraman Tallam <tmsriram@google.com>
1498
1499 * layout.cc (Layout::layout): Do not do default sorting for
1500 text sections when section ordering is specified.
1501 (make_output_section): Ditto.
1502 * testsuite/plugin_final_layout.cc: Name the function sections
1503 to catch reordering issues.
1504
e2458743
AM
15052013-01-15 Alan Modra <amodra@gmail.com>
1506
1507 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1508 plt-thread-safe.
1509
431ed302
AM
15102013-01-15 Alan Modra <amodra@gmail.com>
1511
1512 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1513 * testsuite/Makefile.in: Regenerate.
1514
0ec6429b
AM
15152013-01-14 Alan Modra <amodra@gmail.com>
1516
1517 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1518 * testsuite/Makefile.in: Regenerate.
1519
0bf402d5
ILT
15202013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1521
36af3926 1522 PR bfd/14430
0bf402d5
ILT
1523 Fix mingw gold build with plugins enabled
1524 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1525 * configure.ac: Export DLOPEN_LIBS and add headers check.
1526 * plugin.cc: Handle non-dlfcn case.
1527 * Makefile.in: Regenerate.
1528 * config.in: Regenerate.
1529 * configure: Regenerate.
1530 * testsuite/Makefile.in: Regenerate.
1531
9e9143bc
ST
15322013-01-09 Sriraman Tallam <tmsriram@google.com>
1533
1534 * output.h (sort_attached_input_sections): Change to be public.
1535 * script-sections.cc
1536 (Output_section_definition::set_section_addresses): Sort
1537 attached input sections according to section order before linker
1538 script assigns section addresses.
1539 (Orphan_output_section::set_section_addresses): Sort
1540 attached input sections according to section order before linker
1541 script assigns section addresses.
1542 * Makefile.am (final_layout.sh): Use a simple linker script to
1543 check if section ordering still works.
1544 * Makefile.in: Regenerate.
1545
679af368
ILT
15462013-01-09 Ben Cheng <bccheng@google.com>
1547
1548 * arm.cc (Target_arm::attributes_accept_div): New function.
1549 (Target_arm::attributes_forbid_div): New function.
1550 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1551 attribute using the same new functions as what bfd/elf32_arm.c
1552 does.
1553
3136a00e
CC
15542013-01-07 Cary Coutant <ccoutant@google.com>
1555
1556 PR gold/14993
1557 * output.cc (Output_section::add_input_section): For incremental
1558 updates, don't track input sections that are allocated from patch
1559 space.
1560
f2a6224b
L
15612013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1562 Ian Lance Taylor <iant@google.com>
1563
1564 PR gold/14897
1565 * configure.ac (--enable-ld): Removed.
1566 (install_as_default): Set to yes only for --enable-gold=default
1567 or --disable-ld.
1568 * configure: Regenerated.
1569
4f46f626
L
15702013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1571
1572 * options.h (General_options): Add -fuse-ld= for GCC linker
1573 option compatibility.
1574
26e4ef59
CC
15752013-01-04 Cary Coutant <ccoutant@google.com>
1576
1577 * configure.ac: Fix typo restoring CXXFLAGS.
1578 * configure: Regenerate.
1579
3d587466
CC
15802013-01-04 Cary Coutant <ccoutant@google.com>
1581
4f46f626
L
1582 * testsuite/Makefile.am (CXXLINK_S): New macro.
1583 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1584 * testsuite/Makefile.in: Regenerate.
3d587466 1585
44db6695
L
15862013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1587
1588 * version.cc (print_version): Update copyright year to 2013.
1589
edcac0c1
ILT
15902012-12-20 Ian Lance Taylor <iant@google.com>
1591
1592 * layout.cc (Layout::special_ordering_of_input_section): New
1593 function.
1594 (Layout::layout): If input section requires special ordering, must
1595 sort input sections.
1596 (Layout::make_output_section): May sort .text input sections.
1597 (Layout::is_section_name_prefix_grouped): Remove.
1598 * layout.h (class Layout): Declare
1599 special_ordering_of_input_section. Don't declare
1600 is_section_name_prefix_grouped.
1601 * output.cc (Output_section::add_input_section): Revert last
1602 change.
1603 (Output_section::Input_section_sort::match_file_name): Don't crash
1604 if called on output section data.
1605 (Output_section::Input_section_sort_compare): Sort based on
1606 special ordering.
1607 (Output_section::Input_section_sort_section_order_index_compare):
1608 Revert last patch.
1609 (Output_section::sort_attached_input_sections): Likewise.
1610
28f2a4ac
ST
16112012-12-18 Sriraman Tallam <tmsriram@google.com>
1612
edcac0c1 1613 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
1614 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1615 * output.cc (Output_section::add_input_section): Check if section
1616 name contains special prefix. Keep input sections to sort such
1617 sections.
1618 (Output_section::Input_section_sort_section_order_index_compare
1619 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
1620 (Output_section::sort_attached_input_sections): Add condition to
1621 Input_section_entry constructor call.
28f2a4ac
ST
1622 * testsuite/Makefile.am (text_section_grouping): New test.
1623 * testsuite/Makefile.in: Regenerate.
1624 * testsuite/text_section_grouping.cc: New file.
1625 * testsuite/text_section_grouping.sh: New file.
1626
5bf135a7
NC
16272012-12-17 Nick Clifton <nickc@redhat.com>
1628
1629 * Makefile.am: Add copyright notice.
1630 * NEWS: Likewise.
1631 * README: Likewise.
1632 * configure.ac: Likewise.
1633 * ftruncate.c: Likewise.
1634 * Makefile.in: Regenerate.
1635
59965708
CC
16362012-12-14 Cary Coutant <ccoutant@google.com>
1637
a4034750
AM
1638 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1639 --no-as-needed flag.
1640 (exception_separate_shared_12_test): Likewise.
1641 (incremental_copy_test): Likewise.
1642 * testsuite/Makefile.in: Regenerate.
59965708 1643
2a77e2ab
CC
16442012-12-14 Cary Coutant <ccoutant@google.com>
1645
1646 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1647 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1648
e3deeb9c
AM
16492012-12-12 Alan Modra <amodra@gmail.com>
1650
1651 * powerpc.cc (class Track_tls): New.
1652 (class Relocate, class Scan): Inherit Track_tls.
1653 (Target_powerpc::Scan::local, global): Track tls optimization
1654 and avoid creating plt entry for __tls_get_addr if all uses
1655 are optimized away.
1656 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1657
d8f5a274
AM
16582012-12-12 Alan Modra <amodra@gmail.com>
1659
1660 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1661 Replace no_toc_optimize with toc_optimize.
1662 * output.h (Output_section::input_sections): Provide non-const variant.
1663 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1664 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1665 accessors.
1666 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1667 (class Sort_toc_sections): New.
1668 (Target_powerpc::do_finalize_sections): Sort toc sections.
1669 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1670
4c8a1de1
RM
16712012-12-10 Roland McGrath <mcgrathr@google.com>
1672
1673 * testsuite/binary_unittest.cc (read_all): New function.
1674 (Sized_binary_test): Use it instead of ::read.
1675 * fileread.cc (do_read): Don't assume pread always reads the whole
1676 amount in a single call.
1677
edc27beb
AM
16782012-12-10 Alan Modra <amodra@gmail.com>
1679
1680 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1681 Set EM_PPC64 or EM_PPC here.
1682 (Target_selector_powerpc::do_recognize): Delete.
1683
906b9150
AM
16842012-12-10 Alan Modra <amodra@gmail.com>
1685
1686 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1687 stub_table_.
1688 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1689
418c15ae
RM
16902012-12-07 Roland McGrath <mcgrathr@google.com>
1691
1692 * testsuite/binary_unittest.cc (Sized_binary_test):
1693 Use open_descriptor rather than ::open.
1694
decdd3bc
AM
16952012-12-07 Alan Modra <amodra@gmail.com>
1696
1697 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1698 typedef and invalid_address constant.
1699 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1700 instantiate constants.
1701
db399005
ILT
17022012-12-06 Roland McGrath <mcgrathr@google.com>
1703
1704 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1705 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1706 * aclocal.m4: Regenerate.
1707 * configure: Regenerate.
1708 * Makefile.in: Regenerate.
1709 * testsuite/Makefile.in: Regenerate.
1710
aba6bc71
AM
17112012-12-07 Alan Modra <amodra@gmail.com>
1712
1713 * options.h (General_options): Add no_toc_optimize.
1714 * powerpc.cc (ok_lo_toc_insn): New function.
1715 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1716
9e69ed50
AM
17172012-12-06 Alan Modra <amodra@gmail.com>
1718
1719 * options.h (General_options): Add plt_align, plt_static_chain,
1720 plt_thread_safe. Update stub_group_size help text.
1721 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1722 for new plt_thread_safe_ var.
1723 (use_plt_offset): Correct comments.
1724 (Target_powerpc::do_relax): Look for thread creation symbols to
1725 determine default plt_thread_safe value. Clear plt call stubs
1726 as well as branch stubs each iteration.
1727 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
1728 insn constants.
1729 (l, hi, ha, write_insn): Move earlier.
1730 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
1731 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
1732 plt stubs too.
1733 (Stub_table::update_size): Adjust.
1734 (Stub_table::prev_size, set_prev_size): Delete.
1735 (Stub_table::stub_align): Let --plt-align affect result.
1736 (Stub_table::plt_call_size): Calculate sizes for various stubs.
1737 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
1738 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
1739 (Stub_table::do_write): Support more stub variants.
1740
f43ba157
AM
17412012-12-04 Alan Modra <amodra@gmail.com>
1742
1743 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
1744 (Target_powerpc::do_define_standard_symbols): New function.
1745
34171bc5
AM
17462012-12-03 Alan Modra <amodra@gmail.com>
1747
1748 * output.h: Formatting, whitespace.
1749
dc9589e9 17502012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
1751
1752 * layout.h (Layout::get_executable_sections): Declare.
1753 * layout.cc (Layout::get_executable_sections): New function.
1754 * arm.cc (Target_arm::group_sections): Use it.
1755 (Arm_output_section::group_sections): Delete now redundant test.
1756 * output.cc (Output_reloc::Output_reloc): Add is_relative.
1757 param to handle relative relocs.
1758 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
1759 (Output_data_reloc::add_absolute): Adjust.
1760 (Output_data_reloc::add_relative): New function.
1761 (Output_data::reset_data_size): New function.
1762 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
1763 (Output_section::set_addralign): New function.
1764 (Output_section::checkpoint_set_addralign): New function.
1765 (Output_section::clear_section_offsets_need_adjustment): New function.
1766 (Output_section::input_sections): Make public.
1767 * powerpc.cc (class Output_data_brlt_powerpc): New.
1768 (class Stub_table, class Stub_control): New.
1769 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
1770 stub_table_, set_stub_table, stub_table): New vectors and accessor
1771 functions.
1772 (Target_powerpc::do_may_relax, do_relax, push_branch,
1773 new_stub_table, stub_tables, brlt_section, group_sections,
1774 add_branch_lookup_table, find_branch_lookup_table,
1775 write_branch_lookup_table, make_brlt_section): New functions.
1776 (Target_powerpc::struct Sort_sections, class Branch_info): New.
1777 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
1778 branch_info_): New vars.
1779 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
1780 make call stubs here.
1781 (Output_data_glink): Remove all call stub handling from this class.
1782 (Target_powerpc::Scan::local, global): Save interesting branch
1783 relocs and relocs for ifunc. Adjust calls to plt entry functions.
1784 (Target_powerpc::do_finalize_sections): Only make reg save/restore
1785 functions on final link.
1786 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
1787 Handle long branch destinations too.
1788 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
1789 do_plt_address_for_local): Adjust lookup of plt call stubs.
1790
627b30b7
AM
17912012-11-30 Alan Modra <amodra@gmail.com>
1792
1793 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
1794 relocs against protected symbols when building 32-bit shared libs.
1795
40b469d7
AM
17962012-11-30 Alan Modra <amodra@gmail.com>
1797
1798 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
1799 param. Call got_section() to make .got. Update all callers
1800 and their callers and so on.
1801
bb66a627
AM
18022012-11-30 Alan Modra <amodra@gmail.com>
1803
1804 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
1805 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
1806 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
1807 value if it already exists.
1808
d2cf1c6c
L
18092012-11-19 H.J. Lu <hongjiu.lu@intel.com>
1810
1811 PR gold/14858
1812 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
1813
edccdf7c
RM
18142012-11-14 Roland McGrath <mcgrathr@google.com>
1815
1816 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
1817 than bfc instruction for data sandboxing.
1818
6febeb74
AM
18192012-11-08 Alan Modra <amodra@gmail.com>
1820
1821 * po/POTFILES.in: Regenerate.
1822
0a6f1bf2
AM
18232012-11-05 Alan Modra <amodra@gmail.com>
1824
1825 * configure.ac: Apply 2012-09-10 change to config.in here.
1826 * configure: Regenerate.
1827
26a4e9cb
AM
18282012-11-05 Alan Modra <amodra@gmail.com>
1829
1830 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
1831 (struct Opd_ent): Use "Address" rather than "Offset".
1832 (Output_data_got_powerpc::got_base_offset): Return Valtype.
1833 (Target_powerpc::got_section): Make public.
1834 (Target_powerpc::scan_relocs): Move code setting symbols..
1835 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
1836 Create _SDA_BASE_ only when referenced.
1837
cc928013
RM
18382012-11-02 Roland McGrath <mcgrathr@google.com>
1839
1840 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
1841 from last change.
1842
50ed5eb1
RM
18432012-11-01 Roland McGrath <mcgrathr@google.com>
1844
62fe925a
RM
1845 * target.h (Sized_target::relocate_relocs): Use Elf_Off
1846 for offset_in_output_section parameter.
1847 (Sized_target::relocate_special_relocatable): Likewise.
1848 * arm.cc (Target_arm::relocate_relocs): Likewise.
1849 (Target_arm::relocate_special_relocatable): Likewise.
1850 * i386.cc (Target_i386::relocate_relocs): Likewise.
1851 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
1852 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
1853 * target-reloc.h (relocate_relocs): Likewise.
1854 * testsuite/testfile.cc (Target_test): Likewise.
1855 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
1856 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
1857
1858 * system.h: Move inclusion of <clocale> to after <libintl.h> in
1859 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
1860
1861 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
1862 parameter, which is unused in the [!F_SETFD] case.
1863
50ed5eb1
RM
1864 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
1865 SYMNDX to off_t before comparing it to this->data_size().
1866 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
1867 * incremental.cc (Output_section_incremental_inputs::do_write):
1868 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
1869
2cadc0bf
RM
1870 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
1871
3bfcb652
NC
18722012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
1873
1874 * gold.cc (Target_arm::do_adjust_elf_header): Add the
1875 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
1876 in EABI_VER5.
1877
c1a8d56e
CC
18782012-10-29 Cary Coutant <ccoutant@google.com>
1879
1880 * dwp.cc (usage): Add file and exit status parameters;
1881 add --help and --version options.
1882 (print_version): New function.
1883 (main): Add --help and --version options.
1884
b2490a7b
L
18852012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1886
1887 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
1888 final_layout_sequence.txt.
1889 * testsuite/Makefile.in: Regenerated.
1890
aa543512
L
18912012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1892
1893 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
1894 COMPILE generated by automake.
1895 (LINK1): Likewise.
1896 (CXXCOMPILE1): Likewise.
1897 (CXXLINK1): Likewise.
1898 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
1899 (LINK): Likewise.
1900 (CXXCOMPILE): Likewise.
1901 (CXXLINK): Likewise.
1902 * testsuite/Makefile.in: Regenerated.
1903
d361fafb
L
19042012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1905
1906 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
1907 on bad fwrite return.
1908
598c7410
L
19092012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1910
1911 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
1912 on val.
1913
35c813e2
CC
19142012-10-23 Cary Coutant <ccoutant@google.com>
1915
1916 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
1917 * testsuite/Makefile.in: Regenerate.
1918 * testsuite/dwp_test.h: New source file.
1919 * testsuite/dwp_test_1.cc: New source file.
1920 * testsuite/dwp_test_1.s: New source file.
1921 * testsuite/dwp_test_1.sh: New source file.
1922 * testsuite/dwp_test_1b.cc: New source file.
1923 * testsuite/dwp_test_1b.s: New source file.
1924 * testsuite/dwp_test_2.cc: New source file.
1925 * testsuite/dwp_test_2.s: New source file.
1926 * testsuite/dwp_test_2.sh: New source file.
1927 * testsuite/dwp_test_main.cc: New source file.
1928 * testsuite/dwp_test_main.s: New source file.
1929
77429909
CC
19302012-10-23 Cary Coutant <ccoutant@google.com>
1931
1932 * dwp.h: New header file.
1933 * dwp.cc: New source file.
1934 * gold.h: Move shared declarations to system.h.
1935 * system.h: New header file.
1936 * Makefile.am: Add dwp.
1937 * Makefile.in: Regenerate.
1938
ed5d6712
CC
19392012-10-23 Cary Coutant <ccoutant@google.com>
1940
1941 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1942 Dwarf_info_reader::read_from_pointer.
1943 (Dwarf_pubnames_table::read_header): Likewise.
1944 (Dwarf_pubnames_table::next_name): Likewise.
1945 (Dwarf_die::read_attributes): Likewise.
1946 (Dwarf_die::skip_attributes): Likewise.
1947 (Dwarf_info_reader::read_from_pointer): New function template.
1948 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1949 (Dwarf_pubnames_table): Likewise.
1950 (Dwarf_info_reader::read_from_pointer): New function template.
1951 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1952 Dwarf_pubnames_table ctor.
1953
8787852d
CC
19542012-10-23 Cary Coutant <ccoutant@google.com>
1955
1956 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1957 abbrev_shndx.
1958 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1959 abbrev_shndx_.
1960 (Dwarf_info_reader::set_abbrev_shndx): New method.
1961 (Dwarf_info_reader::abbrev_shndx_): New data member.
1962
9fc236f3
CC
19632012-10-23 Cary Coutant <ccoutant@google.com>
1964
1965 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
1966 from object, not parameters.
1967 (Dwarf_info_reader::parse): Likewise.
1968 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
1969 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
1970 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
1971 methods.
1972
effe8365
CC
19732012-10-23 Cary Coutant <ccoutant@google.com>
1974
1975 * fileread.cc (Input_file::Input_file): New constructor.
1976 * fileread.h (class Input_file): Add new constructor.
1977
1698990d
AM
19782012-10-18 Alan Modra <amodra@gmail.com>
1979
1980 PR gold/14727
1981 * object.cc (Relobj::is_section_name_included): Also match
1982 .sdata personality section.
1983
168a4726
AM
19842012-10-18 Alan Modra <amodra@gmail.com>
1985
1986 * target-reloc.h (class Default_comdat_behavior): New, package up..
1987 (get_comdat_behaviour): ..this.
1988 (relocate_section): Add Relocate_comdat_behavior template arg,
1989 adjust code to suit.
1990 * arm.cc (Target_arm::relocate_section): Adjust to suit.
1991 (Target_arm::scan_reloc_section): Likewise.
1992 * i386.cc (Target_i386::relocate_section): Likewise.
1993 * sparc.cc (Target_sparc::relocate_section): Likewise.
1994 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
1995 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
1996 * powerpc.cc (class Relocate_comdat_behavior): New.
1997 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
1998 gold::relocate_section with new template arg.
1999
acc276d8
AM
20002012-10-18 Alan Modra <amodra@gmail.com>
2001
2002 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2003 dynamic relocs for GOT_TPREL got entries, without symbol if
2004 resolving locally.
2005 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2006 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2007 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2008
e10f9870
AM
20092012-10-17 Alan Modra <amodra@gmail.com>
2010
2011 PR gold/14726
2012 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2013
ae034989
ST
20142012-10-16 Sriraman Tallam <tmsriram@google.com>
2015
2016 * layout.cc (Layout::include_section): Keep sections marked
2017 SHF_EXCLUDE when doing relocatable links.
2018
f3a0ed29
AM
20192012-10-16 Alan Modra <amodra@gmail.com>
2020
2021 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2022 (Target_powerpc::do_finalize_sections): Call it.
2023 (Output_data_save_res): New class and supporting functions.
2024 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2025 normal symbols defined in object files.
2026
c6de8ed4
AM
20272012-10-12 Alan Modra <amodra@gmail.com>
2028
2029 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2030 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2031 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2032 section if scan_opd_relocs not yet called.
2033 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2034
03e25981
AM
20352012-10-12 Alan Modra <amodra@gmail.com>
2036
2037 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2038 add_local_ifunc_entry): Revert last change.
2039 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2040
c9824451
AM
20412012-10-05 Alan Modra <amodra@gmail.com>
2042
2043 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2044 do_plt_address_for_global): New functions.
2045 (Output_data_got_powerpc::do_write): Don't segfault when linking
2046 statically.
2047 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2048 add_local_ifunc_entry): Return true on adding entry..
2049 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2050 glink->add_entry call. Remove unused symtab param. Adjust calls.
2051 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2052 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2053 set up symbols here.
2054 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2055 syms here. Do so even when no .iplt. Don't segfault when linking
2056 statically.
2057 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2058 new variants without reloc param.
2059 (Glink_sym_ent::Glink_sym_ent): Likewise.
2060 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2061 reloc when refs will resolve to plt call stub.
2062 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2063 R_PPC_PLTREL24 to resolve locally.
2064 (Target_powerpc::Scan::global): Correct ifunc handling.
2065 (Target_powerpc::Relocate::relocate): Correct local sym glink
2066 lookup. Don't destroy "value" when we have a plt call stub,
2067 and when checking plt call validity.
2068 (Target_powerpc::do_dynsym_value): Simplify.
2069
19fec8c1
AM
20702012-10-05 Alan Modra <amodra@gmail.com>
2071
2072 * i386.cc (Output_data_plt_i386::address_for_global,
2073 address_for_local): Add plt offset to returned value. Adjust uses.
2074 * sparc.cc (Output_data_plt_sparc::address_for_global,
2075 address_for_local): Likewise.
2076 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2077 address_for_local): Likewise.
2078 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2079 address_for_local): Likewise.
2080 * target.h (Target::plt_address_for_global, plt_address_for_local):
2081 Update comment.
2082 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2083 (Output_data_got::Got_entry::write): Nor here.
2084 * output.h: Comment fix.
2085
e867b647
WL
20862012-10-02 Jiong Wang <jiwang@tilera.com>
2087
2088 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2089 global_offset_table_ value for larget got.
2090 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2091
e5d5f5ed
AM
20922012-09-29 Alan Modra <amodra@gmail.com>
2093
2094 * powerpc.cc (Target_powerpc::iplt_): New output section.
2095 (Target_powerpc::iplt_section, make_iplt_section,
2096 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2097 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2098 Target_powerpc::plt_entry_count): Count iplt entries too.
2099 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2100 reloc section in constructor. New params.
2101 (Target_powerpc::make_plt_section): Create reloc section here instead.
2102 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2103 functions.
2104 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2105 (Output_data_glink::add_entry, find_entry): New functions to
2106 deal with local syms.
2107 (Glink_sym_ent): Add support for local syms.
2108 (Output_data_glink::do_write): Handle ifunc plt entries.
2109 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2110 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2111 (Target_powerpc::Relocate::relocate): Likewise.
2112 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2113
ec4dbad3
AM
21142012-09-25 Alan Modra <amodra@gmail.com>
2115
2116 * object.h (Sized_relobj_file::adjust_local_symbol,
2117 do_adjust_local_symbol): New functions.
2118 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2119 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2120 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2121 and irregular opd entry spacing.
2122 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2123 (Global_symbol_visitor_opd): New functor.
2124 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2125 on deleted opd entries.
2126
5c0b3823
WL
21272012-09-15 Jiong Wang <jiwang@tilera.com>
2128
2129 * tilegx.cc: New file.
2130 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2131 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2132 * configure.tgt: Add entries for tilegx*.
2133 * configure.ac: Likewise.
2134 * Makefile.in: Rebuild.
2135 * configure: Likewise.
2136 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2137 tilegx.
2138
bfdfa4cd
AM
21392012-09-13 Alan Modra <amodra@gmail.com>
2140
2141 * target-reloc.h (scan_relocs): Call scan.local for relocs
2142 against symbols in discarded sections. Pass is_discarded
2143 param.
2144 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2145 Add is_discarded param.
2146 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2147 is_discarded to flag opd entry as discarded. Don't emit dyn
2148 relocs on such entries.
2149 (Target_powerpc::Scan::global): Similarly detect and handle
2150 such opd entries.
2151 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2152 opd_ent_. Update all uses.
2153 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2154 (Target_powerpc::relocate_section): Zero out discarded opd
2155 entry relocs.
2156
d77a0555
ILT
21572012-09-12 Ian Lance Taylor <iant@google.com>
2158
2159 PR gold/14570
2160 * output.cc: Rename Output_data_got template parameter from size
2161 to got_size for all functions. Compile all variants of
2162 Output_data_got.
2163 (Output_data_got::Got_entry::write): Correct use of size for
2164 symbol value. Use local_is_tls rather than casting to
2165 Sized_relobj_file.
2166 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2167 (class Sized_relobj_file): Add do_local_is_tls.
2168 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2169
815a1205
AM
21702012-09-11 Alan Modra <amodra@gmail.com>
2171
2172 PR gold/14566
2173 * layout.cc (Layout::set_segment_offsets): When using
2174 common-page-size alignment, ensure we are on a new max-page-size
2175 page.
2176 * output.cc (Output_segment::set_section_addresses): Use
2177 abi_pagesize, not common_pagesize for relro boundary.
2178 (Output_segment::set_offset): Likewise.
2179
bd73a62d
AM
21802012-09-11 Alan Modra <amodra@gmail.com>
2181
2182 * output.h (Output_data_got::add_global_tls, add_local_tls,
2183 add_local_tls_pair): New functions.
2184 (Output_data_got::add_local_pair_with_rel): Remove second
2185 reloc param. Expand comment.
2186 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2187 use_plt_or_tls_offset_, similarly for constructor param.
2188 (Output_data_got::Got_entry::write): Add got_index param.
2189 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2190 add_local_tls_pair): New functions.
2191 (Output_data_got::Got_entry::write): Handle tls symbols
2192 with use_plt_or_tls_offset_ set specially.
2193 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2194 (Output_data_got::do_write): Replace iterator with index, pass
2195 index to entry write function.
2196 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2197 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2198 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2199 call.
2200 * i386.cc (Target_i386::Scan::local): Likewise.
2201 * sparc.cc (Target_sparc::Scan::local): Likewise.
2202 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2203 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2204 do_tls_offset_for_global): New functions.
2205 (Target_powerpc::Scan::local): Correct TLS relocations and got
2206 entry values.
2207 (Target_powerpc::Scan::global): Don't emit unnecessary
2208 dynamic relocations on TLS GOT entries.
2209
00716ab1
AM
22102012-09-10 Matthias Klose <doko@ubuntu.com>
2211
2212 * config.in: Disable sanity check for kfreebsd.
2213
c891b3f9
SA
22142012-09-10 Sterling Augustine <saugustine@google.com>
2215
2216 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2217 (Gdb_index::pubtypes_read): New parameter.
2218 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2219 to calls.
2220 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2221 pubtypes_object_.
2222
e81fea4d
AM
22232012-09-09 Alan Modra <amodra@gmail.com>
2224
2225 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2226 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2227 * gc.h (gc_process_relocs): Call target gc_add_reference.
2228 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2229 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2230 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2231 unnecessary cast.
2232 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2233 to cater for when we don't need code offset. Update use.
2234 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2235 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2236 set_opd_valid): New functions.
2237 (Target_powerpc::do_gc_add_reference): New function.
2238 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2239 stashed refs.
2240 (Target_powerpc::do_gc_mark_symbol): New function.
2241
d2d60eef
CC
22422012-09-06 Cary Coutant <ccoutant@google.com>
2243
2244 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2245 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2246 (Dwarf_die::skip_attributes): Likewise.
2247 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2248 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2249 (main): Call it.
2250 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2251
32ed4573
L
22522012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2253
2254 * testsuite/script_test_3.t: Add .got.plt output section
2255 statement.
2256 * testsuite/script_test_4.t: Likewise.
2257
f4baf0d4
AM
22582012-09-05 Alan Modra <amodra@gmail.com>
2259
2260 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2261 update all uses and lose "enum" when using type.
2262
864a1b56
AM
22632012-09-05 Alan Modra <amodra@gmail.com>
2264
2265 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2266 * configure: Regenerate.
2267 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2268 (plugin_final_layout.stdout): Likewise.
2269 (memory_test): Set page sizes to 0x1000.
2270 * testsuite/Makefile.in: Regenerate.
2271 * testsuite/discard_locals_test.sh: Add FIXME comment.
2272 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2273 * testsuite/pr14265.t: Add .got output section statement.
2274 * testsuite/script_test_2.t: Likewise.
2275 * testsuite/script_test_3.t: Likewise.
2276 * testsuite/script_test_4.t: Likewise.
2277 * testsuite/script_test_5.t: Likewise.
2278 * testsuite/script_test_6.t: Likewise.
2279 * testsuite/script_test_7.t: Likewise.
2280 * testsuite/script_test_9.t: Likewise.
2281
3ea0a085
AM
22822012-09-05 Alan Modra <amodra@gmail.com>
2283
2284 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2285 (Powerpc_relocate_functions::Status): New typedef.
2286 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2287 (Target_powerpc::Scan::local): Handle REL64.
2288 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2289 for REL32 and REL64.
2290 (Target_powerpc::symval_for_branch): New function, extracted from..
2291 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2292 checks. Report overflow errors.
2293
7404fe1b
AM
22942012-09-05 Alan Modra <amodra@gmail.com>
2295
2296 * object.h (Sized_relobj_file::emit_relocs): Delete.
2297 (Sized_relobj_file::emit_relocs_reltype): Delete.
2298 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2299 relocate_relocs for --emit-relocs.
2300 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2301 * output.h: Update comment.
2302 (Output_segment::first_section): New function.
2303 (Output_segment::first_section_load_address): Use first_section.
2304 * output.cc (Output_segment::first_section): New function extracted..
2305 (Output_segment::first_section_load_address): ..from here. Delete.
2306 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2307 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2308 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2309 adjust call to target.h function.
2310 * i386.cc (Target_i386): Likewise.
2311 * sparc.cc (Target_sparc): Likewise.
2312 * x86_64.cc (Target_x86_64): Likewise.
2313 * powerpc.cc (Target_powerpc): Likewise.
2314 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2315 first tls section has section symbol for optimised local dynamic
2316 output relocs.
2317 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2318 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2319 optimised tls code.
2320 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2321 Rename to relocate_relocs. Update error message.
2322
957564c9
AS
23232012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2324
2325 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2326 --just-symbols.
2327
dd93cd0a
AM
23282012-08-31 Alan Modra <amodra@gmail.com>
2329
2330 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2331 (Powerpc_relobj::toc_base_offset): New stub function.
2332 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2333 got_mod_index_offset to tlsld_got_offset. Update all refs.
2334 (Target_powerpc::Relocate::enum skip_tls): New.
2335 (Target_powerpc::call_tls_get_addr_): New var.
2336 (Target_powerpc::is_branch_reloc): Move to file scope.
2337 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2338 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2339 New functions.
2340 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2341 (powerpc_info): Correct common_pagesize for ppc64.
2342 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2343 (Powerpc_relocate_functions): Add overflow check enums and functions.
2344 Add non-shift version of rela, rela_ua. Delete all rel public
2345 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2346 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2347 addr16_ha3, addr14 functions.
2348 (Output_data_got_powerpc::add_constant_pair): New function.
2349 (Output_data_got_powerpc::got_base_offset): Likewise.
2350 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2351 (instruction constants): Sort, add some more.
2352 (Output_data_glink::do_write): Add and use Address typedef. Use
2353 object->toc_base_offset() stub for 64-bit.
2354 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2355 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2356 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2357 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2358 Always treat .opd relocs as against locally defined symbol.
2359 Correct condition for RELATIVE relocs.
2360 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2361 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2362 for 32-bit syms with a plt entry. Correct ppc64 toc base
2363 calculations. Handle TLS relocs, and more. Add overflow
2364 checking and adjust for Powerpc_relocate_functions changes.
2365 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2366 Reinstate --emit-relocs code with FIXME.
2367
a1373b60
AM
23682012-08-30 Alan Modra <amodra@gmail.com>
2369
2370 * layout.cc (Layout::set_segment_offsets): Set p_align to
2371 abi_pagesize, not common_pagesize.
2372 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2373 to determine whether file header can go in segment.
2374
703d02da
AM
23752012-08-30 Alan Modra <amodra@gmail.com>
2376
2377 * output.h (Output_reloc::Output_reloc <output section>): Add
2378 is_relative param. Adjust calls.
2379 (Output_reloc::add_output_section_relative): New functions.
2380 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2381 is_relative.
2382 (Output_reloc::symbol_value): Handle SECTION_CODE.
2383
16164a6b
ST
23842012-08-24 Sriraman Tallam <tmsriram@google.com>
2385
2386 * gold.cc (queue_middle_tasks): Call layout again when unique
2387 segments for sections is desired.
2388 * layout.cc (Layout::Layout): Initialize new members.
2389 (Layout::get_output_section_flags): New function.
2390 (Layout::choose_output_section): Call get_output_section_flags.
2391 (Layout::layout): Make output section for mapping to a unique segment.
2392 (Layout::insert_section_segment_map): New function.
2393 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2394 output sections marked so.
16164a6b
ST
2395 (Layout::segment_precedes): Check for unique segments when sorting.
2396 * layout.h (Layout::Unique_segment_info): New struct.
2397 (Layout::Section_segment_map): New typedef.
2398 (Layout::insert_section_segment_map): New function.
2399 (Layout::get_output_section_flags): New function.
2400 (Layout::is_unique_segment_for_sections_specified): New function.
2401 (Layout::set_unique_segment_for_sections_specified): New function.
2402 (Layout::unique_segment_for_sections_specified_): New member.
2403 (Layout::section_segment_map_): New member.
2404 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2405 Rename is_gc_pass_one to is_pass_one.
2406 Rename is_gc_pass_two to is_pass_two.
2407 Rename is_gc_or_icf to is_two_pass.
2408 Check for which pass based on whether symbols data is present.
2409 Make it two pass when unique segments for sections is desired.
2410 * output.cc (Output_section::Output_section): Initialize new
2411 members.
2412 * output.h (Output_section::is_unique_segment): New function.
2413 (Output_section::set_is_unique_segment): New function.
2414 (Output_section::is_unique_segment_): New member.
2415 (Output_section::extra_segment_flags): New function.
2416 (Output_section::set_extra_segment_flags): New function.
2417 (Output_section::extra_segment_flags_): New member.
2418 (Output_section::segment_alignment): New function.
2419 (Output_section::set_segment_alignment): New function.
2420 (Output_section::segment_alignment_): New member.
2421 (Output_segment::Output_segment): Initialize is_unique_segment_.
2422 (Output_segment::is_unique_segment): New function.
2423 (Output_segment::set_is_unique_segment): New function.
2424 (Output_segment::is_unique_segment_): New member.
2425 * plugin.cc (allow_unique_segment_for_sections): New function.
2426 (unique_segment_for_sections): New function.
2427 (Plugin::load): Add new functions to transfer vector.
2428 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2429 * Makefile.in: Regenerate.
2430 * testsuite/plugin_final_layout.sh: Check if unique segment
2431 functionality works.
2432 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2433 are available.
2434 (allow_unique_segment_for_sections): New global.
2435 (unique_segment_for_sections): New global.
2436 (claim_file_hook): Call allow_unique_segment_for_sections.
2437 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2438
1e2bee4f
CC
24392012-08-22 Cary Coutant <ccoutant@google.com>
2440
2441 * layout.cc (Layout::include_section): Don't assert on GROUP
2442 sections with --emit-relocs.
2443
1d5dfe78
CC
24442012-08-21 Cary Coutant <ccoutant@google.com>
2445
2446 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2447 if --export-dynamic-symbol names an undef symbol.
2448
c9269dff
AM
24492012-08-18 Alan Modra <amodra@gmail.com>
2450
2451 * powerpc.cc: Formatting and white space.
2452 (Powerpc_relobj): Rename got2_section_ to special_.
2453 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2454 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2455 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2456 (Target_powerpc): Add Address typedef and invalid_address. Use
2457 throughout.
2458 (Target_powerpc::is_branch_reloc): New function.
2459 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2460 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2461 for dst_mask, value and addend.
2462 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2463 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2464 (Output_data_glink::do_write): Correct toc base. Don't try to use
2465 uint16_t for 24-bit offset. Use get_output_section_offset and
2466 check return.
2467 (Target_powerpc::Scan::local): Handle more relocs.
2468 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2469 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2470 Plug in toc restoring insn after plt calls. Translate branches
2471 to function descriptor symbols to corresponding entry point.
2472 (Target_powerpc::relocate_for_relocatable): Check return from
2473 get_output_section_offset.
2474 * symtab.h: Comment typo.
2475
b1759dce
ILT
24762012-08-14 Ian Lance Taylor <iant@google.com>
2477
2478 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2479 unsupported_relocal_local to call unsupported_reloc_global.
2480
b9b2ae8b
NC
24812012-08-14 Nick Clifton <nickc@redhat.com>
2482
2483 PR ld/14265
2484 * script-sections.cc (Sections_element::output_section_name): Add
2485 keep return parameter.
2486 (Output_section_element::match_name): Add keep return parameter.
2487 Return the value of the keep_ member.
2488 * script-sections.h (class Output_section): Update
2489 output_section_name prototype.
2490 * layout.cc (Layout::keep_input_section): New public member
2491 function.
2492 (Layout::choose_output_section): Pass keep parameter to
2493 output_section_name.
2494 * layout.h (class Layout): Add keep_input_section.
2495 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2496 sections.
2497 * testsuite/Makefile.am: Add a test.
2498 * testsuite/Makefile.in: Regenerate.
2499 * testsuite/pr14265.c: Source file for the test.
2500 * testsuite/pr14265.t: Linker script for the test.
2501 * testsuite/pr14265.sh: Shell script for the test.
2502
921b5322
AM
25032012-08-14 Alan Modra <amodra@gmail.com>
2504
2505 * target.h (Target::output_section_name): New function.
2506 (Target::do_output_section_name): New function.
2507 * layout.cc (Layout::choose_output_section): Call the above.
2508 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2509
6ce78956
AM
25102012-08-14 Alan Modra <amodra@gmail.com>
2511
2512 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2513 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2514 for replace_constant call.
2515 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2516 (Output_data_glink::do_print_to_mapfile): New function.
2517 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2518 (Target_powerpc::Relocate::relocate): Likewise.
2519
d1a8cabd
AM
25202012-08-14 Alan Modra <amodra@gmail.com>
2521
2522 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2523 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2524 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2525 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2526 all references to shndx_. Handle special case for R_PPC_PLTREL24
2527 here.
2528 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2529 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2530 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2531 here.
2532 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2533 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2534
d83ce4e3
AM
25352012-08-12 Alan Modra <amodra@gmail.com>
2536
2537 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2538 (glink insn constants): Use uint32_t.
2539 (Output_data_glink::add_entry): Use insert, not [] operator.
2540
cf43a2fe
AM
25412012-08-11 Alan Modra <amodra@gmail.com>
2542
2543 * object.h (Sized_relobj_file::find_shdr): New function.
2544 (Sized_relobj_file::find_special_sections): New function.
2545 * object.cc (Sized_relobj_file::find_shdr): New function.
2546 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2547 (Sized_relobj_file::find_special_sections): New function, split out..
2548 (Sized_relobj_file::do_read_symbols): ..from here.
2549 * output.h (Output_data_got::replace_constant): New function.
2550 (Output_data_got::num_entries): New function.
2551 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2552 (Output_data_got::got_offset): Protected rather than private.
2553 (Output_data_got::replace_got_entry): New function.
2554 * output.cc (Output_data_got::replace_got_entry): New function.
2555 * powerpc.cc (class Powerpc_relobj): New.
2556 (class Powerpc_relocate_functions): Delete all psymval variants or
2557 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2558 Implement _ha functions using corresponding _hi function.
2559 (Powerpc_relobj::find_special_sections): New function.
2560 (Target_powerpc::do_make_elf_object): New function.
2561 (class Output_data_got_powerpc): New.
2562 (class Output_data_glink): New.
2563 (class Powerpc_scan_relocatable_reloc): New.
2564 Many more changes througout file.
2565
3c892704
NC
25662012-08-09 Nick Clifton <nickc@redhat.com>
2567
2568 * po/vi.po: Updated Vietnamese translation.
2569
82435b3b
ILT
25702012-08-07 Ian Lance Taylor <iant@google.com>
2571
2572 * layout.cc (Layout::add_target_dynamic_tags): If
2573 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2574 plt_rel.
2575
a6dc81d2
NC
25762012-07-30 Nick Clifton <nickc@redhat.com>
2577
2578 * po/gold.pot: Updated template.
2579 * po/es.po: Updated Spanish translation.
2580
f1415016
CC
25812012-07-18 Cary Coutant <ccoutant@google.com>
2582
2583 PR gold/14344
2584 * configure.ac: Add check for -gpubnames support.
2585 * configure: Regenerate.
2586 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2587 support; force -gno-pubnames.
2588 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2589 support.
2590 (gdb_index_test_4): New test.
2591 * testsuite/Makefile.in: Regenerate.
2592 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2593 * testsuite/gdb_index_test_2.sh: Likewise.
2594 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2595 * testsuite/gdb_index_test_4.sh: New script.
2596 * testsuite/gdb_index_test_comm.sh: New script with common code;
2597 don't look for space after colon.
2598
b7fd7c37
ST
25992012-07-16 Sriraman Tallam <tmsriram@google.com>
2600
2601 * gold.cc (queue_middle_tasks): Update function order only after
2602 deferred objects due to plugins are processed.
2603
1f3212db
ILT
26042012-07-11 Ian Lance Taylor <iant@google.com>
2605
2606 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2607 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2608 (Target_arm::scan_reloc_for_stub): Likewise.
2609 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2610 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2611 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2612 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2613 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2614
81c82a68
ILT
26152012-07-10 Dodji Seketeli <dodji@redhat.com>
2616 Ian Lance Taylor <iant@google.com>
2617
2618 PR gold/14309
2619 * configure.ac: Test whether std::tr1::hash<off_t> works.
2620 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2621 needed.
2622 * output.h (class Output_fill): Add virtual destructor.
2623 * configure, config.in: Rebuild.
2624
eabc84f4
RM
26252012-06-22 Roland McGrath <mcgrathr@google.com>
2626
2627 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2628
370e30b6
RÁE
26292012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2630
2631 * plugin.cc (Plugin::load): Handle position independent executables.
2632
fb1b895d
CC
26332012-06-06 Cary Coutant <ccoutant@google.com>
2634
2635 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2636 add .debug_macro.
2637 (lines_only_debug_sections): Likewise.
2638 (gdb_fast_lookup_sections): New static array.
2639 (is_gdb_debug_section): Rename formal parameter.
2640 (is_lines_only_debug_section): Likewise.
2641 (is_gdb_fast_lookup_section): New function.
2642 (Layout::include_section): Check for ".zdebug_" prefix; pass
2643 section name suffix to is_gdb_debug_section, et al.; check for
2644 fast-lookup sections when building .gdb_index.
2645 * options.h (--strip-debug-gdb): Update GDB version number.
2646
7c0640fa
CC
26472012-06-06 Cary Coutant <ccoutant@google.com>
2648
2649 * configure.ac: Add check for fallocate.
2650 * configure: Regenerate.
2651 * config.in: Regenerate.
2652
2653 * options.h (class General_options): Add --mmap-output-file and
2654 --posix-fallocate options.
2655 * output.cc: (posix_fallocate): Remove; replace with...
2656 (gold_fallocate): New function.
2657 (Output_file::map_no_anonymous): Call gold_fallocate.
2658 (Output_file::map): Check --mmap-output-file option.
2659
2a49eb69
DK
26602012-06-05 Jing Yu <jingyu@google.com>
2661
2662 * gold.h (textdomain): Add do {} to empty while(0).
2663 (bindtextdomain): Likewise.
2664
fad072ac
CC
26652012-06-04 Cary Coutant <ccoutant@google.com>
2666
2667 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2668 has_dynsym_index.
2669
8cc69fb6
ST
26702012-05-25 Sriraman Tallam <tmsriram@google.com>
2671
2672 * symtab.cc (Symbol_table::define_special_symbol):
2673 Initialize *poldsym to prevent uninitialized variable errors.
2674
1be75daa
CC
26752012-05-23 Cary Coutant <ccoutant@google.com>
2676
2677 * layout.cc (Layout::section_name_mapping): Add rules to handle
2678 exact match on .data.rel.ro.local or .data.rel.ro.
2679 (Layout::output_section_name): Check for exact matches.
2680
9b689de0
CC
26812012-05-23 Cary Coutant <ccoutant@google.com>
2682
2683 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2684 more carefully.
2685
b24fdbf5
CC
26862012-05-22 Cary Coutant <ccoutant@google.com>
2687
2688 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2689 object before exporting symbol.
2690
e550e1a2
L
26912012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2692
2693 * testsuite/tls_test.cc: Include "config.h" first.
2694 * testsuite/tls_test_c.c: Likewise.
2695
df7b86aa
NC
26962012-05-17 Daniel Richard G. <skunk@iskunk.org>
2697 Nick Clifton <nickc@redhat.com>
2698
2699 PR 14072
2700 * configure.in: Add check that sysdep.h has been included before
2701 any system header files.
2702 * configure: Regenerate.
2703 * config.in: Regenerate.
2704
1007b503
CC
27052012-05-14 Cary Coutant <ccoutant@google.com>
2706
2707 * layout.cc (Layout::make_output_section): Mark .tdata section
2708 as RELRO.
2709 * testsuite/relro_test.cc: Add a TLS variable.
2710
fd885f3a
L
27112012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2712
2713 PR gold/14091
2714 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2715 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2716 R_X86_64_64.
2717
80f5885c
CC
27182012-05-08 Cary Coutant <ccoutant@google.com>
2719
2720 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2721 (lines_only_debug_sections): Likewise.
2722
2e702c99
RM
27232012-05-02 Roland McGrath <mcgrathr@google.com>
2724
2725 * nacl.cc: New file.
2726 * nacl.h: New file.
2727 * Makefile.am (CCFILES, HFILES): Add them.
2728 * Makefile.in: Regenerate.
2729 * i386.cc (Output_data_plt_i386_nacl): New class.
2730 (Output_data_plt_i386_nacl_exec): New class.
2731 (Output_data_plt_i386_nacl_dyn): New class.
2732 (Target_i386_nacl): New class.
2733 (Target_selector_i386_nacl): New class.
2734 (target_selector_i386): Use it instead of Target_selector_i386.
2735 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
2736 (Target_x86_64_nacl): New class.
2737 (Target_selector_x86_64_nacl): New class.
2738 (target_selector_x86_64, target_selector_x32): Use it instead of
2739 Target_selector_x86_64.
2740 * arm.cc (Output_data_plt_arm_nacl): New class.
2741 (Target_arm_nacl): New class.
2742 (Target_selector_arm_nacl): New class.
2743 (target_selector_arm, target_selector_armbe): Use it instead of
2744 Target_selector_arm.
2745
2746 * target-select.cc (select_target): Take new Input_file* and off_t
2747 arguments, pass them on to recognize method of selector.
2748 * object.cc (make_elf_sized_object): Update caller.
2749 * parameters.cc (parameters_force_valid_target): Likewise.
2750 * incremental.cc (make_sized_incremental_binary): Likewise.
2751 * target-select.h: Update decl.
2752 (Target_selector::recognize): Take new Input_file* argument,
2753 pass it on to do_recognize.
2754 (Target_selector::do_recognize): Take new Input_file* argument.
2755 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
2756 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
2757 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
2758 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
2759
2760 * target.h (Target::Target_info): New members isolate_execinstr
2761 and rosegment_gap.
2762 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
2763 * arm.cc (Target_arm::arm_info): Update initializer.
2764 * i386.cc (Target_i386::i386_info): Likewise.
2765 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
2766 * sparc.cc (Target_sparc::sparc_info): Likewise.
2767 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2768 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2769 * layout.cc (Layout::attach_allocated_section_to_segment):
2770 Take new const Target* argument. If target->isolate_execinstr(), act
2771 like --rosegment.
2772 (Layout::find_first_load_seg): Take new const Target* argument;
2773 if target->isolate_execinstr(), reject PF_X segments.
2774 (Layout::relaxation_loop_body): Update caller.
2775 (Layout::set_segment_offsets): If target->isolate_execinstr(),
2776 reset file offset to zero when we hit LOAD_SEG, and then do a second
2777 loop over the segments before LOAD_SEG to reassign offsets after
2778 addresses have been determined. Handle target->rosegment_gap().
2779 (Layout::attach_section_to_segment): Take new const Target* argument;
2780 pass it to attach_allocated_section_to_segment.
2781 (Layout::make_output_section): Update caller.
2782 (Layout::attach_sections_to_segments): Take new const Target* argument;
2783 pass it to attach_section_to_segment.
2784 * gold.cc (queue_middle_tasks): Update caller.
2785 * layout.h (Layout): Update method decls with new arguments.
2786
2787 * arm.cc (Target_arm::Target_arm): Take optional argument for the
2788 Target_info pointer to use.
2789 (Target_arm::do_make_data_plt): New virtual method.
2790 (Target_arm::make_data_plt): New method that calls it.
2791 (Target_arm::make_plt_entry): Use it.
2792 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
2793 for the section alignment.
2794 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
2795 method.
2796 (Output_data_plt_arm::first_plt_entry_offset): Call it.
2797 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
2798 method.
2799 (Output_data_plt_arm::get_plt_entry_size): Call it.
2800 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
2801 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
2802 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
2803 method.
2804 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
2805 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
2806 method instead of sizeof(plt_entry).
2807 (Output_data_plt_arm::add_entry): Likewise.
2808 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
2809 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
2810 than static method.
2811 (Target_arm::plt_entry_size): Likewise.
2812 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
2813 Move to ...
2814 (Output_data_plt_arm_standard): ... here, new class.
2815 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
2816 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
2817 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
2818
2819 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2820 Take additional argument for the PLT entry size.
2821 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
2822 Use get_plt_entry_size method rather than plt_entry_size variable.
2823 (Output_data_plt_x86_64::reserve_slot): Likewise.
2824 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
2825 (Output_data_plt_x86_64::add_entry): Likewise.
2826 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
2827 (Output_data_plt_x86_64::address_for_global): Likewise.
2828 (Output_data_plt_x86_64::address_for_local): Likewise.
2829 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2830 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
2831 Make method non-static.
2832 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
2833 method.
2834 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
2835 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
2836 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
2837 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
2838 virtual method.
2839 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
2840 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
2841 virtual method.
2842 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
2843 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
2844 virtual method.
2845 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
2846 (Output_data_plt_x86_64::plt_entry_size)
2847 (Output_data_plt_x86_64::first_plt_entry)
2848 (Output_data_plt_x86_64::plt_entry)
2849 (Output_data_plt_x86_64::tlsdesc_plt_entry)
2850 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
2851 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
2852 (Output_data_plt_x86_64_standard): ... here, new class.
2853 (Target_x86_64::Target_x86_64): Take optional argument for the
2854 Target_info pointer to use.
2855 (Target_x86_64::do_make_data_plt): New virtual method.
2856 (Target_x86_64::make_data_plt): New method to call it.
2857 (Target_x86_64::init_got_plt_for_update): Use that.
2858 Call this->plt_->add_eh_frame method here.
2859 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
2860 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
2861 rather than static method.
2862 (Target_x86_64::plt_entry_size): Likewise.
2863 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
2864 rather than plt_entry_size variable. Move guts of PLT filling to...
2865 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
2866 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
2867 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
2868
2869 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
2870 additional argument for the section alignment.
2871 Don't do add_eh_frame_for_plt here.
2872 (Output_data_plt_i386::first_plt_entry_offset): Make the method
2873 non-static. Use get_plt_entry_size method rather than plt_entry_size
2874 variable.
2875 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
2876 method.
2877 (Output_data_plt_i386::get_plt_entry_size): Call it.
2878 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
2879 (Output_data_plt_i386::add_eh_frame): New method to call it.
2880 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
2881 method.
2882 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
2883 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
2884 method.
2885 (Output_data_plt_i386::fill_plt_entry): New method to call it.
2886 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
2887 method instead of plt_entry_size.
2888 (Output_data_plt_i386::plt_entry_size)
2889 (Output_data_plt_i386::plt_eh_frame_fde_size)
2890 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
2891 (Output_data_plt_i386_standard): ... here, new class.
2892 (Output_data_plt_i386_exec): New class.
2893 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
2894 (Output_data_plt_i386_exec::first_plt_entry): ... here.
2895 (Output_data_plt_i386::exec_plt_entry): Move to ...
2896 (Output_data_plt_i386_exec::plt_entry): ... here.
2897 (Output_data_plt_i386_dyn): New class.
2898 (Output_data_plt_i386::first_plt_entry): Move to ...
2899 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
2900 (Output_data_plt_i386::dyn_plt_entry): Move to ...
2901 (Output_data_plt_i386_dyn::plt_entry): ... here.
2902 (Target_i386::Target_i386): Take optional argument for the Target_info
2903 pointer to use.
2904 (Target_i386::do_make_data_plt): New virtual method.
2905 (Target_i386::make_data_plt): New method to call it.
2906 (Target_i386::make_plt_section): Use that.
2907 Call this->plt_->add_eh_frame method here.
2908 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
2909 rather than plt_entry_size variable.
2910 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
2911 (Output_data_plt_i386::address_for_local): Likewise.
2912 (Output_data_plt_i386::do_write): Likewise.
2913 Move guts of PLT filling to...
2914 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
2915 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
2916 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
2917 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
2918
b9b9f2ee
CC
29192012-05-01 Cary Coutant <ccoutant@google.com>
2920
2921 * dwarf_reader.cc (Dwarf_die::read_attributes)
2922 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
2923 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
2924 * reduced_debug_output.cc
2925 (Output_reduced_debug_info_section::get_die_end): Remove
2926 DW_FORM_GNU_ref_index. Add default case.
2927
57923f48
MW
29282012-04-26 Mark Wielaard <mjw@redhat.com>
2929
2930 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2931 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2932 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2933 DW_AT_high_pc as offset from DW_AT_low_pc.
2934
2935 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2936 * testsuite/Makefile.in: Regenerate.
2937 * testsuite/gdb_index_test_3.c: New test source file.
2938 * testsuite/gdb_index_test_3.sh: New test source file.
2939
2c54b4f4
ILT
29402012-04-25 Ian Lance Taylor <iant@google.com>
2941
2942 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2943 pointer.
2944 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2945 as a class, not a struct.
2946 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2947 (Target_arm::apply_cortex_a8_workaround): Likewise.
2948 * gc.h: Declare Reloc_types as a struct, not a class.
2949 * object.h: Declare Symbols_data as a struct.
2950 * reloc.h: Declare Read_relocs_data as a struct.
2951 * target.h: Declare Relocate_info as a struct.
2952
a5a5f7a3
DM
29532012-04-24 David S. Miller <davem@davemloft.net>
2954
2955 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2956 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2957 and R_SPARC_WPLT30.
2958
f038d496
CC
29592012-04-24 Cary Coutant <ccoutant@google.com>
2960
2961 * incremental-dump.cc (find_input_containing_global): Replace
2962 magic number with symbolic constant.
2963 (dump_incremental_inputs): Update version number.
2964 * incremental.cc (Output_section_incremental_inputs): Update version
2965 number; import symbolic constants from Incremental_inputs_reader.
2966 (Incremental_inputs::create_data_sections): Align relocations
2967 section correctly for 64-bit targets.
2968 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
2969 constants; add padding.
2970 (Output_section_incremental_inputs::write_header): Add assert for
2971 header_size.
2972 (Output_section_incremental_inputs::write_input_files): Add assert
2973 for input_entry_size.
2974 (Output_section_incremental_inputs::write_info_blocks): Add padding;
2975 add assert for object_info_size, input_section_entry_size,
2976 global_sym_entry_size.
2977 * incremental.h (Incremental_inputs_reader): Add symbolic constants
2978 for data structure sizes; use them.
2979 (Incremental_input_entry_reader): Import symbolic constants from
2980 Incremental_inputs_reader; use them.
2981
a4d85145
DM
29822012-04-23 David S. Miller <davem@davemloft.net>
2983
2984 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
2985 and elf_flags_set_.
2986 (Target_sparc::Target_sparc): Initialize new fields.
2987 (Target_sparc::do_make_elf_object): New function.
2988 (Target_sparc::do_adjust_elf_header): New function.
2989
1d509098
CC
29902012-04-23 Cary Coutant <ccoutant@google.com>
2991
2992 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
2993 CU range table of gdb index.
2994
7ebeff7f
DM
29952012-04-20 David S. Miller <davem@davemloft.net>
2996
2997 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
2998 instead of false.
2999
13cf9988
DM
30002012-04-16 David S. Miller <davem@davemloft.net>
3001
2a1079e8
DM
3002 * sparc.cc (Target_sparc::got_address): New function.
3003 (Sparc_relocate_functions::gdop_hix22): New function.
3004 (Sparc_relocate_functions::gdop_lox10): New function.
3005 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3006 relocs.
3007 (Target_sparc::Scan::local): Likewise if the global symbol is not
3008 preemptible and is not IFUNC.
3009 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3010 transformations for local and non-preemptible non-IFUNC global
3011 symbols.
3012
0bc964fc
DM
3013 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3014 writing out 64-bit part of ranges.
3015
661d7a80
DM
3016 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3017 -fpic and -fpie respectively.
3018 * Makefile.in: Regenerate.
3019
8c2bf391
DM
3020 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3021 (Target_sparc::Target_sparc): Initialize new field.
3022 (Target_sparc::do_plt_section_for_global): New function.
3023 (Target_sparc::do_plt_section_for_local): New function.
3024 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3025 (Target_sparc::make_plt_section): New function, broken out of
3026 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3027 (Target_sparc::make_plt_entry): Call make_plt_section.
3028 (Target_sparc::make_local_ifunc_plt_entry): New function.
3029 (Target_sparc::rela_ifunc_section): New function.
3030 (Target_sparc::plt_section): Remove const.
3031 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3032 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3033 and ifunc_count_ fields.
3034 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3035 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3036 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3037 (Output_data_plt_sparc::rela_ifunc): New function.
3038 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3039 (Output_data_plt_sparc::has_ifunc_section): New function.
3040 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3041 (Output_data_plt_sparc::address_for_global): New function.
3042 (Output_data_plt_sparc::address_for_local): New function.
3043 (Output_data_plt_sparc::plt_index_to_offset): New function.
3044 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3045 and entry_count.
3046 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3047 entry_count.
3048 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3049 R_SPARC_JMP_IREL to switch.
3050 (Target_sparc::Scan::check_non_pic): Likewise.
3051 (Target_sparc::Scan::local): Handle IFUNC symbols.
3052 (Target_sparc::Scan::local): Likewise.
3053 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3054 and plt_address_for_local.
3055 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3056 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3057
13cf9988
DM
3058 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3059 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3060 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3061 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3062 global relocs too.
3063 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3064 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3065 calls.
3066 * sparc.cc (Target_sparc::Scan::global): Likewise.
3067 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3068
31821be0
CC
30692012-04-16 Cary Coutant <ccoutant@google.com>
3070
3071 * archive.cc (Library_base::should_include_member): Check for
3072 --export-dynamic-symbol.
3073 * options.h (class General_options): Add --export-dynamic-symbol.
3074 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3075 --export-dynamic-symbol.
3076 (Symbol_table::gc_mark_undef_symbols): Likewise.
3077 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3078
2615994e
DM
30792012-04-12 David S. Miller <davem@davemloft.net>
3080
3081 * sparc.cc (Reloc::wdisp10): New relocation method.
3082 (Reloc::h34): Likewise.
3083 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3084 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3085 R_SPARC_WDISP10.
3086 (Target_sparc::Scan::local): Likewise.
3087 (Target_sparc::Scan::global): Likewise.
3088 (Target_sparc::Relocate::relocate): Likewise.
3089
6782735d
CC
30902012-04-09 Cary Coutant <ccoutant@google.com>
3091
3092 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3093 low_pc == 0.
3094
8c7a0b00
ILT
30952012-04-06 Ian Lance Taylor <iant@google.com>
3096
3097 * timer.cc: #include <unistd.h>.
3098
58797674
RM
30992012-04-06 Roland McGrath <mcgrathr@google.com>
3100
3101 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3102 * config.in: Regenerate.
3103 * configure: Regenerate.
3104
44350750
NC
31052012-04-05 Nick Clifton <nickc@redhat.com>
3106
3107 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3108 (AM_LC_MESSAGES): Add.
3109 * aclocal.m4: Regenerate.
3110 * config.in: Regenerate.
3111 * configure: Regenerate.
3112
c1027032
CC
31132012-03-21 Cary Coutant <ccoutant@google.com>
3114
3115 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3116 * Makefile.in: Regenerate.
3117 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3118 (Sized_elf_reloc_mapper::symbol_section): New function.
3119 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3120 (make_elf_reloc_mapper): New function.
3121 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3122 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3123 (Dwarf_abbrev_table::do_get_abbrev): New function.
3124 (Dwarf_ranges_table::read_ranges_table): New function.
3125 (Dwarf_ranges_table::read_range_list): New function.
3126 (Dwarf_pubnames_table::read_section): New function.
3127 (Dwarf_pubnames_table::read_header): New function.
3128 (Dwarf_pubnames_table::next_name): New function.
3129 (Dwarf_die::Dwarf_die): New function.
3130 (Dwarf_die::read_attributes): New function.
3131 (Dwarf_die::skip_attributes): New function.
3132 (Dwarf_die::set_name): New function.
3133 (Dwarf_die::set_linkage_name): New function.
3134 (Dwarf_die::attribute): New function.
3135 (Dwarf_die::string_attribute): New function.
3136 (Dwarf_die::int_attribute): New function.
3137 (Dwarf_die::uint_attribute): New function.
3138 (Dwarf_die::ref_attribute): New function.
3139 (Dwarf_die::child_offset): New function.
3140 (Dwarf_die::sibling_offset): New function.
3141 (Dwarf_info_reader::check_buffer): New function.
3142 (Dwarf_info_reader::parse): New function.
3143 (Dwarf_info_reader::do_parse): New function.
3144 (Dwarf_info_reader::do_read_string_table): New function.
3145 (Dwarf_info_reader::lookup_reloc): New function.
3146 (Dwarf_info_reader::get_string): New function.
3147 (Dwarf_info_reader::visit_compilation_unit): New function.
3148 (Dwarf_info_reader::visit_type_unit): New function.
3149 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3150 Sized_elf_reloc_mapper.
3151 (Sized_dwarf_line_info::symbol_section): Remove function.
3152 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3153 (Sized_dwarf_line_info::read_line_mappings): Remove object
3154 parameter, adjust callers.
3155 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3156 * dwarf_reader.h: Include <sys/types.h>.
3157 (class Track_relocs): Remove forward declaration.
3158 (class Elf_reloc_mapper): New class.
3159 (class Sized_elf_reloc_mapper): New class.
3160 (class Dwarf_abbrev_table): New class.
3161 (class Dwarf_range_list): New class.
3162 (class Dwarf_ranges_table): New class.
3163 (class Dwarf_pubnames_table): New class.
3164 (class Dwarf_die): New class.
3165 (class Dwarf_info_reader): New class.
3166 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3167 (Sized_dwarf_line_info::symbol_section): Remove member function.
3168 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3169 base class.
3170 * gdb-index.cc: New source file.
3171 * gdb-index.h: New source file.
3172 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3173 and .debug_types sections, call Layout::add_to_gdb_index.
3174 (Sized_relobj_incr::do_section_name): Implement.
3175 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3176 return type; Implement.
3177 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3178 return type.
3179 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3180 parameter list and return type.
3181 (Sized_incr_dynobj::do_section_contents): Likewise.
3182 * layout.cc: Include gdb-index.h.
3183 (Layout::Layout): Initialize gdb_index_data_.
3184 (Layout::init_fixed_output_section): Check for .gdb_index section.
3185 (Layout::add_to_gdb_index): New function. Instantiate.
3186 * layout.h: Add forward declaration for class Gdb_index.
3187 (Layout::add_to_gdb_index): New member function.
3188 (Layout::gdb_index_data_): New data member.
3189 * main.cc: Include gdb-index.h.
3190 (main): Print statistics for gdb index.
3191 * object.cc (Object::section_contents): Move code into
3192 do_section_contents.
3193 (need_decompressed_section): Check for sections needed when building
3194 gdb index.
3195 (build_compressed_section_map): Likewise.
3196 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3197 gdb index.
3198 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3199 sections; call Layout::add_to_gdb_index.
3200 (Sized_relobj_file::do_decompressed_section_contents): Call
3201 do_section_contents directly.
3202 * object.h (Object::do_section_contents): Adjust parameter list and
3203 return type.
3204 (Object::do_decompressed_section_contents): Call do_section_contents
3205 directly.
3206 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3207 return type.
3208 * options.h (class General_options): Add --gdb-index option.
3209 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3210 list and return type.
3211 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3212 * reloc.h (Track_relocs::checkpoint): New function.
3213 (Track_relocs::reset): New function.
3214
3215 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3216 New test cases.
3217 * testsuite/Makefile.in: Regenerate.
3218 * testsuite/gdb_index_test.cc: New test source file.
3219 * testsuite/gdb_index_test_1.sh: New test source file.
3220 * testsuite/gdb_index_test_2.sh: New test source file.
3221
647f1574
DK
32222012-03-19 Doug Kwan <dougkwan@google.com>
3223
3224 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3225 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3226 __exidx_start and __exidx_end. Make symbol table parameter
3227 anonymous as it is not used.
3228 * gold.cc (queue_middle_tasks): Call target hook to define any
3229 target-specific symbols.
3230 * target.h (Target::define_standard_symbols): New method.
3231 (Target::do_define_standard_symbols): Same.
3232 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3233 * testsuite/Makefile.in: Regenerate.
3234 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3235 and __exidx_end.
3236 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3237 relocations are generated for __exidx_start and __exidx_end.
3238
7c6109da
DK
32392012-03-16 Doug Kwan <dougkwan@google.com>
3240
3241 * testsuite/Makefile.am: Disable test initpri3b.
3242 * testsuite/Makefile.in: Regenerate.
3243
7b8957f8
DK
32442012-03-15 Doug Kwan <dougkwan@google.com>
3245
3246 * arm.cc (Target_arm::got_section): Make .got section read-only
3247 if -z now is given.
3248
14dc9ef7
ILT
32492012-03-15 Ian Lance Taylor <iant@google.com>
3250
3251 PR gold/13850
3252 * layout.cc (Layout::make_output_section): Correctly mark
3253 SHT_INIT_ARRAY, et. al., as relro.
3254
fa40b62a
DK
32552012-03-14 Doug Kwan <dougkwan@google.com>
3256
3257 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3258 dynamic relocations for protected symbols in shared objects.
3259
fd325007
ILT
32602012-03-13 Ian Lance Taylor <iant@google.com>
3261
3262 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3263 keep the larger alignment.
3264
e8dd54e1
CC
32652012-03-12 Cary Coutant <ccoutant@google.com>
3266
3267 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3268 handling of DW_LNE_define_file.
3269
feb5f3b0
CC
32702012-03-12 Cary Coutant <ccoutant@google.com>
3271
3272 * reduced_debug_output.cc
3273 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3274 codes to switch.
3275
a1fb4256
CC
32762012-02-29 Cary Coutant <ccoutant@google.com>
3277
3278 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3279
5dd8762a
CC
32802012-02-29 Cary Coutant <ccoutant@google.com>
3281
3282 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3283 Call Object::decompressed_section_contents.
3284 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3285 New dtor.
3286 (Sized_dwarf_line_info::buffer_start_): New data member.
3287 * merge.cc (Output_merge_data::do_add_input_section): Call
3288 Object::decompressed_section_contents.
3289 (Output_merge_string::do_add_input_section): Likewise.
3290 * object.cc (need_decompressed_section): New function.
3291 (build_compressed_section_map): Decompress sections needed later.
3292 (Sized_relobj_file::do_decompressed_section_contents): New function.
3293 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3294 * object.h (Object::decompressed_section_contents): New function.
3295 (Object::discard_decompressed_sections): New function.
3296 (Object::do_decompressed_section_contents): New function.
3297 (Object::do_discard_decompressed_sections): New function.
3298 (Compressed_section_info): New type.
3299 (Compressed_section_map): Include decompressed section contents.
3300 (Sized_relobj_file::do_decompressed_section_contents): New function.
3301 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3302
7b5de7ee
CC
33032012-02-16 Cary Coutant <ccoutant@google.com>
3304
3305 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3306 * testsuite/Makefile.in: Regenerate.
3307
f9fa4a63
CC
33082012-02-14 Cary Coutant <ccoutant@google.com>
3309
3310 * options.cc (General_options::finalize): Disallow -pie and -static.
3311
2c175ebc
DK
33122012-02-03 Doug Kwan <dougkwan@google.com>
3313
3314 * arm.cc (Arm_relocate_functions::abs8,
3315 Arm_relocate_functions::abs16): Use
3316 Bits::has_signed_unsigned_overflow32.
3317 (Arm_relocate_functions::thm_abs8): Correct range of
3318 overflow check.
3319 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3320 in assertions.
3321
90cff06f
DK
33222012-02-02 Doug Kwan <dougkwan@google.com>
3323
3324 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3325 position independent outputs, not just shared objects.
3326
63887f3d
L
33272012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3328
3329 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3330 * configure: Regenerated.
3331
bef2b434
ILT
33322012-01-27 Ian Lance Taylor <iant@google.com>
3333
3334 * reloc.h (Bits): New class with static functions, copied from
3335 namespace utils in arm.cc.
3336 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3337 instead.
3338
c335b55d
L
33392012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3340
3341 * incremental.cc (write_info_blocks): Correct relocation offset.
3342
41194d9f
L
33432012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3344
3345 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3346 (Relocate::tls_gd_to_le): Likewise.
3347
1bae613c
L
33482012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3349
3350 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3351
24482ca0
L
33522012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3353
3354 * configure.ac: Check if -mcmodel=medium works.
3355 * configure: Regenerated.
3356
c2c7840a
CC
33572012-01-24 Cary Coutant <ccoutant@google.com>
3358
3359 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3360 definition and ...
3361 (read_unsigned_LEB_128_x): ... this new function.
3362 (read_signed_LEB_128): Replaced with inline definition and ...
3363 (read_signed_LEB_128_x): ... this new function.
3364 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3365 (read_unsigned_LEB_128): Add inline definition.
3366 (read_signed_LEB_128_x): New function.
3367 (read_signed_LEB_128): Add inline definition.
3368 * testsuite/Makefile.am (leb128_unittest): New unit test.
3369 * testsuite/Makefile.in: Regenerate.
3370 * testsuite/leb128_unittest.cc: New unit test.
3371
833de760 33722012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3373
3374 PR gold/13617
3375 * i386.cc (Target_i386::do_code_fill): When using a jmp
3376 instruction, pad with nop instructions.
3377 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3378
618d6666
L
33792012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3380
3381 * x86_64.cc (gc_process_relocs): Add typename on types used in
3382 template.
3383 (scan_relocs): Likewise.
3384 (relocate_section): Likewise.
3385 (apply_relocation): Likewise.
3386
3660ff06
L
33872012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3388
3389 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3390 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3391 under x32.
3392
fc51264f
L
33932012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3394
3395 * x86_64.cc: Initial support for x32.
3396
dd74ae06
CC
33972012-01-03 Cary Coutant <ccoutant@google.com>
3398
3399 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3400 Use abstract base class for GOT.
3401 * gold/output.h (class Output_data_got_base): New abstract base class.
3402 (class Output_data_got): Derive from new base class, adjust ctors.
3403 (Output_data_got::reserve_slot): Make virtual; rename to
3404 do_reserve_slot; Adjust callers.
3405 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3406 pointer to abstract base class.
3407 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3408
83896202
ILT
34092011-12-18 Ian Lance Taylor <iant@google.com>
3410
3411 * object.h (Relobj::local_symbol_value): New function.
3412 (Relobj::local_plt_offset): New function.
3413 (Relobj::local_has_got_offset): New function.
3414 (Relobj::local_got_offset): New function.
3415 (Relobj::set_local_got_offset): New function.
3416 (Relobj::do_local_symbol_value): New pure virtual function.
3417 (Relobj::do_local_plt_offset): Likewise.
3418 (Relobj::do_local_has_got_offset): Likewise.
3419 (Relobj::do_local_got_offset): Likewise.
3420 (Relobj::do_set_local_got_offset): Likewise.
3421 (Sized_relobj::do_local_has_got_offset): Rename from
3422 local_has_got_offset.
3423 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3424 (Sized_relobj::do_set_local_got_offset): Rename from
3425 set_local_got_offset.
3426 (Sized_relobj_file::do_local_plt_offset): Rename from
3427 local_plt_offset.
3428 (Sized_relobj_file::do_local_symbol_value): New function.
3429 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3430 local_plt_offset.
3431 * output.cc (Output_data_got::Got_entry::write): Change object to
3432 Relobj. Use local_symbol_value.
3433 (Output_data_got::add_global_with_rel): Change rel_dyn to
3434 Output_data_reloc_generic*. Use add_global_generic.
3435 (Output_data_got::add_global_with_rela): Remove. Change all
3436 callers to use add_global_with_rel.
3437 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3438 Output_data_reloc_generic*. Use add_global_generic.
3439 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3440 callers to use add_global_pair_with_rel.
3441 (Output_data_got::add_local): Change object to Relobj*.
3442 (Output_data_got::add_local_plt): Likewise.
3443 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3444 change rel_dyn to Output_data_reloc_generic*. Use
3445 add_local_generic.
3446 (Output_data_got::add_local_with_rela): Remove. Change all
3447 callers to use all_local_with_rel.
3448 (Output_data_got::add_local_pair_with_rel): Change object to
3449 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3450 add_output_section_generic.
3451 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3452 callers to use add_local_pair_with_rel.
3453 (Output_data_got::reserve_local): Change object to Relobj*.
3454 * output.h: (class Output_data_reloc_generic): Add pure virtual
3455 declarations for add_global_generic, add_local_generic,
3456 add_output_section_generic.
3457 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3458 functions for Output_data_reloc_generic. Update declarations for
3459 changes listed in output.cc.
3460 (class Output_data_got): Change template parameter to got_size.
3461 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3462 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3463 function.
3464 (Sized_relobj_incr::do_local_plt_offset): New function.
3465 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3466 add_global_generic.
3467
76677ad0
CC
34682011-12-17 Cary Coutant <ccoutant@google.com>
3469
3470 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3471 * resolve.cc (Symbol_table::resolve): Likewise.
3472 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3473 arrays.
3474 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3475
8b8dd8d5
ILT
34762011-12-16 Ian Lance Taylor <iant@google.com>
3477
3478 * output.h (Output_data_reloc_generic::add): Only call
3479 add_dynamic_reloc if this is a dynamic reloc section.
3480
d55525b9
L
34812011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3482
3483 PR gold/13505
3484 * target-reloc.h (apply_relocation): Replace <64, false> with
3485 <size, big_endian>.
3486
ff81c7c1
NC
34872011-11-25 Nick Clifton <nickc@redhat.com>
3488
3489 * po/it.po: New Italian translation.
3490
628f39be
SA
34912011-11-17 Sterling Augustine <saugustine@google.com>
3492
3493 * script.cc (script_include_directive): Implement.
3494 (read_script_file): New local variables name and search_path. Update
3495 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3496 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3497 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3498
98ef3ea4
SA
34992011-11-11 Sterling Augustine <saugustine@google.com>
3500
3501 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3502 (file_or_sections_cmd): Likewise.
3503
f4a8b6d7
DK
35042011-11-11 Doug Kwan <dougkwan@google.com>
3505
3506 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3507 if --just-symbols is given.
3508
29ab395d
DK
35092011-11-10 Doug Kwan <dougkwan@google.com>
3510
3511 PR gold/13362
3512 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3513 when processing data relocs.
3514 * reloc.h (Relocate_functions::rel_unaligned): New method.
3515 (Relocate_functions::pcrel_unaligned): Ditto.
3516 (Relocate_functions::rel32_unaligned): Ditto.
3517 (Relocate_functions::pcrel32_unaligned): Ditto.
3518
2c339f71
DK
35192011-11-09 Doug Kwan <dougkwan@google.com>
3520
3521 PR gold/13362
3522 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3523 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3524 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3525 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3526 (Relocate_functions::rel_unaligned): New.
3527 (Relocate_functions::rel32_unaligned): New.
3528 * target-reloc.h (relocate_for_relocatable): Add code to handle
3529 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3530 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3531 arm_unaligned_reloc_r): New targets.
3532 * testsuite/Makefile.in: Regenerate.
3533 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3534 linking.
3535
3f3cddf1
ILT
35362011-11-02 Ian Lance Taylor <iant@google.com>
3537
3538 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3539 NATIVE_LINKER.
3540 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3541 * options.cc (General_options::finalize): Use library search path
3542 from configure script if specified. If not native and no sysroot,
3543 only search TOOLLIBDIR.
3544 * options.h (Search_directory::Search_directory): Change name to
3545 const std::string&.
3546 (General_options::add_to_library_path_with_sysroot): Change arg to
3547 const std::string&.
3548 * configure, Makefile.in, config.in: Rebuild.
3549
a8e2273b
ILT
35502011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3551
3552 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3553 we are working around the ARM1176 Erratum.
3554 * options.h (General_options::fix_arm1176): Add option.
3555 * testsuite/Makefile.am: Add testcases, and keep current ones
3556 working.
3557 * testsuite/Makefile.in: Regenerate.
3558 * testsuite/arm_fix_1176.s: New file.
3559 * testsuite/arm_fix_1176.sh: Likewise.
3560
cd6eab1c
ILT
35612011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3562
3563 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3564 may_use_blx_.
3565 (Target_arm::may_use_blx): Remove method.
3566 (Target_arm::set_may_use_blx): Likewise.
3567 (Target_arm::may_use_v4t_interworking): New method.
3568 (Target_arm::may_use_v5t_interworking): Likewise.
3569 (Target_arm::may_use_blx_): Remove member variable.
3570 (Arm_relocate_functions::arm_branch_common): Check for v5T
3571 interworking.
3572 (Arm_relocate_functions::thumb_branch_common): Likewise.
3573 (Reloc_stub::stub_type_for_reloc): Likewise.
3574 (Target_arm::do_finalize_sections): Correct interworking checks.
3575 * testsuite/Makefile.am: Add new tests.
3576 * testsuite/Makefile.in: Regenerate.
3577 * testsuite/arm_farcall_arm_arm.s: New test.
3578 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3579 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3580 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3581 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3582 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3583 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3584 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3585
286adcf4
CC
35862011-10-31 Cary Coutant <ccoutant@google.com>
3587
3588 PR gold/13023
3589 * expression.cc (Expression::eval_with_dot): Add
3590 is_section_dot_assignment parameter.
3591 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3592 absolute and assigning to dot within a section.
3593 * script-sections.cc
3594 (Output_section_element_assignment::set_section_addresses): Pass
3595 dot_section to set_if_absolute.
3596 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3597 as is_section_dot_assignment flag to eval_with_dot.
3598 (Output_section_element_dot_assignment::set_section_addresses):
3599 Likewise.
3600 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3601 parameter. Also set value if relative to dot_section; set the
3602 symbol's output_section.
3603 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3604 parameter. Adjust all callers.
3605 (Expression::eval_maybe_dot): Likewise.
3606 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3607 Adjust all callers.
3608 * testsuite/script_test_2.t: Test assignment of an absolute value
3609 to dot within an output section element.
3610
9634ed06
CC
36112011-10-31 Cary Coutant <ccoutant@google.com>
3612
3613 * options.h (class General_options): Add --[no-]gnu-unique options.
3614 * symtab.cc (Symbol_table::sized_write_globals): Convert
3615 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3616
de4101c7
CC
36172011-10-31 Cary Coutant <ccoutant@google.com>
3618
3619 PR gold/13359
3620 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3621 unnecessary assertion.
3622 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3623
7257cc92
ST
36242011-10-31 Sriraman Tallam <tmsriram@google.com>
3625
3626 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3627 gc_mark_symbol.
3628 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3629 gc_mark_symbol.
3630 Change to just keep the section associated with symbol.
3631 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3632 they are externally visible and --export-dynamic is turned on.
3633 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3634
bfc34b3f
ILT
36352011-10-19 Ian Lance Taylor <iant@google.com>
3636
3637 PR gold/13163
3638 * script-sections.cc
3639 (Output_section_element_dot_assignment::needs_output_section): New
3640 function.
3641
ea0d8c47
ILT
36422011-10-19 Ian Lance Taylor <iant@google.com>
3643
3644 PR gold/13204
3645 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3646 --section-start option was seen.
3647 * options.h (General_options::any_section_start): New function.
3648
abd242a9
DM
36492011-10-18 David S. Miller <davem@davemloft.net>
3650
3651 PR binutils/13301
3652 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3653 member to track relocation locations that have moved during TLS
3654 reloc optimizations.
3655 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3656 (Target_sparc::Relocate::relocate): Adjust view down by 4
3657 bytes if it matches reloc_adjust_addr_.
3658 (Target_sparc::Relocate::relocate_tls): Always move the
3659 __tls_get_addr call delay slot instruction forward 4 bytes when
3660 performing relaxation.
3661
bab9090f
CC
36622011-10-18 Cary Coutant <ccoutant@google.com>
3663
3664 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3665 (Output_file::map_no_anonymous): Check for non-zero
3666 return code from posix_fallocate.
3667
f7c5b166
CC
36682011-10-17 Cary Coutant <ccoutant@google.com>
3669
3670 PR gold/13245
3671 * plugin.cc (is_visible_from_outside): Check for symbols
3672 referenced from dynamic objects.
3673 * resolve.cc (Symbol_table::resolve): Don't count references
3674 from dynamic objects as references from real ELF files.
3675 * testsuite/plugin_test_2.sh: Adjust expected result.
3676
b490c0bb
CC
36772011-10-17 Cary Coutant <ccoutant@google.com>
3678
3679 * gold.cc: Include timer.h.
3680 (queue_middle_tasks): Stamp time.
3681 (queue_final_tasks): Likewise.
3682 * main.cc (main): Store timer in parameters. Print timers
3683 for each pass.
3684 * parameters.cc (Parameters::Parameters): Initialize timer_.
3685 (Parameters::set_timer): New function.
3686 (set_parameters_timer): New function.
3687 * parameters.h (Parameters::set_timer): New function.
3688 (Parameters::timer): New function.
3689 (Parameters::timer_): New data member.
3690 (set_parameters_timer): New function.
3691 * timer.cc (Timer::stamp): New function.
3692 (Timer::get_pass_time): New function.
3693 * timer.h (Timer::stamp): New function.
3694 (Timer::get_pass_time): New function.
3695 (Timer::pass_times_): New data member.
3696
f475cf7b
CC
36972011-10-17 Cary Coutant <ccoutant@google.com>
3698
3699 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3700 task for members of lib groups.
3701
cdd7e244
CC
37022011-10-17 Cary Coutant <ccoutant@google.com>
3703
3704 PR gold/13288
4f95c8b4 3705 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
3706 (File_read::make_view): Move bounds check (replace with assert)...
3707 (File_read::find_or_make_view): ... to here.
3708
dfb45471
CC
37092011-10-12 Cary Coutant <ccoutant@google.com>
3710
4f95c8b4 3711 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
3712 ::read returns less than requested size.
3713
53bbcc1b
CC
37142011-10-10 Cary Coutant <ccoutant@google.com>
3715
4f95c8b4 3716 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
3717 Initialize defined_count_.
3718 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3719 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3720 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3721 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3722 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 3723 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
3724 member.
3725 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 3726 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
3727 Return zeroes instead of internal error.
3728
397b129b
CC
37292011-10-10 Cary Coutant <ccoutant@google.com>
3730
3731 PR gold/13249
4f95c8b4 3732 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 3733 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 3734 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
3735 (Output_reloc::type_): Adjust size of bit field.
3736 (Output_reloc::use_plt_offset_): New bit field.
3737 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
3738 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
3739 flag. Adjust all callers.
4f95c8b4 3740 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
3741 creating RELATIVE relocations.
3742
d5698657
NC
37432011-10-10 Nick Clifton <nickc@redhat.com>
3744
3745 * po/es.po: Updated Spanish translation.
3746 * po/fi.po: Updated Finnish translation.
3747
6a59a5c2
DN
37482011-10-03 Diego Novillo <dnovillo@google.com>
3749
3750 * options.cc (parse_uint): Fix dereference of RETVAL.
3751
f0558624
ST
37522011-09-29 Sriraman Tallam <tmsriram@google.com>
3753
3754 * layout.h (section_order_map_): New member.
3755 (get_section_order_map): New member function.
3756 * output.cc (Output_section::add_input_section): Check for patterns
3757 only when --section-ordering-file is specified.
3758 * gold.cc (queue_middle_tasks): Delay updating order of sections till
3759 output_sections have been formed.
3760 * layout.cc (Layout_Layout): Initialize section_order_map_.
3761 * plugin.cc (update_section_order): Store order in order_map. Do not
3762 update the order.
3763 * testsuite/Makefile.am: Add test case for plugin_final_layout.
3764 * testsuite/Makefile.in: Regenerate.
3765 * testsuite/plugin_section_order.c: New file.
3766 * testsuite/plugin_final_layout.cc: New file.
3767 * testsuite/plugin_final_layout.sh: New file.
3768
a7dac153
CC
37692011-09-29 Cary Coutant <ccoutant@google.com>
3770
4f95c8b4 3771 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 3772 Check for NULL.
4f95c8b4 3773 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
3774 symbols during incremental update.
3775 (Symbol_table::add_from_dynobj): Likewise.
3776
eebd87a5
ILT
37772011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3778 Ian Lance Taylor <iant@google.com>
3779
3780 * symtab.cc (Symbol_table::define_special_symbol): Always
3781 canonicalize version string.
3782
403a3331
CC
37832011-09-26 Cary Coutant <ccoutant@google.com>
3784
4f95c8b4
CC
3785 * gold.cc (queue_initial_tasks): Move option checks ...
3786 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
3787 some options; make others fatal.
3788
235061c2
CC
37892011-09-26 Cary Coutant <ccoutant@google.com>
3790
3791 gcc PR lto/47247
3792 * plugin.cc (get_symbols_v2): New function.
3793 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
3794 (is_referenced_from_outside): New function.
3795 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
3796 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
3797 (get_symbols): Pass version parameter.
3798 (get_symbols_v2): New function.
3799 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
3800 parameter.
3801 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
3802 (onload): Add LDPT_GET_SYMBOLS_V2.
3803 (all_symbols_read_hook): Use get_symbols_v2; check for
3804 LDPR_PREVAILING_DEF_IRONLY_EXP.
3805 * testsuite/plugin_test_3.sh: Update expected results.
3806
dc87f620
ILT
38072011-09-23 Simon Baldwin <simonb@google.com>
3808
3809 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
3810 configuration options.
3811 * configure: Regenerate.
3812 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
3813 * Makefile.in: Regenerate.
3814 * testsuite/Makefile.in: Regenerate.
3815
a8279f82
ST
38162011-09-19 Sriraman Tallam <tmsriram@google.com>
3817
3818 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
3819
0c9350c8
CC
38202011-09-19 Cary Coutant <ccoutant@google.com>
3821
3822 * incremental.cc (can_incremental_update): Fix typo in comment.
3823 * incremental.h (can_incremental_update): Likewise.
3824
aa06ae28
CC
38252011-09-18 Cary Coutant <ccoutant@google.com>
3826
3827 * incremental.cc (can_incremental_update): New function.
3828 * incremental.h (can_incremental_update): New function.
3829 * layout.cc (Layout::init_fixed_output_section): Call it.
3830 (Layout::make_output_section): Don't allow patch space in .eh_frame.
3831 * object.cc (Sized_relobj_file::do_layout): Call
3832 can_incremental_update.
3833
ebb300b2
CC
38342011-09-13 Cary Coutant <ccoutant@google.com>
3835
3836 * configure.ac: Check for glibc support for gnu_indirect_function
3837 support with static linking, setting automake conditional
3838 IFUNC_STATIC.
3839 * Makefile.in: Regenerate.
3840 * configure: Regenerate.
3841
3842 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
3843 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
3844 for IFUNC_STATIC.
3845 * testsuite/Makefile.in: Regenerate.
3846
1206d0d5
CC
38472011-09-13 Cary Coutant <ccoutant@google.com>
3848
3849 * incremental.cc (Sized_relobj_incr::do_layout): Call
3850 report_comdat_group for kept comdat sections.
3851 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
3852 * testsuite/Makefile.in: Regenerate.
3853 * testsuite/incr_comdat_test_1.cc: New source file.
3854 * testsuite/incr_comdat_test_2_v1.cc: New source file.
3855 * testsuite/incr_comdat_test_2_v2.cc: New source file.
3856 * testsuite/incr_comdat_test_2_v3.cc: New source file.
3857
40b29874
ILT
38582011-09-13 Ian Lance Taylor <iant@google.com>
3859
3860 * object.cc (Sized_relobj_file::do_layout): Remove unused local
3861 variable external_symbols_offset.
3862
1b045aac
ILT
38632011-09-12 Ian Lance Taylor <iant@google.com>
3864
3865 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
3866 triggered if object has no symbols.
3867
24c6c55a
DM
38682011-09-09 David S. Miller <davem@davemloft.net>
3869
3870 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
3871 (Output_fill_debug_line::do_write): Likewise.
3872
66570254
CC
38732011-08-29 Cary Coutant <ccoutant@google.com>
3874
3875 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
3876 casts to match formatting specs.
3877 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
3878
8ea8cd50
CC
38792011-08-26 Cary Coutant <ccoutant@google.com>
3880
3881 * layout.cc (Free_list::allocate): Provide guarantee of minimum
3882 remaining hole size when allocating.
3883 (Layout::make_output_section): Set fill methods for debug sections.
3884 * layout.h (Free_list::Free_list_node): Move from private to
3885 public.
3886 (Free_list::set_min_hole_size): New function.
3887 (Free_list::begin, Free_list::end): New functions.
3888 (Free_list::min_hole_): New data member.
3889 * output.cc: Include dwarf.h.
3890 (Output_fill_debug_info::do_minimum_hole_size): New function.
3891 (Output_fill_debug_info::do_write): New function.
3892 (Output_fill_debug_line::do_minimum_hole_size): New function.
3893 (Output_fill_debug_line::do_write): New function.
3894 (Output_section::Output_section): Initialize new data member.
3895 (Output_section::set_final_data_size): Ensure patch space is larger
3896 than minimum hole size.
3897 (Output_section::do_write): Fill holes in debug sections.
3898 * output.h (Output_fill): New class.
3899 (Output_fill_debug_info): New class.
3900 (Output_fill_debug_line): New class.
3901 (Output_section::set_free_space_fill): New function.
3902 (Output_section::free_space_fill_): New data member.
3903 * testsuite/Makefile.am (incremental_test_3): Add
3904 --incremental-patch option.
3905 (incremental_test_4): Likewise.
3906 (incremental_test_5): Likewise.
3907 (incremental_test_6): Likewise.
3908 (incremental_copy_test): Likewise.
3909 (incremental_common_test_1): Likewise.
3910 * testsuite/Makefile.in: Regenerate.
3911
7cf80422
NC
39122011-08-26 Nick Clifton <nickc@redhat.com>
3913
3914 * po/es.po: Updated Spanish translation.
3915
c3f7b0e5
CC
39162011-08-01 Cary Coutant <ccoutant@google.com>
3917
3918 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
3919 * gold/testsuite/Makefile.in: Regenerate.
3920 * gold/testsuite/justsyms_exec.c: New source file.
3921 * gold/testsuite/justsyms_lib.c: New source file.
3922
9590bf25
CC
39232011-08-01 Cary Coutant <ccoutant@google.com>
3924
3925 * layout.cc (Layout::set_segment_offsets): Don't realign text
3926 segment if -Ttext was specified.
3927 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
3928 file type.
3929 * object.h (Sized_relobj_file::e_type): New function.
3930 (Sized_relobj_file::e_type_): New data member.
3931 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3932 base address for ET_EXEC files.
3933 * target.cc (Target::do_make_elf_object_implementation): Allow
3934 ET_EXEC files with --just-symbols option.
3935
dcd8d12e
CC
39362011-07-28 Cary Coutant <ccoutant@google.com>
3937
3938 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3939 Add thread_number parameter.
3940 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3941 * workqueue-threads.cc
3942 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3943 current thread if its thread number is greater than desired thread
3944 count.
3945 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3946 Add thread_number parameter.
3947 (Workqueue::should_cancel_thread): Likewise.
3948 (Workqueue::find_runnable_or_wait): Pass thread_number to
3949 should_cancel_thread.
3950 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3951 parameter.
3952
804eb480
ST
39532011-07-22 Sriraman Tallam <tmsriram@google.com>
3954
3955 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3956 only after checking if it cannot be forced local.
3957 * symtab.h (is_externally_visible): Check if the symbol is not forced
3958 local.
3959
f1ddb600
ILT
39602011-07-15 Ian Lance Taylor <iant@google.com>
3961
3962 * options.h (class General_options): Add --print-output-format.
3963 Move -EL next to -EB, for better --help output.
3964 * target-select.cc: Include <cstdio>, "options.h", and
3965 "parameters.h".
3966 (Target_selector::do_target_bfd_name): New function.
3967 (print_output_format): New function.
3968 * target-select.h (class Target_selector): Update declarations.
3969 (Target_selector::target_bfd_name): New function.
3970 (print_output_format): Declare.
3971 * main.cc: Include "target-select.h".
3972 (main): Handle --print-output-format.
3973 * gold.cc: Include "target-select.h".
3974 (queue_initial_tasks): Handle --print-output-format when there are
3975 no input files.
3976 * parameters.cc (parameters_force_valid_target): Give a better
3977 error message if -EB/-EL does not match target.
3978 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
3979 function.
3980
7d172687
ILT
39812011-07-15 Ian Lance Taylor <iant@google.com>
3982
3983 * i386.cc (class Output_data_plt_i386): Add layout_ field.
3984 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
3985 (Output_data_plt_i386::do_write): Write address of .dynamic
3986 section to first entry in .got.plt section.
3987 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
3988 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3989 Initialize layout_.
3990 (Output_data_plt_x86_64::do_write): Write address of .dynamic
3991 section to first entry in .got.plt section.
3992 * layout.h (Layout::dynamic_section): New function.
3993
e9552f7e
ST
39942011-07-13 Sriraman Tallam <tmsriram@google.com>
3995
3996 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
3997 to claim_file call.
3998 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
3999 input_section_position_, and input_section_glob_.
4000 (read_layout_from_file): Call function section_ordering_specified.
4001 * layout.h (is_section_ordering_specified): New function.
4002 (section_ordering_specified): New function.
4003 (section_ordering_specified_): New boolean member.
4004 * main.cc(main): Call load_plugins after layout object is defined.
4005 * output.cc (Output_section::add_input_section): Use
4006 function section_ordering_specified to check if section ordering is
4007 needed.
4008 * output.cc (Output_section::add_relaxed_input_section): Use
4009 function section_ordering_specified to check if section ordering is
4010 needed.
4011 (Output_section::update_section_layout): New function.
4012 (Output_section::sort_attached_input_sections): Check if input section
4013 must be reordered.
4014 * output.h (Output_section::update_section_layout): New function.
4015 * plugin.cc (get_section_count): New function.
4016 (get_section_type): New function.
4017 (get_section_name): New function.
4018 (get_section_contents): New function.
4019 (update_section_order): New function.
58797674 4020 (allow_section_ordering): New function.
e9552f7e
ST
4021 (Plugin::load): Add the new interfaces to the transfer vector.
4022 (Plugin_manager::load_plugins): New parameter.
4023 (Plugin_manager::all_symbols_read): New parameter.
4024 (Plugin_manager::claim_file): New parameter. Save the elf object for
4025 unclaimed objects.
4026 (Plugin_manager::get_elf_object): New function.
4027 (Plugin_manager::get_view): Change to directly use the bool to check
4028 if get_view is called from claim_file_hook.
4029 * plugin.h (input_objects): New function
4030 (Plugin__manager::load_plugins): New parameter.
4031 (Plugin_manager::claim_file): New parameter.
4032 (Plugin_manager::get_elf_object): New function.
4033 (Plugin_manager::in_claim_file_handler): New function.
4034 (Plugin_manager::in_claim_file_handler_): New member.
4035 (layout): New function.
4036 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4037 handler with an extra parameter. Make the elf object before calling
4038 claim_file handler.
4039 * testsuite/plugin_test.c (get_section_count): New function pointer.
4040 (get_section_type): New function pointer.
4041 (get_section_name): New function pointer.
4042 (get_section_contents): New function pointer.
4043 (update_section_order): New function pointer.
4044 (allow_section_ordering): New function pointer.
4045 (onload): Check if the new interfaces exist.
4046
9446efde
ILT
40472011-07-13 Ian Lance Taylor <iant@google.com>
4048
4049 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4050 relro section.
4051 * x86_64.cc (Target_x86_64::got_section): Likewise.
4052 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4053 (relro_now_test_SOURCES): New variable.
4054 (relro_now_test_DEPENDENCIES): New variable.
4055 (relro_now_test_LDFLAGS): New variable.
4056 (relro_now_test_LDADD): New variable.
4057 (relro_now_test.so): New target.
4058 * testsuite/Makefile.in: Rebuild.
4059
07aa62f2
ILT
40602011-07-12 Ian Lance Taylor <iant@google.com>
4061
4062 PR gold/12980
4063 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4064 GLOB_DAT relocation rather than a RELATIVE relocation for a
4065 protected symbol when creating a shared library.
4066 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4067 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4068 * testsuite/protected_main_1.cc (main): Test that protected
4069 function has same address.
4070
e2153196
ILT
40712011-07-11 Ian Lance Taylor <iant@google.com>
4072
4073 PR gold/12979
4074 * options.h (class General_options): Add -Bgroup.
4075 * options.cc (General_options::finalize): If -Bgroup is set,
4076 default to --unresolved-symbols=report-all.
4077 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4078 * target-reloc.h (issue_undefined_symbol_error): Handle
4079 --unresolved-symbols=report-all.
4080
6daf5215
ILT
40812011-07-08 Ian Lance Taylor <iant@google.com>
4082
4083 PR gold/11985
4084 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4085 if linker script discards key sections.
4086 (Layout::create_dynamic_symtab): Likewise.
4087 (Layout::assign_local_dynsym_offsets): Likewise.
4088 (Layout::sized_create_version_sections): Likewise.
4089 (Layout::create_interp): Likewise.
4090 (Layout::finish_dynamic_section): Likewise.
4091 (Layout::set_dynamic_symbol_size): Likewise.
4092
beabb2c6
ILT
40932011-07-08 Ian Lance Taylor <iant@google.com>
4094
4095 PR gold/12386
4096 * options.h (class General_options): Add --unresolved-symbols.
4097 * target-reloc.h (issue_undefined_symbol_error): Check
4098 --unresolved-symbols. Add comments.
4099
9c16daf1
ILT
41002011-07-08 Ian Lance Taylor <iant@google.com>
4101
4102 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4103 expression more complex.
4104
191f1a2d
ILT
41052011-07-08 Ian Lance Taylor <iant@google.com>
4106
4107 PR gold/11317
4108 * target-reloc.h (issue_undefined_symbol_error): New inline
4109 function, broken out of relocate_section.
4110 (relocate_section): Call issue_undefined_symbol_error.
4111 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4112 there is no TLS segment if we are about to issue an undefined
4113 symbol error.
4114 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4115
62855347
ILT
41162011-07-08 Ian Lance Taylor <iant@google.com>
4117
4118 PR gold/12279
4119 * resolve.cc (Symbol_table::should_override): Add fromtype
4120 parameter. Change all callers. Give error when linking together
4121 TLS and non-TLS symbol.
4122 (Symbol_table::should_override_with_special): Add fromtype
4123 parameter. Change all callers.
4124 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4125 there is no TLS segment if we have reported some errors.
4126 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4127
67181c72
ILT
41282011-07-08 Ian Lance Taylor <iant@google.com>
4129
4130 PR gold/12372
4131 * target.h (Target::plt_address_for_global): New function.
4132 (Target::plt_address_for_local): New function.
4133 (Target::plt_section_for_global): Remove.
4134 (Target::plt_section_for_local): Remove.
4135 (Target::do_plt_address_for_global): New virtual function.
4136 (Target::do_plt_address_for_local): New virtual function.
4137 (Target::do_plt_section_for_global): Remove.
4138 (Target::do_plt_section_for_local): Remove.
4139 (Target::register_global_plt_entry): Add Symbol_table and Layout
4140 parameters.
4141 * output.cc (Output_data_got::Got_entry::write): Use
4142 plt_address_for_global and plt_address_for_local.
4143 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4144 address of output section.
4145 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4146 got_irelative_, and irelative_count_ fields. Update
4147 declarations.
4148 (Output_data_plt_i386::has_irelative_section): New function.
4149 (Output_data_plt_i386::entry_count): Add irelative_count_.
4150 (Output_data_plt_i386::set_final_data_size): Likewise.
4151 (class Target_i386): Add got_irelative_ and rel_irelative_
4152 fields. Update declarations.
4153 (Target_i386::Target_i386): Initialize new fields.
4154 (Target_i386::do_plt_address_for_global): New function replacing
4155 do_plt_section_for_global.
4156 (Target_i386::do_plt_address_for_local): New function replacing
4157 do_plt_section_for_local.
4158 (Target_i386::got_section): Create got_irelative_.
4159 (Target_i386::rel_irelative_section): New function.
4160 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4161 fields. Don't define __rel_iplt_{start,end}.
4162 (Output_data_plt_i386::add_entry): Add symtab and layout
4163 parameters. Change all callers. Use different PLT and GOT for
4164 IFUNC symbols.
4165 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4166 layout parameters. Change all callers. Use different PLT and
4167 GOT.
4168 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4169 (Output_data_plt_i386::rel_irelative): New function.
4170 (Output_data_plt_i386::address_for_global): New function.
4171 (Output_data_plt_i386::address_for_local): New function.
4172 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4173 IRELATIVE GOT when changing IFUNC GOT entries.
4174 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4175 reloc.
4176 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4177 if we didn't create an IRELATIVE GOT.
4178 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4179 plt_address_for_local.
4180 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4181 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4182 got_irelative_, and irelative_count_ fields. Update
4183 declarations.
4184 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4185 Initialize new fields. Remove symtab parameter. Change all
4186 callers.
4187 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4188 irelative_count_.
4189 (Output_data_plt_x86_64::has_irelative_section): New function.
4190 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4191 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4192 fields. Update declarations.
4193 (Target_x86_64::Target_x86_64): Initialize new fields.
4194 (Target_x86_64::do_plt_address_for_global): New function replacing
4195 do_plt_section_for_global.
4196 (Target_x86_64::do_plt_address_for_local): New function replacing
4197 do_plt_section_for_local.
4198 (Target_x86_64::got_section): Create got_irelative_.
4199 (Target_x86_64::rela_irelative_section): New function.
4200 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4201 all callers. Don't create __rel_iplt_{start,end}.
4202 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4203 parameters. Change all callers. Use different PLT and GOT for
4204 IFUNC symbols.
4205 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4206 layout parameters. Change all callers. Use different PLT and
4207 GOT.
4208 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4209 parameters. Change all callers. Use different PLT and GOT for
4210 IFUNC symbols.
4211 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4212 (Output_data_plt_x86_64::rela_irelative): New function.
4213 (Output_data_plt_x86_64::address_for_global): New function.
4214 (Output_data_plt_x86_64::address_for_local): New function.
4215 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4216 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4217 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4218 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4219 parameters.
4220 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4221 reloc.
4222 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4223 symbols if we didn't create an IRELATIVE GOT.
4224 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4225 plt_address_for_local.
4226 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4227 * testsuite/ifuncvar1.c: New test file.
4228 * testsuite/ifuncvar2.c: New test file.
4229 * testsuite/ifuncvar3.c: New test file.
4230 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4231 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4232 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4233 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4234 * testsuite/Makefile.in: Rebuild.
4235
33c15b45
CC
42362011-07-07 Cary Coutant <ccoutant@google.com>
4237
4238 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4239 (two_file_test_1_ndebug.o): Likewise.
4240 (two_file_test_1b_ndebug.o): Likewise.
4241 (two_file_test_2_ndebug.o): Likewise.
4242 (two_file_test_main_ndebug.o): Likewise.
4243 (incremental_test_2): Link with no-debug versions.
4244
f48b5fb7
CC
42452011-07-06 Cary Coutant <ccoutant@google.com>
4246
4247 * gold/incremental.cc
4248 (Output_section_incremental_inputs::write_info_blocks): Check for
4249 hidden and internal symbols.
4250
221597a5
CC
42512011-07-06 Cary Coutant <ccoutant@google.com>
4252
4253 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4254 Check disposition for startup file.
4255 (Incremental_inputs::report_command_line): Ignore
4256 --incremental-startup-unchanged option.
4257 * options.cc (General_options::parse_incremental_startup_unchanged):
4258 New function.
4259 (General_options::General_options): Initialize new data member.
4260 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4261 (General_options): Add --incremental-startup-unchanged option.
4262 (General_options::incremental_startup_disposition): New function.
4263 (General_options::incremental_startup_disposition_): New data member.
4264
e24719f6
CC
42652011-07-06 Cary Coutant <ccoutant@google.com>
4266
4267 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4268 input file index to Script_info ctor.
4269 (Sized_incremental_binary::do_file_has_changed): Find the
4270 command-line argument for files named in scripts.
4271 * incremental.h (Script_info::Script_info): New ctor
4272 with input file index.
4273 (Script_info::input_file_index): New function.
4274 (Script_info::input_file_index_): New data member.
4275 (Incremental_binary::get_library): Add const.
4276 (Incremental_binary::get_script_info): Add const.
4277 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4278 * testsuite/Makefile.am (incremental_test_5): New test case.
4279 (incremental_test_6): New test case.
4280 * testsuite/Makefile.in: Regenerate.
4281
8f7c81e8
CC
42822011-07-06 Cary Coutant <ccoutant@google.com>
4283
4284 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4285 debug output when command lines differ.
4286
9fbd3822
CC
42872011-07-06 Cary Coutant <ccoutant@google.com>
4288
4289 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4290 --incremental-patch option.
4291 * layout.cc (Free_list::allocate): Extend allocation beyond original
4292 end if enabled.
4293 (Layout::make_output_section): Mark sections that should get
4294 patch space.
4295 * options.cc (parse_percent): New function.
4296 * options.h (parse_percent): New function.
4297 (DEFINE_percent): New macro.
4298 (General_options): Add --incremental-patch option.
4299 * output.cc (Output_section::Output_section): Initialize new data
4300 members.
4301 (Output_section::add_input_section): Print section name when out
4302 of patch space.
4303 (Output_section::add_output_section_data): Likewise.
4304 (Output_section::set_final_data_size): Add patch space when
4305 doing --incremental-full.
4306 (Output_section::do_reset_address_and_file_offset): Remove patch
4307 space.
4308 (Output_segment::set_section_list_addresses): Print debug output
4309 only if --incremental-update.
4310 * output.h (Output_section::set_is_patch_space_allowed): New function.
4311 (Output_section::is_patch_space_allowed_): New data member.
4312 (Output_section::patch_space_): New data member.
4313 * parameters.cc (Parameters::incremental_full): New function.
4314 * parameters.h (Parameters::incremental_full): New function
4315 * testsuite/Makefile.am (incremental_test_2): Add test for
4316 --incremental-patch option.
4317 * testsuite/Makefile.in: Regenerate.
4318 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4319 (t18): Remove function body.
4320
f6cccc2c
DK
43212011-07-05 Doug Kwan <dougkwan@google.com>
4322
4323 PR gold/12771
4324 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4325 Arm_Address type for relocation result.
4326 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4327 overflow check.
4328 (Arm_relocate_functions::abs32): Use unaligned access.
4329 (Arm_relocate_functions::rel32): Ditto.
4330 (Arm_relocate_functions::prel31): Ditto.
4331 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4332 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4333 static data relocations.
4334 * testsuite/Makefile.in: Regnerate.
4335 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4336
28a13fec
ILT
43372011-07-05 Ian Lance Taylor <iant@google.com>
4338
4339 PR gold/12392
4340 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4341 symbols if necessary.
4342 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4343
24d47b34
ILT
43442011-07-05 Ian Lance Taylor <iant@google.com>
4345
4346 PR gold/12952
4347 * resolve.cc (Symbol::override_base_with_special): Simply override
4348 version with special symbol version, ignoring previous version.
4349
41f9cbbe
ILT
43502011-07-05 Ian Lance Taylor <iant@google.com>
4351
4352 * object.cc (Sized_relobj_file::include_section_group): Add
4353 information to comment about signature location.
4354
886288f1
ILT
43552011-07-02 Ian Lance Taylor <iant@google.com>
4356
4357 PR gold/12957
4358 * options.h (class General_options): Add -f and -F.
4359 * options.cc (General_options::finalize): Fatal error if -f/-F
4360 are used without -shared.
4361 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4362
ae3a6d4f
ILT
43632011-07-02 Ian Lance Taylor <iant@google.com>
4364
4365 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4366
21131061
ILT
43672011-07-01 Ian Lance Taylor <iant@google.com>
4368
4369 PR gold/12525
4370 PR gold/12952
4371 * resolve.cc (Symbol::override_base_with_special): Don't override
4372 the version if the overriding symbol has a different name.
4373 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4374 all callers. If we give an error about an undefined version,
4375 define the base version if necessary.
4376 * dynobj.h (class Versions): Update declaration.
4377 * testsuite/weak_alias_test_5.cc: New file.
4378 * testsuite/weak_alias_test.script: New file.
4379 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4380 and versioned_alias have the right value, and call t2.
4381 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4382 weak_alias_test_5.so.
4383 (weak_alias_test_LDADD): Likewise.
4384 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4385 * testsuite/Makefile.in: Rebuild.
4386
611062c0
ILT
43872011-07-01 Ian Lance Taylor <iant@google.com>
4388
4389 PR gold/12525
4390 * options.h (class General_options): Support -z notext.
4391 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4392 -Wl,-z,notext.
4393 (two_file_shared_nonpic.so): Likewise.
4394 (two_file_shared_mixed.so): Likewise.
4395 (two_file_shared_mixed_1.so): Likewise.
4396 (weak_undef_lib_nonpic.so): Likewise.
4397 (alt/weak_undef_lib_nonpic.so): Likewise.
4398 (tls_test_shared_nonpic.so): Likewise.
4399 * testsuite/Makefile.in: Rebuild.
4400
328c7c2f
ILT
44012011-07-01 Ian Lance Taylor <iant@google.com>
4402
4403 PR gold/12525
4404 * configure.ac: Test whether static linking works, setting
4405 the automake conditional HAVE_STATIC.
4406 * testsuite/Makefile.am: Disable tests using -static if
4407 HAVE_STATIC is not true.
4408 * configure, testsuite/Makefile.in: Rebuild.
4409
02d7cd44
ILT
44102011-07-01 Ian Lance Taylor <iant@google.com>
4411
4412 PR gold/12525
4413 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4414 Assert if we see DW_EH_PE_indirect.
4415 * target.h (Target::ehframe_datarel_base): New function.
4416 (Target::do_ehframe_datarel_base): New target function.
4417 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4418 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4419 function.
4420
07a60597
ILT
44212011-07-01 Ian Lance Taylor <iant@google.com>
4422
4423 PR gold/12571
4424 * options.h (class General_options): Add
4425 --ld-generated-unwind-info.
4426 * ehframe.cc (Fde::write): Add address parameter. Change all
4427 callers. If associated with PLT, fill in address and size.
4428 (Cie::set_output_offset): Only add merge mapping if there is an
4429 object.
4430 (Cie::write): Add address parameter. Change all callers.
4431 (Eh_frame::add_ehframe_for_plt): New function.
4432 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4433 input_offset_ fields into union u_, with new plt field.
4434 (Fde::Fde): Adjust for new union field.
4435 (Fde::Fde) [Output_data version]: New constructor.
4436 (Fde::add_mapping): Only add merge mapping if there is an object.
4437 (class Cie): Update declarations.
4438 (class Eh_frame): Declare add_ehframe_for_plt.
4439 * layout.cc (Layout::layout_eh_frame): Break out code into
4440 make_eh_frame_section, and call it.
4441 (Layout::make_eh_frame_section): New function.
4442 (Layout::add_eh_frame_for_plt): New function.
4443 * layout.h (class Layout): Update declarations.
4444 * merge.cc (Merge_map::add_mapping): Add assertion.
4445 * i386.cc: Include "dwarf.h".
4446 (class Output_data_plt_i386): Make first_plt_entry,
4447 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4448 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4449 and plt_eh_frame_fde.
4450 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4451 boundary. Call add_eh_frame_for_plt if appropriate.
4452 * x86_64.cc: Include "dwarf.h".
4453 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4454 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4455 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4456 and plt_eh_frame_fde.
4457 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4458 appropriate.
4459
14788a3f
ILT
44602011-06-29 Ian Lance Taylor <iant@google.com>
4461
4462 PR gold/12629
4463 * object.cc (Sized_relobj_file::layout_section): Change shdr
4464 parameter to be const.
4465 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4466 out of do_layout.
4467 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4468 appropriate. Call layout_eh_frame_section.
4469 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4470 sections.
4471 * object.h (class Sized_relobj_file): Update declarations.
4472
6c21fce1
ILT
44732011-06-29 Ian Lance Taylor <iant@google.com>
4474
37e41b03 4475 PR gold/12652
6c21fce1
ILT
4476 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4477 modifier.
4478 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4479
4d5e4e62
ILT
44802011-06-29 Ian Lance Taylor <iant@google.com>
4481
4482 PR gold/12675
4483 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4484 SHT_X86_64_UNWIND.
4485 * layout.cc (Layout::layout_eh_frame): Likewise.
4486
886f533a
ILT
44872011-06-29 Ian Lance Taylor <iant@google.com>
4488
4489 PR gold/12695
4490 * layout.cc (Layout::symtab_section_shndx): New function.
4491 * layout.h (class Layout): Declare symtab_section_shndx.
4492 * output.cc (Output_section::write_header): Call it.
4493
f3ae1b28
ILT
44942011-06-29 Ian Lance Taylor <iant@google.com>
4495
4496 PR gold/12818
4497 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4498 symbols which are not used in a relocation.
4499
aecf301f
ILT
45002011-06-28 Ian Lance Taylor <iant@google.com>
4501
4502 PR gold/12898
4503 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4504 script create indistinguishable segments.
4505 (Layout::set_segment_offsets): Use stable_sort when sorting
4506 segments. Pass this to Compare_segments constructor.
4507 * layout.h (class Layout): Make segment_precedes non-static.
4508 (class Compare_segments): Change from struct to class. Add
4509 layout_ field. Add constructor.
4510 * script-sections.cc
4511 (Script_sections::attach_sections_using_phdrs_clause): Rename
4512 local orphan to is_orphan. Don't report failure to put empty
4513 section in segment. On attachment failure, report name of
4514 section, and attach to first PT_LOAD segment.
4515
03ef7571
ILT
45162011-06-28 Ian Lance Taylor <iant@google.com>
4517
4518 PR gold/12934
4519 * target-select.cc (Target_selector::Target_selector): Add
4520 emulation parameter. Change all callers.
4521 (select_target_by_bfd_name): Rename from select_target_by_name.
4522 Change all callers.
4523 (select_target_by_emulation): New function.
4524 (supported_emulation_names): New function.
4525 * target-select.h (class Target_selector): Add emulation_ field.
4526 Update declarations.
4527 (Target_selector::recognize_by_bfd_name): Rename from
4528 recognize_by_name. Change all callers.
4529 (Target_selector::supported_bfd_names): Rename from
4530 supported_names. Change all callers.
4531 (Target_selector::recognize_by_emulation): New function.
4532 (Target_selector::supported_emulations): New function.
4533 (Target_selector::emulation): New function.
4534 (Target_selector::do_recognize_by_bfd_name): Rename from
4535 do_recognize_by_name. Change all callers.
4536 (Target_selector::do_supported_bfd_names): Rename from
4537 do_supported_names. Change all callers.
4538 (Target_selector::do_recognize_by_emulation): New function.
4539 (Target_selector::do_supported_emulations): New function.
4540 (select_target_by_bfd_name): Change name in declaration.
4541 (select_target_by_emulation): Declare.
4542 (supported_emulation_names): Declare.
4543 * parameters.cc (parameters_force_valid_target): Try to find
4544 target based on emulation from -m option.
4545 * options.h (class General_options): Change doc string for -m.
4546 * options.cc (help): Print emulations.
4547 (General_options::parse_V): Likewise.
4548 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4549 Add emulation parameter. Change all callers.
4550
200b2bb9
ILT
45512011-06-28 Ian Lance Taylor <iant@google.com>
4552
4553 * target.h (class Target): Add osabi_ field.
4554 (Target::osabi): New function.
4555 (Target::set_osabi): New function.
4556 (Target::Target): Initialize osabi_.
4557 (Target::do_adjust_elf_header): Make pure virtual.
4558 (Sized_target::do_adjust_elf_header): Declare.
4559 * target.cc (Sized_target::do_adjust_elf_header): New function.
4560 (class Sized_target): Instantiate all versions.
4561 * freebsd.h (class Target_freebsd): Remove.
4562 (Target_selector_freebsd::do_recognize): Call set_osabi on
4563 Target.
4564 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4565 (Target_selector_freebsd::set_osabi): Remove.
4566 * i386.cc (class Target_i386): Inherit from Sized_target rather
4567 than Target_freebsd.
4568 * x86_64.cc (class Target_x86_64): Likewise.
4569
b3ce541e
ILT
45702011-06-28 Ian Lance Taylor <iant@google.com>
4571
4572 * target.h (Target::can_check_for_function_pointers): Rewrite.
4573 Make non-virtual.
4574 (Target::can_icf_inline_merge_sections): Likewise.
4575 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4576 (Target::Target_info): Add can_icf_inline_merge_sections field.
4577 (Target::do_can_check_for_function_pointers): New virtual
4578 function.
4579 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4580 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4581 from can_check_for_function_pointers, move in file.
4582 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4583 section_may_have_icf_unsafe_poineters, move in file.
4584 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4585 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4586 Rename from can_check_for_function_pointers, move in file.
4587 (Target_i386::can_icf_inline_merge_sections): Remove.
4588 (Target_i386::i386_info): Initialize
4589 can_icf_inline_merge_sections.
4590 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4591 Initialize can_icf_inline_merge_sections.
4592 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4593 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4594 Rename from can_check_for_function_pointers, move in file.
4595 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4596 (Target_x86_64::x86_64_info): Initialize
4597 can_icf_inline_merge_sections.
4598 * testsuite/testfile.cc (Target_test::test_target_info):
4599 Likewise.
4600 * icf.cc (get_section_contents): Correct formatting.
4601
6d1c4efb
ILT
46022011-06-27 Ian Lance Taylor <iant@google.com>
4603
4604 * symtab.cc (Symbol::versioned_name): New function.
4605 (Symbol_table::add_to_final_symtab): Use versioned_name when
4606 appropriate.
4607 (Symbol_table::sized_write_symbol): Likewise.
4608 * symtab.h (class Symbol): Declare versioned_name.
4609 * stringpool.h (class Stringpool_template): Add variant of add
4610 which takes a std::basic_string.
4611 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4612 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4613 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4614 (ver_test_12.o): New target.
4615 * testsuite/Makefile.in: Rebuild.
4616
57eb9b50
DK
46172011-06-27 Doug Kwan <dougkwan@google.com>
4618
4619 * arm.cc (Arm_relocate_functions::thm_jump8,
4620 Arm_relocate_functions::thm_jump11): Use a wider signed
4621 type to compute offset.
4622 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4623 arm_thm_jump8.
4624 * testsuite/Makefile.in: Regenerate.
4625 * testsuite/arm_branch_in_range.sh: Check test results of
4626 arm_thm_jump11 and arm_thm_jump8.
4627 * testsuite/arm_thm_jump11.s: New test source file.
4628 * testsuite/arm_thm_jump11.t: New linker script.
4629 * testsuite/arm_thm_jump8.s: New test source file.
4630 * testsuite/arm_thm_jump8.t: New linker script.
4631
487b39df
ILT
46322011-06-24 Ian Lance Taylor <iant@google.com>
4633
4634 * layout.cc: Include "object.h".
4635 (ctors_sections_in_init_array): New static variable.
4636 (Layout::is_ctors_in_init_array): New function.
4637 (Layout::layout): Add entry to ctors_sections_in_init_array if
4638 appropriate.
4639 * layout.h (class Layout): Declare is_ctors_in_init_array.
4640 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4641 is_ctors_reverse_view is set.
4642 (Sized_relobj_file::write_sections): Add layout parameter. Change
4643 all callers. Set is_ctors_reverse_view field of View_size.
4644 (Sized_relobj_file::reverse_words): New function.
4645 * object.h (Sized_relobj_file::View_size): Add
4646 is_ctors_reverse_view field.
4647 (class Sized_relobj_file): Update declarations.
4648 * testsuite/initpri3.c: New test.
4649 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4650 initpri3b.
4651 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4652 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4653 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4654 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4655 * testsuite/Makefile.in: Rebuild.
4656
472076e4
CC
46572011-06-24 Cary Coutant <ccoutant@google.com>
4658
4659 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4660 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4661 (debug_msg_cdebug.err): New targets.
4662 * testsuite/Makefile.in: Regenerate.
4663 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4664 Fix checks for link with shared library.
4665
a60af0db
DK
46662011-06-24 Doug Kwan <dougkwan@google.com>
4667
4668 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4669 skip empty text sections.
4670 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4671
5393d741
ILT
46722011-06-22 Ian Lance Taylor <iant@google.com>
4673
4674 PR gold/12910
4675 * options.h (class General_options): Add --ctors-in-init-array.
4676 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4677 friends as SHT_PROGBITS for merging sections.
4678 (Layout::layout): Remove special handling of .init_array and
4679 friends. Don't sort if doing relocatable link. Sort for .ctors
4680 and .dtors if ctors_in_init_array.
4681 (Layout::make_output_section): Force correct section types for
4682 .init_array and friends. Don't sort if doing relocatable link,
4683 Don't sort .ctors and .dtors if ctors_in_init_array.
4684 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4685 (Layout::output_section_name): Add relobj parameter. Change all
4686 callers. Handle .ctors. and .dtors. in code rather than table.
4687 Handle .ctors and .dtors if ctors_in_init_array.
4688 (Layout::match_file_name): New function, moved from output.cc.
4689 * layout.h (class Layout): Update declarations.
4690 * output.cc: Include "layout.h".
4691 (Input_section_sort_entry::get_priority): New function.
4692 (Input_section_sort_entry::match_file_name): Just call
4693 Layout::match_file_name.
4694 (Output_section::Input_section_sort_init_fini_compare::operator()):
4695 Handle .ctors and .dtors. Sort by explicit priority rather than
4696 by name.
4697 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4698 * testsuite/initpri2.c: New test.
4699 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4700 (check_PROGRAMS): Add initpri2.
4701 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4702 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4703 * configure, testsuite/Makefile.in: Rebuild.
4704
e1f74f98
ILT
47052011-06-19 Ian Lance Taylor <iant@google.com>
4706
4707 PR gold/12880
4708 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4709 .interp section to a PT_INTERP segment even if we have seen a
4710 --dynamic-linker option. Don't do it if we have seen a PHDRS
4711 clause in a linker script.
4712 (Layout::finalize): Don't create a .interp section if we've
4713 already create a PT_INTERP segment.
4714 (Layout::create_interp): Always call choose_output_section (revert
4715 patch of 2011-06-17). Don't create PT_INTERP segment.
4716 * script-sections.cc
4717 (Script_sections::create_note_and_tls_segments): Add a .interp
4718 section to a PT_INTERP segment even if we have seen a
4719 --dynamic-linker option.
4720
766f91bb
ILT
47212011-06-18 Ian Lance Taylor <iant@google.com>
4722
4723 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
4724 merely because a non-PT_LOAD segment has a dynamic reloc.
4725
0d212c3a
ILT
47262011-06-18 Ian Lance Taylor <iant@google.com>
4727
4728 * layout.cc (Layout::finish_dynamic_section): Don't create
4729 DT_FLAGS entry if not needed.
4730
911a5072
ILT
47312011-06-18 Ian Lance Taylor <iant@google.com>
4732
4733 PR gold/12745
4734 * layout.cc (Layout::layout_eh_frame): Correct handling of
4735 writable .eh_frame section.
4736
534b4e5f
ILT
47372011-06-17 Ian Lance Taylor <iant@google.com>
4738
4739 PR gold/12893
4740 * resolve.cc (Symbol_table::resolve): Don't give an error if a
4741 symbol is redefined with the exact same object and value.
4742
10b4f102
ILT
47432011-06-17 Ian Lance Taylor <iant@google.com>
4744
4745 PR gold/12880
4746 * layout.h (class Layout): Add interp_segment_ field.
4747 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
4748 (Layout::attach_allocated_section_to_segment): If making shared
4749 library, put .interp section in PT_INTERP segment.
4750 (Layout::finalize): Also call create_interp if -dynamic-linker
4751 option was used.
4752 (Layout::create_interp): Assert that there is no PT_INTERP
4753 segment. If not using a SECTIONS clause, use make_output_section.
4754 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
4755 * script-sections.cc
4756 (Script_sections::create_note_and_tls_segments): If making shared
4757 library, put .interp section in PT_INTERP segment.
4758
a29b0dad
ILT
47592011-06-17 Ian Lance Taylor <iant@google.com>
4760
e588ea8d
ILT
4761 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
4762 when making a shared library.
4763
47642011-06-17 Ian Lance Taylor <iant@google.com>
4765
4766 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
4767 parameter. Change all callers. Don't issue warning about PC32
4768 against locally defined symbol.
a29b0dad 4769
9d3b0698
ILT
47702011-06-16 Ian Lance Taylor <iant@google.com>
4771
4772 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
4773 occurs in same object.
4774
85b0f90c
AM
47752011-06-14 Alan Modra <amodra@gmail.com>
4776
4777 * po/POTFILES.in: Regenerate.
4778
a94907d9
ILT
47792011-06-09 Ian Lance Taylor <iant@google.com>
4780
4781 * script-sections.cc
4782 (Orphan_output_section::set_section_addresses): For a relocatable
4783 link set address to 0.
4784
4fb3a1c3
CC
47852011-06-09 Cary Coutant <ccoutant@google.com>
4786
4787 PR gold/12804
4788 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
4789 used with --compress-debug-sections.
4790 * gold/object.cc (Sized_relobj_file::do_layout): Report
4791 uncompressed size of compressed input sections.
4792
61220854
CC
47932011-06-08 Cary Coutant <ccoutant@google.com>
4794
4795 PR gold/12804
4796 * testsuite/two_file_test_2_v1.cc: Change initialization of
4797 v2 to keep it in .data.
4798
e6455dfb
CC
47992011-06-07 Cary Coutant <ccoutant@google.com>
4800
4801 * common.cc (Symbol_table::do_allocate_commons_list): Call
4802 gold_fallback.
4803 * errors.cc (Errors::fatal): Adjust call to gold_exit.
4804 (Errors::fallback): New function.
4805 (gold_fallback): New function.
4806 * errors.h (Errors::fallback): New function.
4807 * gold.cc (gold_exit): Change status parameter to enum; adjust
4808 all callers.
4809 (queue_initial_tasks): Call gold_fallback.
4810 * gold.h: Include cstdlib.
4811 (Exit_status): New enum type.
4812 (gold_exit): Change status parameter to enum.
4813 (gold_fallback): New function.
4814 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
4815 (Layout::create_symtab_sections): Likewise.
4816 (Layout::create_shdrs): Likewise.
4817 * main.cc (main): Adjust call to gold_exit.
4818 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
4819 (Output_data_got::add_got_entry_pair): Likewise.
4820 (Output_section::add_input_section): Likewise.
4821 (Output_section::add_output_section_data): Likewise.
4822 (Output_segment::set_section_list_addresses): Likewise.
4823 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
4824
fb0e076f
CC
48252011-06-07 Cary Coutant <ccoutant@google.com>
4826
4827 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
4828 for incremental links.
4829 * output.cc (Output_segment::set_section_list_addresses): Remove
4830 FIXME and test for TLS or BSS.
4831
a5ee4d5d
CC
48322011-06-07 Cary Coutant <ccoutant@google.com>
4833
4834 * testsuite/Makefile.am: Add incremental_copy_test,
4835 incremental_common_test_1.
4836 * testsuite/Makefile.in: Regenerate.
4837 * testsuite/common_test_1_v1.c: New source file.
4838 * testsuite/common_test_1_v2.c: New source file.
4839 * testsuite/copy_test_v1.cc: New source file.
4840
5146f448
CC
48412011-06-07 Cary Coutant <ccoutant@google.com>
4842
4843 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
4844 update, allocate common from bss section's free list.
4845 * incremental-dump.cc (dump_incremental_inputs): Print flag for
4846 linker-defined symbols.
4847 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4848 Skip GOT and PLT entries that are no longer referenced.
4849 (Output_section_incremental_inputs::write_info_blocks): Mark
4850 linker-defined symbols.
4851 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
4852 * output.cc (Output_section::allocate): New function.
4853 * output.h (Output_section::allocate): New function.
4854 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
4855 linker-defined symbols.
4856 (Symbol::override_base_with_special): Copy is_predefined_ flag.
4857 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
4858 (Symbol::init_base_output_data): Likewise.
4859 (Symbol::init_base_output_segment): Likewise.
4860 (Symbol::init_base_constant): Likewise.
4861 (Sized_symbol::init_output_data): Likewise.
4862 (Sized_symbol::init_output_segment): Likewise.
4863 (Sized_symbol::init_constant): Likewise.
4864 (Symbol_table::do_define_in_output_data): Likewise.
4865 (Symbol_table::do_define_in_output_segment): Likewise.
4866 (Symbol_table::do_define_as_constant): Likewise.
4867 * symtab.h (Symbol::is_predefined): New function.
4868 (Symbol::init_base_output_data): Add is_predefined parameter.
4869 (Symbol::init_base_output_segment): Likewise.
4870 (Symbol::init_base_constant): Likewise.
4871 (Symbol::is_predefined_): New data member.
4872 (Sized_symbol::init_output_data): Add is_predefined parameter.
4873 (Sized_symbol::init_output_segment): Likewise.
4874 (Sized_symbol::init_constant): Likewise.
4875 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
4876
26d3c67d
CC
48772011-06-07 Cary Coutant <ccoutant@google.com>
4878
4879 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
4880 instead of emit_copy_reloc.
4881 (Copy_relocs::emit_copy_reloc): Refactor.
4882 (Copy_relocs::make_copy_reloc): New function.
4883 (Copy_relocs::add_copy_reloc): Remove.
4884 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
4885 section.
4886 (Copy_relocs::make_copy_reloc): New function.
4887 (Copy_relocs::add_copy_reloc): Remove.
4888 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
4889 unchanged input files.
4890 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
4891 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
4892 Reserve BSS space for COPY relocations.
4893 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4894 (Output_section_incremental_inputs::write_info_blocks): Record
4895 whether a symbol is copied from a shared object.
4896 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
4897 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
4898 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
4899 (Incremental_input_entry_reader::get_output_symbol_index): Add
4900 is_copy parameter.
4901 (Incremental_binary::emit_copy_relocs): New function.
4902 (Incremental_binary::do_emit_copy_relocs): New function.
4903 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4904 new data member.
4905 (Sized_incremental_binary::add_copy_reloc): New function.
4906 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4907 (Sized_incremental_binary::Copy_reloc): New struct.
4908 (Sized_incremental_binary::Copy_relocs): New typedef.
4909 (Sized_incremental_binary::copy_relocs_): New data member.
4910 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
4911 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
4912 * target.h (Sized_target::emit_copy_reloc): New function.
4913 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
4914
7cdb37d9
CC
49152011-06-02 Cary Coutant <ccoutant@google.com>
4916
4917 PR gold/12163
4918 * gold/archive.cc (Archive::Archive): Initialize new data member.
4919 (Archive::include_all_members): Return if archive has already been
4920 included.
4921 * gold/archive.h (Archive::include_all_members_): New data member.
4922
cc643b88
NC
49232011-06-02 Nick Clifton <nickc@redhat.com>
4924
4925 * dynobj.h: Fix spelling mistake in comment.
4926 * output.cc: Likewise.
4927
f62a3ca7 49282011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 4929 Asier Llano
f62a3ca7
DK
4930
4931 PR gold/12826
cc643b88 4932 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
4933 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4934 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4935 redundant arm_exidx_test.so.
4936 * testsuite/Makefile.in: Regenerate.
4937 (check_SCRIPTS): Add pr12826.sh
4938 (check_DATA): Add pr12826.stdout
4939 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4940 * testsuite/pr12826.sh: New file.
4941 * testsuite/pr12826_1.s: Ditto.
4942 * testsuite/pr12826_1.s: Ditto.
4943
8dbe1edc
ILT
49442011-05-30 Ian Lance Taylor <iant@google.com>
4945
4946 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4947 sections.
4948
c49875be
ILT
49492011-05-29 Ian Lance Taylor <iant@google.com>
4950
4951 PR gold/12804
4952 * testsuite/Makefile.am: Use different file name for two_file_test
4953 temporary file for each incremental test.
4954 * testsuite/Makefile.in: Rebuild.
4955
69d53f7a
ILT
49562011-05-29 Ian Lance Taylor <iant@google.com>
4957
4958 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4959 binary input file is empty.
4960
41d0ab5f
ILT
49612011-05-27 Ian Lance Taylor <iant@google.com>
4962
4963 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4964 (ver_test_9.so): Likewise.
4965 * testsuite/Makefile.in: Rebuild.
4966
89d8a36b
CC
49672011-05-26 Cary Coutant <ccoutant@google.com>
4968
4969 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4970 * incremental.cc (Incremental_inputs::report_input_section): Fix
4971 comment, indentation.
4972 (Incremental_inputs::report_comdat_group): New function.
4973 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4974 of data for incremental input file entry.
4975 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
4976 group count, COMDAT group signatures.
4977 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
4978 an unchanged input file.
4979 * incremental.h (Incremental_object_entry::Incremental_object_entry):
4980 Initialize new data member.
4981 (Incremental_object_entry::add_comdat_group): New function.
4982 (Incremental_object_entry::get_comdat_group_count): New function.
4983 (Incremental_object_entry::get_comdat_signature_key): New function.
4984 (Incremental_object_entry::groups_): New data member.
4985 (Incremental_inputs::report_comdat_group): New function.
4986 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
4987 data for incremental input file entry.
4988 (Incremental_input_entry_reader::get_comdat_group_count): New function.
4989 (Incremental_input_entry_reader::get_input_section): Adjust size of
4990 data for incremental input file entry.
4991 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
4992 (Incremental_input_entry_reader::get_comdat_group_signature): New
4993 function.
4994 * object.cc (Sized_relobj::include_section_group): Report kept
4995 COMDAT groups for incremental links.
4996
1706a06f
ILT
49972011-05-24 David Meyer <pdox@google.com>
4998
4999 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5000 with name parameter. Add found_name parameter.
5001 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5002 * dirsearch.h (class Dirsearch): Update declaration.
5003
a10ae760
ILT
50042011-05-24 Ian Lance Taylor <iant@google.com>
5005
5006 * archive.cc (Library_base::should_include_member): Pull in object
5007 from archive if it defines the entry symbol.
5008 * parameters.cc (Parameters::entry): New function.
5009 * parameters.h (class Parameters): Declare entry.
5010 * output.h (class Output_file_header): Remove entry_ field.
5011 * output.cc (Output_file_header::Output_file_header): Remove entry
5012 parameter. Change all callers.
5013 (Output_file_header::entry): Use parameters->entry.
5014 * gold.cc (queue_middle_tasks): Likewise.
5015 * plugin.cc (Plugin_hook::run): Likewise.
5016
aa92d6ed
CC
50172011-05-24 Cary Coutant <ccoutant@google.com>
5018
5019 * gold.cc (queue_initial_tasks): Pass incremental base filename
5020 to Output_file::open_base_file; don't print error message.
5021 * incremental-dump.cc (main): Adjust call to
5022 Output_file::open_for_modification.
5023 * incremental-dump.cc (main): Likewise.
5024 * incremental.cc (Incremental_inputs::report_command_line):
5025 Ignore --incremental-base option when comparing command lines.
5026 Ignore parameter when given as separate argument.
5027 * options.h (class General_options): Add --incremental-base.
5028 * output.cc (Output_file::Output_file):
5029 (Output_file::open_base_file): Add base_name and writable parameters;
5030 read base file into new file; print error message here.
5031 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5032 callers.
5033 * output.h (Output_file::open_for_modification): Rename to...
5034 (Output_file::open_base_file): ...this; add base_name and
5035 writable parameters; adjust all callers.
5036 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5037 callers.
5038 * testsuite/Makefile.am (incremental_test_4): Test
5039 --incremental-base.
5040 * testsuite/Makefile.in: Regenerate.
5041
2eedd706
CC
50422011-05-24 Cary Coutant <ccoutant@google.com>
5043
5044 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5045 incremental_test_4.
5046 * testsuite/Makefile.in: Regenerate.
5047 * testsuite/two_file_test_1_v1.cc: New test source file.
5048 * testsuite/two_file_test_1b_v1.cc: New test source file.
5049 * testsuite/two_file_test_2_v1.cc: New test source file.
5050
0f1c85a6
CC
50512011-05-24 Cary Coutant <ccoutant@google.com>
5052
5053 * dynobj.h (Dynobj::do_dynobj): New function.
5054 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5055 flag and soname for shared objects.
5056 * incremental.cc (Incremental_inputs::report_object): Make
5057 either Incremental_object_entry or Incremental_dynobj_entry; add
5058 soname to string table.
5059 (Incremental_inputs::report_input_section): Add assertion.
5060 (Output_section_incremental_inputs::set_final_data_size): Adjust
5061 type of input file entry for shared libraries; adjust size of
5062 shared library info entry.
5063 (Output_section_incremental_inputs::write_input_files): Write
5064 as_needed flag for shared libraries.
5065 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5066 of input file entry for shared libraries; write soname.
5067 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5068 soname from incremental info.
5069 * incremental.h (enum Incremental_input_flags): Add
5070 INCREMENTAL_INPUT_AS_NEEDED.
5071 (Incremental_input_entry::Incremental_input_entry): Initialize new
5072 data member.
5073 (Incremental_input_entry::set_as_needed): New function.
5074 (Incremental_input_entry::as_needed): New function.
5075 (Incremental_input_entry::do_dynobj_entry): New function.
5076 (Incremental_input_entry::as_needed_): New data member.
5077 (Incremental_object_entry::Incremental_object_entry): Don't check
5078 for shared library.
5079 (Incremental_object_entry::do_type): Likewise.
5080 (class Incremental_dynobj_entry): New class.
5081 (Incremental_input_entry_reader::as_needed): New function.
5082 (Incremental_input_entry_reader::get_soname): New function.
5083 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5084 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5085 size of shared library info entry.
58797674 5086 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5087 incremental link when adding DT_NEEDED entries.
5088 * object.h (Object::Object): Initialize new data member.
5089 (Object::dynobj): New function.
5090 (Object::set_as_needed): New function.
5091 (Object::as_needed): New function.
5092 (Object::do_dynobj): New function.
5093 (Object::as_needed_): New data member.
5094
6fa2a40b
CC
50952011-05-24 Cary Coutant <ccoutant@google.com>
5096
5097 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5098 info; adjust display of GOT entries.
5099 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5100 vector of input objects; remove file_status_.
5101 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5102 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5103 got_plt reader; call target hooks to reserve GOT entries.
5104 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5105 of input file info header and GOT info entry.
5106 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5107 relocation info.
5108 (Got_plt_view_info::got_descriptor): Remove.
5109 (Got_plt_view_info::sym_index): New data member.
5110 (Got_plt_view_info::input_index): New data member.
5111 (Local_got_offset_visitor::visit): Write input file index.
5112 (Global_got_offset_visitor::visit): Write 0 for input file index.
5113 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5114 with sym_index and input_index.
5115 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5116 incremental info GOT entry; replace got_descriptor with input_index.
5117 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5118 map from input file index to object.
5119 (Sized_relobj_incr::do_layout): Replace direct data member reference
5120 with accessor function.
5121 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5122 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5123 Adjust size of input file info header.
5124 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5125 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5126 (Incremental_input_entry_reader::get_input_section): Adjust size of
5127 input file info header.
5128 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5129 of incremental info GOT entry.
5130 (Incremental_got_plt_reader::get_got_desc): Remove.
5131 (Incremental_got_plt_reader::get_got_symndx): New function.
5132 (Incremental_got_plt_reader::get_got_input_index): New function.
5133 (Sized_incremental_binary::Sized_incremental_binary): Remove
5134 file_status_; add input_objects_.
5135 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5136 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5137 (Sized_incremental_binary::file_is_unchanged): Remove.
5138 (Sized_incremental_binary::set_input_object): New function.
5139 (Sized_incremental_binary::input_object): New function.
5140 (Sized_incremental_binary::file_status_): Remove.
5141 (Sized_incremental_binary::input_objects_): New data member.
5142 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5143 references.
5144 (Sized_relobj_incr::invalid_address): Move to base class.
5145 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5146 class.
5147 (Sized_relobj_incr::do_output_section_offset): Likewise.
5148 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5149 (Sized_relobj_incr::section_offsets_): Likewise.
5150 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5151 function.
5152 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5153 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5154 with accessor function.
5155 (Sized_relobj_file::do_layout): Likewise.
5156 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5157 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5158 (Sized_relobj_file::compute_final_local_value): Replace refs to
5159 section_offsets_ with accessor function.
5160 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5161 * object.h (Relobj::Relobj): Initialize new data members.
5162 (Relobj::add_dyn_reloc): New function.
5163 (Relobj::first_dyn_reloc): New function.
5164 (Relobj::dyn_reloc_count): New function.
5165 (Relobj::first_dyn_reloc_): New data member.
5166 (Relobj::dyn_reloc_count_): New data member.
5167 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5168 references.
5169 (Sized_relobj::Address): New typedef.
5170 (Sized_relobj::invalid_address): Move here from child class.
5171 (Sized_relobj::Sized_relobj): Initialize new data members.
5172 (Sized_relobj::sized_relobj): New function.
5173 (Sized_relobj::is_output_section_offset_invalid): Move here from
5174 child class.
5175 (Sized_relobj::get_output_section_offset): Likewise.
5176 (Sized_relobj::local_has_got_offset): Likewise.
5177 (Sized_relobj::local_got_offset): Likewise.
5178 (Sized_relobj::set_local_got_offset): Likewise.
5179 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5180 (Sized_relobj::clear_got_offsets): New function.
5181 (Sized_relobj::section_offsets): Move here from child class.
5182 (Sized_relobj::do_output_section_offset): Likewise.
5183 (Sized_relobj::do_set_section_offset): Likewise.
5184 (Sized_relobj::Local_got_offsets): Likewise.
5185 (Sized_relobj::local_got_offsets_): Likewise.
5186 (Sized_relobj::section_offsets_): Likewise.
5187 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5188 references.
5189 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5190 class.
5191 (Sized_relobj_file::sized_relobj): New function
5192 (Sized_relobj_file::local_has_got_offset): Move to base class.
5193 (Sized_relobj_file::local_got_offset): Likewise.
5194 (Sized_relobj_file::set_local_got_offset): Likewise.
5195 (Sized_relobj_file::get_output_section_offset): Likewise.
5196 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5197 (Sized_relobj_file::do_output_section_offset): Likewise.
5198 (Sized_relobj_file::do_set_section_offset): Likewise.
5199 (Sized_relobj_file::Local_got_offsets): Likewise.
5200 (Sized_relobj_file::local_got_offsets_): Likewise.
5201 (Sized_relobj_file::section_offsets_): Likewise.
5202 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5203 (all constructors).
5204 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5205 (Output_reloc::get_symbol_index): Likewise.
5206 (Output_reloc::local_section_offset): Likewise.
5207 (Output_reloc::get_address): Likewise.
5208 (Output_reloc::symbol_value): Likewise.
5209 (Output_data_got::reserve_slot): Move to class definition.
5210 (Output_data_got::reserve_local): New function.
5211 (Output_data_got::reserve_slot_for_global): Remove.
5212 (Output_data_got::reserve_global): New function.
5213 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5214 (all constructors, two instantiations).
5215 (Output_reloc::get_relobj): New function (two instantiations).
5216 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5217 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5218 (Output_data_reloc::add_global): Adjust type of relobj.
5219 (Output_data_reloc::add_global_relative): Likewise.
5220 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5221 (Output_data_reloc::add_local): Likewise.
5222 (Output_data_reloc::add_local_relative): Likewise.
5223 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5224 (Output_data_reloc::add_local_section): Likewise.
5225 (Output_data_reloc::add_output_section): Likewise.
5226 (Output_data_reloc::add_absolute): Likewise.
5227 (Output_data_reloc::add_target_specific): Likewise.
5228 (Output_data_got::reserve_slot): Move definition here.
5229 (Output_data_got::reserve_local): New function.
5230 (Output_data_got::reserve_global): New function.
5231 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5232 section_offsets_ with accessor function.
5233 (Sized_relobj_file::write_sections): Likewise.
5234 (Sized_relobj_file::do_relocate_sections): Likewise.
5235 * target.h (Sized_target::reserve_local_got_entry): New function.
5236 (Sized_target::reserve_global_got_entry): New function.
5237 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5238 (Target_x86_64::reserve_global_got_entry): New function.
5239 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5240
4829d394
CC
52412011-05-23 Cary Coutant <ccoutant@google.com>
5242
5243 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5244 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5245 bit when checking got_type.
5246 * incremental.cc (Sized_incremental_binary::setup_readers):
5247 Store symbol table and string table locations; initialize bit vector
5248 of file status flags.
5249 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5250 unchanged files.
5251 (Sized_incremental_binary::do_process_got_plt): New function.
5252 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5253 (Output_section_incremental_inputs::set_final_data_size): Record
5254 file index for each input file.
5255 (Output_section_incremental_inputs::write_got_plt): Store file index
5256 instead of input entry offset for each GOT entry.
5257 * incremental.h
5258 (Incremental_input_entry::Incremental_input_entry): Initialize new
5259 data member.
5260 (Incremental_input_entry::set_offset): Store file index.
5261 (Incremental_input_entry::get_file_index): New function.
5262 (Incremental_input_entry::file_index_): New data member.
5263 (Incremental_binary::process_got_plt): New function.
5264 (Incremental_binary::do_process_got_plt): New function.
5265 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5266 data members.
5267 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5268 (Sized_incremental_binary::set_file_is_unchanged): New function.
5269 (Sized_incremental_binary::file_is_unchanged): New function.
5270 (Sized_incremental_binary::do_process_got_plt): New function.
5271 (Sized_incremental_binary::file_status_): New data member.
5272 (Sized_incremental_binary::main_symtab_loc_): New data member.
5273 (Sized_incremental_binary::main_strtab_loc_): New data member.
5274 * output.cc (Output_data_got::Got_entry::write): Add case
5275 RESERVED_CODE.
5276 (Output_data_got::add_global): Call add_got_entry.
5277 (Output_data_got::add_global_plt): Likewise.
5278 (Output_data_got::add_global_with_rel): Likewise.
5279 (Output_data_got::add_global_with_rela): Likewise.
5280 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5281 (Output_data_got::add_global_pair_with_rela): Likewise.
5282 (Output_data_got::add_local): Call add_got_entry.
5283 (Output_data_got::add_local_plt): Likewise.
5284 (Output_data_got::add_local_with_rel): Likewise.
5285 (Output_data_got::add_local_with_rela): Likewise.
5286 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5287 (Output_data_got::add_local_pair_with_rela): Likewise.
5288 (Output_data_got::reserve_slot): New function.
5289 (Output_data_got::reserve_slot_for_global): New function.
5290 (Output_data_got::add_got_entry): New function.
5291 (Output_data_got::add_got_entry_pair): New function.
5292 (Output_section::add_output_section_data): Edit FIXME.
5293 * output.h
5294 (Output_section_data_build::Output_section_data_build): New
5295 constructor with size parameter.
5296 (Output_data_space::Output_data_space): Likewise.
5297 (Output_data_got::Output_data_got): Initialize new data member; new
5298 constructor with size parameter.
5299 (Output_data_got::add_constant): Call add_got_entry.
5300 (Output_data_got::reserve_slot): New function.
5301 (Output_data_got::reserve_slot_for_global): New function.
5302 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5303 (Output_data_got::add_got_entry): New function.
5304 (Output_data_got::add_got_entry_pair): New function.
5305 (Output_data_got::free_list_): New data member.
5306 * target.h (Sized_target::init_got_plt_for_update): New function.
5307 (Sized_target::register_global_plt_entry): New function.
5308 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5309 Initialize new data member; call init; add constructor with PLT count.
5310 (Output_data_plt_x86_64::init): New function.
5311 (Output_data_plt_x86_64::add_relocation): New function.
5312 (Output_data_plt_x86_64::reserve_slot): New function.
5313 (Output_data_plt_x86_64::free_list_): New data member.
5314 (Target_x86_64::init_got_plt_for_update): New function.
5315 (Target_x86_64::register_global_plt_entry): New function.
5316 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5317 incremental updates.
5318 (Output_data_plt_x86_64::add_relocation): New function.
5319 * testsuite/object_unittest.cc (Object_test): Set default options.
5320
ec69d6da
ILT
53212011-05-16 Ian Lance Taylor <iant@google.com>
5322
5323 * options.h (class General_options): Make -i a synonym for -r.
5324
732e31de
ILT
53252011-05-16 Ian Lance Taylor <iant@google.com>
5326
5327 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5328
403676b5
CC
53292011-05-10 Cary Coutant <ccoutant@google.com>
5330
5331 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5332 strip_all (-s).
5333
5b7b7d6e
ILT
53342011-05-06 Ian Lance Taylor <iant@google.com>
5335
5336 * layout.cc (Layout::layout): If the output section flags change,
5337 update the ordering.
5338
f0f9babf
CC
53392011-04-25 Cary Coutant <ccoutant@google.com>
5340
5341 * incremental-dump.cc (dump_incremental_inputs): Print local
5342 symbol info for each input file.
5343 * incremental.cc
5344 (Output_section_incremental_inputs::set_final_data_size): Add local
5345 symbol info to input file entries in incremental info.
5346 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5347 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5348 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5349 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5350 implementation.
5351 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5352 (Sized_incr_relobj::do_relocate): Write the local symbols.
5353 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5354 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5355 Adjust size of input file header.
5356 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5357 (Incremental_inputs_reader::get_local_symbol_count): New function.
5358 (Incremental_inputs_reader::get_input_section): Adjust size of input
5359 file header.
5360 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5361 (Sized_incr_relobj::This): New typedef.
5362 (Sized_incr_relobj::sym_size): New const data member.
5363 (Sized_incr_relobj::Local_symbol): New struct.
5364 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5365 (Sized_incr_relobj::do_local_symbol_offset): New function.
5366 (Sized_incr_relobj::local_symbol_count_): New data member.
5367 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5368 (Sized_incr_relobj::local_symbol_index_): New data member.
5369 (Sized_incr_relobj::local_symbol_offset_): New data member.
5370 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5371 (Sized_incr_relobj::local_symbols_): New data member.
5372 * object.h (Relobj::output_local_symbol_count): New function.
5373 (Relobj::local_symbol_offset): New function.
5374 (Relobj::do_output_local_symbol_count): New function.
5375 (Relobj::do_local_symbol_offset): New function.
5376 (Sized_relobj::do_output_local_symbol_count): New function.
5377 (Sized_relobj::do_local_symbol_offset): New function.
5378
d0a9ace3
ILT
53792011-04-22 Vladimir Simonov <sv@sw.ru>
5380
5381 * descriptors.cc (set_close_on_exec): New function.
5382 (Descriptors::open): Use set_close_on_exec.
5383 * output.cc (S_ISLNK): Define if not defined.
5384
94a3fc8b
CC
53852011-04-22 Cary Coutant <ccoutant@google.com>
5386
5387 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5388 global symbol map.
5389 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5390 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5391 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5392 relocations.
5393 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5394 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5395 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5396 * incremental.h
5397 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5398 function.
5399 (Incremental_binary::apply_incremental_relocs): New function.
5400 (Incremental_binary::do_apply_incremental_relocs): New function.
5401 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5402 data member.
5403 (Sized_incremental_binary::add_global_symbol): New function.
5404 (Sized_incremental_binary::global_symbol): New function.
5405 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5406 (Sized_incremental_binary::symbol_map_): New data member.
5407 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5408 * target.h (Sized_target::apply_relocation): New function.
5409 * target-reloc.h (apply_relocation): New function.
5410 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5411
c87e4302
DK
54122011-04-22 Doug Kwan <dougkwan@google.com>
5413
5414 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5415 flag of a SHT_ARM_EXIDX section.
2e702c99 5416 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5417 * testsuite/Makefile.in: Regenerate.
5418 * testsuite/arm_exidx_test.s: New file.
5419 * testsuite/arm_exidx_test.sh: Same.
5420
e7782cf6
CC
54212011-04-20 Cary Coutant <ccoutant@google.com>
5422
5423 PR gold/12689
5424 * archive.h (Incremental_archive_entry::Archive_member):
5425 Initialize arg_serial_ (second constructor).
5426
308ecdc7
ILT
54272011-04-17 Ian Lance Taylor <iant@google.com>
5428
5429 * object.cc (Relocate_info::location): Simplify location string.
5430 * errors.cc (Errors::error_at_location): Don't print program
5431 name.
5432 (Errors::warning_at_location): Likewise.
5433 (Errors::undefined_symbol): Likewise.
5434 * testsuite/debug_msg.sh: Update accordingly.
5435
bec5b579
CC
54362011-04-14 Cary Coutant <ccoutant@google.com>
5437
5438 * gold/layout.cc (Layout::symtab_section_offset): New function.
5439 * gold/layout.h (Layout::symtab_section_offset): New function.
5440 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5441
88597d34
ILT
54422011-04-12 Ian Lance Taylor <iant@google.com>
5443
5444 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5445 with MREMAP_MAYMOVE.
5446 * output.h (class Output_file): Add map_is_allocated_ field.
5447 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5448 not available, provide stubs. If mremap is not available, #define
5449 it to gold_mremap.
5450 (MREMAP_MAYMOVE): Define if not defined.
5451 (Output_file::Output_file): Initialize map_is_allocated_.
5452 (Output_file::resize): Check map_is_allocated_.
5453 (Output_file::map_anonymous): If mmap fails, use malloc.
5454 (Output_file::unmap): Don't do anything for an anonymous map.
5455 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5456 is not available, provide stubs.
5457 (File_read::View::~View): Use free rather than delete[].
5458 (File_read::make_view): Use malloc rather than new[]. If mmap
5459 fails, use malloc.
5460 (File_read::find_or_make_view): Use malloc rather than new[].
5461 * gold.h: Remove HAVE_REMAP code.
5462 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5463 exists. Rename mremap to gold_mremap. If mmap is not available
5464 don't do anything.
5465 * configure, config.in: Rebuild.
5466
11e361bc
ILT
54672011-04-11 Ian Lance Taylor <iant@google.com>
5468
5469 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5470 initialize local variable v.
5471
cdc29364
CC
54722011-04-11 Cary Coutant <ccoutant@google.com>
5473
5474 * archive.cc (Archive::include_member): Adjust call to
5475 report_object.
5476 (Add_archive_symbols::run): Track argument serial numbers.
5477 (Lib_group::include_member): Likewise.
5478 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5479 * archive.h (Incremental_archive_entry::Archive_member):
5480 Initialize arg_serial_.
5481 (Archive_member::arg_serial_): New data member.
5482 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5483 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5484 incremental link.
5485 (Sized_dynobj::do_for_all_local_got_entries): New function.
5486 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5487 function.
5488 * fileread.cc (get_mtime): New function.
5489 * fileread.h (get_mtime): New function.
5490 * gold.cc (queue_initial_tasks): Check for incremental update.
5491 (process_incremental_input): New function.
5492 (queue_middle_tasks): Don't force valid target for incremental
5493 update.
5494 * incremental-dump.cc (find_input_containing_global): Adjust
5495 size of symbol info entry.
5496 (dump_incremental_inputs): Dump argument serial number and
5497 in_system_directory flag; bias shndx by 1; print symbol names
5498 when dumping per-file symbol lists; use new symbol info readers.
5499 * incremental.cc
5500 (Output_section_incremental_inputs:update_data_size): New function.
5501 (Sized_incremental_binary::setup_readers): Setup input readers
5502 for each input file; build maps for files added from libraries
5503 and scripts.
5504 (Sized_incremental_binary::check_input_args): New function.
5505 (Sized_incremental_binary::do_check_inputs): Build map of argument
5506 serial numbers to input arguments.
5507 (Sized_incremental_binary::do_file_has_changed): Rename
5508 do_file_is_unchanged to this; compare file modification times.
5509 (Sized_incremental_binary::do_init_layout): New function.
5510 (Sized_incremental_binary::do_reserve_layout): New function.
5511 (Sized_incremental_binary::do_get_input_reader): Remove.
5512 (Sized_incremental_binary::get_symtab_view): New function.
5513 (Incremental_checker::can_incrementally_link_output_file): Remove.
5514 (Incremental_inputs::report_command_line): Exclude --debug options.
5515 (Incremental_inputs::report_archive_begin): Add parameter; track
5516 argument serial numbers; don't put input file entry for archive
5517 before archive members.
5518 (Incremental_inputs::report_archive_end): Put input file entry
5519 for archive after archive members.
5520 (Incremental_inputs::report_object): Add parameter; track argument
5521 serial numbers and in_system_directory flag.
5522 (Incremental_inputs::report_script): Add parameter; track argument
5523 serial numbers.
5524 (Output_section_incremental_inputs::set_final_data_size): Adjust
5525 size of symbol info entry; check for forwarding symbols.
5526 (Output_section_incremental_inputs::write_input_files): Write
5527 in_system_directory flag and argument serial number.
5528 (Output_section_incremental_inputs::write_info_blocks): Map section
5529 indices between incremental info and original input file; store
5530 input section index for each symbol.
5531 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5532 change operator() to visit().
5533 (class Global_got_offset_visitor): Likewise.
5534 (class Global_symbol_visitor_got_plt):
5535 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5536 classes.
5537 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5538 (Sized_incr_relobj::do_read_symbols): New function.
5539 (Sized_incr_relobj::do_layout): New function.
5540 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5541 (Sized_incr_relobj::do_add_symbols): New function.
5542 (Sized_incr_relobj::do_should_include_member): New function.
5543 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5544 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5545 (Sized_incr_relobj::do_section_size): New function.
5546 (Sized_incr_relobj::do_section_name): New function.
5547 (Sized_incr_relobj::do_section_contents): New function.
5548 (Sized_incr_relobj::do_section_flags): New function.
5549 (Sized_incr_relobj::do_section_entsize): New function.
5550 (Sized_incr_relobj::do_section_address): New function.
5551 (Sized_incr_relobj::do_section_type): New function.
5552 (Sized_incr_relobj::do_section_link): New function.
5553 (Sized_incr_relobj::do_section_info): New function.
5554 (Sized_incr_relobj::do_section_addralign): New function.
5555 (Sized_incr_relobj::do_initialize_xindex): New function.
5556 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5557 (Sized_incr_relobj::do_read_relocs): New function.
5558 (Sized_incr_relobj::do_gc_process_relocs): New function.
5559 (Sized_incr_relobj::do_scan_relocs): New function.
5560 (Sized_incr_relobj::do_count_local_symbols): New function.
5561 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5562 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5563 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5564 (Sized_incr_relobj::do_relocate): New function.
5565 (Sized_incr_relobj::do_set_section_offset): New function.
5566 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5567 (Sized_incr_dynobj::do_read_symbols): New function.
5568 (Sized_incr_dynobj::do_layout): New function.
5569 (Sized_incr_dynobj::do_add_symbols): New function.
5570 (Sized_incr_dynobj::do_should_include_member): New function.
5571 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5572 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5573 (Sized_incr_dynobj::do_section_size): New function.
5574 (Sized_incr_dynobj::do_section_name): New function.
5575 (Sized_incr_dynobj::do_section_contents): New function.
5576 (Sized_incr_dynobj::do_section_flags): New function.
5577 (Sized_incr_dynobj::do_section_entsize): New function.
5578 (Sized_incr_dynobj::do_section_address): New function.
5579 (Sized_incr_dynobj::do_section_type): New function.
5580 (Sized_incr_dynobj::do_section_link): New function.
5581 (Sized_incr_dynobj::do_section_info): New function.
5582 (Sized_incr_dynobj::do_section_addralign): New function.
5583 (Sized_incr_dynobj::do_initialize_xindex): New function.
5584 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5585 (make_sized_incremental_object): New function.
5586 (Incremental_library::copy_unused_symbols): New function.
5587 (Incremental_library::do_for_all_unused_symbols): New function.
5588 * incremental.h (enum Incremental_input_flags): New type.
5589 (class Incremental_checker): Remove.
5590 (Incremental_input_entry::Incremental_input_entry): Add argument
5591 serial number.
5592 (Incremental_input_entry::arg_serial): New function.
5593 (Incremental_input_entry::set_is_in_system_directory): New function.
5594 (Incremental_input_entry::is_in_system_directory): New function.
5595 (Incremental_input_entry::arg_serial_): New data member.
5596 (Incremental_input_entry::is_in_system_directory_): New data member.
5597 (class Script_info): Move here from script.h.
5598 (Script_info::Script_info): Add filename parameter.
5599 (Script_info::filename): New function.
5600 (Script_info::filename_): New data member.
5601 (Incremental_script_entry::Incremental_script_entry): Add argument
5602 serial number.
5603 (Incremental_object_entry::Incremental_object_entry): Likewise.
5604 (Incremental_object_entry::add_input_section): Build list of input
5605 sections with map to original shndx.
5606 (Incremental_object_entry::get_input_section_index): New function.
5607 (Incremental_object_entry::shndx_): New data member.
5608 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5609 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5610 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5611 serial number.
5612 (Incremental_inputs::report_archive_begin): Likewise.
5613 (Incremental_inputs::report_object): Likewise.
5614 (Incremental_inputs::report_script): Likewise.
5615 (class Incremental_global_symbol_reader): New class.
5616 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5617 and store flags and input file type.
5618 (Incremental_input_entry_reader::arg_serial): New function.
5619 (Incremental_input_entry_reader::type): Extract type from flags.
5620 (Incremental_input_entry_reader::is_in_system_directory): New function.
5621 (Incremental_input_entry_reader::get_input_section_count): Call
5622 accessor function for type.
5623 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5624 function for type; adjust size of global symbol entry.
5625 (Incremental_input_entry_reader::get_global_symbol_count): Call
5626 accessor function for type.
5627 (Incremental_input_entry_reader::get_object_count): Likewise.
5628 (Incremental_input_entry_reader::get_object_offset): Likewise.
5629 (Incremental_input_entry_reader::get_member_count): Likewise.
5630 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5631 (Incremental_input_entry_reader::get_member_offset): Likewise.
5632 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5633 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5634 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5635 (Incremental_input_entry_reader::get_global_symbol_reader): New
5636 function.
5637 (Incremental_input_entry_reader::get_output_symbol_index): New
5638 function.
5639 (Incremental_input_entry_reader::type_): Remove.
5640 (Incremental_input_entry_reader::flags_): New data member.
5641 (Incremental_inputs_reader::input_file_offset): New function.
5642 (Incremental_inputs_reader::input_file_index): New function.
5643 (Incremental_inputs_reader::input_file): Call input_file_offset.
5644 (Incremental_inputs_reader::input_file_at_offset): New function.
5645 (Incremental_relocs_reader::get_r_type): Reformat.
5646 (Incremental_relocs_reader::get_r_shndx): Reformat.
5647 (Incremental_relocs_reader::get_r_offset): Reformat.
5648 (Incremental_relocs_reader::data): New function.
5649 (Incremental_binary::Incremental_binary): Initialize new data members.
5650 (Incremental_binary::check_inputs): Add cmdline parameter.
5651 (Incremental_binary::file_is_unchanged): Remove.
5652 (Input_reader::arg_serial): New function.
5653 (Input_reader::get_unused_symbol_count): New function.
5654 (Input_reader::get_unused_symbol): New function.
5655 (Input_reader::do_arg_serial): New function.
5656 (Input_reader::do_get_unused_symbol_count): New function.
5657 (Input_reader::do_get_unused_symbol): New function.
5658 (Incremental_binary::input_file_count): New function.
5659 (Incremental_binary::get_input_reader): Change signature to use
5660 index instead of filename.
5661 (Incremental_binary::file_has_changed): New function.
5662 (Incremental_binary::get_input_argument): New function.
5663 (Incremental_binary::get_library): New function.
5664 (Incremental_binary::get_script_info): New function.
5665 (Incremental_binary::init_layout): New function.
5666 (Incremental_binary::reserve_layout): New function.
5667 (Incremental_binary::output_file): New function.
5668 (Incremental_binary::do_check_inputs): New function.
5669 (Incremental_binary::do_file_is_unchanged): Remove.
5670 (Incremental_binary::do_file_has_changed): New function.
5671 (Incremental_binary::do_init_layout): New function.
5672 (Incremental_binary::do_reserve_layout): New function.
5673 (Incremental_binary::do_input_file_count): New function.
5674 (Incremental_binary::do_get_input_reader): Change signature.
5675 (Incremental_binary::input_args_map_): New data member.
5676 (Incremental_binary::library_map_): New data member.
5677 (Incremental_binary::script_map_): New data member.
5678 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5679 new data members.
5680 (Sized_incremental_binary::output_section): New function.
5681 (Sized_incremental_binary::inputs_reader): Add const.
5682 (Sized_incremental_binary::symtab_reader): Add const.
5683 (Sized_incremental_binary::relocs_reader): Add const.
5684 (Sized_incremental_binary::got_plt_reader): Add const.
5685 (Sized_incremental_binary::get_symtab_view): New function.
5686 (Sized_incremental_binary::Inputs_reader): New typedef.
5687 (Sized_incremental_binary::Input_entry_reader): New typedef.
5688 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5689 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5690 (Sized_incremental_binary::do_file_has_changed): New function.
5691 (Sized_incremental_binary::do_init_layout): New function.
5692 (Sized_incremental_binary::do_reserve_layout): New function.
5693 (Sized_input_reader::Inputs_reader): Remove.
5694 (Sized_input_reader::Input_entry_reader): Remove.
5695 (Sized_input_reader::do_arg_serial): New function.
5696 (Sized_input_reader::do_get_unused_symbol_count): New function.
5697 (Sized_input_reader::do_get_unused_symbol): New function.
5698 (Sized_incremental_binary::do_input_file_count): New function.
5699 (Sized_incremental_binary::do_get_input_reader): Change signature;
5700 use index instead of filename.
5701 (Sized_incremental_binary::section_map_): New data member.
5702 (Sized_incremental_binary::input_entry_readers_): New data member.
5703 (class Sized_incr_relobj): New class.
5704 (class Sized_incr_dynobj): New class.
5705 (make_sized_incremental_object): New function.
5706 (class Incremental_library): New class.
5707 * layout.cc (Free_list::num_lists): New static data member.
5708 (Free_list::num_nodes): New static data member.
5709 (Free_list::num_removes): New static data member.
5710 (Free_list::num_remove_visits): New static data member.
5711 (Free_list::num_allocates): New static data member.
5712 (Free_list::num_allocate_visits): New static data member.
5713 (Free_list::init): New function.
5714 (Free_list::remove): New function.
5715 (Free_list::allocate): New function.
5716 (Free_list::dump): New function.
5717 (Free_list::print_stats): New function.
5718 (Layout_task_runner::run): Resize output file for incremental updates.
5719 (Layout::Layout): Initialize new data members.
5720 (Layout::set_incremental_base): New function.
5721 (Layout::init_fixed_output_section): New function.
5722 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
5723 incremental updates.
5724 (Layout::create_gold_note): Do not create gold note section for
5725 incremental updates.
5726 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
5727 for incremental updates.
5728 (Layout::set_section_offsets): For incremental updates, allocate space
5729 from free list.
5730 (Layout::create_symtab_sections): Layout with offsets relative to
5731 start of section; for incremental updates, allocate space from free
5732 list.
5733 (Layout::create_shdrs): For incremental updates, allocate space from
5734 free list.
5735 (Layout::finish_dynamic_section): For incremental updates, do not
5736 check --as-needed (fixed in subsequent patch).
5737 * layout.h (class Free_list): New class.
5738 (Layout::set_incremental_base): New function.
5739 (Layout::incremental_base): New function.
5740 (Layout::init_fixed_output_section): New function.
5741 (Layout::allocate): New function.
5742 (Layout::incremental_base_): New data member.
5743 (Layout::free_list_): New data member.
5744 * main.cc (main): Print Free_list statistics.
5745 * object.cc (Relobj::finalize_incremental_relocs): Add
5746 clear_counts parameter; clear counts only when clear_counts is set.
5747 (Sized_relobj::Sized_relobj): Initialize new base class.
5748 (Sized_relobj::do_layout): Don't report special sections.
5749 (Sized_relobj::do_for_all_local_got_entries): New function.
5750 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
5751 symtab_off to all symbol table offsets.
5752 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
5753 * object.h (class Got_offset_list): Move to top of file.
5754 (Object::Object): Allow case where input_file == NULL.
5755 (Object::~Object): Likewise.
5756 (Object::input_file): Assert that input_file != NULL.
5757 (Object::lock): Allow case where input_file == NULL.
5758 (Object::unlock): Likewise.
5759 (Object::is_locked): Likewise.
5760 (Object::token): Likewise.
5761 (Object::release): Likewise.
5762 (Object::is_incremental): New function.
5763 (Object::get_mtime): New function.
5764 (Object::for_all_local_got_entries): New function.
5765 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
5766 (Object::set_is_in_system_directory): New function.
5767 (Object::is_in_system_directory): New function.
5768 (Object::do_is_incremental): New function.
5769 (Object::do_get_mtime): New function.
5770 (Object::do_for_all_local_got_entries): New function.
5771 (Object::is_in_system_directory_): New data member.
5772 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
5773 (class Sized_relobj_base): New class.
5774 (class Sized_relobj): Derive from Sized_relobj_base.
5775 (class Sized_relobj::Symbols): Redeclare from base class.
5776 (class Sized_relobj::local_got_offset_list): Remove.
5777 (class Sized_relobj::Output_sections): Redeclare from base class.
5778 (class Sized_relobj::do_for_all_local_got_entries): New function.
5779 (class Sized_relobj::write_local_symbols): Add offset parameter.
5780 (class Sized_relobj::local_symbol_offset_): Update comment.
5781 (class Sized_relobj::local_dynsym_offset_): Update comment.
5782 * options.cc (Input_arguments::add_file): Remove const.
5783 * options.h (Input_file_argument::Input_file_argument):
5784 Initialize arg_serial_ (all constructors).
5785 (Input_file_argument::set_arg_serial): New function.
5786 (Input_file_argument::arg_serial): New function.
5787 (Input_file_argument::arg_serial_): New data member.
5788 (Input_arguments::Input_arguments): Initialize file_count_.
5789 (Input_arguments::add_file): Remove const.
5790 (Input_arguments::number_of_input_files): New function.
5791 (Input_arguments::file_count_): New data member.
5792 (Command_line::number_of_input_files): Call
5793 Input_arguments::number_of_input_files.
5794 * output.cc (Output_segment_headers::Output_segment_headers):
5795 Set current size.
5796 (Output_section::Input_section::current_data_size): New function.
5797 (Output_section::Output_section): Initialize new data members.
5798 (Output_section::add_input_section): Don't do merge sections for
5799 an incremental link; allocate space from free list for an
5800 incremental update.
5801 (Output_section::add_output_section_data): Allocate space from
5802 free list for an incremental update.
5803 (Output_section::update_data_size): New function.
5804 (Output_section::set_fixed_layout): New function.
5805 (Output_section::reserve): New function.
5806 (Output_segment::set_section_addresses): Remove const.
5807 (Output_segment::set_section_list_addresses): Remove const; allocate
5808 space from free list for an incremental update.
5809 (Output_segment::set_offset): Adjust size of RELRO segment for an
5810 incremental update.
5811 * output.h (Output_data::current_data_size): Move here from
5812 child classes.
5813 (Output_data::pre_finalize_data_size): New function.
5814 (Output_data::update_data_size): New function.
5815 (Output_section_headers::update_data_size): new function.
5816 (Output_section_data_build::current_data_size): Move to Output_data.
5817 (Output_data_strtab::update_data_size): New function.
5818 (Output_section::current_data_size): Move to Output_data.
5819 (Output_section::set_fixed_layout): New function.
5820 (Output_section::has_fixed_layout): New function.
5821 (Output_section::reserve): New function.
5822 (Output_section::update_data_size): New function.
5823 (Output_section::has_fixed_layout_): New data member.
5824 (Output_section::free_list_): New data member.
5825 (Output_segment::set_section_addresses): Remove const.
5826 (Output_segment::set_section_list_addresses): Remove const.
5827 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
5828 New function.
5829 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
5830 New function.
5831 * readsyms.cc (Read_symbols::do_read_symbols): Add library
5832 parameter when calling Add_symbols constructor; store argument
5833 serial number for members of a lib group.
5834 (Add_symbols::locks): Allow case where token == NULL.
5835 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
5836 (Read_member::~Read_member): New function.
5837 (Read_member::is_runnable): New function.
5838 (Read_member::locks): New function.
5839 (Read_member::run): New function.
5840 (Check_script::~Check_script): New function.
5841 (Check_script::is_runnable): New function.
5842 (Check_script::locks): New function.
5843 (Check_script::run): New function.
5844 (Check_library::~Check_library): New function.
5845 (Check_library::is_runnable): New function.
5846 (Check_library::locks): New function.
5847 (Check_library::run): New function.
5848 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
5849 (Add_symbols::library_): New data member.
5850 (class Read_member): New class.
5851 (class Check_script): New class.
5852 (class Check_library): New class.
5853 * reloc.cc (Read_relocs::is_runnable): Allow case where
5854 token == NULL.
5855 (Read_relocs::locks): Likewise.
5856 (Scan_relocs::locks): Likewise.
5857 (Relocate_task::locks): Likewise.
5858 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
5859 to clear counters.
5860 (Sized_relobj::incremental_relocs_scan): Fix comment.
5861 (Sized_relobj::do_relocate): Pass output file offset to
5862 write_local_symbols.
5863 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
5864 from class declaration.
5865 * script.cc (read_input_script): Allocate Script_info; pass
5866 argument serial number to report_script.
5867 * script.h (class Script_info): Move to incremental.h.
5868 * symtab.cc (Symbol_table::add_from_incrobj): New function.
5869 * symtab.h (Symbol_table::add_from_incrobj): New function.
5870 (Symbol_table::set_file_offset): New function.
5871
b961d0d7
CC
58722011-04-05 Cary Coutant <ccoutant@google.com>
5873
5874 * incremental-dump.cc (dump_incremental_inputs): Change signature
5875 to take a Sized_incremental_binary; change caller. Use readers
5876 in Sized_incremental_binary.
5877 * incremental.cc
5878 (Sized_incremental_binary::find_incremental_inputs_sections):
5879 Rename do_find_incremental_inputs_sections to this.
5880 (Sized_incremental_binary::setup_readers): New function.
5881 (Sized_incremental_binary::do_check_inputs): Check
5882 has_incremental_info_ flag; move setup code to setup_readers;
5883 use input readers.
5884 (Sized_incremental_binary::do_file_is_unchanged): New function.
5885 (Sized_incremental_binary::do_get_input_reader): New function.
5886 * incremental.h (class Incremental_binary): Move to end of file.
5887 (Incremental_binary::file_is_unchanged): New function.
5888 (Incremental_binary::do_file_is_unchanged): New function.
5889 (Incremental_binary::Input_reader): New class.
5890 (Incremental_binary::get_input_reader): New function.
5891 (class Sized_incremental_binary): Move to end of file.
5892 (Sized_incremental_binary::Sized_incremental_binary): Setup the
5893 input section reader classes.
5894 (Sized_incremental_binary::has_incremental_info): New function.
5895 (Sized_incremental_binary::inputs_reader): New function.
5896 (Sized_incremental_binary::symtab_reader): New function.
5897 (Sized_incremental_binary::relocs_reader): New function.
5898 (Sized_incremental_binary::got_plt_reader): New function.
5899 (Sized_incremental_binary::do_file_is_unchanged): New function.
5900 (Sized_incremental_binary::Sized_input_reader): New class.
5901 (Sized_incremental_binary::get_input_reader): New function.
5902 (Sized_incremental_binary::find_incremental_inputs_sections):
5903 Rename do_find_incremental_inputs_sections to this.
5904 (Sized_incremental_binary::setup_readers): New function.
5905 (Sized_incremental_binary::has_incremental_info_): New data member.
5906 (Sized_incremental_binary::inputs_reader_): New data member.
5907 (Sized_incremental_binary::symtab_reader_): New data member.
5908 (Sized_incremental_binary::relocs_reader_): New data member.
5909 (Sized_incremental_binary::got_plt_reader_): New data member.
5910 (Sized_incremental_binary::current_input_file_): New data member.
5911
a869183f
PP
59122011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
5913
5914 PR gold/12640
5915 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5916 violation.
5917
59182011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
5919
5920 * archive.cc (Archive::include_member): Adjust call to report_object.
5921 (Add_archive_symbols::run): Add script_info to call to
5922 report_archive_begin.
5923 (Lib_group::include_member): Adjust call to report_object.
5924 (Add_lib_group_symbols::run): Adjust call to report_object.
5925 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
5926 blocks. Add object count for script input files.
5927 * incremental.cc (Incremental_inputs::report_archive_begin): Add
5928 script_info parameter; change all callers.
5929 (Incremental_inputs::report_object): Add script_info parameter;
5930 change all callers.
5931 (Incremental_inputs::report_script): Store backpointer to
5932 incremental info entry.
5933 (Output_section_incremental_inputs::set_final_data_size): Record
5934 additional information for scripts.
5935 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5936 * incremental.h (Incremental_script_entry::add_object): New function.
5937 (Incremental_script_entry::get_object_count): New function.
5938 (Incremental_script_entry::get_object): New function.
5939 (Incremental_script_entry::objects_): New data member; adjust
5940 constructor.
5941 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5942 (Incremental_inputs::report_object): Add script_info parameter.
5943 (Incremental_inputs_reader::get_object_count): New function.
5944 (Incremental_inputs_reader::get_object_offset): New function.
5945 * options.cc (Input_arguments::add_file): Return reference to
5946 new input argument.
5947 * options.h (Input_argument::set_script_info): New function.
5948 (Input_argument::script_info): New function.
5949 (Input_argument::script_info_): New data member; adjust all
5950 constructors.
5951 (Input_file_group::add_file): Return reference to new input argument.
5952 (Input_file_lib::add_file): Likewise.
5953 (Input_arguments::add_file): Likewise.
5954 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5955 * script.cc (Parser_closure::Parser_closure): Add script_info
5956 parameter; adjust all callers.
5957 (Parser_closure::script_info): New function.
5958 (Parser_closure::script_info_): New data member.
5959 (read_input_script): Report scripts earlier to incremental info.
5960 (script_add_file): Set script_info in Input_argument.
5961 (script_add_library): Likewise.
5962 * script.h (Script_options::Script_info): Rewrite class.
5963
a869183f 59642011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
5965
5966 * archive.cc (Library_base::should_include_member): Move
5967 method here from class Archive.
5968 (Archive::Archive): Initialize base class.
5969 (Archive::should_include_member): Move to base class.
5970 (Archive::do_for_all_unused_symbols): New function.
5971 (Add_archive_symbols::run): Remove redundant access to
5972 incremental_inputs.
5973 (Lib_group::Lib_group): Initialize base class.
5974 (Lib_group::do_filename): New function.
5975 (Lib_group::include_member): Pass pointer to Lib_group to
5976 report_object.
5977 (Lib_group::do_for_all_unused_symbols): New function.
5978 (Add_lib_group_symbols::run): Report archive information for
5979 incremental links.
5980 * archive.h (class Library_base): New base class.
5981 (class Archive): Derive from Library_base.
5982 (Archive::filename): Move to base class.
5983 (Archive::set_incremental_info): Likewise.
5984 (Archive::incremental_info): Likewise.
5985 (Archive::Should_include): Likewise.
5986 (Archive::should_include_member): Likewise.
5987 (Archive::Armap_entry): Remove.
5988 (Archive::Unused_symbol_iterator): Remove.
5989 (Archive::unused_symbols_begin): Remove.
5990 (Archive::unused_symbols_end): Remove.
5991 (Archive::do_filename): New function.
5992 (Archive::do_get_mtime): New function.
5993 (Archive::do_for_all_unused_symbols): New function.
5994 (Archive::task_): Move to base class.
5995 (Archive::incremental_info_): Likewise.
5996 (class Lib_group): Derive from Library_base.
5997 (Lib_group::do_filename): New function.
5998 (Lib_group::do_get_mtime): New function.
5999 (Lib_group::do_for_all_unused_symbols): New function.
6000 (Lib_group::task_): Move to base class.
6001 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6002 function.
6003 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6004 function.
6005 * incremental.cc (Incremental_inputs::report_archive_begin):
6006 Use Library_base; call library's get_mtime; add incremental inputs
6007 entry before members.
6008 (class Unused_symbol_visitor): New class.
6009 (Incremental_inputs::report_archive_end): Use Library_base; use
6010 visitor class to record unused symbols; don't add incremental inputs
6011 entry after members.
6012 (Incremental_inputs::report_object): Use Library_base.
6013 * incremental.h
6014 (Incremental_archive_entry::Incremental_archive_entry): Remove
6015 unused Archive parameter.
6016 (Incremental_inputs::report_archive_begin): Use Library_base.
6017 (Incremental_inputs::report_archive_end): Likewise.
6018 (Incremental_inputs::report_object): Likewise.
6019 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6020 function.
6021 * object.h (Object::for_all_global_symbols): New function.
6022 (Object::do_for_all_global_symbols): New function.
6023 (Sized_relobj::do_for_all_global_symbols): New function.
6024 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6025 function.
6026 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6027 function.
6028
61ab3e40
ILT
60292011-03-27 Ian Lance Taylor <iant@google.com>
6030
6031 * archive.cc (Archive::interpret_header): Return -1 if something
6032 goes wrong. Change callers accordingly.
6033
30e1f9e6
CC
60342011-03-25 Cary Coutant <ccoutant@google.com>
6035
6036 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6037 * testsuite/Makefile.in: Regenerate.
6038
9370ce59 60392011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6040
6041 * plugin.cc (get_view): New.
6042 (Plugin::load): Pass get_view to the plugin.
6043 (Plugin_manager::get_view): New.
6044
9312bb0a
ILT
60452011-03-21 Ian Lance Taylor <iant@google.com>
6046
6047 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6048 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6049
7e12ba9e
ST
60502011-03-21 Sriraman Tallam <tmsriram@google.com>
6051
6052 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6053 Change == to -eq.
6054 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6055 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6056 Change == to -eq.
6057 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6058 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6059
fd7a005d
ILT
60602011-03-14 Ian Lance Taylor <iant@google.com>
6061
6062 * script-sections.cc (Sort_output_sections::script_compare):
6063 Rename from is_before, change return type.
6064 (Sort_output_sections::operator()): Adjust accordingly.
6065
ed16fd1b
ILT
60662011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6067
6068 PR gold/12572
6069 * testsuite/odr_violation2.cc: Add comment to make all error line
6070 numbers double digits.
6071 * testsuite/debug_msg.sh: Adjust expected errors.
6072
71ff8986
ILT
60732011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6074
6075 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6076 but mark earlier ones as non-canonical
6077 (offset_to_iterator): Update search target and example
6078 (do_addr2line): Return extra lines in a vector*
6079 (format_file_lineno): Extract from do_addr2line
6080 (one_addr2line): Add vector* out-param
6081 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6082 when a lineno entry appeared last for its instruction
6083 (Dwarf_line_info): Add vector* out-param
6084 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6085 * symtab.cc (Odr_violation_compare): Include the lineno in the
6086 comparison again.
6087 (linenos_from_loc): New. Combine the canonical line for an
6088 address with its other lines.
6089 (True_if_intersect): New. Helper functor to make
6090 std::set_intersection a query.
6091 (detect_odr_violations): Compare sets of lines instead of just
6092 one line for each function. This became less deterministic, but
6093 has fewer false positives.
6094 * symtab.h: Declarations.
6095 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6096 mix an optimized and non-optimized object in the same binary
6097 (odr_violation2.so): Same.
6098 * testsuite/Makefile.in: Regenerate from Makefile.am.
6099 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6100 * testsuite/debug_msg.sh: Update line numbers and add
6101 assertions.
6102 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6103 non-optimized context.
6104 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6105 isn't inlined, and use OdrDerived in an optimized context.
6106 * testsuite/odr_header1.h: Defines OdrDerived, where
6107 optimization will change the
6108 first-instruction-in-the-destructor's file and line number.
6109 * testsuite/odr_header2.h: Defines OdrBase.
6110
a19fefdc
ILT
61112011-03-09 Ian Lance Taylor <iant@google.com>
6112
6113 * fileread.cc (File_read::clear_views): Don't delete the whole
6114 file view.
6115
ecb351e9
ILT
61162011-03-08 Ian Lance Taylor <iant@google.com>
6117
6118 PR gold/12525
6119 * fileread.cc: #include <climits>.
6120 (GOLD_IOV_MAX): Define.
6121 (File_read::read_multiple): Limit number of entries by iov_max.
6122 * fileread.h (class File_read): Always set max_readv_entries to
6123 128.
6124
b821d13c
ILT
61252011-03-07 Ian Lance Taylor <iant@google.com>
6126
6127 PR gold/12525
6128 * options.h (class General_options): Add -dy and -dn.
6129
89243142
CC
61302011-03-02 Cary Coutant <ccoutant@google.com>
6131
6132 * testsuite/script_test_9.t: Add TLS segment.
6133
d0773f31
ILT
61342011-03-02 Simon Baldwin <simonb@google.com>
6135
6136 * configure.ac: Add check for gnu_indirect_function support in
6137 the toolchain building binutils.
6138 * configure: Rebuild.
6139
9370ce59 61402011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6141
6142 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6143 plugin only symbols.
6144 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6145 in plugin files as not needed in the symbol table.
6146
4cf7a849
ST
61472011-02-11 Sriraman Tallam <tmsriram@google.com>
6148
6149 * output.cc (Output_section::add_input_section): Delay fill
6150 generation for section ordering.
6151
b578bd7d
ILT
61522011-02-09 Ian Lance Taylor <iant@google.com>
6153
6154 PR gold/12316
6155 * object.h (class Sized_relobj): Remove clear_local_symbols.
6156 * reloc.cc (Sized_relobj::do_relocate): Don't call
6157 clear_local_symbols.
6158
9370ce59 61592011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6160
6161 * plugin.cc (is_visible_from_outside): Return true for symbols
6162 in the -u option.
6163
55382fb7
ILT
61642011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6165
6166 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6167 filename.
6168
4e271fff
ST
61692011-02-02 Sriraman Tallam <tmsriram@google.com>
6170
6171 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6172 to std::string.
4e271fff 6173 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6174 section_name to be std::string.
4e271fff
ST
6175 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6176
d433c3ac
ILT
61772011-01-25 Ian Lance Taylor <iant@google.com>
6178
6179 * script.cc (script_add_extern): Rewrite to use
6180 add_symbol_reference.
6181
880473a6
DK
61822011-01-25 Doug Kwan <dougkwan@google.com>
6183
d433c3ac 6184 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6185
f30f86fa
ILT
61862011-01-24 Ian Lance Taylor <iant@google.com>
6187
6188 * options.h (class General_options): Accept
6189 --no-detect-odr-violations.
6190
8e51a0b9
ILT
61912011-01-24 Ian Lance Taylor <iant@google.com>
6192
6193 * version.cc (version_string): Bump to 1.11.
6194
0f3b89d8
ILT
61952011-01-24 Ian Lance Taylor <iant@google.com>
6196
6197 * plugin.cc (class Plugin_rescan): Define new class.
6198 (Plugin_manager::claim_file): Set any_claimed_.
6199 (Plugin_manager::save_archive): New function.
6200 (Plugin_manager::save_input_group): New function.
6201 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6202 necessary.
6203 (Plugin_manager::new_undefined_symbol): New function.
6204 (Plugin_manager::rescan): New function.
6205 (Plugin_manager::rescannable_defines): New function.
6206 (Plugin_manager::add_input_file): Set any_added_.
6207 * plugin.h (class Plugin_manager): define new fields rescannable_,
6208 undefined_symbols_, any_claimed_, and any_added_. Declare
6209 Plugin_rescan as friend. Declare new functions.
6210 (Plugin_manager::Rescannable): Define type.
6211 (Plugin_manager::Rescannable_list): Define type.
6212 (Plugin_manager::Undefined_symbol_list): Define type.
6213 (Plugin_manager::Plugin_manager): Initialize new fields.
6214 * archive.cc (Archive::defines_symbol): New function.
6215 (Add_archive_symbols::run): Pass archive to plugins if any.
6216 * archive.h (class Archive): Declare defines_symbol.
6217 * readsyms.cc (Input_group::~Input_group): New function.
6218 (Finish_group::run): Pass input_group to plugins if any.
6219 * readsyms.h (class Input_group): Declare destructor.
6220 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6221 any.
6222
3bb951e5
ILT
62232011-01-10 Ian Lance Taylor <iant@google.com>
6224
6225 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6226 section as relro.
6227 (Layout::set_segment_offsets): Reset increase_relro before calling
6228 set_section_addresses a second time.
6229
0aa45fac
CC
62302011-01-04 Cary Coutant <ccoutant@google.com>
6231
6232 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6233 sections before NOBITS sections.
6234
0db46eb4
L
62352011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6236
6237 * version.cc (print_version): Update copyright to 2011.
6238
829c9745
CC
62392010-12-23 Cary Coutant <ccoutant@google.com>
6240
6241 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6242 of OS to this->add. Add OD parameter to second form of the function.
6243
7500420b
ILT
62442010-12-20 Ian Lance Taylor <iant@google.com>
6245
6246 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6247 second of two consecutive entries with same offset.
6248
f8e9a930
RW
62492010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6250
6251 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6252 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6253 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6254 to avoid unneeded links against $(LDADD).
6255 * testsuite/Makefile.in: Regenerate.
6256
2fbb4320
ILT
62572010-12-15 Ian Lance Taylor <iant@google.com>
6258
6259 PR gold/12324
6260 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6261 for R_X86_64_32 and R_X86_64_PC32.
6262 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6263 ver_matching_def_pic.o.
6264 (ver_matching_def_pic.o): New target.
6265
fedb228d
RW
62662010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6267
6268 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6269 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6270 Move definition before File_read::View member definitions.
6271 (File_read::View::~View): Initialize and hold lock before
6272 updating current_mapped_bytes.
6273
9b547ce6
RW
62742010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6275
6276 * dwarf_reader.cc: Remove outdated comment.
6277 * gold-threads.cc: Fix typo in error message.
6278 * archive.cc: Fix typos in comments.
6279 * archive.h: Likewise.
6280 * arm-reloc-property.cc: Likewise.
6281 * arm-reloc-property.h: Likewise.
6282 * arm-reloc.def: Likewise.
6283 * arm.cc: Likewise.
6284 * attributes.h: Likewise.
6285 * cref.cc: Likewise.
6286 * ehframe.cc: Likewise.
6287 * fileread.h: Likewise.
6288 * gold.h: Likewise.
6289 * i386.cc: Likewise.
6290 * icf.cc: Likewise.
6291 * incremental.h: Likewise.
6292 * int_encoding.cc: Likewise.
6293 * layout.h: Likewise.
6294 * main.cc: Likewise.
6295 * merge.h: Likewise.
6296 * object.cc: Likewise.
6297 * object.h: Likewise.
6298 * options.cc: Likewise.
6299 * readsyms.cc: Likewise.
6300 * reduced_debug_output.cc: Likewise.
6301 * reloc.cc: Likewise.
6302 * script-sections.cc: Likewise.
6303 * sparc.cc: Likewise.
6304 * symtab.h: Likewise.
6305 * target-reloc.h: Likewise.
6306 * target.cc: Likewise.
6307 * target.h: Likewise.
6308 * timer.cc: Likewise.
6309 * timer.h: Likewise.
6310 * x86_64.cc: Likewise.
6311
83e17bd5
CC
63122010-12-09 Cary Coutant <ccoutant@google.com>
6313
6314 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6315 stack.
6316 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6317 parameter; change all callers.
6318 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6319 * options.h (warn_execstack): New option.
6320
017257f8
DK
63212010-12-07 Doug Kwan <dougkwan@google.com>
6322
6323 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6324 like function call relocations.
6325
c20cbc06
ILT
63262010-12-07 Ian Lance Taylor <iant@google.com>
6327
6328 * archive.cc (Archive::get_elf_object_for_member): Permit
6329 punconfigured to be NULL.
6330 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6331 (Archive::include_member): Pass NULL to get_elf_object_for_member
6332 if we searched for the archive and this is the first included
6333 object.
6334
4dbfafcc
ILT
63352010-12-01 Ian Lance Taylor <iant@google.com>
6336
6337 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6338 track_relocs_type_ field.
6339 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6340 Set track_relocs_type_.
6341 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6342 contents when using RELA relocs.
6343 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6344 reloc_map_.
6345 * reloc.cc (Track_relocs::next_addend): New function.
6346 * reloc.h (class Track_relocs): Declare next_addend.
6347
e5e19edd
ILT
63482010-12-01 Ian Lance Taylor <iant@google.com>
6349
6350 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6351 virtual destructor.
6352
9a5ce24c
ILT
63532010-12-01 Ian Lance Taylor <iant@google.com>
6354
6355 * README: Update compilers known to work and fail.
6356
c7791212
NC
63572010-11-23 Matthias Klose <doko@ubuntu.com>
6358
6359 * configure.in: For --enable-gold, handle value `default' instead of
6360 `both*'. Always install ld as ld.bfd, install as ld if gold is
6361 not the default.
6362 * configure: Regenerate.
6363
0ad220c9
DK
63642010-11-18 Doug Kwan <dougkwan@google.com>
6365
6366 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6367 and right_alignment to be zero. Store result alignment only if it is
6368 greater than existing alignment.
6369
ab8056e0
CC
63702010-11-16 Cary Coutant <ccoutant@google.com>
6371
6372 PR gold/12220
6373 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6374 Check for ".zdebug_line".
6375
fd064a5b
CC
63762010-11-16 Doug Kwan <dougkwan@google.com>
6377 Cary Coutant <ccoutant@google.com>
6378
6379 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6380 by reference; adjust all callers.
6381 * output.cc (Output_segment::set_section_addresses): Adjust references
6382 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6383 list is empty.
6384 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6385 end at page boundary.
6386
6fc6ea19
CC
63872010-11-16 Cary Coutant <ccoutant@google.com>
6388
6389 PR gold/12220
6390 * layout.cc (Layout::choose_output_section): Transform names of
6391 compressed sections even when using a script with a SECTIONS clause.
6392 (Layout::output_section_name): Remove code to transform
6393 compressed debug section names.
6394 * output.cc (Output_section::add_input_section): Use uncompressed
6395 section size when tracking input sections.
6396
95a2c8d6
RS
63972010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6398
6399 * symtab.h (Symbol::NON_PIC_REF): Remove.
6400 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6401 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6402 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6403 (Symbol::use_plt_offset): Take a flags argument and pass it
6404 directly to needs_dynamic_reloc. Restrict check for undefined
6405 weak symbols to function calls.
6406 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6407 (Target_arm::Scan::global): Use it.
6408 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6409 (Target_arm::Relocate::relocate): Likewise.
6410 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6411 parameter with an r_type parameter. Use get_reference_flags
6412 to get the flags.
6413 (Target_arm::Relocate::relocate): Update accordingly.
6414 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6415 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6416 (Target_i386::Scan::global): Likewise.
6417 (Target_i386::Relocate::relocate): Likewise.
6418 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6419 parameter with an r_type parameter. Use get_reference_flags
6420 to get the flags.
6421 (Target_i386::Relocate::relocate): Update accordingly.
6422 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6423 (Target_powerpc::Scan::global): Use it.
6424 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6425 (Target_powerpc::Relocate::relocate): Likewise.
6426 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6427 (Target_sparc::Scan::global): Use it.
6428 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6429 (Target_sparc::Relocate::relocate): Likewise.
6430 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6431 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6432 (Target_x86_64::Scan::global): Likewise.
6433 (Target_x86_64::Relocate::relocate): Likewise.
6434
f625ae50
DK
64352010-11-08 Doug Kwan <dougkwan@google.com>
6436 Cary Coutant <ccoutant@google.com>
6437
6438 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6439 (Arm_exidx_merge_section::section_contents_): New data member.
6440 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6441 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6442 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6443 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6444 in parameters instead of calling Object::section_contents without
6445 locking.
6446 (Arm_output_section::group_section): New parameter TASK. Pass it
6447 to callees that need locking objects.
6448 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6449 to lock EXIDX input sections. Fix a formatting issue. Call
6450 Arm_exidx_merged_section::build_contents to create merged section
6451 contents.
6452 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6453 to lock object of stub table owner.
6454 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6455 TEXT_SIZE to initialize data member TEXT_SIZE_.
6456 (Arm_exidx_input_section::addralign): Fix typo in comment.
6457 (Arm_exidx_input_section::text_size): New method.
6458 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6459 that require locking objects. Lock objects before scanning for stubs
6460 and updating local symbols.
6461 (Arm_input_section<big_endian>::init): Copy contents of original
6462 input section.
2e702c99 6463 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6464 original input section instead of calling Object::section_contents
6465 without locking.
6466 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6467 size without calling Object::section_size().
6468 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6469 for size. Allocate a buffer for merged EXIDX entries.
6470 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 6471 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
6472 building code to Arm_exidx_merged_section::build_contetns. Write
6473 out contetns in buffer instead of building it on the fly.
6474 (Arm_relobj::make_exidx_input_section): Also pass text section size
6475 to Arm_exidx_input_section constructor.
6476 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6477 (Arm_dynobj::do_read_symbols): Fix memory leak.
6478 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6479 * target.h: (class Task): Add forward declaration.
6480 (Target::relax): Add new parameter TASK and pass it to
6481 Target::do_relax().
6482 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6483
5f9bcf58
CC
64842010-11-05 Cary Coutant <ccoutant@google.com>
6485
6486 PR gold/10708
6487 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6488 object when reading from the file.
6489 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6490 second layout pass.
6491 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6492 when reading section contents.
6493 (get_section_contents): Likewise.
6494 (icf::find_identical_sections): Likewise.
6495 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6496 object when reading from the file.
6497 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6498 the object when doing deferred section layout.
6499
e597fa08
NC
65002010-11-03 Nick Clifton <nickc@redhat.com>
6501
6502 PR gold/12001
6503 * script.h (class Symbol_assignment: name): New member. Returns
6504 the name of the symbol.
6505 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6506 Returns true if the given symbol name is on the list of
6507 assignments wating to be processed.
6508 * archive.cc (should_incldue_member): If the symbol is undefined,
6509 check to see if it is on the list of symbols pending assignment.
6510
3f9a3278
ILT
65112010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6512
6513 * script-sections.cc (Script_sections::find_memory_region): Check
6514 for a NULL output section pointer.
6515
d06fb4d1
DK
65162010-10-29 Doug Kwan <dougkwan@google.com>
6517
6518 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6519 Output_section::add_relaxed_input_section.
6520 * output.cc (Output_section::add_relaxed_input_section): Add new
6521 arguments LAYOUT and NAME. Set section order index.
6522 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6523 Copy section order index.
6524 * output.h (Output_section::add_relaxed_input_section): Add new
6525 arguments LAYOUT and NAME.
6526
90e24de5
ILT
65272010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6528
6529 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 6530 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
6531 * testsuite/Makefile.in: Regenerate.
6532
c9484ea5
DK
65332010-10-20 Doug Kwan <dougkwan@google.com>
6534
6535 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6536 without SHF_LINK_ORDER flags.
6537 * layout.cc (Layout::choose_output_section): Do not filter
6538 SHF_LINK_ORDER flag in a relocatable link.
6539
5bc2f5be
CC
65402010-10-17 Cary Coutant <ccoutant@google.com>
6541
6542 * output.h (Output_segment::set_section_addresses): Change function
6543 signature. Update all callers.
6544 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6545 sections.
6546 (Output_segment::set_section_addresses): Align after last TLS
6547 section. Add padding before last relro section instead of after.
6548
0c91cf04
DK
65492010-10-17 Doug Kwan <dougkwan@google.com>
6550
6551 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6552 GOT output section to be writable.
6553
8c21d9d3
CC
65542010-10-14 Cary Coutant <ccoutant@google.com>
6555
6556 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
6557 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6558 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6559 mode.
6560 * incremental.cc (report_command_line): Ignore all forms of
6561 --incremental.
6562 * layout.cc (Layout::Layout): Check parameters for incremental link
6563 mode.
6564 * options.cc (General_options::parse_incremental): New function.
6565 (General_options::parse_no_incremental): New function.
6566 (General_options::parse_incremental_full): New function.
6567 (General_options::parse_incremental_update): New function.
6568 (General_options::incremental_mode_): New data member.
6569 (General_options::finalize): Check incremental_mode_.
6570 * options.h (General_options): Update help text for --incremental.
6571 Add --no-incremental, --incremental-full, --incremental-update.
6572 (General_options::Incremental_mode): New enum type.
6573 (General_options::incremental_mode): New function.
6574 (General_options::incremental_mode_): New data member.
6575 * parameters.cc (Parameters::incremental_mode_): New data member.
6576 (Parameters::set_options): Set incremental_mode_.
6577 (Parameters::set_incremental_full): New function.
6578 (Parameters::incremental): New function.
6579 (Parameters::incremental_update): New function.
6580 (set_parameters_incremental_full): New function.
6581 * parameters.h (Parameters::set_incremental_full): New function.
6582 (Parameters::incremental): New function.
6583 (Parameters::incremental_update): New function.
6584 (Parameters::incremental_mode_): New data member.
6585 (set_parameters_incremental_full): New function.
6586 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6587 incremental link mode.
6588 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6589 (Sized_relobj::do_relocate_sections): Likewise.
6590 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6591 option.
6592 * testsuite/Makefile.in: Regenerate.
6593 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 6594
bb32aa18 65952010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
6596
6597 * script-sections.h (class Script_sections): Make
6598 Sections_elements typedef public.
6599 * script-sections.cc (class Sort_output_sections): Add elements_
6600 field. Add constructor which sets it; change all callers.
6601 (Sort_output_sections::is_before): New function.
6602 (Sort_output_sections::operator()): Call is_before.
6603 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6604 conditional.
6605 * testsuite/script_test_10.sh: New test. Test script section
6606 order.
6607 * testsuite/script_test_10.t: Likewise.
6608 * testsuite/script_test_10.s: Likewise.
6609 * testsuite/Makefile.am: Wrap the cross linker tests and the
6610 common tests into NATIVE_OR_CROSS_LINKER.
6611 (check_SCRIPTS): Add script_test_10.sh.
6612 (check_DATA): Add script_test_10.stdout.
6613 (script_test_10.o, script_test_10): New targets.
6614 (script_test_10.stdout): New target.
6615 * configure, testsuite/Makefile.in: Regenerate.
6616
3cef7179
ILT
66172010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6618
6619 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6620 error for the deprecated relocations.
6621 (Target_arm::Scan::global): Likewise.
6622 (Target_arm::Relocate::relocate): Likewise.
6623
7411e9a8
RS
66242010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6625
6626 * fileread.cc (Input_file::find_file): Initialize *found_name
6627 and *namep when using the fallback search for case 4.
6628
6a9da32a
CC
66292010-10-11 Cary Coutant <ccoutant@google.com>
6630
6631 * options.h (class General_options): Redefine -z lazy as an alias for
6632 the negation of -z now.
6633
ac897c20
ILT
66342010-10-11 Ian Lance Taylor <iant@google.com>
6635
6636 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6637 binding.
6638
ea5cae92
NC
66392010-10-06 Nick Clifton <nickc@redhat.com>
6640
6641 * script-sections.cc(class Memory_region): Remove
6642 current_lma_offset_ field. Rename current_vma_offset_ to
6643 current_offset_. Add last_section_ field.
6644 (Memory_region::get_current_vma_address): Rename to
6645 get_current_address.
6646 (Memory_region::get_current_lma_address): Delete.
6647 (Memory_region::increment_vma_offset): Rename to
6648 increment_offset.
6649 (Memory_region::increment_lma_offset): Delete.
6650 (Memory_region::attributes_compatible): New method. Returns
6651 true if the provided section is compatible with the region.
6652 (Memory_region::get_last_section): New method. Returns the last
6653 section to use the region.
6654 (Memory_region::set_last_section): New method. Stores the last
6655 section to use the region.
6656 (Script_sections::block_in_region): New method. Returns true if
6657 a block of memory is contained within a region.
6658 (Script_sections::find_memory_region): New method. Locates a
6659 memory region to be used to set a VMA or LMA address.
6660 (Output_section_definition::set_section_addresses): Add code to
6661 check for addresses set by memory regions.
6662 (Output_segment::set_section_addresses): Remove memory region
6663 walking code.
6664 (Script_sections::create_segment): Add a warning if a header
6665 segment is created outside of any region.
6666 * script-sections.h (class Script_sections): Add prototypes for
6667 find_memory_region and block_in_region methods.
6668 * testsuite/memory_test.s: Use .long instead of .word.
6669 * testsuite/memory_test.t: Add some more output sections.
6670 * testsuite/memory_test.sh: Update expected output.
6671
a9bfd952
DK
66722010-10-02 Doug Kwan <dougkwan@google.com>
6673
6674 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6675 defintion to symtab.h
6676 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6677 declaration to defintion.
6678
bacff3ab
NC
66792010-10-01 Nick Clifton <nickc@redhat.com>
6680
6681 * expression.cc (eval): Replace dummy argument with NULL.
6682 (eval_maybe_dot): Check for a NULL result section pointer.
6683 (Symbol_expression::value): Likewise.
6684 (Dot_expression::value): Likewise.
6685 (BINARY_EXPRESSION): Likewise.
6686 (Max_expression::value): Likewise.
6687 (Min_expression::value): Likewise.
6688 (Absolute_expression::value): Likewise.
6689 (Addr_expression::value_from_output_section): Likewise.
6690 (Loaddddr_expression::value_from_output_section): Likewise.
6691 (Segment_start_expression::value): Likewise.
6692 * script-sections.cc
6693 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6694 argument with NULL.
6695 (Sections_elememt_dot_assignment::set_section_addresses):
6696 Likewise.
6697 (Output_data_expression::do_write_to_buffer): Likewise.
6698 (Output_section_definition::finalize_symbols): Likewise.
6699 (Output_section_definition::set_section_addresses): Likewise.
6700
f81bc8b5
DK
67012010-09-30 Doug Kwan <dougkwan@google.com>
6702
6703 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6704
c95e9f27
ST
67052010-09-28 Sriraman Tallam <tmsriram@google.com>
6706
6707 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 6708 function.
c95e9f27
ST
6709 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6710 virtual function.
6711 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6712 virtual function.
6713 * icf.cc (get_section_contents): Inline merge sections only when
6714 target allows it.
6715
3cac54d2
RW
67162010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6717
6718 * configure: Regenerate.
6719
2904037a
ILT
67202010-09-17 Ian Lance Taylor <iant@google.com>
6721
6722 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
6723 * testsuite/Makefile.am (memory_test.o): New target.
6724 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
6725 memory_test.t.
6726 * testsuite/Makefile.in: Rebuild.
2904037a 6727
bca7fb63
DK
67282010-09-17 Doug Kwan <dougkwan@google.com>
6729
6730 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
6731 defintion if relocation uses GOT entries of the symbol.
6732 * testsuite/icf_safe_test.sh: Fix test.
6733 * testsuite/icf_safe_so_test.sh: Fix test.
6734
4ef28648
CC
67352010-09-16 Cary Coutant <ccoutant@google.com>
6736
6737 * script_sections.cc (class Memory_region): Remove "NULL" from
6738 vector initializations.
6739
793990de
CC
67402010-09-15 Cary Coutant <ccoutant@google.com>
6741
6742 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
6743 Resolve forwarding symbols.
6744
81e015e2
DK
67452010-09-15 Doug Kwan <dougkwan@google.com>
6746
6747 * gold/testsuite/script_test_3.t: Add ARM special sections.
6748 * gold/testsuite/script_test_4.t: Same.
6749 * gold/testsuite/script_test_5.t: Same.
6750 * gold/testsuite/script_test_6.t: Same.
6751 * gold/testsuite/script_test_7.t: Same.
6752 * gold/testsuite/script_test_7.t: Same.
6753 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
6754
36171d64
CC
67552010-09-14 Cary Coutant <ccoutant@google.com>
6756
6757 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
6758 (Target_x86_64::Relocate::relocate_tls): Replace check for
6759 saw_tls_block_reloc_ with test for executable section.
6760
d89051bd
CC
67612010-09-12 Cary Coutant <ccoutant@google.com>
6762
6763 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
6764 position-independent executables to shared libraries need dynamic
6765 relocations.
6766 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
6767 position-independent executables.
6768 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
6769 * testsuite/Makefile.in: Regenerate.
6770
fca41f0f
NC
67712010-09-10 Nick Clifton <nickc@redhat.com>
6772
6773 PR gold/11997
6774 * testsuite/memory_test.t: Discard any sections that are not
6775 needed.
6776
6695e4b3
L
67772010-09-09 H.J. Lu <hongjiu.lu@intel.com>
6778
6779 PR gold/11996
6780 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
6781 "This::" to work around a bug in gcc 4.2.
6782
6783 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
6784
0f72bf6f
RÁE
67852010-09-09 Rafael Espindola <espindola@google.com>
6786
6787 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
6788 sections with different PF_X flags in the same segment.
6789 (Layout::find_first_load_seg): Search all segments to find the first
6790 one.
6791 * options.h (rosegment): New.
6792
67932010-09-08 Rafael Espindola <espindola@google.com>
a6577478 6794
05a79166 6795 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 6796
aa98ff75
DK
67972010-09-08 Doug Kwan <dougkwan@google.com>
6798
6799 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
6800 (Arm_relobj::do_relocate_sections): Add new parameter for output
6801 file to match the parent.
6802 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
6803 of local symbols instead of input values. Update code to track
6804 changes in gold::relocate_section.
6805 * object.cc (Sized_relobj::compute_final_local_value): New methods.
6806 (Sized_relobj::compute_final_local_value_internal): New methods.
6807 (Sized_relobj::do_finalize_local_symbols): Move code from loop
6808 body into private version of Sized_relobj::compute_final_local_value.
6809 Call the inline method.
6810 * object.h (Symbol_value::Symbol_value): Define destructor. Free
6811 merged symbol value if there is one.
6812 (Symbol_value::has_output_value): New method defintiion.
6813 (Sized_relobj::Compute_final_local_value_status): New enum type.
6814 (Sized_relobj::compute_final_local_value): New methods.
6815 (Sized_relobj::compute_final_local_value_internal): New methods.
6816 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
6817 and arm_cortex_a8.sh.
6818 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
6819 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
6820 New tests.
6821 * Makefile.in: Regenerate.
6822 * testsuite/arm_bl_out_of_range.s: Update test.
6823 * testsuite/thumb_bl_out_of_range.s: Ditto.
6824 * testsuite/thumb_blx_out_of_range.s: Ditto.
6825 * testsuite/arm_branch_out_of_range.sh: New file.
6826 * testsuite/arm_cortex_a8.sh: Ditto.
6827 * testsuite/arm_cortex_a8_b.s: Ditto.
6828 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
6829 * testsuite/arm_cortex_a8_b_local.s: Ditto.
6830 * testsuite/arm_cortex_a8_bl.s: Ditto.
6831 * testsuite/arm_cortex_a8_blx.s: Ditto.
6832 * testsuite/arm_cortex_a8_local.s: Ditto.
6833 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
6834 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
6835
05a79166
L
68362010-09-08 Rafael Espindola <espindola@google.com>
6837
6838 * Makefile.am (memory_test.stdout): Run readelf with -W.
6839 * Makefile.in: Regenerate.
6840 * testsuite/memory_test.sh: Make the regexps accept both 32 and
6841 64 bit output.
6842
33dbc701
RÁE
68432010-09-08 Rafael Espindola <espindola@google.com>
6844
6845 * script-sections.cc (Script_sections::add_memory_region): Convert
6846 field precision to int.
6847 * script.cc (script_set_section_region, script_set_section_region):
6848 Convert field precision to int.
6849
731ca54a
RÁE
68502010-09-08 Rafael Espindola <espindola@google.com>
6851
6852 * arm.cc (do_finalize_sections): Create the __exidx_start and
6853 __exdix_end symbols even when the section is missing.
6854
7f8cd844
NC
68552010-09-08 Nick Clifton <nickc@redhat.com>
6856
6857 * README: Remove claim that MEMORY is not supported.
6858 * expression.cc (script_exp_function_origin)
6859 (script_exp_function_length): Move from here to ...
6860 * script.cc: ... here.
6861 (script_set_section_region, script_add_memory)
6862 (script_parse_memory_attr, script_include_directive): New
6863 functions.
6864 * script-sections.cc
6865 (class Memory_region): New class.
6866 (class Output_section_definition): Add set_memory_region,
6867 set_section_vma, set_section_lma and get_section_name methods.
6868 (class Script_Sections): Add add_memory_region,
6869 find_memory_region, find_memory_region_origin,
6870 find_memory_region_length and set_memory_region methods.
6871 Have set_section_addresses method walk the list of set memory
6872 regions.
6873 Extend the print methos to display memory regions.
6874 * script-sections.h: Add prototypes for new methods.
6875 Add enum for MEMORY region attributes.
6876 * yyscript.y: Add support for parsing MEMORY regions.
6877 * script-c.h: Add prototypes for new functions.
6878 * testsuite/Makefile.am: Add test of MEMORY region functionality.
6879 * testsuite/Makefile.in: Regenerate.
6880 * testsuite/memory_test.sh: New script.
6881 * testsuite/memory_test.s: New assembler source file.
6882 * testsuite/memory_test.t: New linker script.
6883
a4649286
DK
68842010-08-27 Doug Kwan <dougkwan@google.com>
6885
6886 * gold/resolve.cc (Symbol_table::should_override): Let a weak
6887 reference override an existing dynamic weak reference.
6888 * testsuite/Makefile.am: Add new test dyn_weak_ref.
6889 * testsuite/Makefile.in: Regenerate.
6890 * testsuite/dyn_weak_ref.sh: New file.
6891 * testsuite/dyn_weak_ref_1.c: Ditto.
6892 * testsuite/dyn_weak_ref_2.c: Ditto.
6893
b56648ad
ILT
68942010-08-27 Ian Lance Taylor <iant@google.com>
6895
6896 * incremental.h (class Incremental_input_entry): Add virtual
6897 destructor.
6898
809313cb
ILT
68992010-08-27 Ian Lance Taylor <iant@google.com>
6900
6901 * testsuite/start_lib_test_3.c: Mark t3 as used.
6902
11e32464
NC
69032010-08-27 Nick Clifton <nickc@redhat.com>
6904
6905 * options.cc (version_script): Fix small typo in previous
6906 whitespace tidyup.
6907
ca09d69a
NC
69082010-08-25 Nick Clifton <nickc@redhat.com>
6909
6910 * archive.cc: Formatting fixes: Remove whitespace between
6911 typename and following asterisk. Remove whitespace between
6912 function name and opening parenthesis.
6913 * archive.h: Likewise.
6914 * arm.cc: Likewise.
6915 * attributes.cc: Likewise.
6916 * attributes.h: Likewise.
6917 * common.cc: Likewise.
6918 * copy-relocs.cc: Likewise.
6919 * dirsearch.h: Likewise.
6920 * dynobj.cc: Likewise.
6921 * ehframe.cc: Likewise.
6922 * ehframe.h: Likewise.
6923 * expression.cc: Likewise.
6924 * fileread.cc: Likewise.
6925 * fileread.h: Likewise.
6926 * gc.h: Likewise.
6927 * gold-threads.cc: Likewise.
6928 * gold.cc: Likewise.
6929 * i386.cc: Likewise.
6930 * icf.h: Likewise.
6931 * incremental-dump.cc: Likewise.
6932 * incremental.cc: Likewise.
6933 * layout.cc: Likewise.
6934 * layout.h: Likewise.
6935 * main.cc: Likewise.
6936 * merge.cc: Likewise.
6937 * merge.h: Likewise.
6938 * object.cc: Likewise.
6939 * object.h: Likewise.
6940 * options.cc: Likewise.
6941 * options.h: Likewise.
6942 * output.cc: Likewise.
6943 * output.h: Likewise.
6944 * plugin.cc: Likewise.
6945 * plugin.h: Likewise.
6946 * powerpc.cc: Likewise.
6947 * reloc.cc: Likewise.
6948 * script-c.h: Likewise.
6949 * script-sections.cc: Likewise.
6950 * script.cc: Likewise.
6951 * stringpool.cc: Likewise.
6952 * symtab.cc: Likewise.
6953 * symtab.h: Likewise.
6954 * target.cc: Likewise.
6955 * timer.cc: Likewise.
6956 * timer.h: Likewise.
6957 * version.cc: Likewise.
6958 * x86_64.cc: Likewise.
6959
b8fa8750
NC
69602010-08-24 Nick Clifton <nickc@redhat.com>
6961
6962 PR 11899
6963 * layout.cc (segment_precedes): Sort segments by their physical
6964 addresses, if they have been set.
6965
9919d93b
CC
69662010-08-23 Cary Coutant <ccoutant@google.com>
6967
6968 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
6969 symbols data.
6970 (Lib_group::include_member): Unlock object after deleting its
6971 symbols data.
6972 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
6973 the bug fixed here.
6974
97b4be1c
CC
69752010-08-19 Neil Vachharajani <nvachhar@google.com>
6976 Cary Coutant <ccoutant@google.com>
6977
6978 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
6979 constructor, and set_blocker.
6980 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
6981 readsyms_blocker_.
6982 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
6983 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
6984 * testsuite/Makefile.am (start_lib_test): New test case.
6985 * testsuite/Makefile.in: Regenerate.
6986 * testsuite/start_lib_test_main.c: New file.
6987 * testsuite/start_lib_test_1.c: New file.
6988 * testsuite/start_lib_test_2.c: New file.
6989 * testsuite/start_lib_test_3.c: New file.
6990
dd0b1884
ILT
69912010-08-19 Ian Lance Taylor <iant@google.com>
6992
6993 * Makefile.in: Rebuild with automake 1.11.1.
6994 * aclocal.m4: Likewise.
6995 * testsuite/Makefile.in: Likewise.
6996
7223e9ca
ILT
69972010-08-19 Ian Lance Taylor <iant@google.com>
6998
6999 PR 10893
7000 * i386.cc (class Output_data_plt_i386): Update declarations.
7001 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7002 local_ifuncs_ fields.
7003 (Target_i386::do_plt_section_for_global): New function.
7004 (Target_i386::do_plt_section_for_local): New function.
7005 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7006 parameter; change all callers. Initialize global_ifuncs_ and
7007 local_ifuncs_. If doing a static link define __rel_iplt_start and
7008 __rel_iplt_end.
7009 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7010 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7011 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7012 symbols.
7013 (Target_i386::make_plt_section): New function, broken out of
7014 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7015 (Target_i386::make_plt_entry): Call make_plt_section.
7016 (Target_i386::make_local_ifunc_plt_entry): New function.
7017 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7018 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7019 R_386_IRELATIVE to switch.
7020 (Target_i386::Scan::global): Likewise.
7021 (Target_i386::Relocate::relocate): Likewise.
7022 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7023 switch.
7024 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7025 (Target_x86_64::do_plt_section_for_global): New function.
7026 (Target_x86_64::do_plt_section_for_local): New function.
7027 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7028 parameter; change all callers. If doing a static link define
7029 __rela_iplt_start and __rela_iplt_end.
7030 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7031 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7032 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7033 to point to .plt.
7034 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7035 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7036 switch.
7037 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7038 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7039 R_X86_64_IRELATIVE to switch.
7040 (Target_x86_64::Scan::global): Likewise.
7041 (Target_x86_64::Relocate::relocate): Likewise.
7042 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7043 switch.
7044 * target.h (class Target): Add plt_section_for_global and
7045 plt_section_for_local functions. Add do_plt_section_for_global
7046 and do_plt_section_for_local virtual functions.
7047 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7048 clarifying comments.
7049 (Symbol::use_plt_offset): Handle IFUNC symbol.
7050 * object.cc (Sized_relobj::Sized_relobj): Initialize
7051 local_plt_offsets_.
7052 (Sized_relobj::local_has_plt_offset): New function.
7053 (Sized_relobj::local_plt_offset): New function.
7054 (Sized_relobj::set_local_plt_offset): New function.
7055 (Sized_relobj::do_count): Handle IFUNC symbol.
7056 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7057 a bit away from input_shndx_ field. Add set_is_func_symbol and
7058 is_ifunc_symbol functions.
7059 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7060 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7061 local_plt_offsets_ field.
7062 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7063 * output.h (class Output_section_data): Add non-const
7064 output_section function.
7065 (class Output_data_got): Update declarations.
7066 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7067 Add use_plt_offset parameter to global and local constructors.
7068 Change all callers. Change local_sym_index_ field to 31 bits.
7069 Change GSYM_CODE and CONSTANT_CODE accordingly.
7070 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7071 doing a static link don't set sh_link field.
7072 (Output_data_got::Got_entry::write): Use PLT offset if
7073 appropriate.
7074 (Output_data_got::add_global_plt): New function.
7075 (Output_data_got::add_local_plt): New function.
7076 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7077 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7078 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7079 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7080 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7081 IFUNC conditional.
7082 * testsuite/ifunc-sel.h: New file.
7083 * testsuite/ifuncmain1.c: New file.
7084 * testsuite/ifuncmain1vis.c: New file.
7085 * testsuite/ifuncmod1.c: New file.
7086 * testsuite/ifuncdep2.c: New file.
7087 * testsuite/ifuncmain2.c: New file.
7088 * testsuite/ifuncmain3.c: New file.
7089 * testsuite/ifuncmod3.c: New file.
7090 * testsuite/ifuncmain4.c: New file.
7091 * testsuite/ifuncmain5.c: New file.
7092 * testsuite/ifuncmod5.c: New file.
7093 * testsuite/ifuncmain6pie.c: New file.
7094 * testsuite/ifuncmod6.c: New file.
7095 * testsuite/ifuncmain7.c: New file.
7096 * configure, testsuite/Makefile.in: Rebuild.
7097
56f75c03
ILT
70982010-08-18 Ian Lance Taylor <iant@google.com>
7099
7100 * incremental.cc
7101 (Output_section_incremental_inputs::write_input_files): Add cast
7102 to avoid signed/unsigned comparison warning.
7103 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7104
55455f89
CC
71052010-08-12 Cary Coutant <ccoutant@google.com>
7106
7107 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7108
e2054bcb
ILT
71092010-08-13 Ian Lance Taylor <iant@google.com>
7110
7111 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7112
74f67560
DK
71132010-08-12 Cary Coutant <ccoutant@google.com>
7114 Doug Kwan <dougkwan@google.com>
7115
7116 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7117 defintion overrides non-weak undef, remember that the original undef
7118 is not weak.
7119 * symtab.cc (Symbol_table::sized_write_global): For undef without
7120 an original weak binding, set binding to global in output.
7121 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7122 * testsuite/Makefile.in: Regenerate.
7123 * testsuite/strong_ref_weak_def.sh: New file.
7124 * testsuite/strong_ref_weak_def_1.c: Ditto.
7125 * testsuite/strong_ref_weak_def_2.c: Ditto.
7126
d1238d12
CC
71272010-08-12 Cary Coutant <ccoutant@google.com>
7128
7129 * testsuite/incremental_test.sh: Rewrite.
7130 * testsuite/incremental_test_1.c: Rewrite.
7131 * testsuite/incremental_test_2.c: Rewrite.
7132
0e70b911
CC
71332010-08-12 Cary Coutant <ccoutant@google.com>
7134
7135 * arm.cc (Target_arm::got_size): Add const.
7136 (Target_arm::got_entry_count): New function.
7137 (Target_arm::plt_entry_count): New function.
7138 (Target_arm::first_plt_entry_offset): New function.
7139 (Target_arm::plt_entry_size): New function.
7140 (Output_data_plt_arm::entry_count): New function.
7141 (Output_data_plt_arm::first_plt_entry_offset): New function.
7142 (Output_data_plt_arm::get_plt_entry_size): New function.
7143 * i386.cc (Target_i386::got_size): Add const.
7144 (Target_i386::got_entry_count): New function.
7145 (Target_i386::plt_entry_count): New function.
7146 (Target_i386::first_plt_entry_offset): New function.
7147 (Target_i386::plt_entry_size): New function.
7148 (Output_data_plt_i386::entry_count): New function.
7149 (Output_data_plt_i386::first_plt_entry_offset): New function.
7150 (Output_data_plt_i386::get_plt_entry_size): New function.
7151 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7152 find_incremental_inputs_sections. Dump incremental_got_plt section.
7153 * incremental.cc: Include target.h.
7154 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7155 parameter. Adjust all callers. Find incremental_got_plt section.
7156 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7157 section.
7158 (Output_section_incremental_inputs::set_final_data_size): Calculate
7159 size of incremental_got_plt section.
7160 (Output_section_incremental_inputs::do_write): Write the
7161 incremental_got_plt section.
7162 (Got_plt_view_info): New struct.
7163 (Local_got_offset_visitor): New class.
7164 (Global_got_offset_visitor): New class.
7165 (Global_symbol_visitor_got_plt): New class.
7166 (Output_section_incremental_inputs::write_got_plt): New function.
7167 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7168 Add parameter. Adjust all callers.
7169 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7170 (Incremental_inputs::got_plt_section): New function.
7171 (Incremental_inputs::got_plt_section_): New data member.
7172 (Incremental_got_plt_reader): New class.
7173 * layout.cc (Layout::create_incremental_info_sections): Add the
7174 incremental_got_plt section.
7175 * object.h (Got_offset_list::get_list): New function.
7176 (Got offset_list::for_all_got_offsets): New function.
7177 (Sized_relobj::local_got_offset_list): New function.
7178 * powerpc.cc (Target_powerpc::got_size): Add const.
7179 (Target_powerpc::got_entry_count): New function.
7180 (Target_powerpc::plt_entry_count): New function.
7181 (Target_powerpc::first_plt_entry_offset): New function.
7182 (Target_powerpc::plt_entry_size): New function.
7183 (Output_data_plt_powerpc::entry_count): New function.
7184 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7185 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7186 * sparc.cc (Target_sparc::got_size): Add const.
7187 (Target_sparc::got_entry_count): New function.
7188 (Target_sparc::plt_entry_count): New function.
7189 (Target_sparc::first_plt_entry_offset): New function.
7190 (Target_sparc::plt_entry_size): New function.
7191 (Output_data_plt_sparc::entry_count): New function.
7192 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7193 (Output_data_plt_sparc::get_plt_entry_size): New function.
7194 * symtab.h (Symbol::got_offset_list): New function.
7195 (Symbol_table::for_all_symbols): New function.
7196 * target.h (Sized_target::got_entry_count): New function.
7197 (Sized_target::plt_entry_count): New function.
7198 (Sized_target::plt_entry_size): New function.
7199 * x86_64.cc (Target_x86_64::got_size): Add const.
7200 (Target_x86_64::got_entry_count): New function.
7201 (Target_x86_64::plt_entry_count): New function.
7202 (Target_x86_64::first_plt_entry_offset): New function.
7203 (Target_x86_64::plt_entry_size): New function.
7204 (Output_data_plt_x86_64::entry_count): New function.
7205 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7206 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7207
09ec0418
CC
72082010-08-12 Cary Coutant <ccoutant@google.com>
7209
7210 * archive.cc: Include incremental.h.
7211 (Archive::Archive): Initialize incremental_info_.
7212 (Archive::include_member): Record archive members in incremental info.
7213 (Add_archive_symbols::run): Record begin and end of an archive in
7214 incremental info.
7215 (Lib_group::include_member): Record objects in incremental info.
7216 * archive.h (Incremental_archive_entry): Forward declaration.
7217 (Archive::set_incremental_info): New member function.
7218 (Archive::incremental_info): New member function.
7219 (Archive::Unused_symbol_iterator): New class.
7220 (Archive::unused_symbols_begin): New member function.
7221 (Archive::unused_symbols_end): New member function.
7222 (Archive::incremental_info_): New data member.
7223 * incremental-dump.cc (find_input_containing_global): New function.
7224 (dump_incremental_inputs): Dump new incremental info sections.
7225 * incremental.cc: Include symtab.h.
7226 (Output_section_incremental_inputs): New class.
7227 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7228 new incremental info sections.
7229 (Sized_incremental_binary::do_check_inputs): Likewise.
7230 (Incremental_inputs::report_archive): Remove.
7231 (Incremental_inputs::report_archive_begin): New function.
7232 (Incremental_inputs::report_archive_end): New function.
7233 (Incremental_inputs::report_object): New function.
7234 (Incremental_inputs::finalize_inputs): Remove.
7235 (Incremental_inputs::report_input_section): New function.
7236 (Incremental_inputs::report_script): Rewrite.
7237 (Incremental_inputs::finalize): Do nothing but finalize string table.
7238 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7239 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7240 (Incremental_inputs::create_data_sections): New function.
7241 (Incremental_inputs::relocs_entsize): New function.
7242 (Output_section_incremental_inputs::set_final_data_size): New function.
7243 (Output_section_incremental_inputs::do_write): New function.
7244 (Output_section_incremental_inputs::write_header): New function.
7245 (Output_section_incremental_inputs::write_input_files): New function.
7246 (Output_section_incremental_inputs::write_info_blocks): New function.
7247 (Output_section_incremental_inputs::write_symtab): New function.
7248 * incremental.h (Incremental_script_entry): Forward declaration.
7249 (Incremental_object_entry): Forward declaration.
7250 (Incremental_archive_entry): Forward declaration.
7251 (Incremental_inputs): Forward declaration.
7252 (Incremental_inputs_header_data): Remove.
7253 (Incremental_inputs_header): Remove.
7254 (Incremental_inputs_header_write): Remove.
7255 (Incremental_inputs_entry_data): Remove.
7256 (Incremental_inputs_entry): Remove.
7257 (Incremental_inputs_entry_write): Remove.
7258 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7259 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7260 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7261 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7262 Likewise.
7263 (Incremental_input_entry): New class.
7264 (Incremental_script_entry): New class.
7265 (Incremental_object_entry): New class.
7266 (Incremental_archive_entry): New class.
7267 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7268 (Incremental_inputs::report_inputs): Remove.
7269 (Incremental_inputs::report_archive): Remove.
7270 (Incremental_inputs::report_archive_begin): New function.
7271 (Incremental_inputs::report_archive_end): New function.
7272 (Incremental_inputs::report_object): Change prototype.
7273 (Incremental_inputs::report_input_section): New function.
7274 (Incremental_inputs::report_script): Change prototype.
7275 (Incremental_inputs::get_reloc_count): New function.
7276 (Incremental_inputs::set_reloc_count): New function.
7277 (Incremental_inputs::create_data_sections): New function.
7278 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7279 (Incremental_inputs::inputs_section): New function.
7280 (Incremental_inputs::symtab_section): New function.
7281 (Incremental_inputs::relocs_section): New function.
7282 (Incremental_inputs::get_stringpool): Add const.
7283 (Incremental_inputs::command_line): Add const.
7284 (Incremental_inputs::inputs): Remove.
7285 (Incremental_inputs::command_line_key): New function.
7286 (Incremental_inputs::input_file_count): New function.
7287 (Incremental_inputs::input_files): New function.
7288 (Incremental_inputs::relocs_entsize): New function.
7289 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7290 (Incremental_inputs::finalize_inputs): Remove.
7291 (Incremental_inputs::Input_info): Remove.
7292 (Incremental_inputs::lock_): Remove.
7293 (Incremental_inputs::inputs_): Change type.
7294 (Incremental_inputs::inputs_map_): Remove.
7295 (Incremental_inputs::current_object_entry_): New data member.
7296 (Incremental_inputs::inputs_section_): New data member.
7297 (Incremental_inputs::symtab_section_): New data member.
7298 (Incremental_inputs::relocs_section_): New data member.
7299 (Incremental_inputs::reloc_count_): New data member.
7300 (Incremental_inputs_reader): New class.
7301 (Incremental_symtab_reader): New class.
7302 (Incremental_relocs_reader): New class.
7303 * layout.cc (Layout::finalize): Move finalization of incremental info
7304 and creation of incremental info sections to follow finalization of
7305 symbol table. Set offsets for postprocessing sections.
7306 (Layout::create_incremental_info_sections): Call
7307 Incremental_inputs::create_data_sections. Add incremental symtab
7308 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7309 sections to layout after input sections.
7310 * layout.h (struct Timespec): Forward declaration.
7311 (Layout::incremental_inputs): Add const.
7312 (Layout::create_incremental_info_sections): Add parameter.
7313 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7314 * object.cc: Include incremental.h.
7315 (Relobj::finalize_incremental_relocs): New function.
7316 (Sized_relobj::do_layout): Record input sections in incremental info.
7317 * object.h (Object::output_section): New function.
7318 (Object::output_section_offset): Moved from Relobj.
7319 (Object::get_incremental_reloc_base): New function.
7320 (Object::get_incremental_reloc_count): New function.
7321 (Object::do_output_section): New function.
7322 (Object::do_output_section_offset): Moved from Relobj.
7323 (Object::do_get_incremental_reloc_base): New function.
7324 (Object::do_get_incremental_reloc_count): New function.
7325 (Object::Object): Initialize new data members.
7326 (Relobj::output_section): Renamed do_output_section and moved to
7327 protected.
7328 (Relobj::output_section_offset): Moved to Object.
7329 (Relobj::do_get_incremental_reloc_base): New function.
7330 (Relobj::do_get_incremental_reloc_count): New function.
7331 (Relobj::allocate_incremental_reloc_counts): New function.
7332 (Relobj::count_incremental_reloc): New function.
7333 (Relobj::finalize_incremental_relocs): New function.
7334 (Relobj::next_incremental_reloc_index): New function.
7335 (Relobj::reloc_counts_): New data member.
7336 (Relobj::reloc_bases_): New data member.
7337 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7338 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7339 (Sized_relobj::incremental_relocs_scan): New function.
7340 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7341 (Sized_relobj::incremental_relocs_write): New function.
7342 (Sized_relobj::incremental_relocs_write_reltype): New function.
7343 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7344 incremental link.
7345 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7346 archives and object files elsewhere.
7347 (Add_symbols::run): Report object files here.
7348 (Finish_group::run): Report end of archive at end of group.
7349 * reloc.cc: Include layout.h, incremental.h.
7350 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7351 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7352 (Sized_relobj::incremental_relocs_scan): New function.
7353 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7354 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7355 (Sized_relobj::incremental_relocs_write): New function.
7356 (Sized_relobj::incremental_relocs_write_reltype): New function.
7357 * script.cc (read_input_script): Rewrite test for incremental link.
7358 Change call to Incremental_inputs::report_script.
7359 * symtab.h (Symbol_table::first_global_index): New function.
7360 (Symbol_table::output_count): New function.
7361
ce0d1972
DK
73622010-08-12 Doug Kwan <dougkwan@google.com>
7363
7364 * arm.cc (Target_arm::merge_object_attributes): Check command line
7365 options --no-wchar-size-warning and --no-enum-size-warning.
7366 * options.h (General_options): Add ld-compatible options
7367 --no-enum-size-warning and --no-wchar-size-warning.
7368
6e5710ce
ILT
73692010-08-04 Ian Lance Taylor <iant@google.com>
7370
7371 * x86_64.cc (Target_x86_64::Scan::local): Use
7372 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7373 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7374 (Target_x86_64::Scan::global): Likewise.
7375 (Target_x86_64::Relocate::relocate): Likewise.
7376 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7377 Likewise.
7378
fef830db
CC
73792010-08-03 Cary Coutant <ccoutant@google.com>
7380
7381 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7382 to reserve space in merged_strings vector. Keep total input size
7383 for stats.
7384 (Output_merge_string::do_print_merge_stats): Print total input size.
7385 * merge.h (Output_merge_string): Add input_size_ field.
7386 * stringpool.cc (Stringpool_template::string_length): Move
7387 implementations out of Stringpool_template class and place in
7388 stringpool.h.
7389 * stringpool.h (string_length): Move out of Stringpool_template.
7390
1e3811b0
ILT
73912010-08-03 Ian Lance Taylor <iant@google.com>
7392
7393 PR 11712
7394 * layout.cc (relaxation_loop_body): If address of load segment is
7395 set, adjust address to include headers if possible.
7396
7af0c620
ILT
73972010-08-03 Ian Lance Taylor <iant@google.com>
7398
7399 * version.cc (version_string): Bump to 1.10.
7400
22f0da72
ILT
74012010-08-03 Ian Lance Taylor <iant@google.com>
7402
7403 PR 11805
7404 * layout.h (enum Output_section_order): Define.
7405 (class Layout): Update declarations.
7406 * layout.cc (Layout::get_output_section): Add order parameter.
7407 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7408 is_first_non_relro parameters. Change all callers.
7409 (Layout::choose_output_section): Likewise.
7410 (Layout::add_output_section_data): Likewise.
7411 (Layout::make_output_section): Likewise. Set order.
7412 (Layout::default_section_order): New function.
7413 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7414 * output.cc (Output_section::Output_section): Initialize order_.
7415 Don't initialize deleted fields.
7416 (Output_segment::Output_segment): Don't initialize deleted
7417 fields.
7418 (Output_segment::add_output_section_to_load): New function
7419 replacing add_output_section. Change all callers to call this or
7420 add_output_section_to_nonload.
7421 (Output_segment::add_output_section_to_nonload): New function.
7422 (Output_segment::remove_output_section): Rewrite.
7423 (Output_segment::add_initial_output_data): Likewise.
7424 (Output_segment::has_any_data_sections): Likewise.
7425 (Output_segment::is_first_section_relro): Likewise.
7426 (Output_segment::maximum_alignment): Likewise.
7427 (Output_segment::has_dynamic_reloc): New function replacing
7428 dynamic_reloc_count. Change all callers.
7429 (Output_segment::has_dynamic_reloc_list): New function replacing
7430 dynamic_reloc_count_list. Change all callers.
7431 (Output_segment::set_section_addresses): Rewrite.
7432 (Output_segment::set_offset): Rewrite.
7433 (Output_segment::find_first_and_last_list): Remove.
7434 (Output_segment::set_tls_offsets): Rewrite.
7435 (Output_segment::first_section_load_address): Likewise.
7436 (Output_segment::output_section_count): Likewise.
7437 (Output_segment::section_with_lowest_load_address): Likewise.
7438 (Output_segment::write_section_headers): Likewise.
7439 (Output_segment::print_sections_to_map): Likewise.
7440 * output.h (class Output_data): Remove dynamic_reloc_count_
7441 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7442 (Output_data::add_dynamic_reloc): Rewrite.
7443 (Output_data::has_dynamic_reloc): New function.
7444 (Output_data::dynamic_reloc_count): Remove.
7445 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7446 is_last_relro_, is_first_non_relro_, is_interp_,
7447 is_dynamic_linker_section_ fields. Add order and set_order
7448 functions. Remove is_relro_local, set_is_relro_local,
7449 is_last_relro, set_is_last_relro, is_first_non_relro,
7450 set_is_first_non_relro functions, is_interp, set_is_interp,
7451 is_dynamic_linker_section, and set_is_dynamic_linker_section
7452 functions.
7453 (class Output_segment): Change Output_data_list from std::list to
7454 std:;vector. Add output_lists_ field. Remove output_data_ and
7455 output_bss_ fields. Update declarations.
7456
3ff2ccb0
ILT
74572010-08-02 Ian Lance Taylor <iant@google.com>
7458
7459 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7460 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7461 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7462
88a4108b
ILT
74632010-08-02 Ian Lance Taylor <iant@google.com>
7464
7465 PR 11855
7466 * script.cc (Script_options::Script_options): Initialize
7467 symbol_definitions_ and symbol_references_.
7468 (Script_options::add_symbol_assignment): Update
7469 symbol_definitions_ and symbol_references_.
7470 (Script_options::add_symbol_reference): New function.
7471 (script_symbol): New function.
7472 * script.h (class Script_options): Add symbol_definitions_ and
7473 symbol_references_ fields.
7474 (Script_options::referenced_const_iterator): New type.
7475 (Script_options::referenced_begin): New function.
7476 (Script_options::referenced_end): New function.
7477 (Script_options::is_referenced): New function.
7478 (Script_options::any_unreferenced): New function.
7479 * script-c.h (script_symbol): Declare.
7480 * yyscript.y (exp): Call script_symbol.
7481 * symtab.cc: Include "script.h".
7482 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7483 Change all callers. Check symbols referenced by scripts.
7484 (Symbol_table::add_undefined_symbols_from_command_line): Add
7485 layout parameter. Change all callers.
7486 (Symbol_table::do_add_undefined_symbols_from_command_line):
7487 Likewise. Break out loop body. Check symbols referenced by
7488 scripts.
7489 (Symbol_table::add_undefined_symbol_from_command_line): New
7490 function broken out of
7491 do_add_undefined_symbols_from_command_line.
7492 * symtab.h (class Symbol_table): Update declarations.
7493 * archive.cc: Include "layout.h".
7494 (Archive::should_include_member): Add layout parameter. Change
7495 all callers. Check for symbol mentioned in expression.
7496 * archive.h (class Archive): Update declaration.
7497 * object.cc (Sized_relobj::do_should_include_member): Add layout
7498 parameter.
7499 * object.h (Object::should_include_member): Add layout parameter.
7500 Change all callers.
7501 (Object::do_should_include_member): Add layout parameter.
7502 (class Sized_relobj): Update declaration.
7503 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7504 parameter.
7505 * dynobj.h (class Sized_dynobj): Update declaration.
7506 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7507 layout parameter.
7508 * plugin.h (class Sized_pluginobj): Update declaration.
7509
5f1ab67a
ILT
75102010-08-02 Ian Lance Taylor <iant@google.com>
7511
7512 PR 11866
7513 * output.cc (Output_segment::set_offset): Search for the first and
7514 last sections rather than assuming that the list is in order.
7515 (Output_segment::find_first_and_last_list): New function.
7516 * output.h (class Output_segment): Update declarations.
7517 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7518 (relro_strip_test_SOURCES): New variable.
7519 (relro_strip_test_DEPENDENCIES): New variable.
7520 (relro_strip_test_LDFLAGS): New variable.
7521 (relro_strip_test_LDADD): New variable.
7522 (relro_strip_test.so): New target.
7523
a8df5856
ILT
75242010-08-02 Ian Lance Taylor <iant@google.com>
7525
7526 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7527 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7528 (Target_i386::got_tlsdesc_section): New function.
7529 (Target_i386::got_section): Create space for GOT entries for
7530 TLSDESC relocations.
7531 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7532 R_386_TLS_GOTDESC.
7533 (Target_i386::Scan::global): Likewise.
7534 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7535 using TLSDESC GOT.
7536 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7537 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7538 (Target_x86_64::got_tlsdesc_section): New function.
7539 (Target_x86_64::got_section): Create space for GOT entries for
7540 TLSDESC relocations.
7541 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7542 R_386_TLS_GOTDESC.
7543 (Target_x86_64::Scan::global): Likewise.
7544 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7545 using TLSDESC GOT.
7546
0c10a0a6
ILT
75472010-08-02 Ian Lance Taylor <iant@google.com>
7548
7549 * testsuite/final_layout.sh: Use dc to convert from hex to
7550 decimal.
7551
41cbeecc
ST
75522010-07-29 Sriraman Tallam <tmsriram@google.com>
7553
7554 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7555 paramter to the call to gold::gc_process_relocs.
7556 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7557 paramter to the call to gold::gc_process_relocs.
7558 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7559 parameter to the call to gold::gc_process_relocs.
7560 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7561 template parameter to the call to gold::gc_process_relocs.
7562 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7563 paramter to the call to gold::gc_process_relocs.
7564 * gc.h (get_embedded_addend_size): New function.
7565 (gc_process_relocs): Save the size of the reloc for use by ICF.
7566 * icf.cc (get_section_contents): Get the addend from the text section
7567 for SHT_REL relocation sections.
7568 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7569 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7570 * int_encoding.h (read_from_pointer): New overloaded function.
7571 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7572 * testsuite/icf_sht_rel_addend_test.sh: New file.
7573 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7574 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7575
6ea55b82
RW
75762010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7577
7578 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7579 * Makefile.in: Regenerate.
7580 * testsuite/Makefile.in: Regenerate.
7581
9691462b
ILT
75822010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7583
7584 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7585 * gold/testsuite/debug_msg.cc: Likewise.
7586 * gold/testsuite/odr_violation1.cc
7587 * gold/testsuite/odr_violation2.cc
7588
76897331
CC
75892010-07-21 Cary Coutant <ccoutant@google.com>
7590
7591 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7592 string, and length fields.
7593 (Output_merge_string::Merged_strings_list): New type.
7594 (Output_merge_string::Merged_strings_lists): New typedef.
7595 (Output_merge_string): Replace merged_strings_ with
7596 merged_strings_lists_.
7597 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7598 Merged_strings_list per input object and section. Don't store pointer
7599 to the string. Don't store length with each merged string entry.
7600 (Output_merge_string::finalize_merged_data): Loop over list of merged
7601 strings lists. Recompute length of each merged string.
7602
78384e8f
CC
76032010-07-15 Cary Coutant <ccoutant@google.com>
7604
7605 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7606 here.
7607
783659f9
ILT
76082010-07-14 Ian Lance Taylor <iant@google.com>
7609
7610 * descriptors.cc (Descriptors::open): Report correct name in error
7611 message.
7612
131687b4
DK
76132010-07-13 Doug Kwan <dougkwan@google.com>
7614
7615 * arm.cc (Arm_input_section::Arm_input_section): For a
7616 SHT_ARM_EXIDX section, always keeps the input sections.
7617 (Arm_input_section::set_exidx_section_link): New method.
7618 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7619 has_errors_ to false.
7620 (Arm_exidx_input_section::has_errors,
7621 Arm_exidx_input_section::set_has_errors): New methods.
7622 (Arm_exidx_input_section::has_errors_): New data member.
7623 (Arm_relobj::get_exidx_shndx_list): New method.
7624 (Arm_output_section::append_text_sections_to_list): Do not skip
7625 section without SHF_EXECINSTR.
7626 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7627 errors.
2e702c99 7628 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
7629 section header. Make error messages more verbose. Check for
7630 a non-executable section linked to an EXIDX section.
7631 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7632 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7633 check that there is no deferred EXIDX section if we exit early.
7634 Instead of not making an EXIDX section in case of an error, make one
7635 and set the has_errors flag of it.
7636 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7637 in a relocatable link.
7638 (Target_arm::do_relax): Look for the EXIDX output section instead of
7639 assuming that it is called .ARM.exidx.
2e702c99 7640 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
7641 section list. Do not check for SHF_EXECINSTR section flags but
7642 skip any input section with errors.
7643 * output.cc (Output_section::Output_section): Initialize
7644 always_keeps_input_sections_ to false.
7645 (Output_section::add_input_section): Check for
7646 always_keeps_input_sections_.
7647 * output.h (Output_section::always_keeps_input_sections,
7648 Output_section::set_always_keeps_input_sections): New methods.
7649 (Output_section::always_keeps_input_sections): New data member.
7650
69517287
RÁE
76512010-07-13 Rafael Espindola <espindola@google.com>
7652
7653 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7654 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7655
82742395
ILT
76562010-07-13 Philip Herron <herron.philip@googlemail.com>
7657 Ian Lance Taylor <iant@google.com>
7658
7659 * output.h (Output_section_lookup_maps::add_merge_section):
7660 Correct check of whether value was inserted.
7661 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7662 (Output_section_lookup_maps::add_relaxed_input_section):
7663 Likewise.
7664 * arm.cc (Target_arm::got_section): Remove used local os.
7665 * i386.cc (Target_i386::got_section): Likewise.
7666 * x86_64.cc (Target_x86_64::got_section): Likewise.
7667 * sparc.cc (Target_sparc::got_section): Likewise.
7668 (Target_sparc::relocate): Remove unused local have_got_offset.
7669 * powerpc.cc (Target_powerpc::relocate): Likewise.
7670
f2d707b5
ILT
76712010-07-13 Ian Lance Taylor <iant@google.com>
7672
241531d6
ILT
7673 * compressed_output.cc (zlib_decompress): Fix signature in
7674 !HAVE_ZLIB_H case.
7675
f2d707b5
ILT
7676 * archive.cc (Archive::include_member): Unlock an external member
7677 of a thin archive. Don't bother to delete an object we know is
7678 NULL.
7679
a2e47362
CC
76802010-07-12 Cary Coutant <ccoutant@google.com>
7681
7682 * compressed_output.cc (zlib_decompress): New function.
7683 (get_uncompressed_size): New function.
7684 (decompress_input_section): New function.
7685 * compressed_output.h (get_uncompressed_size): New function.
7686 (decompress_input_section): New function.
7687 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7688 Handle compressed debug sections.
7689 * layout.cc (is_compressed_debug_section): New function.
7690 (Layout::output_section_name): Map compressed section names to
7691 canonical names.
7692 * layout.h (is_compressed_debug_section): New function.
7693 (is_debug_info_section): Recognize compressed debug sections.
7694 * merge.cc: Include compressed_output.h.
7695 (Output_merge_data::do_add_input_section): Handle compressed
7696 debug sections.
7697 (Output_merge_string::do_add_input_section): Handle compressed
7698 debug sections.
7699 * object.cc: Include compressed_output.h.
7700 (Sized_relobj::Sized_relobj): Initialize new data members.
7701 (build_compressed_section_map): New function.
7702 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7703 * object.h (Object::section_is_compressed): New method.
7704 (Object::do_section_is_compressed): New method.
7705 (Sized_relobj::Compressed_section_map): New type.
7706 (Sized_relobj::do_section_is_compressed): New method.
7707 (Sized_relobj::compressed_sections_): New data member.
7708 * output.cc (Output_section::add_input_section): Handle compressed
7709 debug sections.
7710 * reloc.cc: Include compressed_output.h.
7711 (Sized_relobj::write_sections): Handle compressed debug sections.
7712
ce279a62
CC
77132010-07-08 Cary Coutant <ccoutant@google.com>
7714
7715 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7716 weak when resolving to a dynamic def.
7717 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7718 for weak undef/dynamic def cases. Adjust callers.
7719 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7720 undef_binding_weak_.
7721 (Symbol_table::sized_write_globals): Adjust symbol binding.
7722 (Symbol_table::sized_write_symbol): Add binding parameter.
7723 * symtab.h (Symbol::set_undef_binding): New method.
7724 (Symbol::is_undef_binding_weak): New method.
7725 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
7726 (Symbol_table::should_override): Add new parameter.
7727 (Symbol_table::sized_write_symbol): Add new parameter.
7728
7729 * testsuite/weak_undef_file1.cc: Add new test case.
7730 * testsuite/weak_undef_file2.cc: Fix header comment.
7731 * testsuite/weak_undef_test.cc: Add new test case.
7732
b2286c10
DK
77332010-06-29 Doug Kwan <dougkwan@google.com>
7734
7735 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
7736 Initialize USE_SYMBOL_.
7737 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
7738 definition.
7739 (Arm_reloc_property::uses_symbol_): New data member declaration.
7740 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
7741 uses symbol value and symbol is undefined but not weakly undefined.
7742
4802450a
RÁE
77432010-06-28 Rafael Espindola <espindola@google.com>
7744
7745 * plugin.cc (Plugin::load): Use dlerror.
7746
e5ca47ba
ILT
77472010-06-26 Jeffrey Yaskin <jyasskin@google.com>
7748
7749 * symtab.cc (detect_odr_violations): When reporting an ODR
7750 violation, report an object where the symbol is defined.
7751
8a75a161
DK
77522010-06-25 Doug Kwan <dougkwan@google.com>
7753
7754 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
7755 (Target_arm::section_may_have_icf_unsafe_pointers): New method
7756 definition.
7757 (Target_arm::Scan::local_reloc_may_be_function_pointer,
7758 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
7759 target hook to detect function points.
7760 (Target_arm::Scan::possible_function_pointer_reloc): New method.
7761 * icf.h (Icf::check_section_for_function_pointers): Change type of
7762 parameter SECTION_NAME to const reference to std::string. Use
7763 target hook to determine if section may have unsafe pointers.
7764 * target.h (Target::section_may_have_icf_unsafe_pointers): New
7765 method definition.
7766
42218b9f
RÁE
77672010-06-21 Rafael Espindola <espindola@google.com>
7768
7769 * fileread.cc (Input_file::find_fie): New
7770 (Input_file::open): Use Input_file::find_fie.
7771 * fileread.h (Input_file::find_fie): New
7772 * plugin.cc (set_extra_library_path): New.
7773 (Plugin::load): Add set_extra_library_path to the transfer vector.
7774 (Plugin_manager::set_extra_library_path): New.
7775 (Plugin_manager::add_input_file): Use the extra search path if set.
7776 (set_extra_library_path(): New.
7777 * plugin.h (Plugin_manager): Add set_extra_library_path and
7778 extra_search_path_.
7779
a0506cca
CC
77802010-06-19 Cary Coutant <ccoutant@google.com>
7781
7782 * layout.cc (gdb_sections): Add .debug_types.
7783 (lines_only_debug_sections): Likewise.
7784
6508b958
RÁE
77852010-06-18 Rafael Espindola <espindola@google.com>
7786
7787 * plugin.cc (add_input_file,add_input_library)
7788 (Plugin_manager::add_input_file): Make filename arguments const.
7789 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
7790 const.
7791
3e235302
DK
77922010-06-16 Doug Kwan <dougkwan@google.com>
7793
7794 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
7795 .ARM.attributes section if we have not merged any input
7796 attributes sections.
7797
106e8a6c
DK
77982010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7799
7800 * arm.cc: Allow combining objects with no EABI version
7801 information.
7802
91ff43fe
RÁE
78032010-06-15 Rafael Espindola <espindola@google.com>
7804
7805 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
7806
68ed838c
ILT
78072010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7808
7809 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
7810 (struct iovec): Correct !HAVE_READV definition.
7811
f3a2388f
CC
78122010-06-10 Cary Coutant <ccoutant@google.com>
7813
7814 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
7815 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
7816 reloc sections.
7817 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
7818
7819 PR 11683
7820 * symtab.h (Symbol::is_placeholder): New member function.
7821 * target-reloc.h (relocate_section): Check for placeholder symbols.
7822
7823 * testsuite/Makefile.am (plugin_test_8): New test.
7824 (plugin_test_9): New test.
7825 * testsuite/Makefile.in: Regenerate.
7826
e1df38aa
NC
78272010-06-09 Nick Clifton <nickc@redhat.com>
7828
7829 * yyscript.y (input_list_element): Allow strings prefixed with
7830 the '-' character. Treat these as libraries.
7831 * script.cc (script_add_library): New function. Adds a library
7832 specified by "-l<name>" found in an input script.
7833 * script-c.h: Add prototype for script_add_library.
7834
25bbe950
DK
78352010-06-07 Doug Kwan <dougkwan@google.com>
7836
7837 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
7838 Restrict stub-group size to be within long conditional branch
7839 range when working around cortex-A8 erratum.
7840
0f32ea4c
ILT
78412010-06-07 Damien Diederen <dd@crosstwine.com>
7842
7843 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
7844 #ifdef typo.
7845
8fe2a369
ST
78462010-06-03 Sriraman Tallam <tmsriram@google.com>
7847
7848 PR gold/11658
7849 * output.cc
7850 (Output_section::Input_section_sort_entry::compare_section_ordering):
7851 Change to return non-zero correctly.
7852 (Output_section::Input_section_sort_section_order_index_compare
7853 ::operator()): Change to fix ambiguity in comparisons.
7854
6e9ba2ca
ST
78552010-06-01 Sriraman Tallam <tmsriram@google.com>
7856
7857 * gold.h (is_wildcard_string): New function.
7858 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
7859 (Layout::layout_eh_frame): Ditto.
7860 (Layout::find_section_order_index): New method.
7861 (Layout::read_layout_from_file): New method.
7862 * layout.h (Layout::find_section_order_index): New method.
7863 (Layout::read_layout_from_file): New method.
7864 (Layout::input_section_position_): New private member.
7865 (Layout::input_section_glob_): New private member.
7866 * main.cc (main): Call read_layout_from_file here.
7867 * options.h (--section-ordering-file): New option.
7868 * output.cc (Output_section::input_section_order_specified_): New
7869 member.
7870 (Output_section::Output_section): Initialize new member.
7871 (Output_section::add_input_section): Add new parameter.
7872 Keep input sections when --section-ordering-file is used.
7873 (Output_section::set_final_data_size): Sort input sections when
7874 section ordering file is specified.
7875 (Output_section::Input_section_sort_entry): Add new parameter.
7876 Check sorting type.
7877 (Output_section::Input_section_sort_entry::compare_section_ordering):
7878 New method.
7879 (Output_section::Input_section_sort_compare::operator()): Change to
7880 consider section_order_index.
7881 (Output_section::Input_section_sort_init_fini_compare::operator()):
7882 Change to consider section_order_index.
7883 (Output_section::Input_section_sort_section_order_index_compare
7884 ::operator()): New method.
7885 (Output_section::sort_attached_input_sections): Change to sort
7886 according to section order when specified.
e1df38aa
NC
7887 (Output_section::add_input_section<32, true>): Add new parameter.
7888 (Output_section::add_input_section<64, true>): Add new parameter.
7889 (Output_section::add_input_section<32, false>): Add new parameter.
7890 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
7891 * output.h (Output_section::add_input_section): Add new parameter.
7892 (Output_section::input_section_order_specified): New
7893 method.
7894 (Output_section::set_input_section_order_specified): New method.
7895 (Input_section::Input_section): Initialize section_order_index_.
7896 (Input_section::section_order_index): New method.
7897 (Input_section::set_section_order_index): New method.
7898 (Input_section::section_order_index_): New member.
7899 (Input_section::Input_section_sort_section_order_index_compare): New
7900 struct.
7901 (Output_section::input_section_order_specified_): New member.
7902 * script-sections.cc (is_wildcard_string): Delete and move modified
7903 method to gold.h.
7904 (Output_section_element_input::Output_section_element_input): Modify
7905 call to is_wildcard_string.
7906 (Output_section_element_input::Input_section_pattern
7907 ::Input_section_pattern): Ditto.
7908 (Output_section_element_input::Output_section_element_input): Ditto.
7909 * testsuite/Makefile.am (final_layout): New test case.
7910 * testsuite/Makefile.in: Regenerate.
7911 * testsuite/final_layout.cc: New file.
7912 * testsuite/final_layout.sh: New file.
7913
3537c84b
RÁE
79142010-06-01 Rafael Espindola <espindola@google.com>
7915
7916 * plugin.cc (Plugin::load): Pass the output name to the plugin.
7917
105b6afd
RÁE
79182010-06-01 Rafael Espindola <espindola@google.com>
7919
7920 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
7921 visibility of symbols.
7922
29e11421
DK
79232010-05-27 Doug Kwan <dougkwan@google.com>
7924
7925 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
7926 from start of output section instead of address for a local symbol
7927 in a merged or relaxed section when doing a relocatable link.
7928
5e0f337e
RÁE
79292010-05-26 Rafael Espindola <espindola@google.com>
7930
703d02da 7931 PR 11604
5e0f337e
RÁE
7932 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7933 adding sections the garbage collector removed.
7934 * gold/testsuite/Makefile.am: Add test.
7935 * gold/testsuite/Makefile.in: Regenerate.
7936 * gold/testsuite/plugin_test_7.sh: New.
7937 * gold/testsuite/plugin_test_7_1.c: New.
7938 * gold/testsuite/plugin_test_7_2.c: New.
7939
f4187277
RÁE
79402010-05-26 Rafael Espindola <espindola@google.com>
7941
7942 * script-sections.cc (Output_section_definition::set_section_addresses):
7943 Check for --section-start.
7944
5c388529
DK
79452010-05-26 Doug Kwan <dougkwan@google.com>
7946
7947 * arm.cc (Arm_scan_relocatable_relocs): New class.
7948 (Target_arm::relocate_special_relocatable): New method.
7949 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7950 (Arm_relocate_functions::thumb_branch_common): Same.
7951 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7952 instead of Default_scan_relocatable_relocs.
7953 * target-reloc.h (relocate_for_relocatable): Let target handle
7954 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7955 * target.h (Sized_target::relocate_special_relocatable): New method.
7956
bca1c3ae
ILT
79572010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7958
7959 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7960
0439c796
DK
79612010-05-23 Doug Kwan <dougkwan@google.com>
7962
7963 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
7964 instead of a cast.
7965 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
7966 with a direct branch, not a conditional branch, to a stub.
7967 * merge.cc (Output_merge_base::record_input_section): New method
7968 defintion.
7969 (Output_merge_data::do_add_input_section): Record input section if
7970 keeps-input-sections flag is set.
7971 (Output_merge_string::do_add_input_section): Ditto.
7972 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
7973 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
7974 INPUT_SECTIONS_.
7975 (Output_merge_base::keeps_input_sections,
7976 Output_merge_base::set_keeps_input_sections,
7977 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
7978 method definitions.
7979 (Output_merge_base::Input_sections): New type declaration.
7980 (Output_merge_base::input_sections_begin,
7981 Output_merge_base::input_sections_end,
7982 Output_merge_base::do_set_keeps_input_sections): New method definitions.
7983 (Output_merge_base::bool keeps_input_sections_,
7984 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
7985 Output_merge_base::input_sections_): New data members.
7986 (Output_merge_data::do_set_keeps_input_sections): New method
7987 defintion.
7988 (Output_merge_string::do_set_keeps_input_sections): Ditto.
7989 * output.cc (Output_section::Input_section::relobj): Move method
7990 defintion from class declaration to here and handle merge sections.
7991 (Output_section::Input_section::shndx): Ditto.
7992 (Output_section::Output_section): Remove initializations of removed
7993 data members and initialize new data member LOOKUP_MAPS_.
7994 (Output_section::add_input_section): Set keeps-input-sections flag
7995 for a newly created merge output section as appropriate. Adjust code
7996 to use Output_section_lookup_maps class.
7997 (Output_section::add_relaxed_input_section): Adjst code for lookup
7998 maps code refactoring.
2e702c99 7999 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8000 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8001 class. If adding input section to a newly created merge output
8002 section fails, remove the new merge section.
8003 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8004 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8005 (Output_section::find_merge_section): Ditto.
0439c796 8006 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8007 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8008 Output_section_lookup_maps class.
8009 (Output_section::get_input_sections): Export merge sections. Adjust
8010 code to use Output_section_lookup_maps class.
8011 (Output_section:::add_script_input_section): Adjust code to use
8012 Output_section_lookup_maps class. Update lookup maps for merge
8013 sections also.
8014 (Output_section::discard_states): Use Output_section_lookup_maps.
8015 (Output_section::restore_states): Same.
8016 * output.h (Merge_section_properties): Move class defintion out of
8017 Output_section.
8018 (Output_section_lookup_maps): New class.
8019 (Output_section::Input_section::is_merge_section): New method
8020 defintion.
8021 (Output_section::Input_section::relobj): Move defintion out of class
8022 defintion. Declare method only.
8023 (Output_section::Input_section::shndx): Ditto.
8024 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8025 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8026 (Output_section::Merge_section_by_properties_map,
8027 Output_section::Output_section_data_by_input_section_map,
8028 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8029 Remove types.
2e702c99 8030 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8031 KEEPS_INPUT_SECTIONS.
8032 (Output_section::build_lookup_maps): New method declaration.
8033 (Output_section::merge_section_map_,
8034 Output_section::merge_section_by_properties_map_,
8035 Output_section::relaxed_input_section_map_,
8036 Output_section::is_relaxed_input_section_map_valid_): Remove data
8037 members.
8038 (Output_section::lookup_maps_): New data member.
8039
76295588
L
80402010-05-21 Doug Kwan <dougkwan@google.com>
8041
8042 PR gold/11619
8043 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8044 avoid a compilation error.
8045
d103a984
RÁE
80462010-05-19 Rafael Espindola <espindola@google.com>
8047
8048 * script-sections.cc (Output_section_definition::allocate_to_segment):
8049 Update the phdrs_list even when the output section is NULL.
8050 * testsuite/Makefile.am: Add test.
8051 * testsuite/Makefile.in: Regenerate.
8052 * testsuite/script_test_9.cc: New.
8053 * testsuite/script_test_9.sh: New.
8054 * testsuite/script_test_9.t: New.
8055
6625d24e
DK
80562010-05-19 Doug Kwan <dougkwan@google.com>
8057
8058 * arm.cc (Arm_input_section::original_size): New method.
8059 (Arm_input_section::do_addralign): Add a cast.
8060 (Arm_input_section::do_output_offset): Remove static cast.
8061 (Arm_input_section::original_addralign,
8062 Arm_input_section::original_size_): Change type to uint32_t.
8063 (Arm_input_section::init): Add safe casts for section alignment
8064 and size.
8065 (Arm_input_section::set_final_data_size): Do not set address and
8066 offset of stub table.
8067 (Arm_output_section::fix_exidx_coverage): Change use of of
8068 Output_section::Simple_input_section to that of
8069 Output_section::Input_section.
8070 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8071 except for the first pass.
8072 * output.cc (Output_section::get_input_sections): Change type of
8073 input_sections to std::list<Input_section>.
8074 (Output_section::add_script_input_section): Rename from
8075 Output_section::add_simple_input_section. Change type of SIS
8076 parameter from Simple_input_section to Input_section.
8077 * output.h (Output_section::Simple_input_section): Remove class.
8078 (Output_section::Input_section): Change class visibility to public.
8079 (Output_section::Input_section::addralign): Use stored alignments
8080 for special input sections if set.
8081 (Output_section::Input_section::set_addralign): New method.
8082 (Output_section::get_input_sections): Change parameter type from
8083 list of Simple_input_section to list of Input_section.
8084 (Output_section::add_script_input_section): Rename from
8085 Output_section::add_simple_input_section. Change first parameter's
8086 type from Simple_input_section to Input_section and remove the
8087 second and third parameters.
8088 * script-sections.cc (Input_section::Input_section_list): Change
8089 type to list of Output_section::Input_section/
8090 (Input_section_info::Input_section_info): Change parameter type of
8091 INPUT_SECTION to Output_section::Input_section.
8092 (Input_section_info::input_section): Change return type.
8093 (Input_section_info::input_section_): Change type to
8094 Output_section::Input_section.
8095 (Output_section_element_input::set_section_addresses): Adjust code
8096 to use Output_section::Input_section instead of
8097 Output_section::Simple_input_section. Adjust code for renaming
8098 of Output_section::add_simple_input_section.
8099 (Orphan_output_section::set_section_addresses): Ditto.
8100
e1e82ea4
RW
81012010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8102
8103 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8104 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8105
91e75c8a
RÁE
81062010-05-18 Rafael Espindola <espindola@google.com>
8107
8108 * options.cc (General_options::finalize): Handle -nostdlib.
8109 * options.h (nostdlib): New option.
8110 * script.cc (script_add_search_dir): Handle -nostdlib.
8111
da59ad79
DK
81122010-05-12 Doug Kwan <dougkwan@google.com>
8113
8114 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8115 attributes section only if there no attributes section after merging.
8116 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8117 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8118 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8119 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8120 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8121 and arm_attr_merge_7.stdout.
8122 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8123 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8124 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8125 arm_attr_merge_7b.o): New rules.
8126 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8127 arm_attr_merge_7
8128 * testsuite/Makefile.in: Regenerate.
8129 * testsuite/arm_attr_merge.sh: New file.
8130 * testsuite/arm_attr_merge_[67][ab].s: Same.
8131
3e01a7fd
NC
81322010-05-05 Nick Clifton <nickc@redhat.com>
8133
8134 * po/es.po: Updated Spanish translation.
8135
7ad2014a
L
81362010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8137
8138 * Makefile.am (install-exec-local): Properly install gold as
8139 default cross linker.
8140 * Makefile.in: Regenerated.
8141
4fda8867
NC
81422010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8143 Nick Clifton <nickc@redhat.com>
8144
8145 * configure.ac (install_as_default): Define and set to false
8146 unless --enable-gold or --enable-gold=both/gold has been
8147 specified.
8148 * configure: Regenerate.
8149
8150 * Makefile.am (install-exec-local): Install the executable as
8151 'ld.gold'. If install_as_default is true then also install it as
8152 'ld'.
8153 * Makefile.in: Regenerated.
8154
bd288ea2
ILT
81552010-04-24 Ian Lance Taylor <iant@google.com>
8156
8157 * layout.cc (Layout::layout_reloc): In relocatable link don't
8158 combine reloc sections for grouped sections.
8159
ef38fd8a
ST
81602010-04-23 Sriraman Tallam <tmsriram@google.com>
8161
8162 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8163 sections that are not ordinary to icf.
8164 * icf.cc (get_section_contents): Handle relocation pointing to section
8165 with no object or shndx information.
8166 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8167 * testsuite/Makefile.in: Regenerate.
8168 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8169 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8170
f6973bdc
ILT
81712010-04-22 Ian Lance Taylor <iant@google.com>
8172
8173 * expression.cc (Expression::Expression_eval_info): Add
8174 result_alignment_pointer field.
8175 (Expression::eval_with_dot): Add result_alignment_pointer
8176 parameter. Change all callers.
8177 (Expression::eval_maybe_dot): Likewise.
8178 (class Binary_expression): Add alignment_pointer parameter to
8179 left_value and right_value. Change all callers.
8180 (BINARY_EXPRESSION): Set result alignment.
8181 (class Trinary_expression): Add alignment_pointer parameter to
8182 arg2_value and arg3_value. Change all callers.
8183 (Trinary_cond::value): Set result alignment.
8184 (Max_expression::value, Min_expression::value): Likewise.
8185 (Align_expression::value): Likewise.
8186 * script-sections.cc (class Sections_element): Add dot_alignment
8187 parameter to set_section_addresses virtual function. Update
8188 instantiations.
8189 (class Output_section_element): Likewise.
8190 (Script_sections::create_segments): Add dot_alignment parameter.
8191 Change all callers.
8192 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8193 (Script_sections::set_phdrs_clause_addresses): Likewise.
8194 * script-sections.h: Update declarations.
8195 * script.h: Update declarations.
8196 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8197 min_p_align.
8198 * testsuite/script_test_3.t: Set large alignment.
8199 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8200 segment has expected alignment.
8201
9c9c98a5
NC
82022010-04-22 Nick Clifton <nickc@redhat.com>
8203
8204 * po/gold.pot: Updated by the Translation project.
8205 * po/vi.po: Updated Vietnamese translation.
8206
2253bfba
L
82072010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8208
8209 * testsuite/Makefile.am (check_PROGRAMS): Add
8210 icf_virtual_function_folding_test.
8211 * testsuite/Makefile.in: Regenerated.
8212
85fdf906
AH
82132010-04-15 Andrew Haley <aph@redhat.com>
8214
8215 * options.h (merge_exidx_entries): New option.
8216 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8217 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8218 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8219 (Target_arm::merge_exidx_entries): New function.
8220 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8221 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8222 to Arm_exidx_fixup constructor.
8223 Add new arg, merge_exidx_entries.
8224 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8225 Arm_output_section::fix_exidx_coverage.
8226
ce97fa81
ST
82272010-04-18 Sriraman Tallam <tmsriram@google.com>
8228
8229 * icf.cc (get_section_contents): Check for preemptible functions.
8230 Ignore addend when appropriate.
8231 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8232 section folded.
8233 (add_from_relobj): Check for section folded.
8234 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8235 * symtab.h (should_add_dynsym_entry): Add new parameter.
8236 * target-reloc.h (scan_relocs): Check for section folded.
8237 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8238 Check reloc types for function pointers in shared objects.
8239 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8240 case.
8241 (icf_preemptible_functions_test): New test case.
8242 (icf_string_merge_test): New test case.
8243 * testsuite.Makefile.in: Regenerate.
8244 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8245 bar_glob. Refactor code.
8246 * testsuite/icf_preemptible_functions_test.cc: New file.
8247 * testsuite/icf_preemptible_functions_test.sh: New file.
8248 * testsuite/icf_string_merge_test.cc: New file.
8249 * testsuite/icf_string_merge_test.sh: New file.
8250 * testsuite/icf_virtual_function_folding_test.cc: New file.
8251 * testsuite/icf_virtual_function_folding_test.sh: New file.
8252
04ceb17c
DK
82532010-04-14 Doug Kwan <dougkwan@google.com>
8254
8255 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8256 for local symbol recounting if we remove a section due to ICF.
8257 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8258 there are no regular objects in input.
8259
153e7da4
DK
82602010-04-13 Doug Kwan <dougkwan@google.com>
8261
8262 * arm.cc (Arm_input_section::set_final_data_size): Compute
8263 accurate final data size instead of using current data size.
8264
4dbd9faf
DK
82652010-04-09 Doug Kwan <dougkwan@google.com>
8266
8267 * layout.cc (Layout::choose_output_section): Handle script section
8268 types.
8269 (Layout::make_output_section_for_script): Add section type parameter.
8270 Handle script section types.
8271 * layout.h (Layout::make_output_section_for_script): Add section
8272 type parameter.
8273 * output.cc (Output_section::Output_section): Initialize data member
8274 is_noload_.
8275 (Output_section::do_reset_address_and_file_offset): Do not set address
8276 to 0 if section is a NOLOAD section.
8277 * output.h (Output_section::is_noload): New method.
8278 (Output_section::set_is_noload): Ditto.
8279 (Output_section::is_noload_): New data member.
8280 * script-c.h (Script_section_type): New enum type.
8281 (struct Parser_output_section_header): Add new file section_type.
8282 * script-sections.cc (Sections_element::output_section_name): Add
8283 parameter for returning script section type.
8284 (Output_section_definition::output_section_name): Ditto.
8285 (Output_section_definition::section_type)P; New method.
8286 (Output_section_definiton::script_section_type_name): Ditto.
8287 (Output_section_definition::script_section_type_): New data member.
8288 (Output_section_definition::Output_section_definition): Initialize
8289 data member Output_section_definition::script_section_type_.
8290 (Output_section_definition::create_sections): Pass script section type
8291 to Layout::make_output_section_for_script.
8292 (Output_section_definition::output_section_name): Return script
8293 section type to caller.
8294 (Output_section_definition::set_section_address): Do not advance
8295 dot value and load address if section type is NOLOAD. Set address
8296 of NOLOAD sections regardless of section flags.
8297 (Output_section_definition::print): Print section type if it is
8298 not SCRIPT_SECTION_TYPE_NONE.
8299 (Output_section_definition::section_type): New method.
8300 (Output_section_definition::script_section_type_name): Ditto.
8301 (Script_sections::output_section_name): Add new parameter
8302 PSECTION_TYPE for returning script section type. Pass it to
8303 section elements. Handle discard sections.
8304 (Sort_output_sections::operator()): Handle NOLOAD sections.
8305 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8306 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8307 returning script section type.
8308 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8309 INFO and NOLOAD.
8310 * yyscript.y (union): Add new field SECTION_TYPE.
8311 (COPY, DSECT, INFO, NOLOAD): New tokens.
8312 (opt_address_and_section_type): Change type to output_section_header.
8313 (section_type): New non-terminal
8314 (section_header): Handle section type.
2253bfba 8315 (opt_address_and_section_type): Return section type value.
4dbd9faf 8316
721ea635
L
83172010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8318
8319 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8320 * testsuite/plugin_common_test_2.c (foo): Likewise.
8321
6bf924b0
DK
83222010-04-08 Doug Kwan <dougkwan@google.com>
8323
8324 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8325 Output_merge_data.
8326 * output.cc (Output_section::add_merge_input_section): Simplify
8327 code and return status of Output_merge_base::add_input_section.
e1df38aa 8328 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8329 returns true.
8330
24af6f92
DK
83312010-04-07 Doug Kwan <dougkwan@google.com>
8332
8333 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8334 if section is marked as containing instructions but has no mapping
8335 symbols.
8336 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8337 correct section index.
8338 (Arm_relobj::find_linked_text_section): Ditto.
8339
00698fc5
CC
83402010-04-07 Cary Coutant <ccoutant@google.com>
8341
8342 * archive.cc (include_member): Destroy Read_symbols_data object before
8343 releasing file.
8344 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8345 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8346 (Read_symbols_data::~Read_symbols_data) New destructor.
8347 (Section_relocs::Section_relocs) New constructor.
8348 (Section_relocs::~Section_relocs) New destructor.
8349 (Read_relocs_data::Read_relocs_data) New constructor.
8350 (Read_relocs_data::~Read_relocs_data) New destructor.
8351 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8352 pointers to NULL after deleting.
8353
7296d933
DK
83542010-04-07 Doug Kwan <dougkwan@google.com>
8355
8356 * arm.cc: Replace "endianity" with "endianness" in comments.
8357 (Arm_exidx_cantunwind): Ditto.
8358 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8359 (Arm_relobj::merge_flags_and_attributes): New method.
8360 (Arm_relobj::merge_flags_and_attributes_): New data member.
8361 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8362 (Arm_relobj::scan_sections_for_stubs): Ditto.
8363 (Arm_relobj::do_read_symbols): Check to see if we really want to
8364 merge processor-specific flags and attributes. Exit early if
8365 an object is empty except for section names and the undefined symbol.
8366 (Target_arm::do_finalize_sections): Move check for ELF format to
8367 Arm_relobj::do_read_symbols. Merge processor specific flags and
8368 attributes from a regular object only when we have determined that
8369 it is aapropriate. Do not create an .ARM.attributes section in
8370 output if there is no regular input object.
8371 (Target_arm::merge_processor_specific_flags): Check
8372 --warn-mismatch before printing any error.
8373 (Target_arm::merge_object_attributes): Ditto.
8374 * gold.cc (queue_middle_tasks): Handle the case in which there is
8375 no regular object in input.
8376 * options.cc (General_options::parse_EB): New method.
8377 (General_options::parse_EL): Same.
8378 (General_options::General_options): Initialize endianness_.
8379 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8380 New options.
8381 (General_options::Endianness): New enum.
8382 (General_options::endianness): New method.
8383 (General_options::endianness_): New data member.
8384 * parameters.cc (Parameters::set_options): Check target endianness.
8385 (Parameters::set_target_once): Ditto.
8386 (Parameters::check_target_endianness): New method.
8387 (parameters_force_valid_target): If either -EL or -EB is specified,
8388 use it to define endianness of default target.
8389 * parameters.h (Parameters::check_target_endianness): New method
8390 declaration.
8391 * target.h (class Target): Change "endianity" to "endianness"
8392 in comments.
8393
efc8d4f2
RW
83942010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8395
8396 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8397 * configure: Regenerate.
8398 * Makefile.in: Regenerate.
8399 * testsuite/Makefile.in: Regenerate.
8400
be234d88
CC
84012010-04-06 Cary Coutant <ccoutant@google.com>
8402
8403 gcc PR lto/42757
8404 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8405 prevailing definitions of common symbols.
8406 * testsuite/plugin_test_6.sh: New test case.
8407 * testsuite/plugin_common_test_1.c: New test case.
8408 * testsuite/plugin_common_test_2.c: New test case.
8409 * testsuite/Makefile.am (plugin_test_6): New test case.
8410 * testsuite/Makefile.in: Regenerate.
8411
bd32c6bd
NC
84122010-04-06 Nick Clifton <nickc@redhat.com>
8413
8414 * po/vi.po: New Vietnamese translation.
8415
323c532f
DK
84162010-03-30 Doug Kwan <dougkwan@google.com>
8417
8418 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8419
4fcd97eb
DK
84202010-03-25 Doug Kwan <dougkwan@google.com>
8421
8422 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8423 to avoid a conversion warning on a 32-bit host.
8424
4ebf39db
ILT
84252010-03-24 Ian Lance Taylor <iant@google.com>
8426
8427 * testsuite/script_test_3.t: Add a TLS segment.
8428 * testsuite/Makefile.am (check_PROGRAMS): Add
8429 tls_phdrs_script_test.
8430 (tls_phdrs_script_test_SOURCES): Define.
8431 (tls_phdrs_script_test_DEPENDENCIES): Define.
8432 (tls_phdrs_script_test_LDFLAGS): Define.
8433 (tls_phdrs_script_test_LDADD): Define.
8434 * testsuite/Makefile.in: Rebuild.
8435
4a599bdd
CC
84362010-03-23 Cary Coutant <ccoutant@google.com>
8437
8438 * fileread.cc (find_or_make_view): Fix comment.
8439
6c93b22c
ILT
84402010-03-23 Ian Lance Taylor <iant@google.com>
8441
8442 * script-sections.cc (class Orphan_section_placement): Define
8443 PLACE_TLS and PLACE_TLS_BSS.
8444 (Orphan_section_placement::Orphan_section_placement): Initialize
8445 new places.
8446 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8447 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8448 (tls_script_test_SOURCES): Define.
8449 (tls_script_test_DEPENDENCIES): Define.
8450 (tls_script_test_LDFLAGS): Define.
8451 (tls_script_test_LDADD): Define.
8452 * testsuite/Makefile.in: Rebuild.
8453
a2c7281b
DK
84542010-03-22 Doug Kwan <dougkwan@google.com>
8455
8456 * arm.cc (Arm_relocate_functions::abs8,
8457 Arm_relocate_functions::abs16): Use correct check for overflow
8458 specified in the ARM ELF specs.
8459 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8460 target of a BLX instruction specially.
8461 (Reloc_stub::stub_type_for_reloc): Ditto.
8462 (Relocate::relocate): Use symbolic names instead of numeric relocation
8463 codes to report error.
8464 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8465 workaround.
8466 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8467 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8468 thumb2_blx_out_of_range.stdout
8469 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8470 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8471 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8472 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8473 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8474 thumb2_blx_in_range, thumb2_blx_in_range.o,
8475 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8476 thumb2_blx_out_of_range.o): New rules.
2e702c99 8477 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
8478 thumb2_blx_in_range and thumb2_blx_out_of_range.
8479 * testsuite/Makefile.in: Regenerate.
8480 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8481 * testsuite/thumb_blx_in_range.s: New file.
8482 * testsuite/thumb_blx_out_of_range.s: New file.
8483
b0193076
RÁE
84842010-03-22 Rafael Espindola <espindola@google.com>
8485
8486 * archive.cc (Should_include): Move to archive.h.
8487 (should_include_member): Make it a member of Archive.
8488 (Lib_group): New.
8489 (Add_lib_group_symbols): New.
8490 * archive.h: Include options.h.
8491 (Archive_member): Moved from Archive.
8492 (Should_include): Moved from archive.cc.
8493 (Lib_group): New.
8494 (Add_lib_group_symbols): New.
8495 * dynobj.cc (do_should_include_member): New.
8496 * dynobj.h (do_should_include_member): New.
8497 * gold.cc (queue_initial_tasks): Update call to queue.
8498 * main.cc (main): Print lib group stats.
8499 * object.cc (do_should_include_member): New.
8500 * object.h: Include archive.h.
8501 (Object::should_include_member): New.
8502 (Object::do_should_include_member): New.
8503 (Sized_relobj::do_should_include_member): New.
8504 * options.cc (General_options::parse_start_lib): New.
8505 (General_options::parse_end_lib): New.
8506 (Input_arguments::add_file): Handle lib groups.
8507 (Input_arguments::start_group): Check we are not in a lib.
8508 (Input_arguments::start_lib): New.
8509 (Input_arguments::end_lib): New.
8510 * options.h (General_options): Add start_lib and end_lib.
8511 (Input_argument::lib_): New.
8512 (Input_argument::lib): New.
8513 (Input_argument::is_lib): New.
8514 (Input_file_lib): New.
8515 (Input_arguments::in_lib_): New.
8516 (Input_arguments::in_lib): New.
8517 (Input_arguments::start_lib): New.
8518 (Input_arguments::end_lib_): New.
8519 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8520 in unused members as preempted.
8521 (Sized_pluginobj::do_should_include_member): New.
8522 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8523 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8524 return the blocker.
8525 (Read_symbols::do_whole_lib_group): New.
8526 (Read_symbols::do_lib_group): New.
8527 (Read_symbols::do_read_symbols): Handle lib groups.
8528 (Read_symbols::get_name): Handle lib groups.
8529 * readsyms.h (Read_symbols): Add an archive member pointer.
8530 (Read_symbols::do_whole_lib_group): New.
8531 (Read_symbols::do_lib_group): New.
8532 (Read_symbols::member_): New.
8533 * script.cc (read_input_script): Update call to queue_soon.
8534
d099120c
DK
85352010-03-19 Doug Kwan <dougkwan@google.com>
8536
8537 * arm.cc (Stub_table::Stub_table): Initialize new data members
8538 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8539 (Stub_table::add_reloc_stub): Assign stub offset and update
8540 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8541 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8542 New data members.
2e702c99 8543 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
8544 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8545 instead of going over all reloc stubs.
2e702c99 8546 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
8547 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8548 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 8549 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
8550 Stringpool_template::offset_.
8551 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8552 Stringpool_template::offset_ to zero.
8553
1aa37384
DK
85542010-03-15 Doug Kwan <dougkwan@google.com>
8555
8556 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8557 offset_.
8558 (Stringpool_template::new_key_offset): New method.
8559 (Stringpool_template::add_string): Assign offsets when adding new
8560 strings.
8561 (Stringpool_template::set_string_offsets): Do not set string offsets
8562 when not optimizing.
8563 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8564 member size_.
2e702c99
RM
8565 (Chunked_vector::clear): Clear size_.
8566 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8567 (Chunked_vector::size): Return size_.
8568 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 8569 (Chunked_vector::size_): New data member.
1aa37384
DK
8570 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8571 (Stringpool_template::new_key_offset): New method declaration.
8572 (Stringpool_template::offset_): New data member.
8573
b672b057
RÁE
85742010-03-15 Rafael Espindola <espindola@google.com>
8575
8576 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8577 Add_symbols' constructor.
8578 * readsyms.h (Add_symbols): Remove the input_group member.
8579
b6848d3c
ILT
85802010-03-10 Ian Lance Taylor <iant@google.com>
8581
8582 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8583 target to ask whether a reference to a symbol requires a stack
8584 split.
8585 * target.h (Target::is_call_to_non_split): New function.
8586 (Target::do_is_call_to_non_split): Declare virtual function.
8587 * target.cc: Include "symtab.h".
8588 (Target::do_is_call_to_non_split): New function.
8589 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8590
a2a5469e
CC
85912010-03-10 Cary Coutant <ccoutant@google.com>
8592
8593 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8594 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8595 (File_read::open[2]): Add whole_file_view_ to list of views.
8596 (File_read::make_view): Remove test of whole_file_view_.
8597 (File_read::find_or_make_view): Create whole_file_view_ if
8598 necessary.
8599 (File_read::clear_views): Replace bool parameter with enum;
8600 adjust all callers. Don't delete views with permanent data;
8601 do delete cached views and views from archives if
8602 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8603 if clearing the corresponding view.
8604 * fileread.h (File_read::Clear_views_mode): New enum.
8605 (File_read::View::is_permanent_view): New method.
8606 (File_read::clear_views): Replace bool parameter
8607 with enum; adjust all callers.
8608 * options.h (General_options): Change keep_files_mapped option;
8609 add map_whole_files.
8610 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8611 releasing the file.
8612 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8613 the file.
8614
8861f32b
DM
86152010-03-10 David S. Miller <davem@davemloft.net>
8616
8617 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8618
d62d0f5f
ST
86192010-03-09 Sriraman Tallam <tmsriram@google.com>
8620
8621 * icf.cc (get_section_contents): Add '@' marker after processing the
8622 merge reloc.
8623
9177756d
DK
86242010-03-08 Doug Kwan <dougkwan@google.com>
8625
8626 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8627 due to a conversion warning.
8628 (Arm_relobj::update_output_local_symbol_count): Check for local
8629 symbol with unset output index.
8630
9e9e071b
ILT
86312010-03-05 Ian Lance Taylor <iant@google.com>
8632
8633 * options.h (class General_options): Add --spare-dynamic-tags.
8634 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8635 --spare-dynamic-tags.
8636
a81ee015
ILT
86372010-03-05 Ian Lance Taylor <iant@google.com>
8638
8639 * incremental.cc: Include "libiberty.h".
8640
44ec90b9
RO
86412010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8642
8643 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8644 function, is_info_ member.
8645 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8646 (Versions::Versions): Update caller.
8647 (Versions::define_base_version): Likewise.
8648 (Versions::add_def): Likewise.
8649
0897ed3b
ST
86502010-03-03 Sriraman Tallam <tmsriram@google.com>
8651
8652 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8653 (Scan::possible_function_pointer_reloc): New function.
8654 (Scan::local_reloc_may_be_function_pointer): Change to call
8655 possible_function_pointer_reloc.
8656 (Scan::global_reloc_may_be_function_pointer): Ditto.
8657 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8658 relocations in ".data.rel.ro._ZTV" section.
8659 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8660 * testsuite/icf_safe_so_test.cc: Ditto.
8661 * testsuite/icf_safe_test.cc: Ditto.
8662 * testsuite/icf_safe_test.sh: Ditto.
8663
d3bbad62
ILT
86642010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8665 Ian Lance Taylor <iant@google.com>
8666
8667 * target-reloc.h (relocate_section): Check the symbol table index
8668 for -1U before setting the local symbol index.
8669 (scan_relocatable_relocs): If copying the relocation, record that
8670 the local symbol is required.
8671 * object.h (Symbol_value::is_output_symtab_index_set): New
8672 function.
8673 (Symbol_value::may_be_discarded_from_output_symtab): New
8674 function.
8675 (Symbol_value::has_output_symtab_entry): New function.
8676 (Symbol_value::needs_output_symtab_entry): Remove.
8677 (Symbol_value::output_symtab_index): Make sure the symbol index is
8678 set.
8679 (Symbol_value::set_output_symtab_index): Make sure the symbol
8680 index is not set. Make sure the new index is valid.
8681 (Symbol_value::set_must_have_output_symtab_entry): New function.
8682 (Symbol_value::has_output_dynsym_entry): New function.
8683 (Symbol_value::set_output_dynsym_index): Make sure the new index
8684 is valid.
8685 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8686 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8687 local symbol if permitted.
8688 (Sized_relobj::do_finalize_local_symbols): Call
8689 is_output_symtab_index_set rather than needs_output_symtab_entry.
8690 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8691 rather than needs_output_symtab_entry. Call
8692 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8693 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8694 is_output_symtab_index_set rather than needs_output_symtab_entry.
8695 * testsuite/discard_locals_relocatable_test.c: New file.
8696 * testsuite/discard_locals_test.sh: Test -r.
8697 * testsuite/Makefile.am (check_DATA): Add
8698 discard_locals_relocatable_test1.syms,
8699 discard_local_relocatable_test2.syms.
8700 (MOSTLYCLEANFILES): Likewise. Also add
8701 discard_locals_relocatable_test1.lout and
8702 discard_locals_relocatable_test2.out.
8703 (discard_locals_relocatable_test1.syms): New target.
8704 (discard_locals_relocatable_test.o): New target.
8705 (discard_locals_relocatable_test1.out): New target.
8706 (discard_locals_relocatable_test2.syms): New target.
8707 (discard_locals_relocatable_test2.out): New target.
8708 (various): Add missing ../ld-new dependencies.
8709 * testsuite/Makefile.in: Rebuild.
8710
7e8ccf26
NC
87112010-03-03 Nick Clifton <nickc@redhat.com>
8712
8713 * po/fi.po: New Finnish translation.
8714
2a0ff005
DK
87152010-03-01 Doug Kwan <dougkwan@google.com>
8716
8717 * layout.cc (Layout::Layout): Force section types of .init_array*,
8718 .preinit_array* and .fini_array* sections.
8719 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8720 Fix check of return value of std::string::find.().
8721 (Output_section::Input_section_sort_compare::operator()): Remove
8722 comment about .init_array.
8723 (Output_section::Input_section_sort_init_fini_compare::operator()):
8724 New method.
8725 (Output_section::sort_attached_input_sections): Handle .init_array
8726 and .fini_array specially.
8727 * output.h (Output_section::Inut_section_sort_compare): Update
8728 comment.
8729 (Output_section::Input_section_sort_init_fini_compare): New struct.
8730
c3e4ae29
DK
87312010-02-26 Doug Kwan <dougkwan@google.com>
8732
8733 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
8734 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
8735 * testsuite/debug_msg.sh: Avoid matching source line number for
8736 use of global variable undef_int.
8737
2fd9ae7a
DK
87382010-02-26 Doug Kwan <dougkwan@google.com>
8739
8740 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
8741 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
8742 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
8743 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
8744 * options.cc (General_options::General_options): Initialize member
8745 fix_v4bx_.
8746 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
8747 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
8748 and rm_no_fix_v4bx.stdout
8749 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
8750 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
8751 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
8752 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
8753 and arm_no_fix_v4bx.
8754 * Makefile.in: Regenerate.
8755 * testsuite/arm_fix_v4bx.s: New file.
8756 * testsuite/arm_fix_v4bx.sh: Ditto.
8757
67ec7d0b
DK
87582010-02-24 Doug Kwan <dougkwan@google.com>
8759
8760 * arm.cc (Target_arm::got_section): Make the .got section the first
8761 non RELRO section in the data segment.
8762 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
8763 suffixes of section names.
8764
10165461
DK
87652010-02-24 Doug Kwan <dougkwan@google.com>
8766
8767 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
8768 flags and attributes merging if an input file is a binary file.
8769 * fileread.cc (Input_file::open): Record format of original file.
8770 * fileread.h (Input_file::Format): New enum type.
2e702c99 8771 (Input_file::Input_file): Initialize data member format_.
10165461
DK
8772 (Input_file::format): New method definition.
8773 (Input_file::format_):: New data member.
8774
4a54abbb
DK
87752010-02-24 Doug Kwan <dougkwan@google.com>
8776
8777 * arm.cc (Arm_output_data_got): New class.
8778 (ARM_TCB_SIZE): New constant
8779 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
8780 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
8781 If user uses a script with a SECTIONS clause, issue only a warning
8782 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 8783 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
8784 garbage collection.
8785 (Target_arm::got_mode_index_entry): Handle static linking.
8786 (Target_arm::Scan::local): Ditto.
8787 (Target_arm::Scan::global): Ditto.
8788 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
8789 all incorrectly implemented relocations.
e1df38aa 8790 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
8791 Arm_output_section::fix_exidx_coverage.
8792 * layout.cc (Layout::section_name_mapping): Remove trailing dots
8793 from ".ARM.exidx." and ".ARM.extab.".
8794
ca419a6f
ILT
87952010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8796
8797 * arm.cc (Target_arm::do_finalize_sections): Create attribute
8798 section if it does not already exist.
8799 * attributes.cc (Attributes_section_data::Attributes_section_data):
8800 Don't crash if size is zero.
8801
135b9c78
ILT
88022010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8803 Ian Lance Taylor <iant@google.com>
8804
8805 * gold.cc (queue_middle_tasks): If no input files were opened,
8806 exit.
8807 * workqueue.h (Task_function::Task_function): Assert that there is
8808 a blocker.
8809
bb0bfe4f
DK
88102010-02-22 Doug Kwan <dougkwan@google.com>
8811
8812 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
8813 * icf.cc (get_section_contents): Cast snprintf arguments to long long
8814 types to avoid warnings due to different uint64_t implementations
8815 on different hosts.
8816
2a2b6d42
DK
88172010-02-21 Doug Kwan <dougkwan@google.com>
8818
8819 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
8820 handling of the maximum backward branch offset.
2e702c99 8821 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
8822 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
8823 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 8824 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
8825 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
8826 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
8827 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
8828 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
8829 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
8830 thumb_bl_out_of_range thumb_bl_out_of_range.o,
8831 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
8832 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
8833 thumb2_bl_out_of_range.o): New rules.
8834 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
8835 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
8836 thumb2_bl_out_of_range
8837 * testsuite/Makefile.in: Regenerate.
8838 * testsuite/arm_bl_in_range.s: New file.
8839 * testsuite/arm_bl_out_of_range.s: Ditto.
8840 * testsuite/arm_branch_in_range.sh: Ditto.
8841 * testsuite/arm_branch_range.t: Ditto.
8842 * testsuite/thumb2_branch_range.t: Ditto.
8843 * testsuite/thumb_bl_in_range.s: Ditto.
8844 * testsuite/thumb_bl_out_of_range.s: Ditto.
8845 * testsuite/thumb_branch_range.t: Ditto.
8846
b487ad64
ST
88472010-02-20 Sriraman Tallam <tmsriram@google.com>
8848
8849 * gc.h (gc_process_relocs): Change vectors to point to the new list.
8850 Add reloc offset information.
8851 * icf.cc (get_section_contents): Change iterators to point to the new
8852 vectors. Add reloc offset information to the contents.
8853 * icf.h (Icf::Sections_reachable_info): New typedef.
8854 (Icf::Sections_reachable_list): New typedef.
8855 (Icf::Offset_info): New typedef.
8856 (Icf::Reloc_info): New struct typedef.
8857 (Icf::Reloc_info_list): New typedef.
8858 (Icf::symbol_reloc_list): Delete method.
8859 (Icf::addend_reloc_list): Delete method.
8860 (Icf::section_reloc_list): Delete method.
8861 (Icf::reloc_info_list): New method.
8862 (Icf::reloc_info_list_): New member.
8863
f96accdf
DK
88642010-02-19 Doug Kwan <dougkwan@google.com>
8865
8866 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
8867 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
8868 * arm.cc (Arm_relocation_functions): New forward declaration.
8869 (Target_arm::Target_arm): Initialize new data members
8870 got_mod_index_offset_ and tls_base_symbol_defined_.
8871 (Target_arm::Relocate::relocate_tls): New method.
8872 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
8873 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
8874 New methods.
2e702c99 8875 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
8876 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
8877 (Target_arm::got_mod_index_offset_,
8878 Target_arm::tls_base_symbol_defined_): New data members.
8879 (Target_arm::Scan::local, Target::Scan::global,
8880 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
8881 relocations.
8882
c8761b9a
DK
88832010-02-18 Doug Kwan <dougkwan@google.com>
8884
8885 * arm.cc (Arm_relobj::find_linked_text_section): New method.
8886 (Arm_relobj::make_exidx_input_section): Pass section index of linked
8887 text section as a parameter becuase some broken tools may not set
8888 the link in section header.
8889 (Target_arm::has_got_section): New method.
8890 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
8891 without any mapping symbol as data only. Remove warning.
8892 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
8893 link in its section header, try to discover the link by inspecting the
8894 REL31 relocation at the beginning of the section.
8895 (Target_arm::Scan::check_non_pic): Report name of offending relocation
8896 in error message.
8897 (Target_arm::Scan::global): Treat any reference to the symbol
8898 _GLOBAL_OFFSET_TABLE_ as a GOT access.
8899
21bb3914
ST
89002010-02-12 Sriraman Tallam <tmsriram@google.com>
8901
8902 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
8903 (Scan::global_reloc_may_be_function_pointer): New function.
8904 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8905 (Scan::global_reloc_may_be_function_pointer): New function.
8906 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8907 (Scan::global_reloc_may_be_function_pointer): New function.
8908 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
8909 (Scan::global_reloc_may_be_function_pointer): New function.
8910 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
8911 (Scan::global_reloc_may_be_function_pointer): New function.
8912 (Scan::possible_function_pointer_reloc): New function.
8913 (Target_x86_64::can_check_for_function_pointers): New function.
8914 * gc.h (gc_process_relocs): Scan relocation types to determine if
8915 function pointers were taken for targets that support it.
8916 * icf.cc (Icf::find_identical_sections): Include functions for
8917 folding in safe ICF whose pointer is not taken.
8918 * icf.h (Secn_fptr_taken_set): New typedef.
8919 (fptr_section_id_): New member.
8920 (section_has_function_pointers): New function.
8921 (set_section_has_function_pointers): New function.
8922 (check_section_for_function_pointers): New function.
8923 * options.h: Fix comment for safe ICF option.
8924 * target.h (can_check_for_function_pointers): New function.
8925 * testsuite/Makefile.am: Add icf_safe_so_test test case.
8926 Modify icf_safe_test for X86-64.
8927 * testsuite/Makefile.in: Regenerate.
8928 * testsuite/icf_safe_so_test.cc: New file.
8929 * testsuite/icf_safe_so_test.sh: New file.
8930 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8931 (main): Change to take pointer to function kept_func_3.
8932 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8933 folding is done correctly for X86-64.
8934
0da6fa6c
DM
89352010-02-12 David S. Miller <davem@davemloft.net>
8936
8937 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8938 is_symbolless parameter.
8939 (Output_reloc<SHT_REL>::is_symbolless): New.
8940 (Output_reloc<SHT_REL>::is_symbolless_): New.
8941 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8942 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8943 (Output_reloc<SHT_RELA>::is_symbolless): New.
8944 (Output_data_reloc::add_global): Handle is_symbolless.
8945 (Output_data_reloc::add_global_relative): Likewise.
8946 (Output_data_reloc::add_local): Likewise.
8947 (Output_data_reloc::add_local_relative): Likewise.
8948 (Output_data_reloc::add_symbolless_global_addend): New.
8949 (Output_data_reloc::add_symbolless_local_addend): New.
8950 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8951 is_symbolless.
8952 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8953 instead of ->is_relative_
8954 (Output_reloc::write): Likewise.
8955 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8956 (Output_reloc::write_rel): Simplify.
8957
8958 * sparc.cc (Target_sparc::Scan::local): Use
8959 ->add_symbolless_local_addend as needed.
8960 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8961 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8962 based upon relocation offset.
8963
e4782e83
DK
89642010-02-11 Doug Kwan <dougkwan@google.com>
8965
8966 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
8967 (Target_arm::Scan::global): Ditto. Also remove a comment before the
8968 beginning of function.
8969 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
8970 and MOVT_ABS relocations. Those are non issued in scanning. Fix
8971 parameter is_32bit in calls to should_apply_static_reloc.
8972 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
8973 (check_DATA): Add arm_abs_global.stdout.
8974 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
8975 arm_abs_global.stdout): New rules.
8976 (MOSTLLYCLEANFILES): Add arm_abs_global
8977 * Makefile.in: Regenerate.
8978 * testsuite/arm_abs_global.s: New file.
8979 * testsuite/arm_abs_global.sh: Ditto.
8980 * testsuite/arm_abs_lib.s: Ditto.
8981
93ceb764
ILT
89822010-02-11 Ian Lance Taylor <iant@google.com>
8983
8984 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
8985 Read_relocs task.
8986 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
8987 Allocate_commons_task first.
8988 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
8989 task, rather than symtab_lock_.
8990 (Gc_process_relocs::~Gc_process_relocs): New function.
8991 (Gc_process_relocs::is_runnable): Check this_blocker_.
8992 (Gc_process_relocs::locks): Use next_blocker_ rather than
8993 blocker_.
8994 (Scan_relocs::~Scan_relocs): New function.
8995 (Scan_relocs::is_runnable): Check this_blocker_ rather than
8996 symtab_lock_.
8997 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
8998 next_blocker_.
8999 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9000 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9001 constructor accordingly.
9002 (class Gc_process_relocs): Likewise.
9003 (class Scan_relocs): Likewise.
9004 * common.h (class Allocate_commons_task): Remove symtab_lock_
9005 field, and corresponding constructor parameter.
9006 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9007 symtab_lock_.
9008 (Allocate_commons_task::locks): Likewise.
9009
114dfbe1
ILT
90102010-02-11 Ian Lance Taylor <iant@google.com>
9011
9012 * gold-threads.h (class Once): Define.
9013 (class Initialize_lock): Rewrite as child of Once.
9014 * gold-threads.cc (class Once_initialize): Define.
9015 (once_pointer_control): New static variable.
9016 (once_pointer, once_arg): New static variables.
9017 (c_run_once): New static function.
9018 (Once::Once, Once::run_once, Once::internal_run): New functions.
9019 (class Initialize_lock_once): Remove.
9020 (initialize_lock_control): Remove.
9021 (initialize_lock_pointer): Remove.
9022 (initialize_lock_once): Remove.
9023 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9024 (Initialize_lock::initialize): Rewrite.
9025 (Initialize_lock::do_run_once): New function.
9026 * archive.cc (Archive::interpret_header): Only clear name if it is
9027 not already empty.
9028 * fileread.cc: Include "gold-threads.h"
9029 (file_counts_lock): New static variable.
9030 (file_counts_initialize_lock): Likewise.
9031 (File_read::release): Only increment counts when using --stats.
9032 Use a lock around the increment.
9033 * parameters.cc (class Set_parameters_target_once): Define.
9034 (set_parameters_target_once): New static variable.
9035 (Parameters::Parameters): Move here from parameters.h.
9036 (Parameters::set_target): Rewrite.
9037 (Parameters::set_target_once): New function.
9038 (Parameters::clear_target): Move here and rewrite.
9039 * parameters.h (class Parameters): Update declarations. Add
9040 set_parameters_target_once_ field.
9041 (Parameters::Parameters): Move to parameters.cc.
9042 (Parameters::clear_target): Likewise.
9043 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9044 task.
9045 (Start_group::~Start_group): New function.
9046 (Start_group::is_runnable): New function.
9047 (Start_group::locks, Start_group::run): New functions.
9048 (Finish_group::run): Change saw_undefined to size_t.
9049 * readsyms.h (class Start_group): Define.
9050 (class Finish_group): Change saw_undefined_ field to size_t.
9051 (Finish_group::Finish_group): Remove saw_undefined and
9052 this_blocker parameters. Change all callers.
9053 (Finish_group::set_saw_undefined): New function.
9054 (Finish_group::set_blocker): New function.
9055 * symtab.h (class Symbol_table): Change saw_undefined to return
9056 size_t. Change saw_undefined_ field to size_t.
9057 * target-select.cc (Set_target_once::do_run_once): New function.
9058 (Target_selector::Target_selector): Initialize set_target_once_
9059 field. Don't initialize lock_ and initialize_lock_ fields.
9060 (Target_selector::instantiate_target): Rewrite.
9061 (Target_selector::set_target): New function.
9062 * target-select.h (class Set_target_once): Define.
9063 (class Target_selector): Update declarations. Make
9064 Set_target_once a friend. Remove lock_ and initialize_lock_
9065 fields. Add set_target_once_ field.
9066
fa17a3f4
ILT
90672010-02-10 Ian Lance Taylor <iant@google.com>
9068
9069 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9070 queueing any tasks.
9071 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9072 (queue_middle_tasks): Add all blockers before queueing any tasks.
9073 (queue_final_tasks): Likewise.
9074 * token.h (Task_token::add_blockers): New function.
9075 * object.h (Input_objects::number_of_relobjs): New function.
9076
c7177d31
ILT
90772010-02-10 Ian Lance Taylor <iant@google.com>
9078
5de0e392
ILT
9079 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9080 shared, not if not position independent.
9081 * x86_64.cc (Relocate::relocate_tls): Likewise.
9082 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9083 (tls_pie_pic_test): New target.
9084 * testsuite/Makefile.in: Rebuild.
9085
c7177d31
ILT
9086 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9087 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9088 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9089 * testsuite/Makefile.in: Rebuild.
9090
684b268a
DM
90912010-02-09 David S. Miller <davem@davemloft.net>
9092
9093 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9094 R_SPARC_RELATIVE using ->add_local_relative().
9095 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9096
612a8d3d
DM
9097 * output.h (Output_data_dynamic::add_section_size): New method
9098 that takes two Output_data objects.
9099 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9100 entry param. Handle it in initializers.
9101 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9102 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9103 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9104 arg.
9105 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9106 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9107 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9108 for dynrel_includes_plt.
9109 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9110 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9111 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9112 before .rela.plt
9113 (Target_sparc::do_finalize_sections): Update to pass true for
9114 dynrel_includes_plt.
9115 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9116 output before .rela.plt
9117 (Target_powerpc::do_finalize_sections): Update to pass true for
9118 dynrel_includes_plt when 32-bit.
9119
cb1be87e
DK
91202010-02-08 Doug Kwan <dougkwan@google.com>
9121
9122 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9123 method.
9124 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9125 Arm_relobj::scan_section_for_cortex_a8_stubs,
9126 Arm_relobj::do_relocation_section): Instead of calling
9127 Output_section::output_address, use faster
9128 Arm_relobj::simple_input_section_output_address.
9129
705b5121
DM
91302010-02-08 David S. Miller <davem@davemloft.net>
9131
9132 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9133 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9134 relocation helper function.
9135
024c4466
DM
9136 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9137 just like R_SPARC_GOT{10,13,22}.
9138 (Target_sparc::Scan::local): Likewise.
9139 (Target_sparc::Relocate:relocate): Likewise.
9140
9109c078
ILT
91412010-02-06 Ian Lance Taylor <iant@google.com>
9142
9143 * configure.ac: Rewrite targetobjs duplicate removal code to use
9144 only shell constructs.
9145 * configure: Rebuild.
9146
cf846138
DK
91472010-02-05 Doug Kwan <dougkwan@google.com>
9148
9149 PR 11247
9150 * arm.cc (Arm_relobj::section_is_scannable): New method.
9151 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9152 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9153
6cfaf60b
DK
91542010-02-04 Doug Kwan <dougkwan@google.com>
9155
9156 PR 11247
9157 * arm-reloc-property.cc (cstdio): Include.
9158 * configure.ac (targetobjs): Remove duplicates.
9159 * configure: Regenerate.
9160 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9161 big and little endian version for a given address size.
9162
5c57f1be
DK
91632010-02-03 Doug Kwan <dougkwan@google.com>
9164
9165 * arm-reloc-property.cc
9166 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9167 definition.
9168 * arm-reloc-property.h
9169 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9170 New method definition.
9171 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9172 declaration.
9173 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9174 overflow to N.
9175 (GOT_PREL): Change implemented to Y.
9176 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9177 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9178 (Arm_relocate_functions::movw_abs_nc): Remove method.
9179 (Arm_relocate_functions::movt_abs): Ditto.
9180 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9181 (Arm_relocate_functions::thm_movt_abs): Ditto.
9182 (Arm_relocate_functions::movw_rel_nc): Ditto.
9183 (Arm_relocate_functions::movw_rel): Ditto.
9184 (Arm_relocate_functions::movt_rel): Ditto.
9185 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9186 (Arm_relocate_functions:thm_movw_rel): Ditto.
9187 (Arm_relocate_functions:thm_movt_rel): Ditto.
9188 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9189 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9190 New method definitions.
9191 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9192 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9193 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9194 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9195 (Target_arm::Relocate::relocate): Check for non-static or
9196 unimplemented relocation code and exit early. Change calls to
9197 Target_arm::reloc_uses_thumb_bit and
9198 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9199 instead. Refactor code to handle similar relocations to increase
9200 code sharing. Remove check for unsupported relocation code in switch
9201 statement.
9202 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9203 relocation property table to find out size. Change error message to
9204 print out the name of a relocation code instead of the numeric value.
9205 (Target_arm::scan_reloc_for_stub): Use relocation property table
9206 instead of calling Target_arm::reloc_uses_thumb_bit().
9207
218c5831
DK
92082010-02-02 Doug Kwan <dougkwan@google.com>
9209
9210 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9211 types of relaxed input section.
9212
0d31c79d
DK
92132010-02-02 Doug Kwan <dougkwan@google.com>
9214
9215 * Makefile.am (HFILES): Add arm-reloc-property.h.
9216 (DEFFILES): New.
2e702c99
RM
9217 (TARGETSOURCES): Add arm-reloc-property.cc
9218 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9219 (libgold_a_SOURCES): $(DEFFILES)
9220 * Makefile.in: Regenerate.
9221 * arm-reloc-property.cc: New file.
9222 * arm-reloc-property.h: New file.
9223 * arm-reloc.def: New file.
9224 * arm.cc: Update comments.
9225 (arm-reloc-property.h): New included header.
9226 (arm_reloc_property_table): New global variable.
9227 (Target_arm::do_select_as_default_target): New method definition.
9228 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9229 arm-reloc-property to targ_extra_obj.
9230 * parameters.cc (set_parameters_target): Call
9231 Target::select_as_default_target().
9232 * target.h (Target::select_as_default_target): New method definition.
9233 (Target::do_select_as_default_target): Same.
9234
546c7457
DK
92352010-02-01 Doug Kwan <dougkwan@google.com>
9236
9237 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9238 first_output_text_section_.
9239 (Arm_exidx_fixup::first_output_text_section): New method definition.
9240 (Arm_exidx_fixup::first_output_text_section_): New data member.
9241 (Arm_exidx_fixup::process_exidx_section): Record the first text
9242 output section seen.
9243 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9244 and entsize in output section header.
9245
11b861d5
DK
92462010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9247
9248 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9249 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9250 (Arm_relocate_functions::thm_alu11): New Method.
9251 (Arm_relocate_functions::thm_pc8): New Method.
9252 (Arm_relocate_functions::thm_pc12): New Method.
9253 (Target_arm::Scan::local): Handle the relocations.
9254 (Target_arm::Scan::global): Likewise.
9255 (Target_arm::Relocate::relocate): Likewise.
9256 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9257
c9a2c125
DK
92582010-01-29 Doug Kwan <dougkwan@google.com>
9259
9260 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9261 of relocation types as ld.
9262
1521477a
DK
92632010-01-29 Doug Kwan <dougkwan@google.com>
9264
9265 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9266 to public.
9267 (Arm_relocate_functions::thumb_branch_common): Ditto.
9268 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9269 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9270 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9271 Arm_relocate_functions::jump24): Remove.
9272 (Target_arm::Relocate::relocate): Adjust code to call
9273 Arm_relocation_functions::arm_branch_common and
9274 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9275 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9276
e7eca48c
DK
92772010-01-29 Doug Kwan <dougkwan@google.com>
9278
9279 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9280 output_local_symbol_count_needs_update_.
9281 (Arm_relobj::output_local_symbol_count_needs_update,
9282 Arm_relobj::set_output_local_symbol_count_needs_update,
9283 Arm_relobj::update_output_local_symbol_count): New methods.
9284 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9285 member.
9286 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9287 of pointed function as in a R_ARM_PREL31 relocation.
9288 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9289 for output local symbol count updating.
9290 (Target_arm::do_relax): Update output local symbol counts in objects
9291 if necessary.
9292 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9293
02961d7e
ILT
92942010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9295
9296 * arm.cc: Added support for the ARM relocations:
9297 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9298 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9299 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9300 movw_prel_nc).
9301 (Arm_relocate_functions::movw_rel): New method.
9302 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9303 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9304 thm_movw_prel_nc).
9305 (Arm_relocate_functions::thm_movw_rel): New method.
9306 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9307 thm_movt_prel).
9308 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9309 relocations.
9310 (Target_arm::Scan::global): Likewise.
9311 (Target_arm::Relocate::relocate): Likewise.
9312 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9313 Likewise.
9314
b10d2873
ILT
93152010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9316
9317 * arm.cc: Added support for ARM group relocations.
9318 (Target_arm::reloc_needs_sym_origin): New method.
9319 (Arm_relocate_functions::calc_grp_kn): New method.
9320 (Arm_relocate_functions::calc_grp_residual): New method.
9321 (Arm_relocate_functions::calc_grp_gn): New method.
9322 (Arm_relocate_functions::arm_grp_alu): New Method.
9323 (Arm_relocate_functions::arm_grp_ldr): New Method.
9324 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9325 (Arm_relocate_functions::arm_grp_ldc): New Method.
9326 (Target_arm::Scan::local): Handle the ARM group relocations.
9327 (Target_arm::Scan::global): Likewise.
9328 (Target_arm::Relocate::relocate): Likewise.
9329 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9330 Likewise.
9331
2b328d4e
DK
93322010-01-26 Doug Kwan <dougkwan@google.com>
9333
9334 * arm.cc (set): Include.
9335 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9336 pointer type.
2e702c99 9337 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9338 (Arm_output_section::append_text_sections_to_list): New method.
9339 (Arm_output_section::fix_exidx_coverage): Ditto.
9340 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9341 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9342 Relobj::set_section_offset() instead of
9343 Sized_relobj::invalidate_section_offset().
2e702c99 9344 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9345 parameter for section headers. Ignore relocation sections for
9346 unallocated sections and EXIDX sections.
9347 (Target_arm::fix_exidx_coverage): New method.
9348 (Target_arm::output_section_address_less_than): New type.
9349 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9350 linked text section instead of the EXIDX section.
9351 (Arm_output_section::create_stub_group): Add an assertion to check
9352 that this is not an EXIDX output section.
9353 (Arm_output_section::append_text_sections_to_list): New method.
9354 (Arm_output_section::fix_exidx_coverage): Ditto.
9355 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9356 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9357 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9358 first pass.
9359 (Target_arm::fix_exidx_coverage): New method.
9360 * object.h (Relobj::set_output_section): New method.
9361 (Sized_relobj::invalidate_section_offset): Remove method.
9362 (Sized_relobj::do_invalidate_section_offset): Remove method.
9363 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9364
c7f3c371
DK
93652010-01-25 Doug Kwan <dougkwan@google.com>
9366
9367 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9368 Fix warning due to signed and unsigned comparison on a 32-bit host.
9369
8923b24c
DK
93702010-01-22 Doug Kwan <dougkwan@google.com>
9371
9372 * arm.cc (Target_arm::do_relax): Record an output section for section
9373 offset adjustment it contains any stub table that has changed.
9374 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9375 offsets in an output section if necessary.
9376 * output.cc (Output_section::Output_section): Initialize
9377 section_offsets_need_adjustments_.
9378 (Output_section::add_input_section_for_script): Renamed to
9379 Output_section::add_simple_input_section.
9380 (Output_section::save_states): Add a comment.
9381 (Output_section::discard_states): New method defintion.
9382 (Output_section::adjust_section_offsets): Same.
9383 * output.h (Output_section::add_input_section_for_script): Renamed to
9384 Output_section::add_simple_input_section.
9385 (Output_section::discard_states): New method declaration.
9386 (Output_section::adjust_section_offsets): Same.
9387 (Output_section::section_offsets_need_adjustment,
9388 Output_section::set_section_offsets_need_adjustment): New method
9389 definitions.
9390 (Output_section::section_offsets_need_adjustment_): New data member.
9391 * script-sections.cc
9392 (Output_section_element_input::set_section_address): Adjust code for
9393 renaming of Output_section::add_input_section_for_script.
9394 (Orphan_output_section::set_section_address): Same.
9395
9b2fd367
DK
93962010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9397
9398 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9399 Fix_v4bx enum values .
9400 * gold/options.h (General_options): New option definitions.
9401 (General_options::fix_v4bx): New method.
9402 (General_options::Fix_v4bx): New enum.
9403 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9404 (General_options::parse_fix_v4bx_interworking): New method.
9405
80d0d023
DK
94062010-01-22 Doug Kwan <dougkwan@google.com>
9407
9408 * arm.cc (Arm_exidx_fixup): New class.
9409
af2cdeae
DK
94102010-01-21 Doug Kwan <dougkwan@google.com>
9411
9412 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9413 classes.
9414 (Arm_exidx_section_offset_map): New type.
9415
993d07c1
DK
94162010-01-21 Doug Kwan <dougkwan@google.com>
9417
9418 * arm.cc (Arm_exidx_input_section): New class.
9419 (Arm_relobj::exidx_input_section_by_link,
9420 Arm_relobj::exidx_input_section_by_shndx,
9421 Arm_relobj::make_exidx_input_section): New methods.
9422 (read_arm_attributes_section): Remove.
9423 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9424 information about them.
9425 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9426 to here.
9427
5ac169d4
DK
94282010-01-20 Doug Kwan <dougkwan@google.com>
9429
9430 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9431 Input_section_specifier to Section_id.
9432 (Target_arm::new_arm_input_section: Adjust code for change of key
9433 type.
9434 (Target_arm::find_arm_input_section): Ditto.
9435 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9436 (Section_id): Remove.
9437 (Garbage_collection::Section_id_hash): Remove.
9438 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9439 (Section_id): Remove.
9440 (Icf::Section_id_hash): Remove.
9441 * object.h (Section_id, Const_section_id, Section_id_hash,
9442 Const_section_id_hash): New type definitions.
9443 * output.cc (Output_section::add_relaxed_input_section): Change to
9444 use Const_section_id instead of Input_section_specifier as key type.
9445 (Output_section::add_merge_input_section): Ditto.
9446 (Output_section::build_relaxation_map): Change to use Section_id
9447 instead of Input_section_specifier as key type.
2e702c99 9448 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9449 Ditto.
9450 (Output_section::convert_input_sections_to_relaxed_sections): Change
9451 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9452 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9453 (Output_section::find_relaxed_input_section): Ditto.
9454 * output.h (Input_section_specifier): Remove class.
9455 (Output_section::Output_section_data_by_input_section_map): Change
9456 key type to Const_section_id.
9457 (Output_section::Output_relaxed_input_section_by_input_section_map):
9458 Ditto.
9459 (Output_section::Relaxation_map): Change key type to Section_id.
9460
a2162063
ILT
94612010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9462
9463 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9464 (class Arm_v4bx_stub): New class.
9465 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9466 (Stub_factory::make_arm_v4bx_stub): New method.
9467 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9468 (Stub_table::empty): Handle v4bx stubs.
9469 (Stub_table::add_arm_v4bx_stub): New method.
9470 (Stub_table::find_arm_v4bx_stub): New method.
9471 (Arm_relocate_functions::v4bx): New method.
9472 (Target_arm::fix_v4bx): New method.
9473 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9474 (Stub_table::relocate_stubs): Likewise.
9475 (Stub_table::do_write): Likewise.
9476 (Stub_table::update_data_size_and_addralign): Likewise.
9477 (Stub_table::finalize_stubs): Likewise.
9478 (Target_arm::Scan::local): Likewise.
9479 (Target_arm::Scan::global): Likewise.
9480 (Target_arm::do_finalize_sections): Likewise.
9481 (Target_arm::Relocate::relocate): Likewise.
9482 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9483 Likewise.
9484 (Target_arm::scan_reloc_for_stub): Likewise.
9485 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9486
5696ab0b
ILT
94872010-01-19 Ian Lance Taylor <iant@google.com>
9488
9489 * output.cc (Output_section_headers::do_sized_write): Write large
9490 segment count to sh_info field.
9491 (Output_file_header::do_sized_write): For large segment count,
9492 write PN_XNUM to e_phnum field.
9493
800d0f56
ILT
94942010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9495
9496 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9497 (Arm_relocate_functions::thm_jump8): New function.
9498 (Arm_relocate_functions::thm_jump11): New function.
9499 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9500 R_ARM_THM_JUMP11.
9501 (Target_arm::Scan::global): Likewise.
9502 (Target_arm::Relocate::relocate): Likewise.
9503 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9504 Likewise.
9505
41263c05
DK
95062010-01-14 Doug Kwan <dougkwan@google.com>
9507
9508 * arm.cc (map, utility): Include headers.
9509 (Target_arm::apply_cortex_a8_workaround): New method.
9510 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9511 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9512 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9513 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9514 the --[no-]fix-cortex-a8 command line options.
9515 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9516 (Target_arm::relocate_stub): Use addend in instruction template.
9517 * options.h (DEFINE_bool): Set the user-set flag.
9518 (General_options): Add --[no-]-fix-cortex options.
9519 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 9520 : Update fast look-up map after conversion.
41263c05 9521
459e9b03
ST
95222010-01-14 Sriraman Tallam <tmsriram@google.com>
9523
9524 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9525 in the first pass of do_layout.
9526
b521dfe4
DK
95272010-01-13 Doug Kwan <dougkwan@google.com>
9528
9529 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9530 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9531 apparent compiler problem of not folding static constant integral
9532 data members of elfcpp::Elf_sizes<32>.
9533
44272192
DK
95342010-01-13 Doug Kwan <dougkwan@google.com>
9535
9536 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9537 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9538 Arm_relobj::scan_section_for_cortex_a8_erratum,
9539 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9540 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9541 sections to scan for relocation stubs into a new method
9542 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9543 relocation and Cortex-A8 stub scanning.
9544 (Target_arm::do_relax): Force stubs to be after stubbed sections
9545 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 9546 the beginning of a new relaxation pass. Update a comment.
44272192
DK
9547 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9548
44b71ece
ILT
95492010-01-12 Ian Lance Taylor <iant@google.com>
9550
9551 * target-reloc.h (visibility_error): New inline function.
9552 (relocate_section): Call visibility_error.
9553 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9554 (MOSTLYCLEANFILES): Likewise.
9555 (protected_4_pic.o, protected_3.err): New targets.
9556 * testsuite/protected_4.cc: New file.
9557
a120bc7f
DK
95582010-01-12 Doug Kwan <dougkwan@google.com>
9559
9560 * arm.cc (Cortex_a8_reloc): New class.
9561 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9562 and cortex_a8_relocs_info_.
9563 (Target_arm::fix_cortex_a8): New method definition.
9564 (Target_arm::Cortex_a8_relocs_info): New type.
9565 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9566 New data member declarations.
9567 (Target_arm::scan_reloc_for_stub): Record information about
9568 relocations for THUMB branches that might be exempted from the
9569 Cortex-A8 workaround.
9570 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9571 at the beginning of a relaxation pass.
9572
20138696
DK
95732010-01-12 Doug Kwan <dougkwan@google.com>
9574
9575 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9576 (Arm_relobj::Mapping_symbol_position,
9577 Arm_reloj::Mapping_symbol_position_less,
9578 Arm_relobj::Mapping_symbols_info): New types.
9579 (Target_arm::is_mapping_symbol_name): New method definition.
9580 (Arm_relobj::do_count_local_symbols): Save information about mapping
9581 symbols.
9582
089d69dc
DK
95832010-01-11 Doug Kwan <dougkwan@google.com>
9584
9585 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9586 Arm_relocate_functions::thumb32_branch_upper,
9587 Arm_relocate_functions::thumb32_branch_lower,
9588 Arm_relocate_functions::thumb32_cond_branch_offset,
9589 Arm_relocate_functions::thumb32_cond_branch_upper,
9590 Arm_relocate_functions::thumb32_cond_branch_lower,
9591 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9592 branch offset encoding.
9593 (Arm_relocate_functions::thumb_branch_common): Use new branch
9594 offset encoding methods to avoid code duplication.
9595 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9596 (Stub_addend_reader::operator()): Use new branch encoding method
9597 to avoid code duplication.
9598
99e5bff2
DK
95992010-01-11 Doug Kwan <dougkwan@google.com>
9600
9601 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9602 (Target_arm::do_finalize_sections): Define special EXIDX section
9603 symbols only if referenced.
9604 * gc.h (Garbage_collection::add_reference): New method.
9605 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9606 code duplication.
9607
98e090bd
ILT
96082010-01-11 Ian Lance Taylor <iant@google.com>
9609
d0a91bd8
ILT
9610 * script.cc (Version_script_info::build_expression_list_lookup):
9611 Change complaing about duplicate wildcard match from error to
9612 warning.
9613
98e090bd
ILT
9614 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9615 of 2009-12-30.
9616 (Version_script_info::Version_script_info): Initialize globs_,
9617 default_version_, default_is_global_, and exact_. Don't
9618 initialize globals_ or locals_.
9619 (Version_script_info::build_lookup_tables): Build local symbols
9620 first.
9621 (Version_script_info::unquote): New function.
9622 (Version_script_info::add_exact_match): New function.
9623 (Version_script_info::build_expression_list_lookup): Remove lookup
9624 parameter. Add is_global parameter. Change all callers. Handle
9625 wildcard pattern specially. Unquote pattern. Call
9626 add_exact_match.
9627 (Version_script_info::get_name_to_match): New function.
9628 (Version_script_info::get_symbol_version): New function.
9629 (Version_script_info::get_symbol_version_helper): Remove.
9630 (Version_script_info::check_unmatched_names): Call unquote.
9631 * script.h (class Version_script_info): Change get_symbol_version
9632 to be non-inline and add is_global parameter; change all callers.
9633 Rewrite symbol_is_local. Update declarations. Define struct
9634 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9635 Remove globals_ and locals_ members. Add exact_, globs_,
9636 default_version_, is_global_.
9637 (Version_script_info::Glob): Remove pattern, add expression and
9638 is_global. Update constructor. Change all callers.
9639 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9640 default version.
9641 (Versions::symbol_section_contents): If a symbol is undefined, or
9642 defined in a dynamic object, set the version index to
9643 VER_NDX_LOCAL.
9644 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9645 symbol_is_local.
9646 (Symbol_table::add_from_pluginobj): Likewise.
9647 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9648
d56962d3
DK
96492010-01-11 Doug Kwan <dougkwan@google.com>
9650
9651 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9652 (incremental_dump_LDADD): Add linking option for libintl.
9653 * Makefile.in: Regenerate.
9654
94e6ee91
L
96552010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9656
9657 PR gold/11144
9658 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9659 instead of -Ds.
9660 * testsuite/Makefile.in: Regenerated.
9661
e96c574b
DK
96622010-01-10 Doug Kwan <dougkwan@google.com>
9663
9664 * options.h (DEFINE_var): Use parentheses around argument varname__
9665 in macro body to avoid any unintended subsequent substitutions.
9666
7198066b
ILT
96672010-01-10 Ian Lance Taylor <iant@google.com>
9668
ba4d53bf
ILT
9669 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9670 candidates before doing symbol resolution.
9671
7198066b
ILT
9672 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9673 ODR candidates if only one is weak.
9674
a2beed37
ILT
96752010-01-08 Ian Lance Taylor <iant@google.com>
9676
9677 * script.cc (Version_script_info::build_expression_list_lookup):
9678 Don't warn about ambiguous version, just record the ambiguity.
9679 (Version_script_info::get_symbol_version_helper): Give error if
9680 version is ambiguous.
9681
2fb7225c
DK
96822010-01-08 Doug Kwan <dougkwan@google.com>
9683
9684 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
9685 prev_data_size_ and prev_addralign_. Remove initializer for
9686 deleted data member has_been_changed_.
9687 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9688 to determine if the table is empty.
9689 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9690 Remove.
9691 (Stub_table::add_reloc_stub): Define method in class definition
9692 instead of just declaring it there.
9693 (Stub_table::add_cortex_a8_stub): New method definition.
9694 (Stub_table::update_data_size_and_addralign): Ditto.
9695 (Stub_table::finalize_stubs): Ditto.
9696 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9697 (Stub_table::do_addralign_): Return address alignment in the
9698 (Stub_table::do_reset_address_and_file_offset): Define method in
9699 class definition instead of declaring it there. Set current data
9700 size to be the data size of the previous pass.
9701 (Stub_table::set_final_data_size): Use current data size as the
9702 final data size.
9703 (Stub_table::relocate_stub): Change parameter type of stub from
9704 Reloc_stub pointer to Stub pointer.
9705 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9706 (Stub_table::Cortex_a8_stub_list): New typedef.
9707 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9708 Stub_table::prev_addralign_): New data member.
9709 (Arm_relobj::Arm_relobj): Initialize data member
9710 section_has_cortex_a8_workaround_.
9711 (Arm_relobj::section_has_cortex_a8_workaround,
9712 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9713 definitions.
9714 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9715 declarations.
9716 (Target_arm::relocate_stub): Change parameter type of stub from
9717 Reloc_stub pointer to Stub pointer.
9718 (Insn_template::size, Insn_template::alignment): Handle
9719 THUMB16_SPECIAL_TYPE.
9720 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9721 Stub_table::update_data_size_and_addralign,
9722 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
9723 definitions.
9724 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
9725 (Stub_table::do_write): Ditto.
9726 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 9727
880cd20d
ILT
97282010-01-08 Ian Lance Taylor <iant@google.com>
9729
9730 PR 11108
9731 * symtab.h (class Symbol): Remove fields is_target_special_ and
9732 has_plt_offset_. Add field is_defined_in_discarded_section_.
9733 (Symbol::is_defined_in_discarded_section): New function.
9734 (Symbol::set_is_defined_in_discarded_section): New function.
9735 (Symbol::has_plt_offset): Rewrite.
9736 (Symbol::set_plt_offset): Verify that new offset is not -1U.
9737 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
9738 Don't initialize is_target_special_ or has_plt_offset_.
9739 Initialize is_defined_in_discarded_section_.
9740 (Symbol_table::add_from_relobj): If appropriate, set
9741 is_defined_in_discarded_section.
9742 * resolve.cc (Symbol::override_base_with_special): Don't test
9743 is_target_special_. Change has_plt_offset_ to has_plt_offset().
9744 * target-reloc.h (relocate_section): Do special handling for
9745 symbols defined in discarded sections for global symbols as well
9746 as local symbols.
9747
2703e3eb
ILT
97482010-01-08 Ian Lance Taylor <iant@google.com>
9749
9750 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
9751 the SHT_SYMTAB case.
9752
339d40a3
ILT
97532010-01-08 Ian Lance Taylor <iant@google.com>
9754
9755 * object.cc (Sized_relobj::do_layout): Don't get confused if
9756 layout_eh_frame returns NULL.
9757
abecea76
ILT
97582010-01-08 Ian Lance Taylor <iant@google.com>
9759
9760 PR 11084
9761 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
9762 dynamic symbol table, use the normal symbol table.
9763 (Sized_dynobj::do_read_symbols): Remove assertion about type of
9764 symbol table.
9765
6b7dd3f3
ILT
97662010-01-08 Ian Lance Taylor <iant@google.com>
9767
9768 PR 11072
9769 * layout.cc (Layout::include_section): Remove .gnu_debuglink
9770 sections.
9771
36c50e63
L
97722010-01-08 H.J. Lu <hongjiu.lu@intel.com>
9773
9774 * version.cc (print_version): Change to "Copyright 2010".
9775
e291e7b9
ILT
97762010-01-08 Ian Lance Taylor <iant@google.com>
9777
9778 PR 10287
9779 PR 11063
9780 * i386.cc (class Target_i386): Change return type of plt_section
9781 to be non-const.
9782 (class Output_data_plt_i386): Add tls_desc_rel_ field.
9783 (Output_data_plt_i386::Output_data_plt_i386): Initialize
9784 tls_desc_rel_ field.
9785 (Output_data_plt_i386::rel_tls_desc): New function.
9786 (Target_i386::rel_tls_desc_section): New function.
9787 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
9788 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
9789 R_386_TLS_DESC reloc in rel_tls_desc_section.
9790 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
9791 Define struct Tlsdesc_info.
9792 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
9793 (Target_x86_64::do_reloc_symbol_index): New function.
9794 (Target_x86_64::add_tlsdesc_info): New function.
9795 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
9796 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
9797 tlsdesc_rel_ field.
9798 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
9799 all callers.
9800 (Output_data_plt_x86_64::rela_tlsdesc): New function.
9801 (Target_x86_64::rela_tlsdesc_section): New function.
9802 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
9803 handling.
9804 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
9805 (Target_x86_64::do_reloc_addend): New function.
9806 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
9807 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
9808 declarations. Define TARGET_CODE. Add arg field to u1_ union.
9809 (Output_reloc::type): New function.
9810 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
9811 (Output_reloc::is_target_specific): New function.
9812 (Output_reloc::target_arg): New function.
9813 (class Output_reloc) [SHT_RELA]: Add four new constructors for
9814 absolute relocs and target specific relocs.
9815 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
9816 add_target_specific.
9817 (class Output_data_reloc) [SHT_RELA]: Likewise.
9818 * output.cc (Output_reloc::Output_reloc): Add four new versions
9819 for absolute relocs and target specific relocs.
9820 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
9821 (Output_reloc::get_symbol_index): Likewise.
9822 (Output_reloc::local_section_offset): Check that local_sym_index_
9823 is not TARGET_CODE or 0.
9824 (Output_reloc::symbol_value): Likewise.
9825 (Output_reloc::write) [SHT_RELA]: Call target for target specific
9826 reloc.
9827 * target.h (class Target): Add reloc_symbol_index and reloc_addend
9828 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
9829 functions.
9830 * layout.cc (add_target_dynamic_tags): Use output section for
9831 DT_PLTRELSZ and DT_JMPREL.
9832
3a44184e
ILT
98332010-01-07 Ian Lance Taylor <iant@google.com>
9834
9835 PR 11061
9836 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
9837 function.
9838 (class Output_data_reloc_generic): Define.
9839 (class Output_data_reloc_base): Change base class to
9840 Output_data_reloc_generic. Change add() method to call
9841 bump_relative_reloc_count for a relative reloc. Remove
9842 sort_relocs_ field.
9843 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
9844 to sort_relocs().
9845 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
9846 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
9847 appropriate.
9848 * layout.h (class Layout): Update declaration.
9849
ea715a34
ILT
98502010-01-07 Ian Lance Taylor <iant@google.com>
9851
9852 * output.h (class Output_data): Add const version of
9853 output_section and do_output_section.
9854 (class Output_section_data): Add const version of
9855 do_output_section.
9856 (class Output_section): Likewise.
9857 * layout.cc (Layout::add_target_dynamic_tags): New function.
9858 * layout.h (class Layout): Update declarations.
9859 * arm.cc (Target_arm::do_finalize_sections): Use
9860 add_target_dynamic_tags.
9861 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9862 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9863 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9864 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9865
659948a4
ILT
98662010-01-07 Ian Lance Taylor <iant@google.com>
9867
9868 PR 11042
9869 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
9870 object as needed.
9871
9d3b86f6
ILT
98722010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
9873 Ian Lance Taylor <iant@google.com>
9874
9875 PR 11019
9876 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
9877 Xindex::read_symtab_xindex.
9878
bb0d3eb0
DK
98792010-01-07 Doug Kwan <dougkwan@google.com>
9880
9881 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
9882 (Insn_template::thumb16_bcond_insn): New method declaration.
9883 (Insn_template): Fix spelling.
9884 (Stub::thumb16_special): New method declaration.
9885 (Stub::do_write): Define virtual method which was previously pure
9886 virtual.
9887 (Stub::do_thumb16_special): New method declaration.
9888 (Stub::do_fixed_endian_write): New template member.
9889 (Reloc_stub::do_write): Remove.
9890 (Reloc_stub::do_fixed_endian_write): Remove.
9891 (Cortex_a8_stub): New class definition.
9892 (Stub_factory::make_cortex_a8_stub): New method definition.
9893 (Stub_factory::Stub_factory): Add missing static storage class
9894 qualifier for elf32_arm_stub_a8_veneer_blx.
9895
ffeef7df
ILT
98962010-01-07 Ian Lance Taylor <iant@google.com>
9897
dc3f80fe
ILT
9898 PR 10980
9899 * options.h (class General_options): Add --warn-unresolved-symbols
9900 and --error-unresolved-symbols.
9901 * errors.cc (Errors::undefined_symbol): Implement
9902 --warn-unresolved-symbols.
9903
ffeef7df
ILT
9904 * options.h (class General_options): Add -z text and -z textoff.
9905 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
9906
f1ec9ded
ST
99072010-01-06 Sriraman Tallam <tmsriram@google.com>
9908
9909 * gc.h (Garbage_collection::Cident_section_map): New typedef.
9910 (Garbage_collection::cident_sections): New function.
9911 (Garbage_collection::add_cident_section): New function.
9912 (Garbage_collection::cident_sections_): New member.
9913 (gc_process_relocs): Add references to sections whose names are C
9914 identifiers.
9915 * gold.h (cident_section_start_prefix): New constant.
9916 (cident_section_stop_prefix): New constant.
9917 (is_cident): New function.
9918 * layout.cc (Layout::define_section_symbols): Replace string constants
9919 with the newly defined constants.
9920 * object.cc (Sized_relobj::do_layout): Track sections whose names are
9921 C identifiers.
9922 * testsuite/Makefile.am: Add gc_orphan_section_test.
9923 * testsuite/Makefile.in: Regenerate.
9924 * testsuite/gc_orphan_section_test.cc: New file.
9925 * testsuite/gc_orphan_section_test.sh: New file.
9926
6eda8c29
ILT
99272010-01-06 Ian Lance Taylor <iant@google.com>
9928
b9674e17
ILT
9929 PR 10980
9930 * options.h (class General_options): Add --warn-shared-textrel.
9931 * layout.cc (Layout::finish_dynamic_section): Implement
9932 --warn-shared-textrel.
9933
6eda8c29
ILT
9934 PR 10980
9935 * options.h (class General_options): Add --warn-multiple-gp.
9936
32dcd44e
ILT
99372010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9938
9939 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9940 $(THREADSLIB) and $(LIBDL).
9941 * Makefile.in: Rebuild.
9942
a192ba05
ILT
99432010-01-06 Ian Lance Taylor <iant@google.com>
9944
9945 PR 10980
9946 * options.cc (General_options::parse_section_start): New function.
9947 (General_options::section_start): New function.
9948 (General_options::General_options): Initialize all members.
9949 * options.h: Include <map>
9950 (class General_options): Add --section-start. Add section_starts_
9951 member.
9952 * layout.cc (Layout::attach_allocated_section_to_segment): If
9953 --section-start was used, set the address of the segment. Remove
9954 local sort_sections.
9955 (Layout::relaxation_loop_body): If the address of the load segment
9956 has been set by --section-start, don't use it.
9957 * output.h (Output_segment::update_flags_for_output_section): New
9958 function.
9959 * output.cc (Output_segment::add_output_section): Call
9960 update_flags_for_output_section.
9961
dde3f402
ILT
99622010-01-05 Ian Lance Taylor <iant@google.com>
9963
62dfdd4d
ILT
9964 PR 10980
9965 * options.h (class General_options): Add --undefined-version.
9966 * script.cc (struct Version_expression): Add was_matched_by_symbol
9967 field.
9968 (Version_script_info::matched_symbol): New function.
9969 (Version_script_info::get_symbol_version_helper): Call
9970 matched_symbol.
9971 (Version_script_info::check_unmatched_names): New function.
9972 * script.h (class Version_script_info): Update declarations.
9973 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
9974
9c4ae156
ILT
9975 * options.h (class General_options): Use DEFINE_bool_alias for
9976 allow_multiple_definition.
9977 * resolve.cc (Symbol_table::should_override): Don't test
9978 allow_multiple_definition.
9979
dde3f402
ILT
9980 PR 10980
9981 * options.h (class General_options): Add --cref.
9982 * main.cc (main): Print cref table if --cref. Don't close mapfile
9983 until after printing cref table.
9984 * cref.cc: Include "symtab.h".
9985 (class Cref_inputs): Define Cref_table_compare and Cref_table.
9986 (Cref_table_compare::operator()): New function.
9987 (Cref_inputs::gather_cref): New function.
9988 (filecol): New static const.
9989 (Cref_inputs::print_cref): New function.
9990 (Cref::print_cref): New function.
9991 * cref.h: Include <cstdio>.
9992 (class Cref): Update declarations.
9993 * mapfile.h (Mapfile::file): New function.
9994 * object.h (class Object): Define Symbols. Declare virtual
9995 do_get_global_symbols.
9996 (Object::get_global_symbols): New function.
9997 * object.cc (Input_objects::add_object): Pass object to cref_ if
9998 --cref.
9999 (Input_objects::archive_start): Likewise.
10000 (Input_objects::archive_stop): Likewise.
10001 (Input_objects::print_cref): New function.
10002 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10003 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10004 --cref.
10005 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10006 function.
10007 * plugin.h (class Sized_pluginobj): Update declarations.
10008
8781f709
ILT
100092010-01-05 Ian Lance Taylor <iant@google.com>
10010
10011 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10012 to is_default_version. Rename insdef to insdefault.
10013 (Symbol_table::add_from_relobj): Rename def to is_default_version
10014 and local to is_forced_local.
10015 (Symbol_table::add_from_pluginobj): Likewise.
10016 (Symbol_table::add_from_dynobj): Likewise.
10017 (Symbol_table::define_special_symbol): Rename insdef to
10018 insdefault.
10019
fe35d28d
ILT
100202010-01-04 Ian Lance Taylor <iant@google.com>
10021
30bc8c46
ILT
10022 PR 10980
10023 * options.h (class General_options): Add
10024 --allow-multiple-definition and -z muldefs.
10025 * resolve.cc (Symbol_table::should_override): Don't warn about a
10026 multiple symbol definition if --allow-multiple-definition or -z
10027 muldefs.
10028
7eaea549
ILT
10029 PR 10980
10030 * options.h (class General_options): Add --add-needed and
10031 --copy-dt-needed-entries. Tweak --as-needed help entry.
10032 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10033 error if --copy-dt-needed-entries aka --add-needed is used and
10034 would cause a change in behaviour.
10035
fe35d28d
ILT
10036 PR 10980
10037 * options.h (class General_options): Add -G as a short version of
10038 --shared. Add no-op options -assert, -g, and -i.
10039
55a2bb35
ST
100402010-01-04 Sriraman Tallam <tmsriram@google.com>
10041
10042 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10043 check for .text or .gnu.linkonce.t sections.
10044 * icf.cc (Icf::find_identical_sections): Ditto.
10045 Change the detection for mangled function name within the section
10046 name.
10047 * icf.h (is_section_foldable_candidate): New function.
10048
719328e1
ILT
100492009-12-30 Ian Lance Taylor <iant@google.com>
10050
10051 PR 10980
10052 * options.h (class General_options): Permit two dashes with
10053 --retain-symbols-file.
10054
d7bb5745
ILT
100552009-12-30 Ian Lance Taylor <iant@google.com>
10056
403a15dd
ILT
10057 PR 10979
10058 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10059 don't put the file header and segment headers in the text
10060 segment.
10061
eda294df
ILT
10062 PR 10979
10063 * common.cc (Sort_commons::operator()): Stabilize sort when both
10064 entries are NULL.
10065 (Symbol_table::do_allocate_commons_list): When allocating common
10066 symbols, skip a symbol which is no longer common.
10067 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10068 an object before checking its type.
10069 * testsuite/common_test_2.c: New file.
10070 * testsuite/common_test_3.c: New file.
10071 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10072 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10073 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10074 (common_test_2_pic.o, common_test_2.so): New targets.
10075 (common_test_3_pic.o, common_test_3.so): New targets.
10076 * testsuite/Makefile.in: Rebuild.
10077
d7bb5745
ILT
10078 PR 10979
10079 * script.cc (read_input_script): If we see a new SECTIONS clause,
10080 and we have added an input section, give an error.
10081 * layout.h (class Layout): Add have_added_input_section function.
10082 Add have_added_input_section_ field.
10083 * layout.cc (Layout::Layout): Initialize
10084 have_added_input_section_.
10085 (Layout::layout): Set have_added_input_section_.
10086 (Layout::layout_eh_frame): Likewise.
10087
fc59c572
ILT
100882009-12-30 Ian Lance Taylor <iant@google.com>
10089
10090 PR 10931
10091 * options.h (class General_options): Add --sort-common option.
10092 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10093 * common.cc (Sort_common): Add sort_order parameter to
10094 constructor. Add sort_order_ field.
10095 (Sort_commons::operator): Check sort_order_.
10096 (Symbol_table::allocate_commons): Determine the sort order.
10097 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10098 Change all callers.
10099 (Symbol_table::do_allocate_commons_list): Likewise.
10100
1c74fab0
ILT
101012009-12-30 Ian Lance Taylor <iant@google.com>
10102
10103 PR 10916
10104 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10105 symbols from this object, don't change the visibility of an
10106 undefined symbol.
10107 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10108
6affe781
ILT
101092009-12-30 Ian Lance Taylor <iant@google.com>
10110
10111 PR 10861
10112 * script.h (class Version_script_info): Define Language enum.
10113 Update declarations. Define Glob, Exact, and Lookup types. Add
10114 new fields globals_, locals_, and is_finalized_.
10115 * script.cc: Various formatting fixes.
10116 (class Parser_closure): Change language_stack_ from a vector of
10117 std::string to one of Version_script_info::Language. Adjust all
10118 uses accordingly.
10119 (class Lazy_demangler): Remove.
10120 (struct Version_expression): Change language from std::string to
10121 Version_script_info::Language.
10122 (Version_script_info::Version_script_info): New function.
10123 (Version_script_info::~Version_script_info): Don't call clear.
10124 (Version_script_info::finalize): New function.
10125 (Version_script_info::build_lookup_tables): New function.
10126 (Version_script_info::build_expression_list_lookup): New
10127 function.
10128 (Version_script_info::get_symbol_version_helper): Rewrite to use
10129 lookup tables.
10130 (Version_script_info::print_expression_list): Adjust to use
10131 Version_script_info::Language.
10132 (script_push_lex_into_version_mode): Check that the version script
10133 has not been finalized.
10134 (version_script_push_lang): Change language string to
10135 Version_script_info::Language.
10136 * options.cc (Command_line::version_script): New function.
10137 * options.h (class General_options): Add finalize_dynamic_list
10138 function. Change version_script from declaration to definition.
10139 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10140 * testsuite/version_script.map: Remove duplicate def of foo.
10141 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10142 version_script.map.
10143 * testsuite/Makefile.in: Rebuild.
10144
818bf354
ILT
101452009-12-30 Ian Lance Taylor <iant@google.com>
10146
10147 PR 10843
10148 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10149 if the input symbol index is 0, make the output symbol index 0.
10150
ebcc8304
ILT
101512009-12-30 Ian Lance Taylor <iant@google.com>
10152
10153 PR 10670
10154 * options.h (class General_options): Add -x/--discard-all.
10155 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10156 --discard-all. If the local symbol needs a dynamic entry, check
10157 that before handling --discard-locals.
10158
176fe33f
ILT
101592009-12-30 Ian Lance Taylor <iant@google.com>
10160
bb321bb1
ILT
10161 PR 10450
10162 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10163 flags to PF_R.
10164 (Output_segment::add_output_section): Don't change the flags if
10165 the type is PT_TLS.
10166
176fe33f
ILT
10167 PR 10450
10168 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10169 GNU hash table if they need a dynamic value. Otherwise, don't add
10170 them if they are defined in a dynamic object or are forced local.
10171
e8cd95c7
ILT
101722009-12-29 Ian Lance Taylor <iant@google.com>
10173
1b81fb71
ILT
10174 PR 10450
10175 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10176 .gnu.hash table for a 32-bit target.
10177
8d6d383d
ILT
10178 PR 10450
10179 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10180 regular and a dynamic object only needs a dynamic symbol table
10181 entry if it is externally visible.
10182
e785ec03
ILT
10183 PR 10450
10184 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10185 constructor. Add global_offset_table_ field.
10186 (Target_i386::got_section): Set global_offset_table_.
10187 (Target_i386::do_finalize_sections): Set global_offset_table_
10188 size.
10189 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10190 in constructor. Add global_offset_table_ field.
10191 (Target_x86_64::got_section): Set global_offset_table_.
10192 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10193 size.
10194
1a2dff53
ILT
10195 * layout.cc (Layout::Layout): Initialize increase_relro_.
10196 (Layout::get_output_section): Add is_relro, is_last_relro, and
10197 is_first_non_relro parameters. Change all callers.
10198 (Layout::choose_output_section): Likewise.
10199 (Layout::add_output_section_data): Likewise.
10200 (Layout::make_output_section): Likewise.
10201 (Layout::set_segment_offsets): Clear increase_relro when using a
10202 linker script.
10203 * layout.h (class Layout): Add increase_relro method. Add
10204 increase_relro_ field. Update declarations.
10205 * output.cc (Output_section::Output_section): Initialize
10206 is_last_relro_ and is_first_non_relro_.
10207 (Output_segment::add_output_section): Group relro sections is
10208 do_sort is true. Handle is_last_relro and is_first_non_relro.
10209 (Output_segment::maximum_alignment): Remove relro handling.
10210 (Output_segment::set_section_addresses): Add increase_relro
10211 parameter. Change all callers. Add initial alignment to align
10212 relro sections on separate page. Remove old relro handling.
10213 (Output_segment::set_section_list_addresses): Remove in_relro
10214 parameter. Change all callers.
10215 (Output_segment::set_offset): Add increase parameter. Change all
10216 callers. Remove old relro handling.
10217 * output.h (class Output_section): Add new methods: is_last_relro,
10218 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10219 Add is_last_relro_ and is_first_non_relro_ fields.
10220 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10221 Create separate .got.plt section. Call increase_relro.
10222 * x86_64.cc (Target_x86_64::got_section): Likewise.
10223 * testsuite/relro_script_test.t: Add .got.plt.
10224
f0ba79e2
ILT
10225 PR 10450
10226 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10227 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10228 (Layout::finalize): Call set_dynamic_symbol_size.
10229 (Layout::set_dynamic_symbol_size): New function.
10230 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10231 set_dynamic_symbol_size.
10232
e8cd95c7
ILT
10233 PR 10450
10234 * output.h (class Output_section): Add is_entsize_zero_ field.
10235 * output.cc (Output_section::Output_section): Initialize
10236 is_entsize_zero_.
10237 (Output_section::set_entsize): If two different entsizes are
10238 requested, force it to zero.
10239 (Output_section::add_input_section): Set flags for .debug_str
10240 before updating section flags. Set entsize.
10241 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10242 and SHF_STRING if all input sections have those flags.
10243
3e1b9a8a
RÁE
102442009-12-29 Rafael Espindola <espindola@google.com>
10245
10246 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10247 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10248 reporting.
3e1b9a8a 10249
3dcad376
ST
102502009-12-29 Sriraman Tallam <tmsriram@google.com>
10251
10252 * options.cc (General_options::parse_version): Allow -v to exit
10253 without an error if there is nothing to link.
10254
084e2665
ILT
102552009-12-29 Ian Lance Taylor <iant@google.com>
10256
10257 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10258 using a version of gcc before 4.1.
10259 * configure: Rebuild.
10260
250acde3
CD
102612009-12-28 Chris Demetriou <cgd@google.com>
10262
10263 * attributes.cc (Output_attributes_section_data::do_write): Use
10264 std::vector::front rather than std::vector::data.
10265
99fff23b
ILT
102662009-12-28 Ian Lance Taylor <iant@google.com>
10267
10268 * symtab.h (class Symbol_table): Add enum Defined.
10269 * resolve.cc (Symbol_table::should_override): Add defined
10270 parameter. Change all callers. Test whether object is NULL
10271 before calling a method on it.
10272 (Symbol_table::report_resolve_problem): Add defined parameter.
10273 Change all callers.
10274 (Symbol_table::should_override_with_special): Likewise.
10275 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10276 parameter. Change all callers.
10277 (Symbol_table::do_define_in_output_data): Likewise.
10278 (Symbol_table::define_in_output_segment): Likewise.
10279 (Symbol_table::do_define_in_output_segment): Likewise.
10280 (Symbol_table::define_as_constant): Likewise.
10281 (Symbol_table::do_define_as_constant): Likewise.
10282 * script.h (class Symbol_assignment): Add is_defsym parameter to
10283 constructor; change all callers.
10284 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10285 parameter. Change all callers. Add is_defsym_ field.
10286 (class Parser_closure): Add parsing_defsym parameter to
10287 constructor; change all callers. Add parsing_defsym accessor
10288 function. Add parsing_defsym_ field.
10289
556bd683
ILT
102902009-12-28 Ian Lance Taylor <iant@google.com>
10291
10292 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10293 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10294
1782c879
ILT
102952009-12-23 Ian Lance Taylor <iant@google.com>
10296
10297 * i386.cc (Target_i386::do_calls_non_split): Recognize
10298 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10299 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10300 -fsplit-stack prologue when using %r11.
1782c879 10301
329ca2b1
ST
103022009-12-21 Sriraman Tallam <tmsriram@google.com>
10303
10304 * options.cc (General_options::parse_version): Make -v continue and do
10305 the link like GNU ld does.
10306
d675ff46
RÁE
103072009-12-17 Rafael Avila de Espindola <espindola@google.com>
10308
10309 * Makefile.am (CCFILES): Add timer.cc.
10310 (HFILES): Add timer.h.
10311 * configure.ac: Check for sysconf and times.
10312 * main.cc: include timer.h.
10313 (main): Use Timer instead of get_run_time.
10314 * timer.cc: New.
10315 * timer.h: New.
10316 * workqueue.cc: include timer.h.
10317 (Workqueue::find_and_run_task):
10318 Report user, sys and wall time.
10319 * Makefile.in: Regenerate.
10320 * config.in: Regenerate.
10321 * configure: Regenerate.
10322
d6344fb5
DK
103232009-12-16 Doug Kwan <dougkwan@google.com>
10324
10325 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10326 sections.
10327 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10328 relaxed input sections.
10329 * output.cc (Output_section::find_relaxed_input_section): Change
10330 return type to Output_relaxed_input_section pointer. Adjust code
10331 for new type of relaxed_input_section_map_.
10332 * output.h (Output_section::find_relaxed_input_section): Change
10333 return type to Output_relaxed_input_section pointer.
10334 (Output_section::Output_relaxed_input_section_by_input_section_map):
10335 New type.
10336 (Output_section::relaxed_input_section_map_): Change type to
10337 Output_section::Output_relaxed_input_section_by_input_section_map.
10338 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10339 input section.
10340
0e0d5469
ILT
103412009-12-15 Ian Lance Taylor <iant@google.com>
10342
10343 * layout.cc (Layout::create_shstrtab): Only write out after input
10344 sections if we are compressing debug sections.
10345
0649a889
ILT
103462009-12-15 Ian Lance Taylor <iant@google.com>
10347
10348 * archive.cc (Archive::add_symbols): Only look up a symbol without
10349 a version if there is, in fact, a version.
10350
2ea97941
ILT
103512009-12-14 Ian Lance Taylor <iant@google.com>
10352
10353 Revert -Wshadow changes, all changes from:
10354 2009-12-11 Doug Kwan <dougkwan@google.com>
10355 2009-12-11 Nick Clifton <nickc@redhat.com>
10356 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10357
b0eec2cc
DK
103582009-12-11 Doug Kwan <dougkwan@google.com>
10359
10360 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10361 due to -Wshadow.
10362 * attributes.cc (Object_attribute::size): Ditto.
10363 (Attributes_section_data::size): Ditto.
10364 (Attributes_section_data::Attributes_section_data): Ditto.
10365 (Output_attributes_section_data::do_write): Ditto.
10366 * attributes.h (Object_attribute::set_type): Ditto.
10367 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10368
91d6fa6a
NC
103692009-12-11 Nick Clifton <nickc@redhat.com>
10370
10371 * archive.cc: Fix shadowed variable warnings.
10372 * arm.cc: Likewise.
10373 * compressed_output.cc: Likewise.
10374 * compressed_output.h: Likewise.
10375 * configure: Likewise.
10376 * dwarf_reader.cc: Likewise.
10377 * dynobj.cc: Likewise.
10378 * dynobj.h: Likewise.
10379 * ehframe.cc: Likewise.
10380 * ehframe.h: Likewise.
10381 * errors.cc: Likewise.
10382 * expression.cc: Likewise.
10383 * fileread.cc: Likewise.
10384 * fileread.h: Likewise.
10385 * freebsd.h: Likewise.
10386 * i386.cc: Likewise.
10387 * icf.cc: Likewise.
10388 * incremental.h: Likewise.
10389 * layout.cc: Likewise.
10390 * layout.h: Likewise.
10391 * mapfile.cc: Likewise.
10392 * merge.cc: Likewise.
10393 * merge.h: Likewise.
10394 * object.cc: Likewise.
10395 * object.h: Likewise.
10396 * options.h: Likewise.
10397 * output.cc: Likewise.
10398 * output.h: Likewise.
10399 * parameters.cc: Likewise.
10400 * plugin.cc: Likewise.
10401 * powerpc.cc: Likewise.
10402 * reduced_debug_output.cc: Likewise.
10403 * reduced_debug_output.h: Likewise.
10404 * reloc.cc: Likewise.
10405 * reloc.h: Likewise.
10406 * resolve.cc: Likewise.
10407 * script-sections.cc: Likewise.
10408 * script.cc: Likewise.
10409 * script.h: Likewise.
10410 * sparc.cc: Likewise.
10411 * symtab.cc: Likewise.
10412 * symtab.h: Likewise.
10413 * target-select.cc: Likewise.
10414 * target-select.h: Likewise.
10415 * token.h: Likewise.
10416 * workqueue.cc: Likewise.
10417 * workqueue.h: Likewise.
10418 * x86_64.cc: Likewise.
10419
a0351a69
DK
104202009-12-10 Doug Kwan <dougkwan@google.com>
10421
10422 * arm.cc (attributes.h): New include.
10423 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10424 (Arm_relobj::~Arm_relobj): Delete object pointed by
10425 attributes_section_data_.
10426 (Arm_relobj::attributes_section_data): New method definition.
10427 (Arm_relobj::attributes_section_data_): New data member declaration.
10428 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10429 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10430 attributes_section_data_.
10431 (Arm_dynobj::attributes_section_data): New method definition.
10432 (Arm_dynobj::attributes_section_data_): New data member declaration.
10433 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10434 initialization value of may_use_blx_ to false.
2e702c99 10435 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10436 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10437 object attributes to compute results instead of hard-coding.
10438 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10439 Target_arm::get_secondary_compatible_arch,
10440 Target_arm::set_secondary_compatible_arch
10441 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10442 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10443 New method declarations.
10444 (Target_arm::get_aeabi_object_attribute): New method definition.
10445 (Target_arm::attributes_section_data_): New data member declaration.
10446 (read_arm_attributes_section): New template definition.
10447 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10448 (Arm_dynobj::do_read_symbols): Ditto.
10449 (Target_arm::do_finalize_sections): Merge attributes sections from
10450 input. Check for BLX use after attributes section merging.
10451 Fix __exidx_start and __exidx_end visibility. Create an
10452 .ARM.attributes section if necessary.
10453 (Target_arm::get_secondary_compatible_arch,
10454 Target_arm::set_secondary_compatible_arch,
10455 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10456 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10457 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10458 New method definitions.
10459
b59befec
ILT
104602009-12-09 Ian Lance Taylor <iant@google.com>
10461
10462 * plugin.cc (Plugin::load): Don't cast from void* to a function
10463 pointer.
10464
1276bc89
ILT
104652009-12-09 Ian Lance Taylor <iant@google.com>
10466
10467 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10468 information fields.
10469
2f2de248
L
104702009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10471
10472 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10473 Replace two_file_shared_1.so with two_file_shared_2.so.
10474 * testsuite/Makefile.in: Regenerated.
10475
4f787271
DK
104762009-12-08 Doug Kwan <dougkwan@google.com>
10477
10478 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10479 (HFILES): Add attributes.h and int_encoding.h.
10480 * Makefile.in: Regenerate.
10481 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10482 function definitions to int_encoding.cc
10483 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10484 prototypes to int_encoding.h
10485 * reduced_debug_output.cc (int_encoding.h): New include.
10486 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10487 function definitions to int_encoding.cc
10488 (insert_into_vector, read_from_pointer): Move template definitions to
10489 int_encoding.h
10490 * attributes.cc: New file.
10491 * attributes.h: New file.
10492 * int_encoding.cc: New file.
10493 * int_encoding.h: New file.
10494
20b52f1a
RÁE
104952009-12-07 Rafael Avila de Espindola <espindola@google.com>
10496
10497 PR gold/11055
10498 * incremental-dump.cc (dump_incremental_inputs): New.
10499 (main): Use dump_incremental_inputs.
10500
53d7974c
L
105012009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10502
10503 PR gold/10893
10504 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10505 checking elfcpp::STT_FUNC.
10506 (Target_i386::Relocate::relocate): Likewise.
10507 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10508
10509 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10510 symbols from shared libraries into normal FUNC symbols.
10511
10512 * symtab.h (Symbol): Add is_func and use it.
10513
05a352e6
DK
105142009-12-05 Doug Kwan <dougkwan@google.com>
10515
10516 * arm.cc (Target_arm::arm_info): Initialize new fields
10517 attributes_section and attributes_vendor.
10518 * i386.cc (Target_i386::i386_info): Same.
10519 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10520 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10521 fields attributes_section and attributes_vendor.
53d7974c 10522 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
10523 * target.h (Target::attributes_section, Target::attributes_vendor,
10524 Target::is_attributes_section, Target::attribute_arg_type,
10525 Target::attributes_order): New method definitions.
10526 (Target::Target_info::attributes_section,
10527 Target::Target_info::attributes_vendor): New fields.
10528 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10529 virtual method definitions.
10530 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10531 attributes_section and attributes_vendor.
10532 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10533
f4e5969c
DK
105342009-12-05 Doug Kwan <dougkwan@google.com>
10535
10536 * arm.cc: Update comments about interworking and stub generation.
10537 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10538 considered as non-PIC.
10539 (Arm_relocate_functions::base_abs): Fix formatting.
10540 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10541 of function to use GOT entry address instead of offset.
10542 (Target_arm::Scan::global): Issue an error if a symbol would need a
10543 PLT does not get one because it is untyped. Remove code to create
10544 dynamic symbols for relative branches.
10545 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10546 takes unsigned integer instead of boolean.
10547
1abce4a6
L
105482009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10549
10550 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10551 (two_file_test_LDADD): Likewise.
10552 (common_test_1_LDADD): Likewise.
10553 (exception_test_LDADD) Likewise.
10554 (weak_test_LDADD): Likewise.
10555 (many_sections_test_LDADD): Likewise.
10556 (initpri1_LDADD): Likewise.
10557 (script_test_1_LDADD): Likewise.
10558 (script_test_2_LDADD): Likewise.
10559 (justsyms_LDADD): Likewise.
10560 (binary_test_LDADD): Likewise.
10561 (large_LDADD): Likewise.
10562 * testsuite/Makefile.in: Regenerated.
10563
adcf2816 105642009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 10565
adcf2816
L
10566 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10567 (Symbol_table::override_with_special): Likewise.
10568 (Symbol_table::add_from_object): Likewise.
10569
28e67f5d
RÁE
105702009-12-04 Rafael Avila de Espindola <espindola@google.com>
10571
10572 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10573 Don't set the data_offset twice.
10574
ae10a101
RÁE
105752009-12-04 Rafael Avila de Espindola <espindola@google.com>
10576
10577 * testsuite/Makefile.in: Regenerate.
10578
f59f41f3
DK
105792009-12-03 Doug Kwan <dougkwan@google.com>
10580
10581 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10582 (Target_arm::do_finalize_sections): Add parameter for symbol table
10583 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10584 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10585 parameter for symbol table pointer.
10586 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10587 an additional parameter for a pointer to symbol table.
10588 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10589 parameter for a symbol table pointer.
10590 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10591 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10592 Ditto.
10593 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10594 parameter for a symbol table pointer.
10595
ca55d848
RÁE
105962009-12-03 Rafael Avila de Espindola <espindola@google.com>
10597
10598 * incremental.cc (Incremental_inputs_header)
10599 (Incremental_inputs_header_write, Incremental_inputs_entry)
10600 (Incremental_inputs_entry_write): Move ...
10601 * incremental.h (Incremental_inputs_header)
10602 (Incremental_inputs_header_write, Incremental_inputs_entry)
10603 (Incremental_inputs_entry_write): here.
10604
3aec4f9c
RÁE
106052009-12-02 Rafael Avila de Espindola <espindola@google.com>
10606
10607 * incremental.cc (make_sized_incremental_binary): Set the target.
10608 Error if it is incompatible.
10609 * output.h (Output_file): Add filename method.
10610
9c0ae74d
RÁE
106112009-12-02 Rafael Avila de Espindola <espindola@google.com>
10612
10613 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10614 from the get_* methods.
10615
a45500ae
RÁE
106162009-12-02 Rafael Avila de Espindola <espindola@google.com>
10617
10618 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10619 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10620 Write 0 for the data_offset of scripts.
10621
325e6408
RÁE
106222009-12-02 Rafael Avila de Espindola <espindola@google.com>
10623
10624 * testsuite/Makefile.am: Add the incremental_test.sh test.
10625 * testsuite/incremental_test.sh: New.
10626 * testsuite/incremental_test_1.c: New.
10627 * testsuite/incremental_test_2.c: New.
10628
954c3e2e
RÁE
106292009-12-01 Rafael Avila de Espindola <espindola@google.com>
10630
703d02da 10631 * incremental-dump.cc (main): Fix typos.
954c3e2e 10632
f8086623
RÁE
106332009-11-27 Rafael Avila de Espindola <espindola@google.com>
10634
10635 PR gold/11025
10636 * incremental-dump.cc (main): Use llu to print 64 bit values.
10637
3b0dd6ac
L
106382009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10639 H.J. Lu <hongjiu.lu@intel.com>
10640
10641 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10642 $(LIBDL).
10643 (incremental_dump_LDADD): Likewise.
10644 * Makefile.in: Regenerated.
10645
a6d1ef57 106462009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 10647
a6d1ef57
DK
10648 Revert:
10649
10650 2009-11-25 Doug Kwan <dougkwan@google.com>
10651
10652 * arm.cc (Target_arm::Target_arm): Move method definition
10653 outside of class definition. Add code to handle
10654 --target1-rel, --target1-abs and --target2= options.
10655 (Target_arm::get_reloc_reloc_type): Change method to be
10656 non-static and const.
10657 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10658 New data member declaration.
10659 (Target_arm::Scan::local, Target_arm::Scan::global,
10660 Target_arm::Relocate::relocate,
10661 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10662 Adjust call to Target_arm::get_real_reloc_type.
10663 (Target_arm::get_real_reloc_type): Use command line options
10664 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10665 * options.h (--target1-rel, --target1-abs, --target2): New
10666 ARM-only options.
10667
50aeb7d4
DK
106682009-11-25 Doug Kwan <dougkwan@google.com>
10669
10670 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10671 class definition. Add code to handle --target1-rel, --target1-abs
10672 and --target2= options.
10673 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10674 and const.
10675 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10676 member declaration.
10677 (Target_arm::Scan::local, Target_arm::Scan::global,
10678 Target_arm::Relocate::relocate,
10679 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10680 call to Target_arm::get_real_reloc_type.
10681 (Target_arm::get_real_reloc_type): Use command line options to
10682 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10683 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10684 options.
10685
51938283
DK
106862009-11-25 Doug Kwan <dougkwan@google.com>
10687
10688 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10689 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10690 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10691 formatting.
10692 (Arm_relocate_functions::thm_call): Replace body with a call to
10693 Arm_relocate_functions::thumb_branch_common.
10694 (Arm_relocate_functions::thm_jump24,
10695 Arm_relocate_functions::thm_xpc22): New method definitions.
10696 (Arm_relocate_functions::thumb_branch_common): New method definition.
10697 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10698 operator.
10699 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10700 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10701
e2b8f3c4
RÁE
107022009-11-24 Rafael Avila de Espindola <espindola@google.com>
10703
10704 * Makefile.am: Build incremental-dump
10705 * Makefile.in: Regenerate.
10706 * incremental-dump.cc: New.
10707 * incremental.cc (Incremental_inputs_header_data,
10708 Incremental_inputs_entry_data): Move to incremental.h
10709 * incremental.h: (Incremental_inputs_header_data,
10710 Incremental_inputs_entry_data): Move from incremental.cc
10711
bcba9aec
RÁE
107122009-11-24 Rafael Avila de Espindola <espindola@google.com>
10713
10714 * incremental.cc (Incremental_inputs_header,
10715 Incremental_inputs_header_write, Incremental_inputs_entry,
10716 Incremental_inputs_entry_write): Add a typedef with the data type.
10717
7c3afe08
RÁE
107182009-11-24 Rafael Avila de Espindola <espindola@google.com>
10719
10720 * incremental.cc (Incremental_inputs_header,
10721 Incremental_inputs_header_write, Incremental_inputs_entry,
10722 Incremental_inputs_entry_write): Update comment about which
10723 type has the filed descriptions.
10724
d204b6e9
DK
107252009-11-15 Doug Kwan <dougkwan@google.com>
10726
10727 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
10728 (Arm_relocate_functions::arm_branch_common): Change method defintion
10729 in class definition to a method declaration and update list of formal
10730 parameters.
10731 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
10732 Arm_relocation_functions::jump24): Adjust call to
10733 Arm_relocate_functions::arm_branch_common. Update list of formal
10734 parameters.
10735 (Arm_relocate_functions::xpc25): New method definition.
10736 (Arm_relocate_functions::arm_branch_common): Move method defintion
10737 out from class definition. Use stubs for mode-switching and extending
10738 branch ranges.
10739 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
10740 specially. Change code to enable use of stubs in ARM branches.
10741
43d12afe
DK
107422009-11-10 Doug Kwan <dougkwan@google.com>
10743
10744 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
10745 in method declaration.
10746 (Target_arm::relocate_stub): New method declaration.
10747 (Target_arm::default_target): Change to return a pointer instead of
10748 a const reference.
10749 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
10750 Target_arm::default_target.
10751 (Arm_Relobj::do_relocate_sections): Remove options paramater in
10752 method definition.
10753 (Target_arm::relocate_section): Adjust view.
10754 (Target_arm::relocate_stub): New method definition.
10755
ac33a407
DK
107562009-11-10 Doug Kwan <dougkwan@google.com>
10757
10758 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
10759 a format warning.
10760 * incremental.cc (open_incremental_binary): Initialized local
10761 variables to avoid warnings.
10762 * object.cc (make_elf_object): Ditto.
10763 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
10764 a format warning.
e1df38aa 10765
88ee28e9
L
10766009-11-09 H.J. Lu <hongjiu.lu@intel.com>
10767
10768 PR gold/10930
10769 * testsuite/plugin_test.c: Include "config.h".
10770
2daedcd6
DK
107712009-11-09 Doug Kwan <dougkwan@google.com>
10772
10773 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
10774 (arm_symbol_value): Remove.
10775 (Arm_relocate_functions::arm_branch_common,
10776 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
10777 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
10778 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
10779 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
10780 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
10781 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
10782 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
10783 Arm_relocate_functions::thm_mobw_abs_nc,
10784 Arm_relocate_functions::thm_mov_abs,
10785 Arm_relocate_functions::movw_prel_nc,
10786 Arm_relocate_functions::thm_movt_abs,
10787 Arm_relocate_functions::movt_prel,
10788 Arm_relocate_functions::thm_movw_prel_nc,
10789 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
10790 (Target_arm::Relocate::relocate): Only decompose address into two
10791 parts if relocation type uses the thumb-bit and pass the actual
10792 bit instead of a flag indicating that the thumb-bit is used. Adjust
10793 calls to methods in Arm_relocate_functions for this change.
10794
1276bc89 107952009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
10796
10797 PR 10925
10798 * reloc.cc: Instantiate
10799 Sized_relobj::initialize_input_to_output_maps and
10800 Sized_relobj:free_input_to_output_maps.
10801
e53ad1b5
ILT
108022009-11-06 Ian Lance Taylor <iant@google.com>
10803
10804 PR 10876
10805 * defstd.cc (in_segment): Set only_if_ref true for "end".
10806
eb44217c
DK
108072009-11-06 Doug Kwan <dougkwan@google.com>
10808
10809 * arm.cc (class Reloc_stub): Correct a comment.
10810 (Target_arm::Target_arm): Initialize arm_input_section_map_.
10811 (Target_arm::scan_section_for_stubs): New method declaration.
10812 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
10813 Change methods from private to protected.
10814 (Target_arm::do_may_relax): New method definition.
10815 (Target_arm::do_relax, Target_arm::group_sections,
10816 Target_arm::scan_reloc_for_stub,
10817 Target_arm::scan_reloc_section_for_stubs): New method declarations.
10818 (Target_arm::arm_input_section_map_): New data member declaration.
10819 (Target_arm::scan_reloc_for_stub,
10820 Target_arm::scan_reloc_section_for_stubs,
10821 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
10822 Target_arm::do_relax): New method definitions.
10823
5d329b7d
ILT
108242009-11-06 Mikolaj Zalewski <mikolaj@google.com>
10825
10826 * configure.ac: Check for (struct stat)::st_mtim
10827 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
10828 * config.in: Regenerate.
10829 * configure: Regenerate.
10830
96a0d71b
ILT
108312009-11-05 Ian Lance Taylor <iant@google.com>
10832
10833 PR 10910
10834 * output.cc (Output_segment::add_output_section): Add missing
10835 return statement.
10836
594c8e5e
ILT
108372009-11-04 Ian Lance Taylor <iant@google.com>
10838
10839 PR 10880
10840 * object.h (class Object): Add is_needed and set_is_needed
10841 methods. Add is_needed_ field. Make bool fields into bitfields.
10842 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
10843 defined in a dynamic object and referenced by a regular object,
10844 set is_needed for the dynamic object.
10845 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
10846 if the file is marked with as_needed and it is not needed.
10847
22b127cc
ILT
108482009-11-04 Ian Lance Taylor <iant@google.com>
10849
10850 PR 10887
10851 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
10852 tags if data is discarded by linker script.
10853 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10854 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10855 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10856 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10857
f5c870d2
ILT
108582009-11-04 Ian Lance Taylor <iant@google.com>
10859
10860 * layout.cc (Layout::get_output_section): Add is_interp and
10861 is_dynamic_linker_section parameters. Change all callers.
10862 (Layout::choose_output_section): Likewise.
10863 (Layout::make_output_section): Likewise.
10864 (Layout::add_output_section_data): Add is_dynamic_linker_section
10865 parameter. Change all callers.
10866 * layout.h (class Layout): Update declarations.
10867 * output.h (class Output_section): Add is_interp, set_is_interp,
10868 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
10869 Add is_interp_, is_dynamic_linker_section_ fields. Change
10870 generate_code_fills_at_write_ to a bitfield.
10871 * output.cc (Output_section::Output_sections): Initialize new
10872 fields.
10873 (Output_segment::add_output_section): Add do_sort parameter.
10874 Change all callers.
10875
1ae4d23b
ILT
108762009-11-03 Ian Lance Taylor <iant@google.com>
10877
10878 PR 10860
10879 * options.h (class General_options): Add --warn-common.
10880 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
10881 merging two common symbols.
10882 (Symbol_table::should_override): Handle --warn-common when merging
10883 a common symbol with a defined symbol. Use report_resolve_problem
10884 for multiple definitions.
10885 (Symbol_table::report_resolve_problem): New function.
10886 * symtab.h (class Symbol_table): Declare report_resolve_problem.
10887
55da9579
DK
108882009-11-03 Doug Kwan <dougkwan@google.com>
10889
10890 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
10891 stub_factory_.
10892 (Target_arm::stub_factory): New method definition.
10893 (Target_arm::new_arm_input_section,
10894 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
10895 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 10896 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
10897 New type definitions.
10898 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
10899 member declarations.
10900 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
10901 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
10902 New method definitions.
10903
37a9ac43
ILT
109042009-11-03 Ian Lance Taylor <iant@google.com>
10905
10906 * options.h (class General_options): Add --warn_constructors.
10907
b3d6a3d4
ILT
109082009-11-03 Ian Lance Taylor <iant@google.com>
10909
10910 PR 10893
10911 * defstd.cc (in_section): Add entries for __rel_iplt_start,
10912 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
10913
934b01dd
ILT
109142009-11-03 Ian Lance Taylor <iant@google.com>
10915
10916 PR 10895
10917 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
10918 --msgid-bugs-address.
10919 (install-pdf): New target.
10920 (install-data_yes): Look up one directory to find mkinstalldirs.
10921
03c1939b
L
109222009-11-03 H.J. Lu <hongjiu.lu@intel.com>
10923
10924 * po/Make-in (.po.gmo): Don't generate .gmo files in source
10925 tree.
10926
ebd95253
DK
109272009-10-30 Doug Kwan <dougkwan@google.com>
10928
10929 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10930
e9bbb538
DK
109312009-10-30 Doug Kwan <dougkwan@google.com>
10932
10933 * arm.cc (Stub_addend_reader): New struct template definition
10934 and partial specializations.
10935 (Stub_addend_reader::operator()): New method definition for a
10936 partially specialized template.
10937
d5b40221
DK
109382009-10-30 Doug Kwan <dougkwan@google.com>
10939
10940 * arm.cc (Arm_relobj::processor_specific_flags): New method
10941 definition.
10942 (Arm_relobj::do_read_symbols): New method declaration.
10943 (Arm_relobj::processor_specific_flags_): New data member declaration.
10944 (Arm_dynobj): New class definition.
10945 (Target_arm::do_finalize_sections): Add input_objects parameter.
10946 (Target_arm::do_adjust_elf_header): New method declaration.
10947 (Target_arm::are_eabi_versions_compatible,
10948 (Target_arm::merge_processor_specific_flags): New method declaration.
10949 (Target_arm::do_make_elf_object): New overloaded method definitions
10950 and declaration.
10951 (Arm_relobj::do_read_symbols): New method definition.
10952 (Arm_dynobj::do_read_symbols): Ditto.
10953 (Target_arm::do_finalize_sections): Add input_objects parameters.
10954 Merge processor-specific flags from all input objects.
10955 (Target_arm::are_eabi_versions_compatible,
10956 Target_arm::merge_processor_specific_flags,
10957 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10958 New method definitions.
10959 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10960 Input_objects pointer type parameter.
10961 * layout.cc (Layout::finalize): Pass input objects to target's.
10962 finalize_sections function.
10963 * output.cc (Output_file_header::do_sized_write): Set ELF file
10964 header's processor-specific flags.
10965 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
10966 Input_objects pointer type parameter.
10967 * sparc.cc (Target_sparc::do_finalize_sections): Same.
10968 * target.h (Input_objects): New forward class declaration.
10969 (Target::processor_specific_flags,
10970 Target::are_processor_specific_flags_sect): New method definitions.
10971 (Target::finalize_sections): Add input_objects parameter.
10972 (Target::Target): Initialize processor_specific_flags_ and
10973 are_processor_specific_flags_set_.
10974 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
10975 parameter.
10976 (Target::set_processor_specific_flags): New method definition.
10977 (Target::processor_specific_flags_,
10978 Target::are_processor_specific_flags_set_): New data member
10979 declarations.
10980 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
10981 Input_objects pointer type parameter.
10982
ebabffbd
DK
109832009-10-30 Doug Kwan <dougkwan@google.com>
10984
10985 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
10986
ad0f2072
ILT
109872009-10-28 Ian Lance Taylor <iant@google.com>
10988
10989 * object.h (class Relobj): Drop options parameter from
10990 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
10991 do_scan_relocs, do_relocate. Change all callers.
10992 (class Sized_relobj): Drop options parameters from
10993 do_gc_process_relocs, do_scan_relocs, do_relocate,
10994 do_relocate_sections, relocate_sections, emit_relocs_scan,
10995 emit_relocs_scan_reltype. Change all callers.
10996 (struct Relocate_info): Remove options field and all references to
10997 it.
10998 * reloc.h (class Read_relocs): Remove options constructor
10999 parameter and options_ field. Change all callers.
11000 (class Gc_process_relocs, class Scan_relocs): Likewise.
11001 (class Relocate_task): Likewise.
11002 * target-reloc.h (scan_relocs): Remove options parameter. Change
11003 all callers.
11004 (scan_relocatable_relocs): Likewise.
11005 * target.h (class Sized_target): Remove options parameter from
11006 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11007 all callers.
11008 * gc.h (gc_process_relocs): Remove options parameter. Change all
11009 callers.
11010 * arm.cc: Update functions to remove options parameters.
11011 * i386.cc: Likewise.
11012 * powerpc.cc: Likewise.
11013 * sparc.cc: Likewise.
11014 * x86_64.cc: Likewise.
11015 * testsuite/testfile.cc: Likewise.
11016
8ffa3667
DK
110172009-10-28 Doug Kwan <dougkwan@google.com>
11018
11019 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11020 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11021 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11022 New method definitions.
11023
40f36857
CC
110242009-10-28 Cary Coutant <ccoutant@google.com>
11025
11026 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11027 (Plugin::cleanup_done_): New member.
11028 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11029 (Plugin_manager::cleanup_done_): Remove.
11030 (Plugin_manager::add_input_file): Edit error message.
11031 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11032 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11033
2c849493
ILT
110342009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11035
11036 * fileread.cc: (File_read::View::~View): Use the new
11037 data_ownership_ filed.
11038 (File_read::~File_read): Dispose the new whole_file_view_.
11039 (File_read::open): Mmap the whole file if needed.
11040 (File_read::open): Use whole_file_view_ instead of contents_.
11041 (File_read::find_view): Use whole_file_view_ if applicable.
11042 (File_read::do_read): Use whole_file_view_ instead of contents_.
11043 (File_read::make_view): Use whole_file_view_ instead of contents_,
11044 update File_read::View::View call.
11045 (File_read::find_or_make_view): Update File_read::View::View
11046 call.
11047 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11048 remove contents_
11049 (File_read::View::Data_ownership): New enum.
11050 (File_read::View::View): Replace bool mapped_ with Data_ownership
11051 argument.
11052 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11053 (File_read::View::data_ownership_): New field.
11054 (File_read::contents_): Remove (replaced by whole_file_view_).
11055 (File_read::whole_file_view_): New field.
11056 * options.h (class General_options): Add --keep-files-mapped.
11057
24998053
CC
110582009-10-27 Cary Coutant <ccoutant@google.com>
11059
11060 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11061 * testsuite/Makefile.am (plugin_test_5): New test case.
11062 * testsuite/Makefile.in: Regenerate.
11063
72adc4fa
DK
110642009-10-25 Doug Kwan <dougkwan@google.com>
11065
11066 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11067 from private to protected to allow access by child class.
11068 (Sized_relobj::do_relocate_sections): New method declaration.
11069 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11070 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11071 Sized_relobj::relocate_sections. Instantiate template explicitly
11072 for different target sizes and endianity.
11073
07f508a2
DK
110742009-10-24 Doug Kwan <dougkwan@google.com>
11075
11076 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11077 (Arm_input_section::as_arm_input_section): New method.
11078 (Arm_output_section): New class definition.
11079 (Arm_output_section::create_stub_group,
11080 Arm_output_section::group_sections): New method definitions.
11081
10ad9fe5
DK
110822009-10-22 Doug Kwan <dougkwan@google.com>
11083
11084 * arm.cc (Arm_input_section): New class definition.
11085 (Arm_input_section::init, Arm_input_section:do_write,
11086 Arm_input_section::set_final_data_size,
11087 Arm_input_section::do_reset_address_and_file_offset): New method
11088 definitions.
11089
56ee5e00
DK
110902009-10-21 Doug Kwan <dougkwan@google.com>
11091
11092 * arm.cc (Stub_table, Arm_input_section): New forward class
11093 declarations.
11094 (Stub_table): New class defintion.
11095 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11096 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11097 New method definition.
11098
b569affa
DK
110992009-10-21 Doug Kwan <dougkwan@google.com>
11100
11101 * arm.cc: Update copyright comments.
11102 (Target_arm): New forward class template declaration.
11103 (Arm_address): New type.
11104 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11105 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11106 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11107 constants.
11108 (Insn_template): Same.
11109 (DEF_STUBS): New macro.
11110 (Stub_type): New enum type.
11111 (Stub_template): New class definition.
11112 (Stub): Same.
11113 (Reloc_stub): Same.
11114 (Stub_factory): Same.
11115 (Target_arm::Target_arm): Initialize may_use_blx_ and
11116 should_force_pic_veneer_.
11117 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11118 Target_arm::should_force_pic_veneer,
11119 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11120 Target_arm::using_thumb_only, Target_arm:;default_target): New
11121 method defintions.
11122 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11123 New data member declarations.
11124 (Insn_template::size, Insn_template::alignment): New method defintions.
11125 (Stub_template::Stub_template): New method definition.
11126 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11127 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11128 (Stub_factory::Stub_factory): New method definition.
11129 * gold.h (string_hash): New template.
11130 * output.h (Input_section_specifier::hash_value): Use
11131 gold::string_hash.
11132 (Input_section_specifier::string_hash): Remove.
11133 * stringpool.cc (Stringpool_template::string_hash): Use
11134 gold::string_hash.
11135
6c172549
DK
111362009-10-20 Doug Kwan <dougkwan@google.com>
11137
11138 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11139 symbols of relaxed input sections.
11140 * output.h (Output_section::find_relaxed_input_section): Make
11141 method public.
11142
c5617f2f
DK
111432009-10-16 Doug Kwan <dougkwan@google.com>
11144
11145 * dynobj.cc (Versions::Versions): Initialize version_script_.
11146 Only insert base version symbol definition for a shared object
11147 if version script defines any version versions.
11148 (Versions::define_base_version): New method definition.
11149 (Versions::add_def): Check that base version is not needed.
11150 (Versions::add_need): Define base version lazily.
11151 * dynobj.h (Versions::define_base_version): New method declaration.
11152 (Versions::needs_base_version_): New data member declaration.
11153 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11154 (check_DATA): Add no_version_test.stdout.
11155 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11156 New make rules.
11157 * testsuite/Makefile.in: Regenerate.
11158 * testsuite/no_version_test.c: New file.
11159 * testsuite/no_version_test.sh: Ditto.
11160
3c12dcdb
DK
111612009-10-16 Doug Kwan <dougkwan@google.com>
11162
11163 * expression.cc (class Segment_start_expression): New class definition.
11164 (Segment_start_expression::value): New method definition.
11165 (script_exp_function_segment_start): Return a new
11166 Segment_start_expression.
11167 * gold/script-c.h (script_saw_segment_start_expression): New function
11168 prototype.
11169 * script-sections.cc (Script_sections::Script_sections): Initialize
11170 SAW_SEGMENT_START_EXPRESSION_ to false.
11171 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11172 and -Tbbs options to specify section addresses if given in
11173 command line and no SEGMENT_START expression is seen in a script.
11174 * script-sections.h (Script_sections::saw_segment_start_expression,
11175 Script_sections::set_saw_segment_start_expression): New method
11176 definition.
11177 (Script_sections::saw_segment_start_expression_): New data member
11178 declaration.
11179 * script.cc (script_saw_segment_start_expression): New function.
11180 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11181 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11182 script_test_7.sh and script_test_8.sh.
11183 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11184 script_test_8.stdout.
11185 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11186 (script_test_6, script_test_6.stdout, script_test_7,
11187 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11188 * Makefile.in: Regenerate.
11189 * testsuite/script_test_6.sh: New file.
11190 * testsuite/script_test_6.t: Same.
11191 * testsuite/script_test_7.sh: Same.
11192 * testsuite/script_test_7.t: Same.
11193 * testsuite/script_test_8.sh: Same.
11194
64b1ae37
DK
111952009-10-16 Doug Kwan <dougkwan@google.com>
11196
11197 * output.cc (Output_segment::set_section_list_address): Cast
11198 expressions to unsigned long long type to avoid format warnings.
11199
661be1e2
ILT
112002009-10-15 Ian Lance Taylor <iant@google.com>
11201
12edd763 11202 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11203 dot assignment to script_sections_.
12edd763
ILT
11204 * script-sections.cc (Script_sections::add_dot_assignment):
11205 Initialize if necessary.
11206
68b6574b
ILT
11207 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11208 program headers with no load segment if there is a linker script.
11209
661be1e2
ILT
11210 * layout.cc (Layout::set_segment_offsets): Align the file offset
11211 to the segment aligment for -N or -n with no load segment.
11212 * output.cc (Output_segment::add_output_section): Don't crash if
11213 the first section is a TLS section.
11214 (Output_segment::set_section_list_addresses): Print an error
11215 message if the address moves backward in a linker script.
11216 * script-sections.cc
11217 (Output_section_element_input::set_section_addresses): Don't
11218 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11219 (Orphan_output_section::set_section_addresses): Likewise.
11220
f15f61a7
DK
112212009-10-15 Doug Kwan <dougkwan@google.com>
11222
11223 * layout.cc (Layout::finish_dynamic_section): Generate tags
11224 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11225 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11226 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11227
82bb573a
ILT
112282009-10-14 Ian Lance Taylor <iant@google.com>
11229
11230 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11231 fields.
11232 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11233 data_shdr fields of relinfo.
11234 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11235 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11236 R_386_TLS_LDO_32, adjust based on section flags.
11237 (Target_i386::Relocate::fix_up_ldo): Remove.
11238
374ad285
ILT
112392009-10-13 Ian Lance Taylor <iant@google.com>
11240
11241 Add support for -pie.
11242 * options.h (class General_options): Add -pie and
11243 --pic-executable.
11244 (General_options::output_is_position_independent): Test -pie.
11245 (General_options::output_is_executable): Return true if not shared
11246 and not relocatable.
11247 (General_options::output_is_pie): Remove.
11248 * options.cc (General_options::finalize): Reject incompatible uses
11249 of -pie.
11250 * gold.cc (queue_middle_tasks): A -pie link is not static.
11251 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11252 * symtab.cc (Symbol::final_value_is_known): Return false if
11253 output_is_position_independent.
11254 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11255 output_is_position_independent.
11256 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11257 output_is_position_independent.
11258 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11259 output_is_position_independent.
11260 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11261 two_file_pie_test.
11262 (basic_pie_test.o, basic_pie_test): New targets.
11263 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11264 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11265 (two_file_pie_test): New target.
11266 * testsuite/Makefile.in: Rebuild.
11267 * README: Remove note saying that -pie is not supported.
11268
c6585162
ILT
112692009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11270
11271 * options.h (class General_options): Add -init and -fini.
11272 * layout.cc (Layout::finish_dynamic_section): Emit
11273 given init and fini functions.
11274
032ce4e9
ST
112752009-10-13 Sriraman Tallam <tmsriram@google.com>
11276
11277 * gc.h (gc_process_relocs): Check if icf is enabled using new
11278 function.
11279 * gold.cc (queue_initial_tasks): Likewise.
11280 (queue_middle_tasks): Likewise.
11281 * object.cc (do_layout): Likewise.
11282 * symtab.cc (is_section_folded): Likewise.
11283 * main.cc (main): Likewise.
11284 * reloc.cc (Read_relocs::run): Likewise.
11285 (Sized_relobj::do_scan_relocs): Likewise.
11286 * icf.cc (is_function_ctor_or_dtor): New function.
11287 (Icf::find_identical_sections): Check if function is ctor or dtor when
11288 safe icf is chosen.
11289 * options.h (General_options::icf): Change option to be an enum.
11290 (Icf_status): New enum.
11291 (icf_enabled): New method.
11292 (icf_safe_folding): New method.
11293 (set_icf_status): New method.
11294 (icf_status_): New variable.
11295 * (options.cc) (General_options::finalize): Set icf_status_.
11296 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11297 icf_test and icf_keep_unique_test to use the --icf enum flag.
11298 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11299 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11300
f345227a
ST
113012009-10-12 Sriraman Tallam <tmsriram@google.com>
11302
11303 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11304 includes to gc.h and icf.h.
11305 * arm.cc: Include gc.h.
11306 * gold.cc: Likewise.
11307 * i386.cc: Likewise.
11308 * powerpc.cc: Likewise.
11309 * sparc.cc: Likewise.
11310 * x86_64.cc: Likewise.
11311 * gc.h: Include icf.h.
11312
1c7814ed
ILT
113132009-10-11 Ian Lance Taylor <iant@google.com>
11314
11315 * plugin.cc: Include "gold.h" before other header files.
11316
ae3b5189
CD
113172009-10-10 Chris Demetriou <cgd@google.com>
11318
11319 * options.h (Input_file_argument::Input_file_type): New enum.
11320 (Input_file_argument::is_lib_): Replace with...
11321 (Input_file_argument::type_): New member.
11322 (Input_file_argument::Input_file_argument): Take Input_file_type
11323 'type' rather than boolean 'is_lib' as second argument.
11324 (Input_file_argument::is_lib): Use type_.
11325 (Input_file_argument::is_searched_file): New function.
11326 (Input_file_argument::may_need_search): Handle is_searched_file.
11327 * options.cc (General_options::parse_library): Support -l:filename.
11328 (General_options::parse_just_symbols): Update for Input_file_argument
11329 changes.
11330 (Command_line::process): Likewise.
11331 * archive.cc (Archive::get_file_and_offset): Likewise.
11332 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11333 * script.cc (read_script_file, script_add_file): Likewise.
11334 * fileread.cc (Input_file::Input_file): Likewise.
11335 (Input_file::will_search_for): Handle is_searched_file.
11336 (Input_file::open): Likewise.
11337 * readsyms.cc (Read_symbols::get_name): Likewise.
11338 * testsuite/Makefile.am (searched_file_test): New test.
11339 * testsuite/Makefile.in: Regenerate.
11340 * testsuite/searched_file_test.cc: New file.
11341 * testsuite/searched_file_test_lib.cc: New file.
11342
f3048a1d
ILT
113432009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11344 Ian Lance Taylor <iant@google.com>
11345
11346 * descriptor.cc: Include <cstdio> and "binary-io.h".
11347 (Descriptors::open): Open the files in binary mode always.
11348 * script.cc (Lex::get_token): Treat \r as whitespace.
11349
d4780e57
ILT
113502009-10-09 Ian Lance Taylor <iant@google.com>
11351
11352 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11353
d9a893b8
ILT
113542009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11355 Ian Lance Taylor <iant@google.com>
11356
11357 * configure.ac: Check for readv function also.
11358 * fileread.cc (readv): Define if not HAVE_READV.
11359 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11360 does not exist.
11361 * config.in: Regenerate.
11362 * configure: Regenerate.
11363
c0a62865
DK
113642009-10-09 Doug Kwan <dougkwan@google.com>
11365
11366 * layout.cc (Layout::make_output_section): Call target hook to make
11367 ordinary output section.
11368 (Layout::finalize): Adjust parameter list of call the
11369 Target::may_relax().
11370 * layout.h (class Layout::section_list): New method.
11371 * merge.h (Output_merge_base::entsize): Change visibility to public.
11372 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11373 New methods.
11374 (Output_merge_string::do_is_string): New method.
11375 * object.cc (Sized_relobj::do_setup): renamed from
11376 Sized_relobj::set_up.
11377 * object.h (Sized_relobj::adjust_shndx,
11378 Sized_relobj::initializ_input_to_output_maps,
11379 Sized_relobj::free_input_to_output_maps): Change visibilities to
11380 protected.
11381 (Sized_relobj::setup): Virtualize.
11382 (Sized_relobj::do_setup): New method declaration.
11383 (Sized_relobj::invalidate_section_offset,
11384 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11385 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11386 * options.cc (parse_int): New function.
11387 * options.h (parse_int): New declaration.
11388 (DEFINE_int): New macro.
11389 (stub_group_size): New option.
11390 * output.cc (Output_section::Output_section): Initialize memebers
11391 merge_section_map_, merge_section_by_properties_map_,
11392 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11393 (Output_section::add_input_section): Handled deferred code-fill
11394 generation and remove an old comment.
11395 (Output_section::add_relaxed_input_section): New method definition.
11396 (Output_section::add_merge_input_section): Use merge section by
11397 properties map to speed to search. Update merge section maps
11398 as appropriate.
11399 (Output_section::build_relaxation_map): New method definition.
11400 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11401 Same.
11402 (Output_section::relax_input_section): Renamed to
11403 Output_section::convert_input_sections_to_relaxed_sections and change
11404 interface to take a vector of pointers to relaxed sections.
11405 (Output_section::find_merge_section,
11406 Output_section::find_relaxed_input_section): New method definitions.
11407 (Output_section::is_input_address_mapped,
11408 Output_section::output_offset, Output_section::output_address):
11409 Use output section data maps to speed up searching.
11410 (Output_section::find_starting_output_address): Add comments.
11411 (Output_section::do_write,
11412 Output_section::write_to_postprocessing_buffer): Do code-fill
11413 generation as appropriate.
11414 (Output_section::get_input_sections): Invalidate relaxed input section
11415 map.
11416 (Output_section::restore_states): Adjust type of checkpoint .
11417 Invalidate relaxed input section map.
11418 * output.h (Output_merge_base): New class declaration.
11419 (Input_section_specifier): New class defintion.
11420 (class Output_relaxed_input_section) Change base class to
11421 Output_section_data_build.
11422 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11423 base class initializer.
11424 (Output_section::add_relaxed_input_section): New method declaration.
11425 (Output_section::Input_section): Change visibility to protected.
2e702c99 11426 (Output_section::Input_section::relobj,
c0a62865
DK
11427 Output_section::Input_section::shndx): Handle relaxed input sections.
11428 Output_section::input_sections) Change visibility to protected. Also
11429 define overload to return a non-const pointer.
11430 (Output_section::Merge_section_properties): New class defintion.
11431 (Output_section::Merge_section_by_properties_map,
11432 Output_section::Output_section_data_by_input_section_map,
11433 Output_section::Relaxation_map): New types.
11434 (Output_section::relax_input_section): Rename method to
11435 Output_section::convert_input_sections_to_relaxed_sections and change
11436 interface to take a vector of relaxed section pointers.
11437 (Output_section::find_merge_section,
11438 Output_section::find_relaxed_input_section,
11439 Output_section::build_relaxation_map,
11440 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11441 New method declarations.
11442 (Output_section::merge_section_map_
11443 Output_section::merge_section_by_properties_map_,
11444 Output_section::relaxed_input_section_map_,
11445 Output_section::is_relaxed_input_section_map_valid_,
11446 Output_section::generate_code_fills_at_write_): New data members.
11447 * script-sections.cc
11448 (Output_section_element_input::set_section_addresses): Call
11449 current_data_size and addralign methods of relaxed input sections.
11450 (Orphan_output_section::set_section_addresses): Call current_data_size
11451 and addralign methods of relaxed input sections.
11452 * symtab.cc (Symbol_table::compute_final_value): Extract template
11453 from the body of Symbol_table::sized_finalize_symbol.
11454 (Symbol_table::sized_finalized_symbol): Call
11455 Symbol_table::compute_final_value.
11456 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11457 (Symbol_table::compute_final_value): New templated method declaration.
11458 * target.cc (Target::do_make_output_section): New method defintion.
11459 * target.h (Target::make_output_section): New method declaration.
11460 (Target::relax): Add more parameters for input objects, symbol table
11461 and layout. Adjust call to do_relax.
11462 (Target::do_make_output_section): New method declaration.
11463 (Target::do_relax): Add parameters for input objects, symbol table
11464 and layout.
11465
d446d6c4
ILT
114662009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11467
11468 * pread.c: Include stdio.h.
11469
bc06c745
ILT
114702009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11471
11472 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11473 defined.
11474
75aea3d0
ILT
114752009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11476
11477 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11478 Change read_shndx type to unsigned int.
11479 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11480 int.
11481 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11482 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11483 Change read_shndx type to unsigned int.
11484 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11485 int.
11486 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11487 * layout.cc (Layout::create_symtab_sections): Cast the result of
11488 local_symcount * symsize to off_t in the gold_assert.
11489
be8fcb75
ILT
114902009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11491
11492 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11493 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11494 R_ARM_BASE_ABS.
11495 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11496 (Arm_relocate_functions::thm_abs5): New function.
11497 (Arm_relocate_functions::abs12): New function.
11498 (Arm_relocate_functions::abs16): New function.
11499 (Arm_relocate_functions::base_abs): New function.
11500 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11501 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11502 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11503 R_ARM_BASE_ABS.
11504 (Scan::global): Likewise.
11505 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11506 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11507 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11508 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11509 R_ARM_BASE_ABS.
11510
c2a122b6
ILT
115112009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11512
11513 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11514 (Arm_relocate_functions::movt_prel): New function.
11515 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11516 (Arm_relocate_functions::thm_movt_prel): New function.
11517 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11518 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11519 (Scan::global, Relocate::relocate): Likewise.
11520 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11521
c4aa1e2d
ILT
115222009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11523
11524 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11525 Incremental_checker.
11526 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11527 unsigned int.
11528 (class Incremental_inputs_header): New class.
11529 (Incremental_inputs_header_writer): Edit comment.
11530 (Incremental_inputs_entry): New class.
11531 (Incremental_inputs_entry_writer): Edit comment.
11532 (Sized_incremental_binary::do_find_incremental_inputs_section):
11533 Add *strtab_shndx parameter, fill it.
11534 (Sized_incremental_binary::do_check_inputs): New method.
11535 (Incremental_checker::can_incrementally_link_output_file): Use
11536 Sized_incremental_binary::check_inputs.
11537 (Incremental_inputs::report_command_line): Save command line in
11538 command_line_.
11539 * incremental.h:
11540 (Incremental_binary::find_incremental_inputs_section): New
11541 method.
11542 (Incremental_binary::do_find_incremental_inputs_section): Add
11543 strtab_shndx parameter.
11544 (Incremental_binary::do_check_inputs): New pure virtual method.
11545 (Sized_incremental_binary::do_check_inputs): Declare.
11546 (Incremental_checker::Incremental_checker): Add incremental_inputs
11547 parameter, use it to initialize incremental_inputs_.
11548 (Incremental_checker::incremental_inputs_): New field.
11549 (Incremental_checker::command_line): New method.
11550 (Incremental_checker::inputs): New method.
11551 (Incremental_checker::command_line_): New field.
11552
c549a694
ILT
115532009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11554
11555 * incremental.cc: Include <cstdarg> and "target-select.h".
11556 (vexplain_no_incremental): New function.
11557 (explain_no_incremental): New function.
11558 (Incremental_binary::error): New method.
11559 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11560 method.
11561 (make_sized_incremental_binary): New function.
11562 (open_incremental_binary): New function.
11563 (can_incrementally_link_file): Add checks if output is ELF and has
11564 inputs section.
11565 * incremental.h: Include "elfcpp_file.h" and "output.h".
11566 (Incremental_binary): New class.
11567 (Sized_incremental_binary): New class.
11568 (open_incremental_binary): Declare.
11569 * object.cc (is_elf_object): Use
11570 elfcpp::Elf_recognizer::is_elf_file.
11571 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11572 * output.h (Output_file::filesize): New method.
11573
fd3c5f0b
ILT
115742009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11575
11576 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11577 New function.
11578 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11579 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11580 function.
11581 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11582 function.
11583 (Arm_relocate_functions::movw_abs_nc): New function.
11584 (Arm_relocate_functions::movt_abs): New function.
11585 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11586 (Arm_relocate_functions::thm_movt_abs): New function.
11587 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11588 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11589 (Scan::global): Likewise.
11590 (Relocate::relocate): Likewise.
11591 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11592
7f5309a5
ILT
115932009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11594
11595 * arm.cc (Arm_relocate_functions::got_prel) New function.
11596 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11597 (Relocate::relocate): Likewise.
11598 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11599
364c7fa5
ILT
116002009-10-06 Ian Lance Taylor <iant@google.com>
11601
11602 * options.h (class General_options): Define
11603 split_stack_adjust_size parameter.
11604 * object.h (class Object): Add uses_split_stack_ and
11605 has_no_split_stack_ fields. Add uses_split_stack and
11606 has_no_split_stack accessor functions. Declare
11607 handle_split_stack_section.
11608 (class Reloc_symbol_changes): Define.
11609 (class Sized_relobj): Define Function_offsets. Declare
11610 split_stack_adjust, split_stack_adjust_reltype, and
11611 find_functions.
11612 * object.cc (Object::handle_split_stack_section): New function.
11613 (Sized_relobj::do_layout): Call handle_split_stack_section.
11614 * dynobj.cc (Sized_dynobj::do_layout): Call
11615 handle_split_stack_section.
11616 * reloc.cc (Sized_relobj::relocate_sections): Call
11617 split_stack_adjust for executable sections in split_stack
11618 objects. Pass reloc_map to relocate_section.
11619 (Sized_relobj::split_stack_adjust): New function.
11620 (Sized_relobj::split_stack_adjust_reltype): New function.
11621 (Sized_relobj::find_functions): New function.
11622 * target-reloc.h: Include "object.h".
11623 (relocate_section): Add reloc_symbol_changes parameter. Change
11624 all callers.
11625 * target.h (class Target): Add calls_non_split method. Declare
11626 do_calls_non_split virtual method. Declare match_view and
11627 set_view_to_nop.
11628 * target.cc: Include "elfcpp.h".
11629 (Target::do_calls_non_split): New function.
11630 (Target::match_view): New function.
11631 (Target::set_view_to_nop): New function.
11632 * gold.cc (queue_middle_tasks): Give an error if mixing
11633 split-stack and non-split-stack objects with -r.
11634 * i386.cc (Target_i386::relocate_section): Add
11635 reloc_symbol_changes parameter.
11636 (Target_i386::do_calls_non_split): New function.
11637 * x86_64.cc (Target_x86_64::relocate_section): Add
11638 reloc_symbol_changes parameter.
11639 (Target_x86_64::do_calls_non_split): New function.
11640 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11641 parameter.
11642 * powerpc.cc (Target_powerpc::relocate_section): Add
11643 reloc_symbol_changes parameter.
11644 * sparc.cc (Target_sparc::relocate_section): Add
11645 reloc_symbol_changes parameter.
11646 * configure.ac: Call AM_CONDITIONAL for the default target.
11647 * configure: Rebuild.
11648 * testsuite/Makefile.am (TEST_AS): New variable.
11649 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11650 (check_DATA): Add split_i386 and split_x86_64 files.
11651 (SPLIT_DEFSYMS): Define.
11652 (split_i386_[1234n].o): New targets.
11653 (split_i386_[124]): New targets.
11654 (split_i386_[1234r].stdout): New targets.
11655 (split_x86_64_[1234n].o): New targets.
11656 (split_x86_64_[124]): New targets.
11657 (split_x86_64_[1234r].stdout): New targets.
11658 (MOSTLYCLEANFILES): Add new executables.
11659 * testsuite/split_i386.sh: New file.
11660 * testsuite/split_x86_64.sh: New file.
11661 * testsuite/split_i386_1.s: New file.
11662 * testsuite/split_i386_2.s: New file.
11663 * testsuite/split_i386_3.s: New file.
11664 * testsuite/split_i386_4.s: New file.
11665 * testsuite/split_i386_n.s: New file.
11666 * testsuite/split_x86_64_1.s: New file.
11667 * testsuite/split_x86_64_2.s: New file.
11668 * testsuite/split_x86_64_3.s: New file.
11669 * testsuite/split_x86_64_4.s: New file.
11670 * testsuite/split_x86_64_n.s: New file.
11671 * testsuite/testfile.cc (Target_test): Update relocation_section
11672 function.
11673 * testsuite/Makefile.in: Rebuild.
11674
e8a9fcda
ILT
116752009-10-06 Ian Lance Taylor <iant@google.com>
11676
11677 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11678 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11679 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11680 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11681 the address on ldo_addrs_.
11682 (Target_i386::Relocate::fix_up_ldo): New function.
11683
e99daf92
ILT
116842009-10-06 Rafael Espindola <espindola@google.com>
11685
11686 * plugin.cc (add_input_library): New.
11687 (Plugin::load): Add add_input_library to tv.
11688 (Plugin_manager::add_input_file): Add the is_lib argument.
11689 (add_input_file): Update call to Plugin_manager::add_input_file.
11690 (add_input_library): New.
11691 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11692
966d4097
DK
116932009-09-30 Doug Kwan <dougkwan@google.com>
11694
11695 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11696 symbol and call Symbol::may_need_copy_reloc to determine if
11697 a copy reloc is needed.
11698 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11699 nocopyreloc is given in command line.
11700 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11701 given in command line.
11702 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11703 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11704 of the removed Target_i386::may_need_copy_reloc.
11705 * options.h (copyreloc): New option with default value false.
11706 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11707 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11708 instead of the removed Target_powerpc::may_need_copy_reloc.
11709 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11710 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11711 instead of the removed Target_sparc::may_need_copy_reloc.
11712 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11713 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11714 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11715 instead of the removed Target_x86_64::may_need_copy_reloc.
11716
029ba973
ILT
117172009-09-30 Ian Lance Taylor <iant@google.com>
11718
11719 * object.h (class Object): Remove target_ field, and target,
11720 sized_target, and set_target methods.
11721 (Object::sized_target): Remove.
11722 (class Sized_relobj): Update declarations. Remove sized_target.
11723 * object.cc (Sized_relobj::setup): Remove target parameter.
11724 Change all callers.
11725 (Input_objects::add_object): Don't do anything with the target.
11726 (make_elf_sized_object): Add punconfigured parameter. Change all
11727 callers. Set or test parameter target.
11728 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
11729 Change all callers.
11730 * parameters.cc (Parameters::set_target): Change parameter type to
11731 be non-const.
11732 (Parameters::default_target): Remove.
11733 (set_parameters_target): Change parameter type to be non-const.
11734 (parameters_force_valid_target): New function.
11735 (parameters_clear_target): New function.
11736 * parameters.h (class Parameters): Update declarations. Remove
11737 default_target method. Add sized_target and clear_target
11738 methods. Change target_ to be non-const.
11739 (set_parameters_target): Update declaration.
11740 (parameters_force_valid_target): Declare.
11741 (parameters_clear_target): Declare.
11742 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
11743 as NULL if we aren't searching.
11744 (Add_symbols::run): Don't check for compatible target.
11745 * fileread.cc (Input_file::open_binary): Call
11746 parameters_force_valid_target.
11747 * gold.cc (queue_middle_tasks): Likewise.
11748 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
11749 set_target on object.
11750 * dynobj.h (class Sized_dynobj): Update declarations.
11751 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
11752 make_elf_object returns NULL.
11753 (Archive::include_member): Don't check whether object target is
11754 compatible.
11755 * output.cc (Output_section::add_input_section): Get target from
11756 parameters.
11757 (Output_section::relax_input_section): Likewise.
11758 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
11759 parameters.
11760 (Sized_relobj::do_scan_relocs): Likewise.
11761 (Sized_relobj::relocate_sections): Likewise.
11762 * resolve.cc (Symbol_table::resolve): Likewise.
11763 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
11764 parameter. Change all callers.
11765 (Symbol_table::add_from_object): Get target from parameters.
11766 (Symbol_table::add_from_relobj): Don't check object target.
11767 (Symbol_table::add_from_dynobj): Likewise.
11768 (Symbol_table::define_special_symbol): Get target from
11769 parameters.
11770 * symtab.h (class Symbol_table): Update declaration.
11771 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
11772 parameter. Change all callers. Clear parameter target.
11773 (Binary_test): Test target here.
11774 * testsuite/object_unittest.cc (gold_testsuite): Remove
11775 target_test_pointer parameter. Change all callers.
11776 (Object_test): Test target here.
11777
a6a22b83
ILT
117782009-09-26 Ian Lance Taylor <iant@google.com>
11779
11780 * testsuite/initpri1.c: Don't try to use constructor priorities if
11781 compiling with gcc before 4.3.
11782
6a8f49fe
ILT
117832009-09-22 Mikolaj Zalewski <mikolajz@google.com>
11784
11785 * testsuite/retain_symbols_file_test.sh (check_present): Change
11786 output file name to retain_symbols_file_test.stdout.
11787 (check_absent): Likewise.
11788
8c604651
CS
117892009-09-18 Craig Silverstein <csilvers@google.com>
11790
11791 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
11792 * options.cc: Include <cerrno> and <fstream>.
11793 (General_options::finalize): Parse -retain-symbols-file tag.
11794 * options.h: New flag.
11795 (General_options): New method should_retain_symbol, new
11796 variable symbols_to_retain.
11797 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
11798 should_retain_symbol map.
11799 * testsuite/Makefile.am (retain_symbols_file_test): New test.
11800 * testsuite/Makefile.in: Regenerate.
11801 * testsuite/retain_symbols_file_test.sh: New file.
11802
ca58b19f
NC
118032009-09-18 Nick Clifton <nickc@redhat.com>
11804
11805 * po/es.po: Updated Spanish translation.
11806
20e6d0d6
DK
118072009-09-17 Doug Kwan <dougkwan@google.com>
11808
11809 * debug.h (DEBUG_RELAXATION): New constant.
11810 (DEBUG_ALL): Add DEBUG_RELAXATION.
11811 (debug_string_to_enum): Add relaxation debug option.
11812 * layout.cc
11813 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
11814 Layout::Relaxation_debug_check::read_sections,
11815 Layout::Relaxation_debug_check::read_sections): New method definitions.
11816 (Layout::Layout): Initialize data members
11817 record_output_section_data_from_scrips_,
11818 script_output_section_data_list_ and relaxation_debug_check_.
11819 (Layout::save_segments, Layout::restore_segments,
11820 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11821 Layout::relaxation_loop_body): New method definitions.
11822 (Layout::finalize): Support relaxation. Move section layout code to
11823 Layout::relaxation_loop_body.
11824 (Layout::set_asection_address_from_script): Move code for orphan
11825 section placement out.
11826 (Layout::place_orphan_sections_in_script): New method definition.
11827 * layout.h (Output_segment_headers, Output_file_header):
11828 New forward class declarations.
11829 (Layout::~Layout): Define.
11830 (Layout::new_output_section_data_from_script): New method definition.
11831 (Layout::place_orphan_sections_in_script): New method declaration.
11832 (Layout::Segment_states): New type declaration.
11833 (Layout::save_segments, Layout::restore_segments,
11834 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11835 Layout::relaxation_loop_body): New method declarations.
11836 (Layout::Output_section_data_list): New type declaration.
11837 (Layout::Relaxation_debug_check): New class definition.
11838 (Layout::record_output_section_data_from_script_,
11839 Layout::script_output_section_data_list_, Layout::segment_states_,
11840 Layout::relaxation_debug_check_): New data members.
11841 * output.cc: (Output_section_headers::do_size): New method definition.
11842 (Output_section_headers::Output_section_headers): Move size
11843 computation to Output_section_headers::do_size.
11844 (Output_segment_headers::do_size): New method definition.
e1df38aa 11845 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
11846 Output_file_header::do_size and call it.
11847 (Output_file_header::do_size): New method definition.
11848 (Output_data_group::Output_data_group): Adjust call to
11849 Output_section_data.
11850 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
11851 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 11852 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
11853 RELAXED_INPUT_SECTION_CODE.
11854 (Output_section::Output_section): Initialize data member checkpoint_.
11855 (Output_section::~Output_section): Delete checkpoint object pointed
11856 by checkpoint_.
11857 (Output_section::add_input_section): Always add an Input_section if
11858 relaxing.
11859 (Output_section::add_merge_input_section): Add assert.
11860 (Output_section::relax_input_section): New method definition.
11861 (Output_section::set_final_data_size): Set load address to zero for
11862 an unallocated section.
11863 (Output_section::do_address_and_file_offset_have_reset_values):
11864 New method definition.
11865 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
11866 Handle relaxed input section.
11867 (Output_section::sort_attached_input_sections): Checkpoint input
11868 section list lazily.
11869 (Output_section::get_input_sections): Change type of input_sections to
11870 list of Simple_input_section pointers. Checkpoint input section list
11871 lazily. Also handle relaxed input sections.
11872 (Output_section::add_input_section_for_script): Take a reference to
11873 a Simple_input_section object instead of Relobj pointer and section
11874 index as parameter. Handle relaxed input sections.
11875 (Output_section::save_states, Output_section::restore_states): New
11876 method definitions.
11877 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
11878 (Output_data::is_data_size_fixed): New method definition.
11879 (Output_data::reset_addresss_and_file_offset): Do not reset data size
11880 if it is fixed.
11881 (Output_data::address_and_file_offset_have_reset_values): New method
11882 definition.
11883 (Output_data::do_address_and_file_offset_have_reset_values): New method
11884 definition.
11885 (Output_data::set_data_size): Check that data size is not fixed.
11886 (Output_data::fix_data_size): New method definition.
11887 (Output_data::is_data_size_fixed_): New data member.
11888 (Output_section_headers::set_final_data_size): New method definition.
11889 (Output_section_headers::do_size): New method declaration.
11890 (Output_segment_headers::set_final_data_size): New method definition.
11891 (Output_segment_headers::do_size): New method declaration.
11892 (Output_file_header::set_final_data_size)::New method definition.
11893 (Output_file_header::do_size)::New method declaration.
11894 (Output_section_data::Output_section_data): Add new parameter
11895 is_data_size_fixed and use it to fix data size.
11896 (Output_data_const::Output_data_const): Adjust call to base class
11897 constructor and fix data size.
11898 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
11899 base class constructor and fix data size.
11900 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
11901 base class constructor and fix data size.
11902 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
11903 class constructor and fix data size.
11904 (Output_data_group::set_final_data_size): New method definition.
11905 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
11906 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
11907 class constructor and fix data size.
11908 (Output_relaxed_input_section): New class definition.
11909 (Output_section::Simple_input_section): New class definition.
11910 (Output_section::get_input_sections): Adjust parameter list.
11911 (Output_section::add_input_section_for_script): Same.
11912 (Output_section::save_states, Output_section::restore_states,
11913 Output_section::do_address_and_file_offset_have_reset_values,
11914 (Output_section::Input_section::Input_section): Handle
11915 RELAXED_INPUT_SECTION_CODE. Add new overload for
11916 Output_relaxed_input_section.
11917 (Output_section::Input_section::is_input_section,
11918 Output_section::Input_section::set_output_section): Handle relaxed
11919 input section.
11920 (Output_section::Input_section::is_relaxed_input_section,
11921 Output_section::Input_section::output_section_data,
11922 Output_section::Input_section::relaxed_input_section): New method
11923 definitions.
11924 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
11925 value.
11926 (Output_section::Input_section::u1_): Update comments.
11927 (Output_section::Input_section::u2_): Add new union member poris.
11928 (Output_section::Checkpoint_output_section): New classs definition.
11929 (Output_section::relax_input_section): New method declaration.
11930 (Output_section::checkpoint_): New data member.
11931 (Output_segment): Update comments.
11932 (Output_segment::Output_segment): Un-privatize copy constructor.
11933 (Output_segment::operator=): Un-privatize.
11934 * script-sections.cc (Output_section_element::Input_section_list):
11935 Change element type to Output_section::Simple_input_section.
11936 (Output_section_element_dot_assignment::set_section_addresses):
11937 Register output section data for relaxation clean up.
11938 (Output_data_exression::Output_data_expression): Adjust call to base
11939 constructor to fix data size.
11940 (Output_section_element_data::set_section_addresses): Register
11941 Output_data_expression object for relaxation clean up.
11942 (struct Input_section_info): Replace Relobj pointer and section index
11943 pair with Output_section::Simple_input_section and Convert struct to a
11944 class.
11945 (Input_section_sorter::operator()): Adjust access to
e1df38aa 11946 Input_section_info data member to use accessors.
20e6d0d6
DK
11947 (Output_section_element_input::set_section_addresses): Use layout
11948 parameter. Adjust code to use Output_section::Simple_input_section
11949 and Input_secction_info classes. Register filler for relaxation
11950 clean up.
11951 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11952 and section index pair with Output_section::Simple_input_section
11953 class. Adjust code accordingly.
11954 (Phdrs_element::release_segment): New method definition.
11955 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11956 segment list.
11957 (Script_sections::release_segments): New method definition.
11958 * gold/script-sections.h (Script_sections::release_segments): New
11959 method declaration.
11960 * gold/target.h (Target::may_relax, Target::relax,
11961 Target::do_may_relax, Target::do_relax): New method definitions.
11962
5e445df6
ILT
119632009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11964
11965 * arm.cc (has_signed_unsigned_overflow): New function.
11966 (Arm_relocate_functions::abs8): New function.
11967 (Target_arm::Scan::local): Handle R_ARM_ABS8.
11968 (Target_arm::Scan::global): Likewise.
11969 (Target_arm::relocate::relocate): Likewise.
11970 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11971 Likewise.
11972
8c604651 119732009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
11974
11975 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
11976 * testsuite/Makefile.in: Regenerate.
11977
1e9cc1c2
NC
119782009-09-11 Nick Clifton <nickc@redhat.com>
11979
11980 * po/gold.pot: Updated by the Translation project.
11981
6a89f575
CC
119822009-09-08 Cary Coutant <ccoutant@google.com>
11983
11984 * output.cc (Output_file::open): Add execute permission to empty file.
11985 * testsuite/Makefile.am (permission_test): New test.
11986 * testsuite/Makefile.in: Regenerate.
11987
fdcac5af
ILT
119882009-09-02 Ian Lance Taylor <iant@google.com>
11989
11990 * output.cc (Output_file::resize): Call map_no_anonymous rather
11991 than map.
11992
44453f85
ILT
119932009-09-01 Mikolaj Zalewski <mikolajz@google.com>
11994
11995 * gold.cc: Include "incremental.h".
11996 (queue_initial_tasks): Call Incremental_checker methods.
11997 * incremental.cc: Include "output.h".
11998 (Incremental_checker::can_incrementally_link_output_file): New
11999 method.
12000 * incremental.h (Incremental_checker): New class.
12001
12002 * output.cc (Output_file::open_for_modification): New method.
12003 (Output_file::map_anonymous): Changed return type to bool. Record
12004 map in base_ field.
12005 (Output_file::map_no_anonymous): New method, broken out of map.
12006 (Output_file::map): Use map_no_anonymous and map_anonymous.
12007 * output.h (class Output_file): Update declarations.
12008
293c1386
CC
120092009-08-24 Cary Coutant <ccoutant@google.com>
12010
12011 * options.h (Command_line::Pre_options): New class.
12012 (Command_line::pre_options): New member.
12013 * options.cc (gold::options::ready_to_register): New variable.
12014 (One_option::register_option): Do nothing if not registering options.
12015 Assert if same short option registered twice.
12016 (General_options::General_options): Turn off option registration when
12017 done constructing.
12018 (Command_line::Pre_options::Pre_options): New constructor.
12019
f773f3d2
CC
120202009-08-24 Cary Coutant <ccoutant@google.com>
12021
06a73cfe
CC
12022 * options.h (General_options::no_keep_memory): Remove incorrect
12023 short option.
f773f3d2 12024
a15af8e2
RW
120252009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12026
12027 * Makefile.am (am__skiplex, am__skipyacc): New.
12028 * Makefile.in: Regenerate.
12029
c462b41b
RW
120302009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12031
14ec8efd
RW
12032 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12033 (INCLUDES): ... this.
12034 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12035 (AM_CPPFLAGS): Renamed from ...
12036 (INCLUDE): ... this.
12037 * Makefile.in, testsuite/Makefile.in: Regenerate.
12038
81ecdfbb
RW
12039 * Makefile.in: Regenerate.
12040 * aclocal.m4: Likewise.
12041 * config.in: Likewise.
12042 * configure: Likewise.
12043 * testsuite/Makefile.in: Likewise.
12044
c462b41b
RW
12045 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12046 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12047 * Makefile.in: Regenerate.
12048 * testsuite/Makefile.in: Regenerate.
12049
2da73f13
CC
120502009-08-19 Cary Coutant <ccoutant@google.com>
12051
12052 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12053 symbols in shared libraries overridden by hidden or internal symbols
12054 in the main program.
12055
2db70501
CD
120562009-08-19 Chris Demetriou <cgd@google.com>
12057
12058 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12059 checking source file names in error messages.
12060
f733487b
DK
120612009-08-18 Doug Kwan <dougkwan@google.com>
12062
12063 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12064 an elcpp::Ehdr as parameter. Adjust call to set_target.
12065 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12066 an elfcpp::Ehdr as parameter.
12067 * object.cc (Object::set_target): Remove the version that looks up
12068 a target and sets it.
12069 (Sized_relobj::setup): Take a Target object instead of
12070 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12071 (make_elf_sized_object): Find target and ask target to
12072 make an ELF object.
12073 * object.h: (Object::set_target): Remove the version that looks up
12074 a target and sets it.
12075 (Sized_relobj::setup): Take a Target object instead of
12076 an elfcpp:Ehdr as parameter.
12077 * target.cc: Include dynobj.h.
12078 (Target::do_make_elf_object_implementation): New.
2e702c99 12079 (Target::do_make_elf_object): New.
f733487b
DK
12080 * target.h (Target::make_elf_object): New template declaration.
12081 (Target::do_make_elf_object): New method declarations.
12082 (Target::do_make_elf_object_implementation): New template declaration.
12083
cc70f101
ILT
120842009-08-14 Ian Lance Taylor <iant@google.com>
12085
12086 * gold.h (FUNCTION_NAME): Define.
12087 (gold_unreachable): Use FUNCTION_NAME.
12088
ef5e0cb1
ST
120892009-08-12 Sriraman Tallam <tmsriram@google.com>
12090
12091 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12092 symbol in the --keep-unique list is not found.
12093
48c187ce
ST
120942009-08-12 Sriraman Tallam <tmsriram@google.com>
12095
12096 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12097 been maked as --keep-unique.
12098 (Icf::unfold_section): New function.
12099 * icf.h (Icf::unfold_section): New function.
12100 * options.h (General_options::keep_unique): New option.
12101 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12102 * testsuite/Makefile.in: Regenerate.
12103 * testsuite/icf_keep_unique_test.sh: New file.
12104 * testsuite/icf_keep_unique_test.cc: New file.
12105
645afe0c
CC
121062009-08-12 Cary Coutant <ccoutant@google.com>
12107
12108 PR 10471
12109 * resolve.cc (Symbol_table::resolve): Check for references from
12110 dynamic objects to hidden and internal symbols.
12111 * testsuite/Makefile.am (hidden_test.sh): New test.
12112 * testsuite/Makefile.in: Regenerate.
12113 * testsuite/hidden_test.sh: New script.
12114 * testsuite/hidden_test_1.c: New test source.
12115 * testsuite/hidden_test_main.c: New test source.
12116
11af873f
DK
121172009-08-11 Doug Kwan <dougkwan@google.com>
12118
12119 * arm.cc: Update comments.
12120 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12121 segment to locate the .ARM.exidx section if present.
12122
b9f7d72d
DK
121232009-08-09 Doug Kwan <dougkwan@google.com>
12124
12125 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12126 patch.
12127
ddd3c53c
ST
121282009-08-07 Sriraman Tallam <tmsriram@google.com>
12129 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12130 compiler warnings.
12131
27721062
ST
121322009-08-06 Sriraman Tallam <tmsriram@google.com>
12133
12134 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12135 valid tls_segment only for non-debug-section relocations.
12136 * testsuite/Makefile.am: Add gc_tls_test.
12137 * testsuite/Makefile.in: Regenerate.
12138 * testsuite/gc_tls_test.cc: New file.
12139 * testsuite/gc_tls_test.sh: New file.
12140
ef15dade 121412009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12142
ef15dade
ST
12143 * icf.cc: New file.
12144 * icf.h: New file.
12145 * Makefile.am (CCFILES): Add icf.cc.
12146 (HFILES): Add icf.h
12147 * Makefile.in: Regenerate.
12148 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12149 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12150 section, symbol and addend information for the relocs.
12151 * gold.cc (queue_middle_tasks): Call identical code folding.
12152 * gold.h: Add defines for multimap.
12153 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12154 to the call of finalize_local_symbols.
12155 * main.cc (main): Create object of class Icf.
12156 * object.cc (Sized_relobj::do_layout): Allow this function to be
12157 called twice during icf.
12158 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12159 to sections marked as identical by icf.
12160 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12161 when available.
12162 (Sized_relobj::do_section_entsize): New function.
12163 * object.h (Object::section_entsize): New function.
12164 (Object::do_section_entsize): New pure virtual function.
12165 (Relobj::finalize_local_symbols): Add new parameter.
12166 (Relobj::do_section_entsize): New function.
12167 * options.h (General_options::icf): New option.
12168 (General_options::icf_iterations): New option.
12169 (General_options::print_icf_sections): New option.
12170 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12171 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12172 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12173 icf.
12174 * symtab.cc (Symbol_table::is_section_folded): New function.
12175 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12176 to sections marked as identical by icf.
12177 * symtab.h (Symbol_table::set_icf): New function.
12178 (Symbol_table::icf): New function.
12179 (Symbol_table::is_section_folded): New function.
12180 (Symbol_table::icf_): New data member.
12181 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12182 * testsuite/Makefile.am: Add commands to build icf_test.
12183 * testsuite/Makefile.in: Regenerate.
12184 * testsuite/icf_test.sh: New file.
12185 * testsuite/icf_test.cc: New file.
12186
c3b65ac4
CD
121872009-07-24 Chris Demetriou <cgd@google.com>
12188
12189 * layout.cc (is_compressible_debug_section): Fix incorrect
12190 comment about compressed section names.
12191
1caf2c51
ILT
121922009-07-20 Ian Lance Taylor <ian@airs.com>
12193
12194 PR 10419
12195 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12196
1ef4d87f
ILT
121972009-07-16 Ian Lance Taylor <iant@google.com>
12198
12199 PR 10400
12200 * layout.h: #include <map>.
12201 (class Kept_section): Change from struct to class. Add accessors
12202 and setters. Add section size to Comdat_group mapping. Change
12203 Comdat_group to std::map. Add is_comdat_ field. Add
12204 linkonce_size field in union.
12205 (class Layout): Update declaration of find_or_add_kept_section.
12206 Don't declare find_kept_object.
12207 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12208 parameter. Add object, shndx, is_comdat, and is_group_name
12209 parameters. Change all callers. Adjust for new Kept_section.
12210 (Layout::find_kept_object): Remove.
12211 * object.cc (Sized_relobj::include_section_group): Update use of
12212 Kept_section. Rename secnum to shndx. Only record
12213 Kept_comdat_section if sections are the same size.
12214 (Sized_relobj::include_linkonce_section): Update use of
12215 Kept_section. Only record Kept_comdat_section if sections are the
12216 same size. Set size of linkonce section.
12217 (Sized_relobj::map_to_kept_section): Update call to
12218 get_kept_comdat_section.
12219 * object.h (class Sized_relobj): Rename fields in
12220 Kept_comdat_section to drop trailing underscores; change object
12221 field to Relobj*. Change Kept_comdat_section_table to store
12222 struct rather than pointer.
12223 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12224 Add kept_object and kept_shndx parameters. Change all callers.
12225 (Sized_relobj::get_kept_comdat_section): Change return type to
12226 bool. Add kept_object and kept_shndx parameters. Change all
12227 callers.
12228 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12229 Layout::find_or_add_kept_section.
12230
37c3b7b0
ILT
122312009-07-09 Ian Lance Taylor <iant@google.com>
12232
12233 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12234 Reserve space in the hash table.
12235
98fa85cb
ILT
122362009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12237
12238 * fileread.cc (File_read::get_mtime): New method.
12239 * fileread.h (Timespec): New structure.
12240 (File_read::get_mtime): New method.
12241 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12242 Renamed from timestamp_nsec.
12243 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12244 Elf_Xword.
e1df38aa 12245 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12246 timestamp_nsec.
e1df38aa 12247 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12248 (Incremental_inputs::report_obejct): Save mtime; style fix.
12249 (Incremental_inputs::report_script): Save mtime; style fix.
12250 (Incremental_inputs::finalize_inputs): Style fix.
12251 (Incremental_inputs::finalize): Style fix.
12252 (Incremental_inputs::create_input_section_data): Store inputs
12253 mtime.
12254 * incremental.h (Incremental_inputs::report_script): Add mtime
12255 argument.
12256 (Incremental_inputs::Input_info::Input_info): Intialize only one
12257 union member.
12258 (Incremental_inputs::Input_info::archive): Move to nameless
12259 union.
12260 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12261 (Incremental_inputs::Input_info::script): Move to nameless union.
12262 (Incremental_inputs::mtime): New field.
12263 * script.cc (read_input_script): Pass file mtime to
12264 Incremental_input.
12265 * script.h (Script_info::inputs): Style fix.
12266
c9d70757
ILT
122672009-07-01 Ian Lance Taylor <ian@airs.com>
12268
12269 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12270 instead of 32.
12271
9c547ec3
ILT
122722009-06-24 Ian Lance Taylor <iant@google.com>
12273
12274 PR 10156
12275 * layout.cc (Layout::choose_output_section): If we find an
12276 existing section, update the flags.
12277 (Layout::create_notes): New function, broken out of
12278 Layout::finalize.
12279 (Layout::finalize): Don't create note sections.
12280 (Layout::create_note): Don't crash if linker script discards
12281 section.
12282 (Layout::create_gold_note): Likewise.
12283 (Layout::create_build_id): Likewise. Don't set
12284 after_input_sections on the section.
12285 (Layout::create_executable_stack_info): Remove target parameter.
12286 Change caller.
12287 * layout.h (class Layout): Declare create_notes. Update
12288 declaration of create_executable_stack_info.
12289 * gold.cc (queue_middle_tasks): Call create_notes.
12290 * output.cc (Output_section::update_flags_for_input_section): Move
12291 here from output.h. If SHF_ALLOC flag is newly set, mark address
12292 invalid.
12293 * output.h (Output_data::mark_address_invalid): New function.
12294 (class Output_section): Only declare, not define,
12295 update_flags_for_input_section. Remove set_flags.
12296
55458500
ILT
122972009-06-24 Ian Lance Taylor <iant@google.com>
12298
12299 * script-sections.cc (Output_section_definition::
12300 set_section_addresses): Rename shadowing local load_address to
12301 laddr.
12302
1307d6cd
ILT
123032009-06-24 Ian Lance Taylor <iant@google.com>
12304
12305 PR 10244
12306 * reloc.cc (relocate_sections): Skip empty relocation sections.
12307
ec3f783e
ILT
123082009-06-23 Ian Lance Taylor <iant@google.com>
12309
12310 PR 10156
12311 * layout.cc (Layout::create_note): Use choose_output_section
12312 rather than make_output_section.
12313
459c9f1c
ILT
123142009-06-23 Ian Lance Taylor <iant@google.com>
12315
12316 PR 10237
12317 * options.cc (General_options::parse_V): Set printed_version_.
12318 (General_options::General_options): Initialize printed_version_.
12319 * options.h (class General_options): Add printed_version_ field.
12320 * gold.cc (queue_initial_tasks): If there are no input files,
12321 don't give a fatal error if we printed the version information.
12322 (queue_middle_tasks): If using -r with a shared object, give a
12323 fatal error rather than an ordinary error.
12324
1518dc8f
ILT
123252009-06-23 Ian Lance Taylor <iant@google.com>
12326
12327 PR 10219
12328 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12329 (Layout::make_output_section): Set have_stabstr_section_ if we see
12330 a .stab*str section.
12331 (Layout::finalize): Call link_stabs_sections.
12332 (Layout::link_stabs_sections): New file.
12333 * layout.h (class Layout): Add have_stabstr_section_ field.
12334 Declare link_stabs_sections.
12335
3d857b98
DK
123362009-06-23 Doug Kwan <dougkwan@google.com>
12337
12338 * Makefile.am (libgold_a_LIBADD): New.
12339 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12340 * Makefile.in: Regenerate.
3d857b98
DK
12341 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12342 * configure: Regenerate.
12343 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12344 * fileread.cc: Include sys/state.h
12345 * gold.h: Declare memmem and strndup if found missing.
12346 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12347
0639a6f6
ILT
123482009-06-23 Ian Lance Taylor <iant@google.com>
12349
12350 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12351 * configure: Rebuild.
12352
8d63875c
ILT
123532009-06-23 Ian Lance Taylor <iant@google.com>
12354
12355 PR 10147
12356 * object.cc (Object::section_contents): Don't try to get a view if
12357 the section has length zero.
12358 (Object::handle_gnu_warning_section): If the section is empty, use
12359 the name of the section as the warning.
12360
f7c8a183
ILT
123612009-06-23 Ian Lance Taylor <iant@google.com>
12362
12363 PR 10133
12364 * stringpool.h (class Stringpool_template): Add optimize_ field.
12365 (Stringpool_template::set_optimize): New function.
12366 * stringpool.cc (Stringpool_template::Stringpool_template):
12367 Initialize optimize_ field.
12368 (Stringpool_template::set_string_offsets): Test local optimize
12369 fild rather than parameter.
12370 * layout.cc (Layout::Layout): Call set_optimize on the section
12371 name stringpool.
12372
e6a307ba
ILT
123732009-06-22 Ian Lance Taylor <iant@google.com>
12374
12375 PR 10030
12376 * yyscript.y: Parse TARGET.
12377 * script.cc (script_set_target): New function.
12378 * script-c.h (script_set_target): Declare.
12379 * options.cc (General_options::string_to_object_format): Rename
12380 from string_to_object_format in anonymous namespace. Change
12381 callers.
12382 * options.h (class General_options): Declare
12383 string_to_object_format.
12384
3ee173de
ILT
123852009-06-22 Ian Lance Taylor <iant@google.com>
12386
12387 * script-sections.cc (Script_sections::create_segments): Don't put
12388 program headers in a PT_LOAD segment if -n or -N.
12389
123902009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12391
12392 PR 10141
12393 * options.h (class General_options): Add -z lazy and -z now. Sort
12394 -z options into alphabetical order.
12395 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12396
cd6739a1 123972009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12398
12399 * layout.cc (Layout::make_output_section): Call
12400 Target::new_output_section.
12401 (Layout::attach_allocated_section_to_segment): Put large section
12402 sections in a separate load segment with the large segment flag
12403 set.
12404 (Layout::segment_precedes): Sort large data segments after other
12405 load segments.
12406 (align_file_offset): New static function.
12407 (Layout::set_segment_offsets): Use align_file_offset.
12408 * output.h (class Output_section): Add is_small_section_ and
12409 is_large_section_ fields.
12410 (Output_section::is_small_section): New function.
12411 (Output_section::set_is_small_section): New function.
12412 (Output_section::is_large_section): New function.
12413 (Output_section::set_is_large_section): New function.
12414 (Output_section::is_large_data_section): New function.
12415 (class Output_segment): Add is_large_data_segment_ field.
12416 (Output_segment::is_large_data_segment): New function.
12417 (Output_segment::set_is_large_data_segment): New function.
12418 * output.cc (Output_section::Output_section): Initialize new
12419 fields.
12420 (Output_segment::Output_segment): Likewise.
12421 (Output_segment::add_output_section): Add assertion that large
12422 data sections always go in large data segments. Force small data
12423 sections to the end of the list of data sections. Force small BSS
12424 sections to the start of the list of BSS sections. For large BSS
12425 sections to the end of the list of BSS sections.
12426 * symtab.h (class Symbol): Declare is_common_shndx.
12427 (Symbol::is_defined): Check Symbol::is_common_shndx.
12428 (Symbol::is_common): Likewise.
12429 (class Symbol_table): Define enum Commons_section_type. Update
12430 declarations. Add small_commons_ and large_commons_ fields.
12431 * symtab.cc (Symbol::is_common_shndx): New function.
12432 (Symbol_table::Symbol_table): Initialize new fields.
12433 (Symbol_table::add_from_object): Put small and large common
12434 symbols in the right list.
12435 (Symbol_table::sized_finalized_symbol): Check
12436 Symbol::is_common_shndx.
12437 (Symbol_table::sized_write_globals): Likewise.
12438 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12439 common symbol lists. Don't call do_allocate_commons_list if the
12440 list is empty.
12441 (Symbol_table::do_allocate_commons_list): Remove is_tls
12442 parameter. Add comons_section_type parameter. Change all
12443 callers. Handle small and large common symbols.
12444 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12445 Symbol::is_common_shndx.
12446 * resolve.cc (symbol_to_bits): Likewise.
12447 * target.h (Target::small_common_shndx): New function.
12448 (Target::small_common_section_flags): New function.
12449 (Target::large_common_shndx): New function.
12450 (Target::large_common_section_flags): New function.
12451 (Target::new_output_section): New function.
12452 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12453 small_common_section_flags, and large_common_section_flags
12454 fields.
12455 (Target::do_new_output_section): New virtual function.
12456 * arm.cc (Target_arm::arm_info): Initialize new fields.
12457 * i386.cc (Target_i386::i386_info): Likewise.
12458 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12459 Likewise.
12460 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12461 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12462 (Target_x86_64::do_new_output_section): New function.
12463 * configure.ac: Define conditional MCMODEL_MEDIUM.
12464 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12465 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12466 (large_LDFLAGS): Define.
12467 * testsuite/large.c: New file.
12468 * testsuite/testfile.cc (Target_test::test_target_info):
12469 Initialize new fields.
12470 * configure, testsuite/Makefile.in: Rebuild.
12471
bb04269c
DK
124722009-06-05 Doug Kwan <dougkwan@google.com>
12473
12474 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 12475 * Makefile.in: Regenerate.
bb04269c
DK
12476 * i386.cc (class Target_i386): Define new virtual method to
12477 override do_is_local_label_name in parent.
12478 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12479 local symbols if --discard-locals or -X is given.
12480 * options.h (class General_options): Declare new options
12481 '--discard-locals' and '-X' for discarding locals.
12482 * target.h (class Target): Define new methods is_local_label_name.
12483 Declare new virtual method do_is_local_label_name.
12484 * target.cc: New file.
12485 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12486 (check_SCRIPTS): Add discard_locals_test.sh.
12487 (check_DATA): Add discard_local_tests.syms.
12488 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12489 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12490 * testsuite/Makefile.in: Regenerate.
12491 * testsuite/discard_locals_test.c: New file.
12492 * testsuite/discard_locals_test.sh: Same.
12493
805bb01c
DK
124942009-06-05 Doug Kwan <dougkwan@google.com>
12495
12496 * object.cc (Sized_relobj::Sized_relobj): Initialize
12497 discarded_eh_frame_shndx_ to -1U.
12498 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12499 section.
12500 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12501 a discarded .eh_frame section.
12502 (Sized_relobj::do_finalize_local_symbols): Ditto.
12503 * object.h (class Sized_relobj): Declare new member
12504 discarded_eh_frame_shndx_.
12505 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12506 (local_labels_test.o, local_labels_test): New rules.
12507 * testsuite/Makefile.in: Regenerate.
12508
1dcd334d
DK
125092009-06-04 Doug Kwan <dougkwan@google.com>
12510
12511 * layout.cc (Layout::section_name_mapping): Add mapping for
12512 special ARM sections.
12513
96d49306
DK
125142009-06-03 Doug Kwan <dougkwan@google.com>
12515
12516 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12517 (utils::has_overflow): Same.
12518
dff16297
ILT
125192009-06-03 Ian Lance Taylor <iant@google.com>
12520
12521 * layout.cc (Layout::section_name_mapping): New array, replacing
12522 Layout::linkonce_mapping.
12523 (Layout::section_name_mapping_count): New variable, replacing
12524 Layout::linkonce_mapping_count.
12525 (Layout::linkonce_output_name): Remove.
12526 (Layout::output_section_name): Rewrite.
12527 * layout.h (class Layout): Rename Linkonce_mapping to
12528 Section_name_mapping, linkonce_mapping to section_name_mapping,
12529 linkonce_mapping_count to section_name_mapping_count. Don't
12530 declare linkonce_output_name.
12531
c121c671
DK
125322009-06-03 Doug Kwan <dougkwan@google.com>
12533
12534 * gold/arm.cc (namespace utils): New.
12535 (Target_arm::reloc_is_non_pic): Define new method.
12536 (class Arm_relocate_functions): New.
12537 (Target_arm::Relocate::relocate): Handle relocation types used by
12538 Android.
12539
07800fab
ILT
125402009-06-03 Ian Lance Taylor <iant@google.com>
12541
12542 * arm.cc (Target_arm::scan::global): Use || instead of |.
12543
c121c671
DK
125442009-06-02 Doug Kwan <dougkwan@google.com>
12545
12546 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12547 issued_non_pic_error_.
12548 (class Target_arm::Scan): Declare new method check_non_pic.
12549 Define new method symbol_needs_plt_entry.
12550 Declare new data member issued_non_pic_error_.
12551 (class Target_arm::Relocate): Declare new method
12552 should_apply_static_reloc.
12553 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12554 (Target_arm::Scan::check_non_pic): Define new method.
12555 (Target_arm::Scan::local): Handle a small subset of reloc types used
12556 by Android.
12557 (Target_arm::Scan::local): Same.
12558 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12559
b19b0c6d
ILT
125602009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12561
12562 * incremental.cc (Incremental_inputs::report_command_line): Filter
12563 out --incremental-* options.
12564
94cdfcff
DK
125652009-05-29 Doug Kwan <dougkwan@google.com>
12566
12567 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12568 template class.
12569 (class Target_arm): Update comment.
12570 (Target_arm::Target_arm): Initialize new data members GOT_,
12571 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12572 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12573 and Target_arm::rel_dyn_section.
12574 Declare new_enum Target_arm::Got_type.
12575 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12576 and DYNBSS_.
12577 Update commments for member do_dynsym_value.
12578 (Target_arm::got_size, Target_arm::plt_section,
12579 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12580 new methods inside class defintion.
12581 (Target_arm::got_section): Define new method.
12582 (Target_arm::rel_dyn_section): Same.
12583 (Output_data_plt_arm): New template class.
12584 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12585 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12586 (Output_data_plt_arm::add_entry): Same.
12587 (Output_data_plt_arm::first_plt_entry): Define new
12588 static data member for PLT instruction template.
12589 (Output_data_plt_arm::plt_entry): Same.
12590 (Output_data_plt_arm::do_write): Define new method.
12591 (Target_arm::make_plt_entry): Same.
12592 (Target_arm::do_finalize_sections): Same.
12593 (Target_arm::do_dynsym_value): Same.
12594
4a657b0d
DK
125952009-05-28 Doug Kwan <dougkwan@google.com>
12596
12597 * Makefile.am (TARGETSOURCES): Add arm.cc.
12598 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12599 * Makefile.in: Regenerate.
12600 * arm.cc: New file.
12601 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12602
e7ae8c36
DK
126032009-05-26 Doug Kwan <dougkwan@google.com>
12604
12605 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12606 (General_options::check_excluded_libs): Strip off directories in
12607 archive name before matching like GNU ld does.
12608 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12609 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12610 (exclude_libs_test_LDFLAGS): Add linker option
12611 -Wl,--exclude-libs,libexclude_libs_test_3
12612 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12613 an explicit archive without using -l.
12614 (alt/libexclude_libs_test_3.a): New make rule.
12615 * testsuite/Makefile.in: Regenerate.
12616 * testsuite/exclude_libs_test.c : Declare lib3_default().
12617 (main): Call it.
12618 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12619 * exclude_libs_test_3.c: New file.
12620
f12e7348
NC
126212009-05-26 Nick Clifton <nickc@redhat.com>
12622
12623 * po/id.po: New Indonesian translation.
12624 * po/gold.pot: Updated template file.
12625
4daadc0d
ST
126262009-05-22 Sriraman Tallam <tmsriram@google.com>
12627
e1df38aa 12628 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
12629 gc_comdat_test files. Add -Wl,--gc-sections to build
12630 gc_comdat_test.
12631 * testsuite/Makefile.in: Regenerate.
12632 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12633
531813ad
ST
126342009-05-21 Sriraman Tallam <tmsriram@google.com>
12635
12636 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12637 kept comdat section was garbage collected.
12638 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12639 * testsuite/Makefile.in: Regenerate.
12640 * testsuite/gc_comdat_test.sh: New file.
12641 * testsuite/gc_comdat_test_1.cc: New file.
12642 * testsuite/gc_comdat_test_2.cc: New file.
12643
65514900
CC
126442009-05-19 Doug Kwan <dougkwan@google.com>
12645
12646 * archive.cc (Archive::Archive): Move constructor from archive.h
12647 to here. Initialize no_export_.
12648 (Archive::get_elf_object_for_member): Set no_export flag of object.
12649 * archive.h (Archive::Archive): Move constructor body to
12650 archive.cc.
12651 (Archive::no_export): New method.
12652 (Archive::no_export_): New field.
12653 * object.h (Object::Object): Initialize no_export_ to false.
12654 (Object::no_export, Object::set_no_export): New methods.
12655 (Object::no_export_): New field.
12656 * options.cc (General_options::parse_exclude_libs): New method.
12657 (General_options::check_excluded_libs) Same.
12658 * options.h (exclude_libs): New option.
12659 (General_options::check_excluded_libs): New method declaration.
12660 (General_options::excluded_libs_): New field.
12661 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12662 default or protected visibility if an object has no-export flag set.
12663 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12664 (check_SCRIPTS): Add exclude_libs_test.sh.
12665 (check_DATA): Add exclude_libs_test.syms.
12666 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12667 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12668 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12669 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12670 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12671 libexclude_libs_test_2.a): New rules.
12672 * testsuite/Makefile.in: Regenerate.
12673 * testsuite/exclude_libs_test.c: New file.
12674 * testsuite/exclude_libs_test.sh: Ditto.
12675 * testsuite/exclude_libs_test_1.c: Ditto.
12676 * testsuite/exclude_libs_test_2.c: Ditto.
12677
1b77ea50
ILT
126782009-05-15 Ian Lance Taylor <iant@google.com>
12679
12680 * configure.ac: Check for declarations for cases where libiberty.h
12681 checks HAVE_DECL_xxx.
12682 * configure, config.in: Rebuild.
12683
072fe7ce
ILT
126842009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12685
12686 * gold.h (Incremental_argument_list): Remove (invalid) forward
12687 declaration.
12688 * incremental.cc (Incremental_inputs::report_achive): New method.
12689 (Incremental_inputs::report_object): New method.
12690 (Incremental_inputs::report_script): New method.
12691 (Incremental_inputs::finalize_inputs): New method.
12692 (Incremental_inputs::finalize): Call finalize_inputs().
12693 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12694 Create inputs entries.
12695 * incremental.h (Incremental_input_type): New enum.
12696 (Incremental_inputs::Incremental_input): Initialize new fields.
12697 (Incremental_inputs::report_inputs): New method.
12698 (Incremental_inputs::report_achive): New method.
12699 (Incremental_inputs::report_object): New method.
12700 (Incremental_inputs::report_script): New method.
12701 (Incremental_inputs::finalize_inputs): New method.
12702 (Incremental_inputs::Input_info): New struct.
12703 (Incremental_inputs::Input_info_map): New typedef.
12704 (Incremental_inputs::lock_): New field.
12705 (Incremental_inputs::Inputs_): New field.
12706 (Incremental_inputs::Inputs_map): New field.
12707 * main.cc (main): Call Incremental_input::report_inputs.
12708 * options.h (Input_argument_list): Typedef moved from
12709 Input_arguments.
12710 (Input_file_group::Files): Remove, use ::Input_argument_list.
12711 (Input_file_group::Input_argument_list): Remove, use
12712 ::Input_argument_list.
12713 * plugin.cc (Plugin_manager::add_input_file): Add error in
12714 incremental build.
12715 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12716 functions.
12717 * script.cc (read_input_script): Call
12718 Incremental_input::report_script.
12719 * script.h (Script_info): New class.
12720
b0481b0b
ILT
127212009-04-27 Ian Lance Taylor <iant@google.com>
12722
12723 * x86_64.cc (do_adjust_output_section): Set entsize to
12724 plt_entry_size.
12725
b22a5a41 127262009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
12727
12728 * output.cc (Output_file::close): After short writes, continue
12729 writing from the correct offset in the buffer being written.
12730
40fde488
CD
127312009-04-23 Chris Demetriou <cgd@google.com>
12732
12733 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
12734 * configure: Regenerate.
12735 * config.in: Regenerate.
12736 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
12737 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
12738
3ce2c28e
ILT
127392009-04-21 Mikolaj Zalewski <mikolajz@google.com>
12740
12741 * incremental.cc (Incremental_inputs_header_data): Renamed from
12742 Incremental_input_header_data.
12743 (Incremental_inputs_header_data::data_size): New field.
12744 (Incremental_inputs_header_data::put_input_file_count): Renamed
12745 from input_file_count.
12746 (Incremental_inputs_header_data::put_command_line_offset): Renamed
12747 from command_line_offset.
12748 (Incremental_inputs_header_data::put_reserved): Renamed from
12749 put_reserved.
12750 (Incremental_inputs_entry_data): Renamed from
12751 Incremental_input_entry_data.
12752 (Incremental_inputs_entry_data::data_size): New field.
12753 (Incremental_inputs::report_command_line): New method.
12754 (Incremental_inputs::finalize): New method.
12755 (Incremental_inputs::create_incremental_inputs_data): New method.
12756 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
12757 * incremental.h: New file.
12758 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 12759 (Layout::finalize): Create incremental inputs section in
3ce2c28e 12760 incremental builds.
703d02da 12761 (Layout::create_incremental_info_sections): New method.
3ce2c28e 12762 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
12763 (Layout::create_incremental_info_sections): New method.
12764 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
12765 * main.cc (main): Notify Incremental_input of the command line.
12766
e55bde5e
ILT
127672009-04-01 Ian Lance Taylor <iant@google.com>
12768 Mikolaj Zalewski <mikolajz@google.com>
12769
12770 * gold.h (reserve_unordered_map): Define, three versions, one for
12771 each version of Unordered_map.
12772 * layout.cc (Layout::Layout): Remove options parameter. Add
12773 number_of_input_files parameter. Don't initialize options_.
12774 Initialize number_of_input_files_ and resized_signatures_. Move
12775 sections_are_attached_.
12776 (Layout::layout_group): Reserve space for group_signatures_.
12777 (Layout::find_or_add_kept_section): Change name parameter to be a
12778 reference. Resize signatures_ map when it gets large enough.
12779 (Layout::layout_eh_frame): Use parameters->options() instead of
12780 this->options_.
12781 (Layout::make_output_section): Likewise.
12782 (Layout::attach_allocated_section_to_segment): Likewise.
12783 (Layout::finalize, Layout::create_executable_stack): Likewise.
12784 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
12785 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
12786 * layout.h (class Layout): Update declarations. Remove options_
12787 field. Add number_of_input_files_ and resized_signatures_
12788 fields. Move sections_are_attached_ field.
12789 * main.cc (main): Pass number of input files to Layout
12790 constructor. Don't pass options.
12791
154b857c
ILT
127922009-03-30 Ian Lance Taylor <iant@google.com>
12793
12794 * ffsll.c (ffsll): Correct implementation.
12795
2f35ab9b
ILT
127962009-03-27 Ian Lance Taylor <iant@google.com>
12797
fd03461a
ILT
12798 * ffsll.c: New file.
12799 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
12800 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
12801 * ftruncate.c (ftruncate): Declare before definition.
12802 * mremap.c (mremap): Likewise.
12803 * pread.c (pread): Likewise.
12804 * configure, Makefile.in, config.in: Rebuild.
12805
2f35ab9b
ILT
12806 * mremap.c: New file.
12807 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
12808 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
12809 (mremap): Declare if HAVE_MREMAP is not defined.
12810 * configure, Makefile.in, config.in: Rebuild.
12811
33aea2fd
CC
128122009-03-27 Cary Coutant <ccoutant@google.com>
12813
12814 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
12815 position independent.
12816 * sparc.cc (Target_sparc::check_non_pic): Likewise.
12817 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
12818
6d479619
CC
128192009-03-24 Cary Coutant <ccoutant@google.com>
12820
12821 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
12822 an executable.
12823 (needs_dynamic_reloc): Likewise.
12824
afc06bb8
ILT
128252009-03-24 Ian Lance Taylor <iant@google.com>
12826
12827 * yyscript.y (file_cmd): Recognize EXTERN.
12828 (extern_name_list, extern_name_list_body): New nonterminals.
12829 * script.cc (script_add_extern): Define.
12830 * script-c.h (script_add_extern): Declare.
12831
f6060a4d
ILT
128322009-03-24 Rafael Avila de Espindola <espindola@google.com>
12833
12834 * object.cc (is_elf_object): Define.
12835 * object.h (is_elf_object): Declare.
12836 * archive.cc (Archive::get_elf_object_for_member): Call
12837 is_elf_object.
33aea2fd 12838 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 12839
26736d8e
ILT
128402009-03-24 Elliott Hughes <enh@google.com>
12841
12842 * output.cc (Output_file::map_anonymous): Define.
12843 (Output_file::map): Use map_anonymous. If the regular mmap fails,
12844 try an anonymous one. Report the size if the mmap fails.
12845 * output.h (class Output_file): Declare map_anonymous.
12846
22fd9730
ILT
128472009-03-24 Ian Lance Taylor <iant@google.com>
12848
12849 * target-select.cc (instantiate_target): Don't acquire the lock if
12850 the instantiated_target_ field has already been set.
12851
cb010894
ILT
128522009-03-23 Ian Lance Taylor <iant@google.com>
12853
7f055c20
ILT
12854 * gold-threads.h (class Initialize_lock): Define.
12855 * gold-threads.cc (class Initialize_lock_once): Define.
12856 (initialize_lock_control): New static variable.
12857 (initialize_lock_pointer): New static variable.
12858 (initialize_lock_once): New static function.
12859 (Initialize_lock::Initialize_lock): Define.
12860 (Initialize_lock::initialize): Define.
12861 * target-select.h: Include "gold-threads.h".
12862 (class Target_selector): Add lock_ and initialize_lock_ fields.
12863 Don't define instantiate_target, just declare it.
12864 * target-select.cc (Target_selector::Target_selector): Initialize
12865 new fields.
12866 (Target_selector::instantiate_target): Define.
12867 * descriptors.h: Include "gold-threads.h".
12868 (class Descriptors): Add initialize_lock_ field.
12869 * descriptors.cc (Descriptors::Descriptors): Initialize new
12870 field.
12871 (Descriptors::open): Use initialize_lock_ field
12872 * errors.h (class Errors): Add initialize_lock_ field.
12873 * errors.cc (Errors::Errors): Initialize new field.
12874 (Errors::initialize_lock): Use initialize_lock_ field.
12875 * powerpc.cc (class Target_selector_powerpc): Remove
12876 instantiated_target_ field. In do_recognize call
12877 instantiate_target rather than do_instantiate_target. In
12878 do_instantiate_target just allocate a new target.
12879 * sparc.cc (class Target_selector_sparc): Likewise.
12880
36959681
ILT
12881 * freebsd.h: New file.
12882 * i386.cc: Include "freebsd.h".
12883 (Target_i386): Derive from Target_freebsd rather than
12884 Sized_target.
12885 (Target_selector_i386): Derive from Target_selector_freebsd rather
12886 than Target_selector.
12887 * x86_64.cc: Include "freebsd.h".
12888 (Target_x86_64): Derive from Target_freebsd rather than
12889 Sized_target.
12890 (Target_selector_x86_64): Derive from Target_selector_freebsd
12891 rather than Target_selector.
12892 * target.h (class Target): Add adjust_elf_header and
12893 do_adjust_elf_header.
12894 * output.cc (Output_file_header:: do_sized_write): Call target
12895 adjust_elf_header routine.
12896 * configure.tgt: Set targ_osabi.
12897 * configure.ac: Define GOLD_DEFAULT_OSABI.
12898 * parameters.cc (Parameters::default_target): Pass
12899 GOLD_DEFAULT_OSABI to select_target.
12900 * target-select.h (class Target_selector): Make instantiate_target
12901 protected rather than private.
12902 * Makefile.am (HFILES): Add freebsd.h.
12903 * configure, Makefile.in, config.in: Rebuild.
12904
cb010894
ILT
12905 * merge.cc (do_add_input_section): Correct pend value. Change
12906 message about last entry not being null terminated from error to
12907 warning.
12908
0e879927
ILT
129092009-03-20 Mikolaj Zalewski <mikolajz@google.com>
12910
12911 * incremental.cc: New file.
12912 * Makefile.am (CCFILES): Add incremental.cc.
12913 * Makefile.in: Rebuild.
12914
41105937
PP
129152009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
12916
12917 * layout.cc (Layout::output_section_name): Preserve names
12918 of '.note.' sections.
e1df38aa 12919
60439920
ILT
129202009-03-19 Ian Lance Taylor <iant@google.com>
12921
12922 * descriptors.cc (Descriptors::open): Check that the options are
12923 valid before using them.
12924
0d371ad3
ILT
129252009-03-18 Ian Lance Taylor <iant@google.com>
12926
12927 * script-sections.h: Include <list>.
12928 (class Script_sections): Change Sections_elements from std::vector
12929 to std::list. Typedef public Elements_iterator. Add
12930 orphan_section_placement_, data_segment_align_start_, and
12931 saw_data_segment_align_ fields. Remove data_segment_align_index_
12932 field.
12933 * script-sections.cc (class Orphan_section_placement): New class.
12934 (class Sections_element): Add virtual functions is_relro and
12935 orphan_section_init. Remove virtual function place_orphan_here.
12936 (class Output_section_definition): Add is_relro and
12937 orphan_section_init. Remove place_orphan_here.
12938 (class Orphan_output_section): Likewise.
12939 (Script_sections::Script_sections): Update for field changes.
12940 (Script_sections::data_segment_align): Set saw_data_segment_align_
12941 and data_segment_align_start_, not data_segment_align_index.
12942 (Script_sections::data_segment_relro_end): Check
12943 saw_data_segment_align_. Use data_segment_align_start_ rather
12944 than data_segment_align_index_.
12945 (Script_sections::place_orphan): Rewrite to use
12946 Orphan_section_placement.
12947
9201d894
ILT
129482009-03-17 Ian Lance Taylor <iant@google.com>
12949
9c5b8369
ILT
12950 * archive.cc (Archive::add_symbols): Check for a version attached
12951 to the symbol name in the archive map.
12952 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12953 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12954 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12955 (ver_test_11.a): New target.
12956 * testsuite/Makefile.in: Rebuild.
12957
9201d894
ILT
12958 * configure.ac: Check for chsize and posix_fallocate. Replace
12959 ftruncate.
12960 * ftruncate.c: New file, from gnulib.
12961 * output.cc (posix_fallocate): Define dummy version if not
12962 HAVE_POSIX_FALLOCATE.
12963 (Output_file::map): Call posix_fallocate rather than lseek and
12964 write.
12965 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
12966 * configure, Makefile.in, config.in: Rebuild.
12967
ef4ab7a8 129682009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 12969
ef4ab7a8
PP
12970 * layout.h (Layout::create_note): Add section_name parameter.
12971 * layout.cc (Layout::create_note): Likewise.
12972 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 12973
8c500701
ILT
129742009-03-17 Ian Lance Taylor <iant@google.com>
12975
e85b18e1
ILT
12976 * descriptors.cc: Include "options.h".
12977 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
12978 (Descriptors::open): Always use O_CLOEXEC when opening a new
12979 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
12980 then set FD_CLOEXEC.
12981
9efe6174
ILT
12982 * sparc.cc (class Target_sparc): Add has_got_section.
12983 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
12984 make sure we have a GOT section.
12985
12986 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
12987 (Target_sparc::Scan::local): Likewise.
12988 (Target_sparc::Scan::global): Likewise.
12989 (Target_sparc::Relocate::relocate): Likewise.
12990 (Target_sparc::Relocate::relocate_tls): Likewise.
12991
8c500701
ILT
12992 * symtab.cc (Symbol_table::define_default_version): New function,
12993 broken out of add_from_object.
12994 (Symbol_table::add_from_object): Call define_default_version.
12995 (Symbol_table::define_special_symbol): Add resolve_oldsym
12996 parameter. Change all callers. If the version for a symbol comes
12997 from a version script, resolve it with the symbol with the same
12998 name with no version. Also add the symbol without a version if
12999 appropriate.
13000 (do_define_in_output_data): If resolving with oldsym, don't delete
13001 sym.
13002 (do_define_in_output_segment): Likewise.
13003 (do_define_as_constant): Likewise.
13004 * symtab.h (class Symbol_table): Update declarations.
13005
f1ed28fb
ILT
130062009-03-13 Ian Lance Taylor <iant@google.com>
13007
15f8229b
ILT
13008 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13009 (Read_symbols::requeue): New function.
13010 (Read_symbols::do_read_symbols): If make_elf_object fails because
13011 the target type is not configured, and the file was searched for,
13012 issue a warning and retry with the next directory.
13013 (Add_symbols::run): If the file has an incompatible format, and
13014 it was searched for, requeue the Read_symbols task. On error,
13015 release the object.
13016 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13017 dirindex parameter to constructor. Change all callers. Declare
13018 incompatible_warning and requeue.
13019 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13020 input_argument_ and input_group_ fields. Add them to
13021 constructor. Change all callers.
13022 (class Read_script): Add dirindex_ field. Add it to constructor.
13023 Change all callers.
13024 * archive.cc (Archive::setup): Remove input_objects parameter.
13025 Change all callers.
13026 (Archive::get_file_and_offset): Likewise.
13027 (Archive::read_all_symbols): Likewise.
13028 (Archive::read_symbols): Likewise.
13029 (Archive::get_elf_object_for_member): Remove input_objects
13030 parameter. Add punconfigured parameter. Change all callers.
13031 (Archive::add_symbols): Change return type to bool. Check return
13032 value of include_member.
13033 (Archive::include_all_members): Likewise.
13034 (Archive::include_member): Change return type to bool. Return
13035 false if first included object has incompatible target. Set
13036 included_member_ field.
13037 (Add_archive_symbols::run): If add_symbols returns false, requeue
13038 Read_symbols task.
13039 * archive.h (class Archive): Add included_member_ field.
13040 Initialize it in constructor. Add input_file and searched_for
13041 methods. Update declarations.
13042 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13043 input_argument_ fields. Add them to constructor. Change all
13044 callers.
13045 * script.cc: Include "target-select.h".
13046 (class Parser_closure): Add skip_on_incompatible_target_ and
13047 found_incompatible_target_ fields. Add
13048 skip_on_incompatible_target parameter to constructor. Change all
13049 callers. Add methods skip_on_incompatible_target,
13050 clear_skip_on_incompatible_target, found_incompatible_target, and
13051 set_found_incompatible_target.
13052 (read_input_script): Add dirindex parameter. Change all callers.
13053 If parser finds an incompatible target, requeue Read_symbols
13054 task.
13055 (script_set_symbol): Clear skip_on_incompatible_target in
13056 closure.
13057 (script_add_assertion, script_parse_option): Likewise.
13058 (script_start_sections, script_add_phdr): Likewise.
13059 (script_check_output_format): New function.
13060 * script.h (read_input_script): Update declaration.
13061 * script-c.h (script_check_output_format): Declare.
13062 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13063 (ignore_cmd): Remove OUTPUT_FORMAT.
13064 * fileread.cc (Input_file::Input_file): Add explicit this.
13065 (Input_file::will_search_for): New function.
13066 (Input_file::open): Add pindex parameter. Change all callers.
13067 * fileread.h (class Input_file): Add input_file_argument method.
13068 Declare will_search_for. Update declarations.
13069 * object.cc (make_elf_object): Add punconfigured parameter.
13070 Change all callers.
13071 * object.h (class Object): Make input_file public. Add
13072 searched_for method.
13073 (make_elf_object): Update declaration.
13074 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13075 restart search.
13076 * dirsearch.h (class Dirsearch): Update declaration.
13077 * options.h (class General_options): Add --warn-search-mismatch.
13078 * parameters.cc (Parameters::is_compatible_target): New function.
13079 * parameters.h (class Parameters): Declare is_compatible_target.
13080 * workqueue.cc (Workqueue::add_blocker): New function.
13081 * workqueue.h (class Workqueue): Declare add_blocker.
13082
f1ed28fb
ILT
13083 * fileread.cc (Input_file::open): Remove options parameter.
13084 Change all callers.
13085 (Input_file::open_binary): Likewise.
13086 * script.cc (read_input_script): Likewise.
13087 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13088 options parameter from constructor. Change all callers.
13089 (class Read_script): Likewise.
13090 * fileread.h (class Input_file): Update declarations.
13091 * script.h (read_input_script): Update declaration.
13092
34dd024a
NC
130932009-03-10 Nick Clifton <nickc@redhat.com>
13094
13095 * po/es.po: New Spanish translation.
13096
6d71b17c
CC
130972009-03-06 Cary Coutant <ccoutant@google.com>
13098
13099 * options.cc (parse_short_option): Keep dash_z from registering itself.
13100
031cdbed
ILT
131012009-03-03 Ian Lance Taylor <iant@google.com>
13102
13103 PR 9918
13104 * target-reloc.h (relocate_section): Pass output_section to
13105 relocate.
13106 * i386.cc (Target_i386::should_apply_static_reloc): Add
13107 output_section parameter. Change all callers.
13108 (Target_i386::Relocate::relocate): Add output_section parameter.
13109 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13110 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13111 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13112 * testsuite/two_file_shared.sh: New script.
13113 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13114 (check_DATA): Add two_file_shared.dbg.
13115 (two_file_shared.dbg): New target.
13116 * testsuite/Makefile.in: Rebuild.
13117
15d5fa16
ILT
131182009-03-01 Ian Lance Taylor <iant@google.com>
13119
13120 * configure.ac: Check for byteswap.h.
13121 * configure: Rebuild.
13122 * config.in: Rebuild.
13123
8a4c0b0d
ILT
131242009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13125
13126 * layout.cc (Layout::find_or_add_kept_section): New function.
13127 (Layout::add_comdat): Removed.
13128 * layout.h (struct Kept_section): Move out of class Layout.
13129 Remove trailing underscores from field names. Add group_sections
13130 field. Rename group_ field to is_group. Change all uses.
13131 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13132 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13133 comdat_groups_ field.
13134 (Sized_relobj::include_section_group): Use
13135 find_or_add_kept_section and Kept_section::group_sections.
13136 (Sized_relobj::include_linkonce_section): Likewise.
13137 * object.cc (class Sized_relobj): Don't define Comdat_group or
13138 Comdat_group_table. Remove find_comdat_group and
13139 add_comdat_group. Remove comdat_groups_ field.
13140 * plugin.cc (include_comdat_group): Use
13141 Layout::find_or_add_kept_section.
13142
b4ecf66b
ILT
131432009-02-28 Ian Lance Taylor <iant@google.com>
13144
14359ca0
ILT
13145 * README: --gc-sections and map files are now supported. Document
13146 some build requirements.
13147
b4ecf66b
ILT
13148 PR 6992
13149 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13150 relocatable link set the value of the section symbol to zero.
13151 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13152 relocatable link don't include the section address in the local
13153 symbol value.
13154
0602e05a
ILT
131552009-02-27 Ian Lance Taylor <iant@google.com>
13156
fd9d194f
ILT
13157 PR 6811
13158 * options.h (class Search_directory): Add is_system_directory.
13159 (class General_options): Declare is_in_system_directory.
13160 * options.cc (get_relative_sysroot): Make static.
13161 (get_default_sysroot): Make static.
13162 (General_optoins::is_in_system_directory): New function.
13163 * fileread.cc (Input_file::is_in_system_directory): New function.
13164 * fileread.h (class Input_file): Declare is_in_system_directory.
13165 * object.h (class Object): Add is_in_system_directory.
13166 (class Input_objects): Remove system_library_directory_ field.
13167 * object.cc (Input_objects::add_object): Don't set
13168 system_library_directory_.
13169 (input_objects::found_in_system_library_directory): Remove.
13170 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13171 parameter. Change all callers.
13172 (Symbol_table::sized_write_globals): Likewise.
13173 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13174 Call Object::is_in_system_directory.
13175 * symtab.h (class Symbol_table): Update declarations.
13176
61edd21f
ILT
13177 PR 5990
13178 * descriptors.h (Open_descriptor): Add is_on_stack field.
13179 * descriptors.cc (Descriptors::open): If the descriptor is on the
13180 top of the stack, remove it. Initialize is_on_stack field.
13181 (Descriptors::release): Only add pod to stack if it is not on the
13182 stack already.
13183 (Descriptors::close_some_descriptor): Clear stack_next and
13184 is_on_stack fields.
13185
e29e076a
ILT
13186 PR 7091
13187 * output.cc (Output_section::find_starting_output_address): Rename
13188 from starting_output_address; add PADDR parameter; change return
13189 type.
13190 * output.h (class Output_section): Declare
13191 find_starting_output_address instead of starting_output_address.
13192 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13193 section symbol for which we can't find a merge section.
13194
0602e05a
ILT
13195 PR 9836
13196 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13197 hidden or internal, force the symbol to be local.
13198 * resolve.cc (Symbol::override_visibility): Define.
13199 (Symbol::override_base): Use override_visibility.
13200 (Symbol_table::resolve): Likewise.
13201 (Symbol::override_base_with_special): Likewise.
13202 (Symbol_table::override_with_special): If the visibility is hidden
13203 or internal, force the symbol to be local.
13204 * symtab.h (class Symbol): Add set_visibility and
13205 override_visibility.
13206 * testsuite/ver_test_1.sh: New file.
13207 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13208 (check_DATA): Add ver_test_1.syms.
13209 (ver_test_1.syms): New target.
13210 * testsuite/Makefile.in: Rebuild.
13211
401a9a73
CC
132122009-02-25 Cary Coutant <ccoutant@google.com>
13213
13214 * layout.cc (Layout::choose_output_section): Don't rename sections
13215 when using a linker script that has a SECTIONS clause.
13216 * Makefile.in: Regenerate.
13217
13218 * testsuite/Makefile.am (script_test_5.sh): New test case.
13219 * testsuite/Makefile.in: Regenerate.
13220 * testsuite/script_test_5.cc: New file.
13221 * testsuite/script_test_5.sh: New file.
13222 * testsuite/script_test_5.t: New file.
13223
f488e4b0
CC
132242009-02-13 Rafael Avila de Espindola <espindola@google.com>
13225
13226 * archive.cc (Archive::include_member): Update calls to add_symbols.
13227 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13228 the Layout argument.
13229 * dynobj.h (do_add_symbols): Add the Layout argument.
13230 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13231 Layout argument.
13232 * object.h (Object::add_symbols): Add the Layout argument.
13233 (Object::do_add_symbols): Add the Layout argument.
13234 (Sized_relobj::do_add_symbols): Add the Layout argument.
13235 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13236 Unify the two versions.
13237 (Add_plugin_symbols): Remove.
13238 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13239 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13240 (Add_plugin_symbols): Remove.
13241 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13242 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13243 (Add_symbols::run): Make it work with Pulginobj.
13244
89dd1680
ILT
132452009-02-06 Ian Lance Taylor <iant@google.com>
13246
13247 * object.cc (Sized_relobj::do_layout): Make info message start
13248 with lower case letter.
13249
266d0a74
ILT
132502009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13251
602b464e
ILT
13252 * binary.cc: Fix file comment.
13253
266d0a74
ILT
13254 * options.h (enum Incremental_disposition): Define.
13255 (class General_options): Add new options: --incremental,
13256 --incremental_changed, --incremental_unchanged,
13257 --incremental_unknown. Add incremental_disposition_ and
13258 implicit_incremental_ fields.
13259 (General_options::incremental_disposition): New function.
13260 (class Position_dependent_options): Add incremental_disposition
13261 option.
13262 (Position_dependent_options::copy_from_options): Set incremental
13263 dispositions.
13264 * options.cc (General_options::parse_incremental_changed): New
13265 function.
2e702c99
RM
13266 (General_options::parse_incremental_unchanged): New function.
13267 (General_options::parse_incremental_unknown): New function.
13268 (General_options::General_options): Initialize new fields
266d0a74 13269 incremental_disposition_ and implicit_incremental_.
2e702c99 13270 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13271 without --incremental.
13272
f073bbf7
CD
132732009-02-06 Chris Demetriou <cgd@google.com>
13274
13275 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13276 pointer and to report location as the file name associated with
13277 the symbol.
13278 (gold_undefined_symbol_at_location): New function to replace the
13279 old gold_undefined_symbol functionality.
13280 * target-reloc.h (relocate_section): Update to use
13281 gold_undefined_symbol_at_location.
13282 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13283 Call gold_undefined_symbol function rather than gold_error.
13284 * errors.h (Errors::undefined_symbol): Take location as a
13285 string, rather than calculating it from a relocation.
13286 * errors.cc (Errors::fatal): Print "fatal error:" before the
13287 formatted message.
13288 (Errors::error, Errors::error_at_location): Print "error: "
13289 before the formatted message.
13290 (Errors::undefined_symbol): Take location as a string, rather
13291 than calculating it from a relocation.
13292 (gold_undefined_symbol_at_location): New function akin to
13293 old gold_undefined_symbol, calculates location from relocation.
13294 (gold_undefined_symbol): Change to take only a Symbol pointer
13295 and to report location as the file name associated with the symbol.
13296 * testsuite/debug_msg.sh: Update for changed error messages.
13297 * testsuite/undef_symbol.sh: Likewise.
13298
8e94a90c
ILT
132992009-02-04 Duncan Sands <baldrick@free.fr>
13300
13301 PR 9812
13302 * reduced_debug_output.h
13303 (Output_reduced_debug_abbrev_section::failed): Use format for
13304 gold_warning.
13305 (Output_reduced_debug_info_section::faild): Likewise.
13306
88a0e15b
ILT
133072009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13308
13309 * script.cc (Lazy_demangler): New class.
2e702c99 13310 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13311 symbol only once.
13312
5efc7cd2
CC
133132009-01-29 Cary Coutant <ccoutant@google.com>
13314
13315 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13316 to __tls_get_addr.
13317 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13318
e0ebcf42
ILT
133192009-01-28 Ian Lance Taylor <iant@google.com>
13320
5efc7cd2 13321 * version.cc (version_string): Bump to 1.9.
75fe7426 13322
e0ebcf42
ILT
13323 * gold.h: Include <cstring> and <stdint.h>.
13324 * version.cc: Include <cstdio>.
13325 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13326 warning.
13327 * reduced_debug_output.cc (insert_into_vector): Rename from
13328 Insert_into_vector; change all callers. Use Swap_unaligned to
13329 avoid aliasing issue; remove union since it is unnecessary.
13330
8e2813be 133312009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13332
13333 * Makefile.am (CCFILES): Add gc.cc.
13334 (HFILES): Add gc.h.
13335 * Makefile.in: Regenerate.
13336 * gold.cc (Gc_runner): New class.
13337 (queue_initial_tasks): Call garbage collection related tasks
13338 when corresponding options are invoked.
13339 (queue_middle_gc_tasks): New function.
13340 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13341 processed early before laying out sections during garbage collection.
13342 * gold.h (queue_middle_gc_tasks): New function.
13343 (is_prefix_of): Move from "layout.cc".
13344 * i386.cc (Target_i386::gc_process_relocs): New function.
13345 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13346 * main.cc (main): Create object of class "Garbage_collection".
13347 * object.cc (Relobj::copy_symbols_data): New function.
13348 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13349 (Sized_relobj::do_layout): Allow this function to be called twice
13350 during garbage collection and defer layout of section during the
6d03d481
ST
13351 first call.
13352 * object.h (Relobj::get_symbols_data): New function.
13353 (Relobj::is_section_name_included): New function.
13354 (Relobj::copy_symbols_data): New function.
13355 (Relobj::set_symbols_data): New function.
13356 (Relobj::get_relocs_data): New function.
13357 (Relobj::set_relocs_data): New function.
13358 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13359 (Relobj::gc_process_relocs): New function.
13360 (Relobj::do_gc_process_relocs): New pure virtual function.
13361 (Relobj::sd_): New data member.
13362 (Sized_relobj::is_output_section_offset_invalid): New function.
13363 (Sized_relobj::do_gc_process_relocs): New function.
13364 * options.h (General_options::gc_sections): Modify to not be a no-op.
13365 (General_options::print_gc_sections): New option.
13366 * plugin.cc (Plugin_finish::run): Remove function call to
13367 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13368 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13369 * reloc.cc (Read_relocs::run): Add task to process relocs and
13370 determine unreferenced sections when doing garbage collection.
13371 (Gc_process_relocs): New class.
13372 (Sized_relobj::do_gc_process_relocs): New function.
13373 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13374 sections that are garbage collected.
13375 * reloc.h (Gc_process_relocs): New class.
13376 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13377 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13378 symbols whose corresponding sections are garbage collected.
13379 (Symbol_table::Symbol_table): Add new parameter for the garbage
13380 collection object.
13381 (Symbol_table::gc_mark_undef_symbols): New function.
13382 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13383 (Symbol_table::gc_mark_dyn_syms): New function.
13384 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13385 as garbage.
13386 (Symbol_table::add_from_object): Likewise.
13387 (Symbol_table::add_from_relobj): When building shared objects, do not
13388 treat externally visible symbols as garbage.
13389 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13390 table information for static and relocatable links.
13391 * symtab.h (Symbol_table::set_gc): New function.
13392 (Symbol_table::gc): New function.
13393 (Symbol_table::gc_mark_undef_symbols): New function.
13394 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13395 (Symbol_table::gc_mark_dyn_syms): New function.
13396 (Symbol_table::gc_): New data member.
e1df38aa 13397 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13398 function.
13399 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13400 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13401
3b293544
CF
134022009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13403
13404 * options.h (General_options::gc_sections): Define as a no-op for now.
13405 (General_options::no_keep_memory): Ditto.
13406 (General_options::Bshareable): Define.
13407 * options.cc (General_options::finalize): Honor -Bshareable.
13408
83d22aa8
AS
134092009-01-20 Andreas Schwab <schwab@suse.de>
13410
13411 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13412 read the value in the contents, since we don't use it. Use the
13413 template endianness when writing.
13414 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13415
cd536b21
AS
134162009-01-19 Andreas Schwab <schwab@suse.de>
13417
13418 * configure.tgt (powerpc64-*): Fix targ_obj.
13419
99e9a495
ILT
134202009-01-15 Ian Lance Taylor <iant@google.com>
13421
13422 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13423 local symbols when stripping all symbols.
13424
bbbfea06
CC
134252009-01-14 Cary Coutant <ccoutant@google.com>
13426
99e9a495 13427 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13428
0f7c0701
CC
134292009-01-14 Cary Coutant <ccoutant@google.com>
13430
13431 * archive.cc (Archive::get_elf_object_for_member): Remove call
13432 to File_read::claim_for_plugin.
13433 * descriptors.cc (Descriptors::open): Remove reference to
13434 is_claimed.
13435 (Descriptors::claim_for_plugin): Remove.
13436 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13437 (Descriptors::is_claimed): Remove.
13438 (claim_descriptor_for_plugin): Remove.
13439 * fileread.cc (File_read::claim_for_plugin): Remove.
13440 * fileread.h (File_read::claim_for_plugin): Remove.
13441 (File_read::descriptor): Reopen descriptor if necessary.
13442 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13443 (Plugin_manager::all_symbols_read): Add task parameter. Change
13444 all callers.
13445 (Plugin_manager::get_input_file): New function.
13446 (Plugin_manager::release_input_file): New function.
13447 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13448 corresponding data member.
13449 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13450 and pass to base constructor. Change all callers.
13451 (get_input_file, release_input_file): New functions.
13452 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13453 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13454 (Plugin_manager::all_symbols_read): Add task parameter.
13455 (Plugin_manager::get_input_file): New function.
13456 (Plugin_manager::release_input_file): New function.
13457 (Plugin_manager::task_): New data member.
13458 (Pluginobj::Pluginobj): Add filesize parameter.
13459 (Pluginobj::filename): New function.
13460 (Pluginobj::descriptor): New function.
13461 (Pluginobj::filesize): New function.
13462 (Pluginobj::filesize_): New data member.
13463 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13464 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13465 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13466
13467 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13468 with archive libraries.
13469 * testsuite/Makefile.in: Regenerate.
13470 * testsuite/plugin_test.c (struct sym_info): New type.
13471 (get_input_file, release_input_file): New static variables.
13472 (onload): Capture new transfer vector entries.
13473 (claim_file_hook): Stop reading at end of file according to filesize.
13474 Factor out parsing of readelf output into separate function.
13475 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13476 APIs and get the source file name from the symbol table. Convert
13477 source file name to corresponding object file name. Print info
13478 message when adding new input files.
13479 (parse_readelf_line): New function.
13480 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13481 * testsuite/plugin_test_2.sh: Likewise.
13482 * testsuite/plugin_test_3.sh: Likewise.
13483 * testsuite/plugin_test_4.sh: New test case.
13484
62a6d109
ILT
134852009-01-07 Ian Lance Taylor <iant@google.com>
13486
13487 * version.cc (version_string): Bump to 1.8.
13488
483620e8
CC
134892008-12-23 Cary Coutant <ccoutant@google.com>
13490
13491 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13492 * plugin.cc (Plugin_manager::finish): Rename as
13493 layout_deferred_objects. Move cleanup to separate function.
13494 (Plugin_manager::cleanup): New function.
13495 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13496 separately.
13497 * plugin.h (Plugin_manager::finish): Rename as
13498 layout_deferred_objects.
13499 (Plugin_manager::cleanup): New function.
13500 (Plugin_manager::cleanup_done): New field.
13501
d66a9eb3
CC
135022008-12-23 Cary Coutant <ccoutant@google.com>
13503
13504 * plugin.cc (is_visible_from_outside): New function.
13505 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13506 so we don't return "IR only" status for exported symbols or -r links.
13507
13508 * testsuite/Makefile.am (plugin_test_3): New test case.
13509 * testsuite/Makefile.in: Regenerate.
13510 * testsuite/plugin_test_3.sh: New file.
13511
5995b570
CC
135122008-12-22 Cary Coutant <ccoutant@google.com>
13513
13514 * object.cc (Sized_relobj::layout_section): New function.
13515 (Sized_relobj::do_layout): Defer layout of input sections until after
13516 plugin has provided replacement files.
13517 (Sized_relobj::do_layout_deferred_sections): New function.
13518 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13519 (Relobj::layout_deferred_sections): New function.
13520 (Relobj::do_layout_deferred_sections): New function.
13521 (Sized_relobj::do_layout_deferred_sections): New function.
13522 (Sized_relobj::layout_section): New function.
13523 (Sized_relobj::Deferred_layout): New structure.
13524 (Sized_relobj::deferred_layout_): New field.
13525 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13526 Change all callers. Layout deferred sections.
13527 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13528 references.
13529 (Plugin_hook::run): Move code from do_plugin_hook inline.
13530 (Plugin_hook::do_plugin_hook): Remove.
13531 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13532 (Plugin_manager::finish): Renamed, was cleanup.
13533 (Plugin_manager::should_defer_layout): New function.
13534 (Plugin_manager::add_deferred_layout_object): New function.
13535 (Plugin_manager::Deferred_layout_list): New type.
13536 (Plugin_manager::deferred_layout_objects_): New field.
13537 (Plugin_hook::do_plugin_hook): Remove.
13538
ee769c88
ILT
135392008-12-17 Ian Lance Taylor <iant@google.com>
13540
13541 * options.h (class General_options): Add --no case for
13542 --export-dynamic.
13543
abc8dcba
CC
135442008-12-16 Cary Coutant <ccoutant@google.com>
13545
13546 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13547 vector.
13548 (Plugin_manager::claim_file): Create plugin object even if
13549 plugin did not call the add_symbols callback.
13550 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13551 asking for more symbols than were added.
13552 * testsuite/Makefile.am (plugin_test_1): Add test case with
13553 no global symbols.
13554 (empty.syms): New target.
13555 * testsuite/Makefile.in: Regenerate.
13556 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13557 message. Don't call add_symbols if no globals.
13558 (all_symbols_read_hook): Don't provide replacement for empty
13559 claimed file.
13560
b0074644
ILT
135612008-12-12 Ian Lance Taylor <iant@google.com>
13562
68943102
ILT
13563 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13564 r_type == 0 for a local symbol with r_sym == 0.
13565 (scan_relocatable_relocs): Pass r_sym to
13566 local_non_section_strategy.
13567 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13568 r_sym parameter.
13569
b0074644
ILT
13570 * configure.ac: Update test for TLS descriptors: they are
13571 supported as of glibc 2.9.
13572 * configure: Rebuild.
13573
c2508178
ILT
135742008-12-11 Ian Lance Taylor <iant@google.com>
13575
13576 PR 7091
13577 * target-reloc.h (Default_scan_relocatable_relocs): For each
13578 function, map r_type == 0 to RELOC_DISCARD.
13579
2756a258
CC
135802008-12-10 Cary Coutant <ccoutant@google.com>
13581
13582 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13583 object to override a kept COMDAT group from a plugin object.
13584
bb6f53d3
ILT
135852008-12-09 Ian Lance Taylor <iant@google.com>
13586
fbc558e1
ILT
13587 PR 7088
13588 * yyscript.y (file_cmd): Handle INPUT.
13589
bb6f53d3
ILT
13590 * testsuite/initpri1.c: Change all declarations to be full
13591 prototypes by adding void, to avoid compiler warnings.
13592
4674ecfc
CC
135932008-12-05 Rafael Avila de Espindola <espindola@google.com>
13594
13595 * options.cc (General_options::parse_plugin_opt): New.
13596 (General_options::add_plugin): The argument now is just the filename.
13597 (General_options::add_plugin_option): New.
13598 * options.h (plugin_opt): New.
13599 (add_plugin): Change argument name.
13600 (add_plugin_option): New.
13601 * plugin.cc (Plugin::load): Don't parse the plugin option.
13602 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13603 (Plugin::add_option): New.
13604 (Plugin::args_): Change type.
13605 (Plugin::filename_): New.
13606 (Plugin_manager::add_plugin_option): New.
13607 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13608 * testsuite/Makefile.in: Regenerate.
13609
fd06b4aa
CC
136102008-12-05 Cary Coutant <ccoutant@google.com>
13611
13612 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13613 Handle --strip-lto-sections option.
13614 * options.h (strip_lto_sections): New option.
13615
6c52134c
CC
136162008-12-01 Cary Coutant <ccoutant@google.com>
13617
13618 * plugin.cc (ld_plugin_message): Change format parameter to const.
13619 Fix mismatch between new[] and delete.
13620
a45248e0
CC
136212008-11-14 Cary Coutant <ccoutant@google.com>
13622
13623 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13624 instead of -1U.
13625
c82fbeee
CS
136262008-11-05 Craig Silverstein <csilvers@google.com>
13627
13628 * options.cc (General_options::parse_dynamic_list): New function.
13629 * options.h (General_options): New flags dynamic_list,
13630 dynamic_list_data, dynamic_list_cpp_new, and
13631 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13632 (General_options::in_dynamic_list): New function.
13633 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13634 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13635 (Lex::can_continue_name): Likewise.
13636 (yylex): Likewise.
13637 (read_script_file): New parameter script_options.
13638 (read_dynamic_list): New function.
13639 (Script_options::define_dynamic_list): New function.
13640 (dynamic_list_keyword_parsecodes): New variable.
13641 (dynamic_list_keywords): New variable.
13642 * script.h (Script_options::define_dynamic_list): New function
13643 prototype.
13644 (read_dynamic_list): New function prototype.
13645 * symtab.cc (strprefix): New macro.
13646 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13647 dynamic_list_data, dynamic_list_cpp_new, and
13648 dynamic_list_cpp_typeinfo.
13649 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13650 (dynamic_list_expr): New rule.
13651 (dynamic_list_nodes): Likewise.
13652 (dynamic_list_node): Likewise.
13653 * testsuite/Makefile.am (dynamic_list): New test.
13654 * testsuite/Makefile.in: Regenerated.
13655 * testsuite/dynamic_list.t: New file.
13656 * testsuite/dynamic_list.sh: New file.
13657
e0bb29a5
CS
136582008-11-05 Craig Silverstein <csilvers@google.com>
13659
13660 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13661 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13662 (t11_last): Likewise.
13663 * testsuite/ver_test_6.c (main): Likewise.
13664
4e1e25e0
CC
136652008-10-07 Cary Coutant <ccoutant@google.com>
13666
13667 * options.c (General_options::finalize): Add check for -static and
13668 -shared.
13669 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13670 is not empty.
13671
92f03fcb
CC
136722008-10-02 Cary Coutant <ccoutant@google.com>
13673
13674 * plugin.cc (make_sized_plugin_object): Fix conditional
13675 compilation to work when not all targets are enabled.
13676
fbd8a257
CC
136772008-09-29 Cary Coutant <ccoutant@google.com>
13678
13679 * archive.cc (Archive::get_file_and_offset): Use filename instead
13680 of name to get library path.
13681 (Archive::include_member): Unlock external member of a thin archive.
13682
13683 * testsuite/Makefile.am (TEST_AR): New variable.
13684 (thin_archive_test_1): New test.
13685 (thin_archive_test_2): New test.
81636b3f
CC
13686 * testsuite/Makefile.in: Regenerate.
13687 * testsuite/thin_archive_main.cc: New file.
13688 * testsuite/thin_archive_test_1.cc: New file.
13689 * testsuite/thin_archive_test_2.cc: New file.
13690 * testsuite/thin_archive_test_3.cc: New file.
13691 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 13692
eff45813
CC
136932008-09-29 Cary Coutant <ccoutant@google.com>
13694
13695 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13696 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13697 instead of -1U.
13698 (Sized_relobj::do_finalize_local_symbols): Likewise.
13699 (Sized_relobj::map_to_kept_section): Likewise.
13700 * object.h (Sized_relobj::invalid_address): New constant.
13701 (Sized_relobj::do_output_section_offset): Check for invalid_address
13702 and return -1ULL.
13703 * output.cc (Output_reloc::local_section_offset): Use constant
13704 invalid_address instead of -1U.
13705 (Output_reloc::get_address): Likewise.
13706 (Output_section::output_address): Change -1U to -1ULL.
13707 * output.h (Output_reloc::invalid_address): New constant.
13708 * reloc.cc (Sized_relobj::write_sections): Use constant
13709 invalid_address instead of -1U.
13710 (Sized_relobj::relocate_sections): Likewise.
13711 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13712 values for merge sections.
13713 * target-reloc.h (relocate_for_relocatable): Use constant
13714 invalid_address instead of -1U.
13715
89fc3421
CC
137162008-09-19 Cary Coutant <ccoutant@google.com>
13717
13718 Add plugin functionality for link-time optimization (LTO).
13719 * configure.ac (plugins): Add --enable-plugins option.
13720 * configure: Regenerate.
13721 * config.in: Regenerate.
13722 * Makefile.am (LIBDL): New variable.
13723 (CCFILES): Add plugin.cc.
13724 (HFILES): Add plugin.h.
13725 (ldadd_var): Add LIBDL.
13726 * Makefile.in: Regenerate.
13727
13728 * archive.cc: Include "plugin.h".
13729 (Archive::setup): Don't preread archive symbols when using a plugin.
13730 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
13731 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
13732 files.
13733 (Archive::include_member): Add symbols from plugin objects.
13734 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
13735 * descriptors.cc (Descriptors::open): Check for file descriptors
13736 abandoned by plugins.
13737 (Descriptors::claim_for_plugin): New function.
13738 * descriptors.h (Descriptors::claim_for_plugin): New function.
13739 (Open_descriptor::is_claimed): New field.
13740 (claim_descriptor_for_plugin): New function.
13741 * fileread.cc (File_read::claim_for_plugin): New function.
13742 * fileread.h (File_read::claim_for_plugin): New function.
13743 (File_read::descriptor): New function.
13744 * gold.cc: Include "plugin.h".
13745 (queue_initial_tasks): Add task to call plugin hooks for generating
13746 new object files.
13747 * main.cc: Include "plugin.h".
13748 (main): Load plugin libraries.
13749 * object.h (Pluginobj): Declare.
13750 (Object::pluginobj): New function.
13751 (Object::do_pluginobj): New function.
13752 (Object::set_target): New function.
13753 * options.cc: Include "plugin.h".
13754 (General_options::parse_plugin): New function.
13755 (General_options::General_options): Initialize plugins_ field.
13756 (General_options::add_plugin): New function.
13757 * options.h (Plugin_manager): Declare.
13758 (General_options): Add --plugin option.
13759 (General_options::has_plugins): New function.
13760 (General_options::plugins): New function.
13761 (General_options::add_plugin): New function.
13762 (General_options::plugins_): New field.
13763 * plugin.cc: New file.
13764 * plugin.h: New file.
13765 * readsyms.cc: Include "plugin.h".
13766 (Read_symbols::do_read_symbols): Check for archive before checking
13767 for ELF file. Call plugin hooks to claim files.
13768 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
13769 from a real object file; force override when processing replacement
13770 files.
13771 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
13772 (Symbol::init_base_object): Likewise.
13773 (Symbol::init_base_output_data): Likewise.
13774 (Symbol::init_base_output_segment): Likewise.
13775 (Symbol::init_base_constant): Likewise.
13776 (Symbol::init_base_undefined): Likewise.
13777 (Symbol::output_section): Assert that object is not a plugin.
13778 (Symbol_table::add_from_pluginobj): New function.
13779 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
13780 undefined.
13781 (Symbol_table::sized_write_globals): Likewise.
13782 (Symbol_table::add_from_pluginobj): Instantiate template.
13783 * symtab.h (Sized_pluginobj): Declare.
13784 (Symbol::in_real_elf): New function.
13785 (Symbol::set_in_real_elf): New function.
13786 (Symbol::in_real_elf_): New field.
13787 (Symbol_table::add_from_pluginobj): New function.
13788
13789 * testsuite/Makefile.am (AM_CFLAGS): New variable.
13790 (LIBDL): New variable.
13791 (LDADD): Add LIBDL.
13792 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
13793 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
13794 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
13795 (MOSTLYCLEANFILES): Likewise.
13796 * testsuite/Makefile.in: Regenerate.
13797 * testsuite/plugin_test.c: New file.
13798 * testsuite/plugin_test_1.sh: New file.
13799 * testsuite/plugin_test_2.sh: New file.
13800
de31bda5
ILT
138012008-09-16 Ian Lance Taylor <iant@google.com>
13802
9c2d0ef9
ILT
13803 * target-reloc.h (relocate_section): Check whether a symbol is
13804 defined by the ABI before reporting an undefined symbol error.
13805 * target.h (Target::is_defined_by_abi): Make parameter const.
13806 (Target::do_is_defined_by_abi): Likewise.
13807 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
13808 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
13809 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
13810 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
13811 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
13812 * testsuite/Makefile.in: Rebuild.
13813
de31bda5
ILT
13814 * fileread.cc (make_view): Add casts to avoid warning.
13815
9fa33bee
AO
138162008-09-16 Alexandre Oliva <aoliva@redhat.com>
13817
13818 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
13819 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13820
183fd0e3
AO
138212008-09-16 Alexandre Oliva <aoliva@redhat.com>
13822
13823 * options.h (General_options::output_is_executable): New.
13824 (General_options::output_is_pie): New.
13825 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
13826 for shared libraries.
13827 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13828
7be8330a
CD
138292008-09-11 Chris Demetriou <cgd@google.com>
13830
13831 * options.h (origin): New -z option.
13832 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
13833 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
13834 in DT_FLAGS_1.
13835
a9caad02
CC
138362008-09-05 Cary Coutant <ccoutant@google.com>
13837
13838 * fileread.cc (File_read::make_view): Add check for attempt to map
13839 beyond end of file.
13840
ae6dce4d
CC
138412008-09-05 Cary Coutant <ccoutant@google.com>
13842
13843 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
13844 explicit instantiations.
13845
d7ab2a47
KVH
138462008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
13847
13848 PR gold/6858
13849 * options.cc (General_options::finalize): Allow undefined symbols
13850 in shlibs if linking -shared.
13851
13852 PR gold/6859
13853 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
13854 symbols as not needing a dynsym entry.
13855
1e52a9c1
CS
138562008-08-20 Craig Silverstein <csilvers@google.com>
13857
13858 * fileread.cc (File_read::open): Do not lock the file unless it
13859 was successfully opened.
13860
d85c80a3
CC
138612008-08-14 Cary Coutant <ccoutant@google.com>
13862
13863 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
13864 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
13865 * testsuite/tls_test.cc (struct int128): 128-bit struct
13866 for testing TLS relocs with non-zero addend.
13867 (v12): New TLS variable.
13868 (t12): New test.
13869 (t_last): Add check for v12.
13870 * testsuite/tls_test.h (t12): New function.
13871 * testsuite/tls_test_main.cc (thread_routine): Call new test.
13872
2d924fd9
ILT
138732008-08-13 Ian Lance Taylor <iant@google.com>
13874
13875 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
13876 set tls_segment_ or relro_segment_.
13877 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
13878 when appropriate.
13879 * output.h (Output_section::clear_is_relro): New function.
13880 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
13881 sections specially even when output_data_ is empty.
13882 (Output_segment::maximum_alignment): When first section is relro,
13883 only force alignment for PT_LOAD segments.
13884 * script.cc (script_data_segment_align): New function.
13885 (script_data_segment_relro_end): New function.
13886 * script-c.h (script_data_segment_align): Declare.
13887 (script_data_segment_relro_end): Declare.
13888 * script-sections.h (class Script_sections): Declare
13889 data_segment_align and data_segment_relro_end. Add fields
13890 segment_align_index_ and saw_relro_end_.
13891 * script-sections.cc (class Sections_element): Add set_is_relro
13892 virtual function. Add new bool* parameter to place_orphan_here.
13893 Add get_output_section virtual function.
13894 (class Output_section_definition): Add set_is_relro. Add new
13895 bool* parameter to place_orphan_here. Add get_output_section.
13896 Add is_relro_ field.
13897 (Output_section_definition::Output_section_definition): Initialize
13898 evaluated_address_, evaluated_load_address, evaluated_addralign_,
13899 and is_relro_ fields.
13900 (Output_section_definition::place_orphan_here): Add is_relro
13901 parameter.
13902 (Output_section_definition::set_section_addresses): Set relro for
13903 output section.
13904 (Output_section_definition::alternate_constraint): Likewise.
13905 (class Orphan_output_section): Add new bool* parameter to
13906 place_orphan_here. Add get_output_section.
13907 (Orphan_output_section::place_orphan_here): Add is_relro
13908 parameter.
13909 (Script_sections::Script_sections): Initialize
13910 data_segment_align_index_ and saw_relro_end_.
13911 (Script_sections::data_segment_align): New function.
13912 (Script_sections::data_segment_relro_end): New function.
13913 (Script_sections::place_orphan): Set or clear is_relro.
13914 (Script_sections::set_section_addresses): Force alignment of first
13915 TLS section.
13916 * yyscript.y (exp): Call script_data_segment_align and
13917 script_data_segment_relro_end.
13918 * testsuite/relro_script_test.t: New file.
13919 * testsuite/relro_test.cc (using_script): Declare.
13920 (t1, t2): Test using_script.
13921 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
13922 (relro_script_test_SOURCES): Define.
13923 (relro_script_test_DEPENDENCIES): Define.
13924 (relro_script_test_LDFLAGS): Define.
13925 (relro_script_test_LDADD): Define.
13926 (relro_script_test.so): New target.
13927 * testsuite/Makefile.in: Rebuild.
13928
f827c9a9
CC
139292008-08-06 Cary Coutant <ccoutant@google.com>
13930
13931 * archive.cc (Archive::total_archives, Archive::total_members)
13932 (Archive::total_members_loaded): New variables.
13933 (Archive::setup): Add parameter. Add option to preread
13934 archive symbols.
13935 (Archive::read_armap): Add counter.
13936 (Archive::get_file_and_offset): New function.
13937 (Archive::get_elf_object_for_member): New function.
13938 (Archive::read_all_symbols): New function.
13939 (Archive::read_symbols): New function.
13940 (Archive::add_symbols): Add counters.
13941 (Archive::include_all_members): Use armap to find members if it's
13942 already built.
13943 (Archive::include_member): Skip reading symbols if already read.
13944 Factored code into Archive::get_file_and_offset and
13945 Archive::get_elf_object_for_member. Changed call to
13946 Mapfile::report_include_archive_member.
13947 (Archive::print_stats): New function.
13948 * archive.h: Declare Object and Read_symbols_data classes.
13949 (Archive::Archive): Add initializers for new members.
13950 (Archive::setup): Add parameter.
13951 (Archive::print_stats): New function.
13952 (Archive::total_archives, Archive::total_members)
13953 (Archive::total_members_loaded): New variables.
13954 (Archive::get_file_and_offset): New function.
13955 (Archive::get_elf_object_for_member): New function.
13956 (Archive::read_all_symbols): New function.
13957 (Archive::read_symbols): New function.
13958 (Archive::Archive_member): New class.
13959 (Archive::members_): New member.
13960 (Archive::num_members_): New member.
13961 * main.cc: Include archive.h.
13962 (main): Call Archive::print_stats.
13963 * mapfile.cc (Mapfile::report_include_archive_member): Delete
13964 archive parameter; member_name is now the fully-decorated name.
13965 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
13966 * options.h: (General_options): Add --preread-archive-symbols option.
13967 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
13968 Archive::setup.
13969
de4c45bd
ILT
139702008-08-04 Ian Lance Taylor <iant@google.com>
13971
13972 * symtab.h (Symbol::use_plt_offset): New function.
13973 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
13974 * powerpc.cc (Relocate::relocate): Likewise.
13975 * sparc.cc (Relocate::relocate): Likewise.
13976 * x86_64.cc (Relocate::relocate): Likewise.
13977 * testsuite/weak_plt.sh: New test.
13978 * testsuite/weak_plt_main.cc: New test.
13979 * testsuite/weak_plt_shared.cc: New test.
13980 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
13981 (check_PROGRAMS): Add weak_plt.
13982 (check_DATA): Add weak_plt_shared.so.
13983 (weak_plt_main_pic.o, weak_plt): New targets.
13984 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
13985 * testsuite/Makefile.in: Rebuild.
13986
13987 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
13988 gcctestdir/ld.
13989 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
13990 * testsuite/Makefile.in: Rebuild.
13991
323ee3f4
AM
139922008-08-04 Alan Modra <amodra@bigpond.net.au>
13993
13994 * Makefile.am (POTFILES.in): Set LC_ALL=C.
13995 * Makefile.in: Regenerate.
13996 * po/POTFILES.in: Regenerate.
13997
7c07ecec
ILT
139982008-07-29 Ian Lance Taylor <iant@google.com>
13999
14000 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14001 symbols before other symbols.
14002 * testsuite/script_test_2.cc (test_addr): Declare.
14003 (test_addr_alias): Declare.
14004 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14005 values.
7c07ecec
ILT
14006 * testsuite/script_test_2.t: Define test_addr_alias and
14007 test_addr.
14008
5778530e
ILT
140092008-07-24 Ian Lance Taylor <iant@google.com>
14010
2a00e4fb
ILT
14011 PR 5990
14012 * descriptors.cc: New file.
14013 * descriptors.h: New file.
14014 * gold-threads.h (class Hold_optional_lock): New class.
14015 * fileread.cc: Include "descriptors.h".
14016 (File_read::~File_read): Release descriptor rather than closing
14017 it.
14018 (File_read::open) [file]: Call open_descriptor rather than open.
14019 Set is_descriptor_opened_.
14020 (File_read::open) [memory]: Assert that descriptor is not open.
14021 (File_read::reopen_descriptor): New function.
14022 (File_read::release): Release descriptor.
14023 (File_read::do_read): Make non-const. Reopen descriptor.
14024 (File_read::read): Make non-const.
14025 (File_read::make_view): Reopen descriptor.
14026 (File_read::do_readv): Likewise.
14027 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14028 Update declarations.
14029 * layout.cc: Include "descriptors.h".
14030 (Layout::create_build_id): Use open_descriptor rather than open.
14031 * output.cc: Include "descriptors.h".
14032 (Output_file::open): Use open_descriptor rather than open.
14033 * archive.cc (Archive::const_iterator): Change Archive to be
14034 non-const.
14035 (Archive::begin, Archive::end): Make non-const.
14036 (Archive::count_members): Likewise.
14037 * archive.h (class Archive): Update declarations.
14038 * object.h (Object::read): Make non-const.
14039 * Makefile.am (CCFILES): Add descriptors.cc.
14040 (HFILES): Add descriptors.h.
14041 * Makefile.in: Rebuild.
14042
801647d1
ILT
14043 PR 6716
14044 * gold.h: Always include <clocale>. Add Solaris workarounds
14045 following code in binutils/sysdep.h.
14046
5edd166e
ILT
14047 PR 6048
14048 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14049 this->eh_frame_hdr_ is NULL before using it.
14050
c89ad728
ILT
14051 * dynobj.cc (Versions::Versions): Update comment.
14052
aa86f06b
ILT
14053 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14054 the base version name.
14055
5778530e
ILT
14056 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14057 array size plus one.
14058 (Stringpool_template::set_string_offsets): Subtract one from key
14059 before using it as an array index.
14060 (Stringpool_template::get_offset_with_length): Likewise.
14061 (Stringpool_template::write_to_buffer): Likewise.
14062 * stringpool.h (Stringpool_template::get_offset_from_key):
14063 Likewise.
14064
057ead22
ILT
140652008-07-23 Ian Lance Taylor <iant@google.com>
14066
7f649c59
ILT
14067 PR 6658
14068 * object.h (Merged_symbol_value::value): Do our best to handle a
14069 negative addend.
14070
057ead22
ILT
14071 PR 6647
14072 * script.cc (Version_script_info::get_versions): Don't add empty
14073 version tag to return value.
14074 (Version_script_info::get_symbol_version_helper): Change return
14075 type to bool. Add pversion parameter. Change all callers.
14076 (script_register_vers_node): Don't require a non-NULL tag.
14077 * script.h (class Version_script_info): Update declarations.
14078 (Version_script_info::get_symbol_version): Change return type to
14079 bool. Add version parameter. Change all callers.
14080 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14081 handling. Handle an empty version from a version script.
14082 (Symbol_table::define_special_symbol): Likewise.
14083 * testsuite/ver_test_10.script: New file.
14084 * testsuite/ver_test_10.sh: New file.
14085 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14086 (check_DATA): Add ver_test_10.syms.
14087 (ver_test_10.syms, ver_test_10.so): New target.
14088 * testsuite/Makefile.in: Rebuild.
14089
58e54ac2
CD
140902008-07-23 Simon Baldwin <simonb@google.com>
14091
14092 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14093 to zero for undefined symbols from dynamic libraries.
14094
95d14cd3
ILT
140952008-07-23 Ian Lance Taylor <iant@google.com>
14096
14097 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14098 Change all callers.
14099 * symtab.h (class Symbol_table): Update declaration.
14100 * testsuite/ver_test_9.cc: New file.
14101 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14102 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14103 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14104 (ver_test_9.so, ver_test_9.o): New targets.
14105 * testsuite/Makefile.in: Rebuild.
14106
92de84a6
ILT
141072008-07-22 Ian Lance Taylor <iant@google.com>
14108
34810851
ILT
14109 * options.h (class General_options): Define --check-sections.
14110 * layout.cc (Layout::set_segment_offsets): Handle
14111 --check-sections.
14112
af6156ef
ILT
14113 * options.h (class General_options): Define -n/--nmagic and
14114 -N/--omagic.
14115 * options.cc (General_options::finalize): For -n/--nmagic or
14116 -N/--omagic, set -static.
14117 * layout.cc (Layout::attach_allocated_section_to_segment): If
14118 -N/--omagic, don't put read-only and read-write sections in
14119 different segments.
14120 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14121 finding a read-only segment.
14122 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14123 don't set the minimum segment alignment to the common page size,
14124 and don't set the file offset to the address modulo the page size.
14125 * script-sections.cc (Script_sections::create_segments): If
14126 -n/--omagic, don't put read-only and read-write sections in
14127 different segments.
14128
92de84a6
ILT
14129 * cref.cc: New file.
14130 * cref.h: New file.
14131 * options.h (class General_options): Add --print-symbol-counts.
14132 * main.cc (main): Issue defined symbol report if requested.
14133 * archive.cc (Archive::interpret_header): Make into a const member
14134 function.
14135 (Archive::add_symbols): Call Input_objects::archive_start and
14136 archive_stop.
14137 (Archive::const_iterator): Define new class.
14138 (Archive::begin, Archive::end): New functions.
14139 (Archive::include_all_members): Rewrite to use iterator.
14140 (Archive::count_members): New function.
14141 * archive.h (class Archive): Update declarations.
14142 (Archive::filename): New function.
14143 * object.cc: Include "cref.h".
14144 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14145 (Sized_relobj::do_get_global_symbol_counts): New function.
14146 (Input_objects::add_object): Add object to cross-referencer.
14147 (Input_objects::archive_start): New function.
14148 (Input_objects::archive_stop): New function.
14149 (Input_objects::print_symbol_counts): New function.
14150 * object.h: Declare Cref and Archive.
14151 (Object::get_global_symbol_counts): New function.
14152 (Object::do_get_global_symbol_counts): New pure virtual function.
14153 (class Sized_relobj): Add defined_count_ field. Update
14154 declarations.
14155 (class Input_objects): Add cref_ field. Update constructor.
14156 Update declarations.
14157 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14158 defined_count_.
14159 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14160 symbol counts.
14161 (Sized_dynobj::do_get_global_symbol_counts): New function.
14162 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14163 defined_count_. Update declarations. Define Symbols typedef.
14164 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14165 parameter. Change all callers.
14166 (Symbol_table::add_from_dynobj): Add sympointers and defined
14167 parameters. Change all callers.
14168 * symtab.h (class Symbol_table): Update declarations.
14169 * Makefile.am (CCFILES): Add cref.cc.
14170 (HFILES): Add cref.h.
14171 * Makefile.in: Rebuild.
14172
3f7c5e1d
CD
141732008-07-22 Simon Baldwin <simonb@google.com>
14174
14175 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14176 to zero when writing undefined symbols.
14177
e0b64032
ILT
141782008-07-22 Ian Lance Taylor <iant@google.com>
14179
14180 * output.cc (Output_section::add_input_section): Don't try to
14181 merge empty merge sections.
14182
096b02cf
CS
141832008-07-21 Craig Silverstein <csilvers@google.com>
14184
14185 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14186 Include symbol version in error message.
cd536b21 14187
1d1f116d
CD
141882008-07-20 Chris Demetriou <cgd@google.com>
14189
cd536b21 14190 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14191 (RANDOM_SEED_CFLAGS): New substituted variable.
14192 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14193 * configure: Rebuild.
14194 * Makefile.in: Likewise.
14195 * testsuite/Makefile.in: Likewise.
14196
a18f591e
ILT
141972008-07-18 Ian Lance Taylor <iant@google.com>
14198
14199 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14200 where we see NAME/NULL and NAME/VERSION as separate symbols.
14201 * testsuite/ver_test_main.cc (main): Call t4.
14202 (t4, t4_2a): Define.
14203 * testsuite/ver_test_2.cc (t4_2): Define.
14204 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14205 * testsuite/ver_test_4.cc (t4_2a): Define.
14206 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14207 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14208
c6e3f6ed
ILT
142092008-07-17 Ian Lance Taylor <iant@google.com>
14210
14211 * dynobj.cc (Versions::add_def): If we give an error about a
14212 missing version, go ahead and create the version anyhow.
14213
ef9beddf
ILT
142142008-07-10 Ian Lance Taylor <iant@google.com>
14215
14216 Handle output sections with more than 0x7fffffff bytes.
14217 * object.h (class Relobj): Change map_to_output_ to
14218 output_sections_, and just keep a section pointer. Change all
14219 uses. Move comdat group support to Sized_relobj.
14220 (Relobj::is_section_specially_mapped): Remove.
14221 (Relobj::output_section): Remove poff parameter. Change all
14222 callers.
14223 (Relobj::output_section_offset): New function.
14224 (Relobj::set_section_offset): Rewrite.
14225 (Relobj::map_to_output): Remove.
14226 (Relobj::output_sections): New function.
14227 (Relobj::do_output_section_offset): New pure virtual function.
14228 (Relobj::do_set_section_offset): Likewise.
14229 (class Sized_relobj): Add section_offsets_ field. Add comdat
14230 group support from Relobj. Update declarations.
14231 (Sized_relobj::get_output_section_offset): New function.
14232 (Sized_relobj::do_output_section_offset): New function.
14233 (Sized_relobj::do_set_section_offset): New function.
14234 * object.cc (Relobj::output_section_address): Remove.
14235 (Sized_relobj::Sized_relobj): Initialize new fields.
14236 (Sized_relobj::include_section_group): Cast find_kept_object to
14237 Sized_relobj.
14238 (Sized_relobj::include_linkonce_section): Likewise.
14239 (Sized_relobj::do_layout): Use separate arrays for output section
14240 and output offset.
14241 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14242 output_sections.
14243 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14244 output_sections and section_offsets.
14245 (Sized_relobj::write_local_symbols): Likewise.
14246 (map_to_kept_section): Compute output address directly.
14247 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14248 output_sections and section_offsets.
14249 (Sized_relobj::write_sections): Likewise.
14250 (Sized_relobj::relocate_sections): Likewise.
14251 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14252 * output.h (class Output_reloc): Update declarations. Change
14253 u2_.relobj to Sized_relobj*.
14254 (class Output_data_reloc): Change add functions to use
14255 Sized_relobj*.
14256 * output.cc (Output_reloc::Output_reloc): Change relobj to
14257 Sized_relobj*.
14258 (Output_reloc::local_section_offset): Change return type to
14259 Elf_Addr. Use get_output_section_offset.
14260 (Output_reloc::get_address): Likewise.
14261 (Output_section::is_input_address_mapped): Don't call
14262 is_section_specially_mapped.
14263 (Output_section::output_offset): Likewise.
14264 (Output_section::output_address): Likewise.
14265 (Output_section::starting_output_address): Likewise.
14266 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14267 parameter to Sized_relobj*.
14268 (Copy_relocs::need_copy_reloc): Likewise.
14269 (Copy_relocs::save): Likewise.
14270 * copy-relocs.h (class Copy_relocs): Update declarations.
14271 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14272 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14273 * target-reloc.h (relocate_for_relocatable): Change
14274 offset_in_output_section type to Elf_Addr. Change code that uses
14275 it as well.
14276 * layout.cc (Layout::layout): Always set *off.
14277 * mapfile.cc (Mapfile::print_input_section): Use
14278 output_section_offset.
14279 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14280 Sized_relobj*.
14281 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14282 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14283 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14284
5cb66f97
ILT
142852008-07-03 Ian Lance Taylor <iant@google.com>
14286
14287 * layout.cc (Layout::include_section): Do not discard unrecognized
14288 SHT_STRTAB sections.
14289
afe47622
CS
142902008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14291
14292 * script.cc (Lex::can_continue_name): Make '?' allowable in
14293 version-script names.
14294 * testsuite/version_script.map: Change glob pattern to use '?'
14295
5adf9721
ILT
142962008-06-30 Manish Singh <yosh@gimp.org>
14297
14298 PR 6585
14299 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14300 Correct typo.
14301
e6fde208
ILT
143022008-06-30 Ian Lance Taylor <iant@google.com>
14303
14304 PR 6660
14305 PR 6682
14306 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14307 versions]: Don't try to read the value in the contents, since we
14308 don't use it. Use the template endianness when writing.
14309
3f2e6a2d
CC
143102008-06-25 Cary Coutant <ccoutant@google.com>
14311
14312 * fileread.cc (File_read::make_view): Assert on zero-length view.
14313 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14314 symbol table when there are no symbols to read.
14315
c43d3a48
CS
143162008-06-23 Craig Silverstein <csilvers@google.com>
14317
14318 * version.cc (version_string): Bump to 1.7
14319
5f494ea0
CS
143202008-06-18 Craig Silverstein <csilvers@google.com>
14321
14322 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14323 constant 0xFFFF to type Valtype.
14324 (Powerpc_relocate_functions::rel16_ha): Likewise.
14325
c42e122e
ILT
143262008-06-17 Ian Lance Taylor <iant@google.com>
14327
f34787f8
ILT
14328 * output.h (Output_section::Input_section): Initialize p2align_ to
14329 zero for Output_section_data constructors.
14330 (Output_section::Input_section::addralign): If not an input
14331 section, return the alignment of the Output_section_data.
14332 * testsuite/copy_test.cc: New file.
14333 * testsuite/copy_test_1.cc: New file.
14334 * testsuite/copy_test_2.cc: New file.
14335 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14336 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14337 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14338 (copy_test_1_pic.o, copy_test_1.so): New targets.
14339 (copy_test_2_pic.o, copy_test_2.so): New targets.
14340 * testsuite/Makefile.in: Rebuild.
14341
c42e122e
ILT
14342 * script-sections.cc (Script_sections::place_orphan): Initialize
14343 local variable exact.
14344
ce3ac18a
DE
143452008-06-13 David Edelsohn <edelsohn@gnu.org>
14346
14347 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14348
42cacb20
DE
143492008-06-12 David Edelsohn <edelsohn@gnu.org>
14350 David S. Miller <davem@davemloft.net>
14351
14352 * powerpc.cc: New file.
14353 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14354 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14355 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14356 * Makefile.in: Rebuild.
14357
7b308235
ILT
143582008-06-09 Ian Lance Taylor <iant@google.com>
14359
14360 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14361 <exception>.
14362 (throwing, orig_terminate): New static variables.
14363 (terminate_handler): New static function.
14364 (t2): Set terminate handler.
14365
f0b886e3
ILT
143662008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14367
14368 PR 6584
cd536b21 14369 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14370 alignment.
14371
3e90f135
CC
143722008-05-30 Cary Coutant <ccoutant@google.com>
14373
14374 * archive.cc (Archive::include_all_members) Correct to step
14375 over symbol table and extended name table in thin archives.
14376
e09ad04a
ILT
143772008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14378
14379 PR 6407
14380 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14381 calculation.
14382
62b01cb5
ILT
143832008-05-28 Caleb Howe <cshowe@google.com>
14384
14385 * reduced_debug_output.cc: New file.
14386 * reduced_debug_output.h: New file.
92de84a6 14387 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14388 * options.cc (General_options::finalize): Add strip_debug_non_line
14389 to the strip heirarchy.
14390 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14391 fields.
14392 * layout.cc: Include "reduced_debug_output.h".
14393 (Layout::Layout): Initialize new fields.
14394 (line_only_debug_sections): New static array.
14395 (is_lines_only_debug_sections): New static inline function.
14396 (Layout::include_section): Handle --strip-debug-non-line.
14397 (Layout::make_output_section): If --strip-debug-non-line, build
14398 new output sections for .debug_abbrev and .debug_info.
14399 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14400 gold. Warn about possible overflow.
14401 (read_signed_LEB_128): Likewise.
14402 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14403 (read_signed_LEB_128): Declare.
14404 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14405 (HFILES): Add reduced_debug_output.h.
14406 * Makefile.in: Rebuild.
14407
7d9e3d98
ILT
144082008-05-21 Ian Lance Taylor <iant@google.com>
14409
14410 * mapfile.cc: New file.
14411 * mapfile.h: New file.
14412 * options.h (class General_options): Add -M/--print-map and -Map.
14413 * options.cc (General_options::finalize): Make -M equivalent to
14414 -Map -.
14415 * main.cc: Include <cstdio> and "mapfile.h".
14416 (main): Open mapfile if requested.
14417 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14418 constructor. Change caller.
14419 (queue_initial_tasks): Add mapfile parameter. Change caller.
14420 (queue_middle_tasks): Likewise.
14421 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14422 declarations.
14423 * archive.cc: Include "mapfile.h".
14424 (Archive::add_symbols): Add mapfile parameter. Change all
14425 callers. Pass mapfile, symbol, and reason to include_member.
14426 (Archive::include_all_members): Add mapfile parameter. Change all
14427 callers.
14428 (Archive::include_member): Add mapfile, sym, and why parameters.
14429 Change all callers. Report inclusion to map file.
14430 * archive.h: Include "fileread.h".
14431 (class Archive): Update declarations.
14432 (Archive::file): New const method.
14433 (class Add_archive_symbols): Add mapfile_ field. Update
14434 constructor. Change all callers.
14435 * readsyms.h (class Read_symbols): Likewise.
14436 (class Finish_group): Likewise.
14437 (class Read_script): Likewise.
14438 * common.cc: Include "mapfile.h".
14439 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14440 all callers.
14441 (Symbol_table::do_allocate_commons): Likewise.
14442 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14443 symbol allocation to mapfile.
14444 * common.h (class Allocate_commons_task): Add mapfile_ field.
14445 Update constructor. Change all callers.
14446 * symtab.h (class Symbol_table): Update declarations.
14447 * layout.cc: Include "mapfile.h".
14448 (Layout_task_runner::run): Print information to mapfile.
14449 (Layout::create_gold_note): Change Output_data_fixed_space to
14450 Output_data_zero_fill.
14451 (Layout::create_build_id): Likewise.
14452 (Layout::print_to_mapfile): New function.
14453 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14454 constructor. Change caller.
14455 (class Layout): Declare print_to_mapfile.
14456 * output.cc (Output_section::Input_section::print_to_mapfile): New
14457 function.
14458 (Output_section::add_input_section): If producing a map, always
14459 add to input_sections_ list.
14460 (Output_section::do_print_to_mapfile): New function.
14461 (Output_segment::print_sections_to_mapfile): New function.
14462 (Output_segment::print_section_list_to_mapfile): New function.
14463 * output.h: Include "mapfile.h".
14464 (Output_data::print_to_mapfile): New function.
14465 (Output_data::do_print_to_mapfile): New virtual function.
14466 (Output_segment_headers::do_print_to_mapfile): New function.
14467 (Output_file_header::do_print_to_mapfile): New function.
14468 (Output_data_const::do_print_to_mapfile): New function.
14469 (class Output_data_const_buffer): Add map_name_ field. Update
14470 constructor. Change all callers. Add do_print_to_mapfile
14471 function.
14472 (class Output_data_fixed_space): Likewise.
14473 (class Output_data_space): Likewise.
14474 (class Output_data_zero_fill): New class.
14475 (Output_data_strtab::do_print_to_mapfile): New function.
14476 (Output_data_reloc_base::do_print_to_mapfile): New function.
14477 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14478 (Output_data_group::do_print_to_mapfile): New function.
14479 (Output_data_got::do_print_to_mapfile): New function.
14480 (Output_data_dynamic::do_print_to_mapfile): New function.
14481 (Output_symtab_xindex::do_print_to_mapfile): New function.
14482 (class Output_section): Declare do_print_to_mapflie. Declare
14483 print_to_mapfile in Input_section.
14484 (class Output_segment): Declare new functions.
14485 * object.h (Sized_relobj::symbol_count): New function.
14486 * script-sections.cc
14487 (Output_section_element_dot_assignment::set_section_addresses):
14488 Change Output_data_fixed_space to Output_data_zero_fill.
14489 (Output_data_expression::do_print_to_mapfile): New function.
14490 * script.cc (read_input_script): Add mapfile parameter. Change
14491 all callers.
14492 * script.h (read_input_script): Update declaration.
14493 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14494 (Eh_frame::do_print_to_mapfile): New function.
14495 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14496 (Output_merge_string::do_print_to_mapfile): New function.
14497 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14498 function.
14499 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14500 function.
14501 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14502 function.
14503 * Makefile.am (CCFILES): Add mapfile.cc.
14504 (HFILES): Add mapfile.h.
14505 * Makefile.in: Rebuild.
14506
9f1d377b
ILT
145072008-05-19 Ian Lance Taylor <iant@google.com>
14508
14509 * options.h (class General_options): Add -z relro.
14510 * layout.cc (Layout::Layout): Initialize relro_segment_.
14511 (Layout::add_output_section_data): Return the output section.
14512 (Layout::make_output_section): Rcognize relro sections and mark
14513 them appropriately.
14514 (Layout::attach_allocated_section_to_segment): Put relro sections
14515 in a PT_GNU_RELRO segment.
14516 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14517 section as relro.
14518 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14519 PT_TLS segments.
14520 (Layout::linkonce_mapping): Map d.rel.ro.local to
14521 .data.rel.ro.local.
14522 (Layout::output_section_name): Us .data.rel.ro.local for any
14523 section which begins with that.
14524 * layout.h (class Layout): Update add_output_section_data
14525 declaration. Add relro_segment_ field.
14526 * output.cc (Output_section::Output_section): Initialize is_relro_
14527 and is_relro_local_ fields.
14528 (Output_segment::add_output_section): Group relro sections.
14529 (Output_segment::is_first_section_relro): New function.
14530 (Output_segment::maximum_alignment): If there is a relro section,
14531 align the segment to the common page size.
14532 (Output_segment::set_section_addresses): Track whether we are
14533 looking at relro sections. If the last section is a relro
14534 section, align to the common page size.
14535 (Output_segment::set_section_list_addresses): Add in_relro
14536 parameter. Change all callers. Align to the page size when
14537 moving from relro to non-relro section.
14538 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14539 segment.
14540 * output.h (class Output_section): Add is_relro_ and
14541 is_relro_local_ fields.
14542 (Output_section::is_relro): New function.
14543 (Output_section::set_is_relro): New function.
14544 (Output_section::is_relro_local): New function.
14545 (Output_section::set_is_relro_local): New function.
14546 (class Output_segment): Update declarations.
14547 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14548 * sparc.cc (Target_sparc::got_section): Likewise.
14549 * x86_64.cc (Target_x86_64::got_section): Likewise.
14550 * testsuite/relro_test_main.cc: New file.
14551 * testsuite/relro_test.cc: New file.
14552 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14553 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14554 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14555 (relro_test.so, relro_test_pic.o): New targets.
14556 * testsuite/Makefile.in: Rebuild.
14557
a984ee1d
ILT
145582008-05-16 Ian Lance Taylor <iant@google.com>
14559
01676dcd
ILT
14560 * output.cc (Output_segment::add_output_section): Remove front
14561 parameter.
14562 * output.h (class Output_segment): Remove
14563 add_initial_output_section and overloaded add_output_section.
14564 Update declaration of remaining add_output_section.
14565 * layout.cc (Layout::create_interp): Call add_output_section
14566 rather than add_initial_output_section.
14567 (Layout::finish_dynamic_section): Likewise.
14568
497897f9
ILT
14569 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14570 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14571 know the dynamic type.
14572 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14573 field. Initialize it in constructor.
14574 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14575 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14576 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14577 reloc.
14578
a984ee1d
ILT
14579 * output.cc (Output_reloc::get_address): Change return type to
14580 Elf_Addr.
14581 * output.h (class Output_reloc): Update get_address declaration.
14582 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14583 for section addresses.
14584
55ba0940
ILT
145852008-05-09 Ian Lance Taylor <iant@google.com>
14586
14587 PR 6493
14588 * gold.cc (gold_nomem): Use return value of write.
14589
75517b77
ILT
145902008-05-08 Ian Lance Taylor <iant@google.com>
14591
14592 * symtab.c (Symbol::init_base_output_data): Add version
14593 parameter. Change all callers.
14594 (Symbol::init_base_output_segment): Likewise.
14595 (Symbol::init_base_constant): Likewise.
14596 (Symbol::init_base_undefined): Likewise.
14597 (Sized_symbol::init_output_data): Likewise.
14598 (Sized_symbol::init_output_segment): Likewise.
14599 (Sized_symbol::init_constant): Likewise.
14600 (Sized_symbol::init_undefined): Likewise.
14601 (Symbol_table::do_define_in_output_data): If the new symbol has a
14602 version, mark it as the default.
14603 (Symbol_table::do_define_in_output_segment): Likewise.
14604 (Symbol_table::do_define_as_constant): Likewise.
14605 * symtab.h (class Symbol): Update declarations.
14606 (class Sized_symbol): Likewise.
14607 * resolve.cc (Symbol::override_version): New function.
c42e122e 14608 (Symbol::override_base): Call override_version.
75517b77
ILT
14609 (Symbol::override_base_with_special): Likewise.
14610 * testsuite/ver_script_8.script: New file.
14611 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14612 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14613 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14614 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14615
f1f70eae
ILT
146162008-05-06 Ian Lance Taylor <iant@google.com>
14617
f3e9c5c5
ILT
14618 PR 6049
14619 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14620 functions.
14621 (class General_options): Remove existing --undefined, and add
14622 --no-undefined instead. Add new --undefined as synonym for -u.
14623 * archive.cc (Archive::add_symbols): Check whether symbol was
14624 named with -u.
14625 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14626 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14627 all uses. Add IS_UNDEFINED. Update declarations to split
14628 different versions of init_base. Declare init_base_undefined.
14629 (Symbol::is_defined): Handle IS_UNDEFINED.
14630 (Symbol::is_undefined): Likewise.
14631 (Symbol::is_weak_undefined): Call is_undefined.
14632 (Symbol::is_absolute): Handle IS_CONSTANT.
14633 (class Sized_symbol): Update declarations to split different
14634 versions of init. Declare init_undefined.
14635 (class Symbol_table): Declare new functions.
14636 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14637 Change all callers.
14638 (Symbol::init_base_output_data): Likewise.
14639 (Symbol::init_base_output_segment): Likewise.
14640 (Symbol::init_base_constant): Likewise.
14641 (Symbol::init_base_undefined): New function.
14642 (Sized_symbol::init_object): Rename from init. Change all
14643 callers.
14644 (Sized_symbol::init_output_data): Likewise.
14645 (Sized_symbol::init_output_segment): Likewise.
14646 (Sized_symbol::init_constant): Likewise.
14647 (Sized_symbol::init_undefined): New function.
14648 (Symbol_table::add_undefined_symbols_from_command_line): New
14649 function.
14650 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14651 function.
14652 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14653 (Symbol::output_section): Likewise.
14654 (Symbol::set_output_section): Likewise.
14655 (Symbol_table::sized_finalize_symbol): Likewise.
14656 (Symbol_table::sized_write_globals): Likewise.
14657 * resolve.cc (Symbol_table::should_override): Likewise.
14658 (Symbol::override_base_with_special): Likewise.
14659
8bdcdf2c
ILT
14660 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14661 symbol, change it to have default visibility.
14662 * testsuite/protected_1.cc: New file.
14663 * testsuite/protected_2.cc: New file.
14664 * testsuite/protected_3.cc: New file.
14665 * testsuite/protected_main_1.cc: New file.
14666 * testsuite/protected_main_2.cc: New file.
14667 * testsuite/protected_main_3.cc: New file.
14668 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14669 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14670 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14671 (protected_1.so): New target.
14672 (protected_1_pic.o, protected_2_pic.o): New targets.
14673 (protected_3_pic.o): New target.
14674 (check_PROGRAMS): Add protected_2.
14675 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14676 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14677 * testsuite/Makefile.in: Rebuild.
14678
2b706932
ILT
14679 * options.h (DEFINE_var): Add set_user_set_##varname__.
14680 (DEFINE_bool_alias): New macro.
14681 (class General_options): Define -Bstatic using DEFINE_bool_alias
14682 rather than DEFINE_special. Add --undefined as an alias for -z
14683 defs.
14684 * options.cc (General_options::parse_Bstatic): Remove.
14685
d82a5bcc
ILT
14686 * options.h (class General_options): Add --fatal-warnings.
14687 * main.cc (main): Implement --fatal-warnings.
14688 * errors.h (Errors::warning_count): New function.
14689
f1f70eae
ILT
14690 * options.h (class General_options): Add -Bsymbolic-functions.
14691 * symtab.h (Symbol::is_preemptible): Check for
14692 -Bsymbolic-functions.
14693
8825ac63
ILT
146942008-05-05 Ian Lance Taylor <iant@google.com>
14695
d98bc257
ILT
14696 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14697 as noVARNAME rather than no-VARNAME.
14698 (class General_options): Add option -z combreloc.
14699 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14700 get_address.
14701 (Output_reloc::sort_before) [SHT_REL]: New function.
14702 (Output_reloc::sort_before) [SHT_RELA]: New function.
14703 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14704 Sort_relocs_comparison.
14705 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14706 parameter. Change all callers.
14707 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14708 sort_relocs parameter. Change all callers.
14709 * output.cc (Output_reloc::get_address): New function, broken out
14710 of write_rel.
14711 (Output_reloc::write_rel): Call it.
14712 (Output_reloc::compare): New function.
14713 (Output_data_reloc_base::do_write): Optionally sort relocs.
14714
60b2b4e7
ILT
14715 * configure.ac: If targ_extra_obj is set, link it in.
14716 * configure.tgt: Initialize all variables.
14717 (x86_64*): Set targ_extra_obj and targ_extra_size.
14718 * configure: Rebuild.
14719
8825ac63
ILT
14720 * object.cc (Sized_relobj::include_section_group): Adjust section
14721 indexes read from group data. Build vector to pass to
14722 layout_group.
14723 * layout.cc (Layout::layout_group): Add flags and shndxes
14724 parameters. Remove contents parameter. Change caller. Update
14725 explicit instantiations.
14726 * layout.h (class Layout): Update layout_group declaration.
14727 * output.cc (Output_data_group::Output_data_group): Add flags and
14728 input_shndxes parameters. Remove contents parameter. Change
14729 caller.
14730 (Output_data_group::do_write): Change input_sections_ to
14731 input_shndxes_.
14732 * output.h (class Output_data_group): Update constructor
14733 declaration. Rename input_sections_ to input_shndxes_.
14734 * testsuite/many_sections_test.cc: Add template.
14735
e94cf127
CC
147362008-04-30 Cary Coutant <ccoutant@google.com>
14737
4418b2d5
CC
14738 * target-reloc.h (relocate_section): Fix dead-pointer bug.
14739
e94cf127
CC
14740 * layout.cc (Layout::include_section): Refactored check for debug
14741 info section.
14742 (Layout::add_comdat): Add new parameters. Change type
14743 of signature parameter. Add object and shndx to signatures table.
14744 (Layout::find_kept_object): New function.
14745 * layout.h: Include <cstring>.
14746 (Layout::is_debug_info_section): New function.
14747 (Layout::add_comdat): Add new parameters.
14748 (Layout::find_kept_object): New function.
14749 (Layout::Kept_section): New struct.
14750 (Layout::Signatures): Change type of map range.
14751 * object.cc (Relobj::output_section_address): New function.
14752 (Sized_relobj::include_section_group): Add new parameters. Change
14753 calls to Layout::add_comdat. Change to build table of kept comdat
14754 groups and table mapping discarded sections to kept sections.
14755 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
14756 (Sized_relobj::do_layout): Change calls to include_section_group and
14757 include_linkonce_section.
14758 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
14759 value to zero when section is discarded.
14760 (Sized_relobj::map_to_kept_section): New function.
14761 * object.h (Relobj::output_section_address): New function.
14762 (Relobj::Comdat_group): New type.
14763 (Relobj::find_comdat_group): New function.
14764 (Relobj::Comdat_group_table): New type.
14765 (Relobj::Kept_comdat_section): New type.
14766 (Relobj::Kept_comdat_section_table): New type.
14767 (Relobj::add_comdat_group): New function.
14768 (Relobj::set_kept_comdat_section): New function.
14769 (Relobj::get_kept_comdat_section): New function.
14770 (Relobj::comdat_groups_): New field.
14771 (Relobj::kept_comdat_sections_): New field.
14772 (Symbol_value::input_value): Update comment.
14773 (Sized_relobj::map_to_kept_section) New function.
14774 (Sized_relobj::include_linkonce_section): Add new parameter.
14775 * target-reloc.h (Comdat_behavior): New type.
14776 (get_comdat_behavior): New function.
14777 (relocate_section): Add code to map a discarded section to the
14778 corresponding kept section when applying a relocation.
14779
e4e5049b
CS
147802008-04-30 Craig Silverstein <csilvers@google.com>
14781
14782 * dwarf_reader.cc (next_generation_count): New static var.
14783 (Addr2line_cache_entry): New struct.
14784 (addr2line_cache): New static var.
14785 (Dwarf_line_info::one_addr2line): Added caching.
14786 (Dwarf_line_info::clear_addr2line_cache): New function.
14787 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
14788 cache-size parameter.
14789 (Dwarf_line_info::one_addr2line_cache): New function.
14790 * symtab.cc (Symbol_table::detect_odr_violations): Pass
14791 new cache-size argument to one_addr2line(), and clear cache.
14792
d09e9154
CC
147932008-04-28 Cary Coutant <ccoutant@google.com>
14794
14795 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
14796 R_386_PC8 relocations.
14797
7ef73768
ILT
147982008-04-23 Ian Lance Taylor <iant@google.com>
14799
55438702
ILT
14800 * object.cc (Sized_relobj::include_section_group): Check for
14801 invalid section group.
14802
c165fb93
ILT
14803 * object.cc (make_elf_object): Correct test for 64-bit ELF file
14804 header size.
14805
7ef73768
ILT
14806 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
14807 than read for file header.
14808 * archive.cc (Archive::include_member): Likewise.
14809
6194aaab
L
148102008-04-23 Paolo Bonzini <bonzini@gnu.org>
14811
14812 * aclocal.m4: Regenerate.
14813 * configure: Regenerate.
14814
d491d34e
ILT
148152008-04-19 Ian Lance Taylor <iant@google.com>
14816
5ea2bac6
ILT
14817 * version.cc (version_string): Bump to 1.6.
14818
7bc3e21a
ILT
14819 * testsuite/Makefile.am (many_sections_r_test): New target.
14820 (many_sections_r_test_SOURCES): Remove.
14821 (many_sections_r_test_DEPENDENCIES): Remove.
14822 (many_sections_r_test_LDFLAGS): Remove.
14823 (many_sections_r_test_LDADD): Remove.
14824
7fcd3aa9
ILT
14825 * object.cc (Sized_relobj::do_add_symbols): Always pass
14826 local_symbol_count_ to add_from_relobj.
14827
4c94d6ae
ILT
14828 * testsuite/Makefile.am (many_sections_check.h): Only check one in
14829 every thousand variables.
14830 * testsuite/Makefile.in: Rebuild.
14831
d491d34e
ILT
14832 * object.cc (Xindex::initialize_symtab_xindex): New function.
14833 (Xindex::read_symtab_xindex): New function.
14834 (Xindex::sym_xindex_to_shndx): New function.
14835 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
14836 available.
14837 (Sized_relobj::do_initialize_xindex): New function.
14838 (Sized_relobj::do_read_symbols): Adjust section links.
14839 (Sized_relobj::symbol_section_and_value): Add is_ordinary
14840 parameter. Change all callers.
14841 (Sized_relobj::include_section_group): Adjust section links and
14842 symbol section indexes.
14843 (Sized_relobj::do_layout): Adjust section links.
14844 (Sized_relobj::do_count_local_symbols): Adjust section links and
14845 symbol section indexes.
14846 (Sized_relobj::do_finalize_local_symbols): Distinguish between
14847 ordinary and special symbols.
14848 (Sized_relobj::write_local_symbols): Add symtab_xindex and
14849 dynsym_xindex parameters. Change all callers. Adjust section
14850 links. Use SHN_XINDEX when needed.
14851 (Sized_relobj::get_symbol_location_info): Adjust section links.
14852 Don't get fooled by special symbols.
14853 * object.h (class Xindex): Define.
14854 (class Object): Add xindex_ parameter. Declare virtual functoin
14855 do_initialize_xindex.
14856 (Object::adjust_sym_shndx): New function.
14857 (Object::set_xindex): New protected function.
14858 (class Symbol_value): Add is_ordinary_shndx_ field.
14859 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
14860 (Symbol_value::value): Assert ordinary section.
14861 (Symbol_value::initialize_input_to_output_map): Likewise.
14862 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
14863 Change all callers.
14864 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
14865 all callers.
14866 (class Sized_relobj): Update declarations.
14867 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
14868 parameter. Change all callers.
14869 (Sized_relobj::adjust_shndx): New function.
14870 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
14871 field.
14872 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
14873 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
14874 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
14875 (Sized_dynobj::read_dynsym_section): Adjust section links.
14876 (Sized_dynobj::read_dynamic): Likewise.
14877 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
14878 section links.
14879 (Sized_dynobj::do_initialize_xindex): New function.
14880 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
14881 do_initialize_xindex.
14882 (Sized_dynobj::adjust_shndx): New function.
14883 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
14884 dynsym_xindex_ fields.
14885 (Layout::finalize): Add a call to set_section_indexes before
14886 creating the symtab sections.
14887 (Layout::set_section_indexes): Don't do anything if the section
14888 already has a section index.
14889 (Layout::create_symtab_sections): Add shnum parameter. Change
14890 caller. Create .symtab_shndx section if needed.
14891 (Layout::create_shdrs): Add shstrtab_section parameter. Change
14892 caller.
14893 (Layout::allocated_output_section_count): New function.
14894 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
14895 needed.
14896 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
14897 fields. Update declarations.
14898 (Layout::symtab_xindex): New function.
14899 (Layout::dynsym_xindex): New function.
14900 (class Write_symbols_task): Add layout_ field.
14901 (Write_symbols_task::Write_symbols_task): Add layout parameter.
14902 Change caller.
14903 * output.cc (Output_section_headers::Output_section_headers): Add
14904 shstrtab_section parameter. Change all callers.
14905 (Output_section_headers::do_sized_write): Store overflow values
14906 for section count and section string table section index in
14907 section header zero.
14908 (Output_file_header::do_sized_write): Check for overflow of
14909 section count and section string table section index.
14910 (Output_symtab_xindex::do_write): New function.
14911 (Output_symtab_xindex::endian_do_write): New function.
14912 * output.h (class Output_section_headers): Add shstrtab_section_.
14913 Update declarations.
14914 (class Output_symtab_xindex): Define.
14915 (Output_section::has_out_shndx): New function.
14916 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
14917 field.
14918 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
14919 Change all callers.
14920 (Sized_symbol::init): Likewise.
14921 (Symbol::output_section): Check for ordinary symbol.
14922 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
14923 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
14924 callers.
14925 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
14926 Change all callers. Simplify handling of symbols from sections
14927 not included in the link.
14928 (Symbol_table::add_from_dynobj): Handle ordinary symbol
14929 distinction.
14930 (Weak_alias_sorter::operator()): Assert that symbols are
14931 ordinary.
14932 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14933 distinction.
14934 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14935 parameters. Change all callers.
14936 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14937 symbol distinction. Use SHN_XINDEX when needed.
14938 (Symbol_table::write_section_symbol): Add symtab_xindex
14939 parameter. Change all callers.
14940 (Symbol_table::sized_write_section_symbol): Likewise. Use
14941 SHN_XINDEX when needed.
14942 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14943 declarations.
14944 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14945 (Symbol::is_defined): Check is_ordinary.
14946 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14947 (Symbol::is_absolute, Symbol::is_common): Likewise.
14948 (class Sized_symbol): Update declarations.
14949 (class Symbol_table): Update declarations.
14950 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14951 parameters. Change all callers.
14952 (Sized_symbol::override): Likewise.
14953 (Symbol_table::override): Likewise.
14954 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14955 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14956 is_ordinary, and orig_st_shndx parameters. Change all callers.
14957 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14958 to be in an ordinary section.
14959 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14960 object and is_ordinary parameters. Change all callers.
14961 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14962 Change all callers. Don't add undefined or non-ordinary symbols
14963 to reloc_map_.
14964 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
14965 Change all callers.
14966 * dwarf_reader.h (class Sized_dwarf_line_info): Update
14967 declarations.
14968 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
14969 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
14970 (Sized_relobj::relocate_sections): Likewise.
14971 * target-reloc.h (scan_relocs): Adjust section symbol index.
14972 (scan_relocatable_relocs): Likewise.
14973 * i386.cc (Scan::local): Check for ordinary symbols.
14974 * sparc.cc (Scan::local): Likewise.
14975 * x86_64.cc (Scan::local): Likewise.
14976 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
14977 to symbol_section_and_value.
14978 * testsuite/many_sections_test.cc: New file.
14979 * testsuite/Makefile.am (BUILT_SOURCES): Define.
14980 (check_PROGRAMS): Add many_sections_test.
14981 (many_sections_test_SOURCES): Define.
14982 (many_sections_test_DEPENDENCIES): Define.
14983 (many_sections_test_LDFLAGS): Define.
14984 (BUILT_SOURCES): Add many_sections_define.h.
14985 (many_sections_define.h): New target.
14986 (BUILT_SOURCES): Add many_sections_check.h.
14987 (many_sections_check.h): New target.
14988 (check_PROGRAMS): Add many_sections_r_test.
14989 (many_sections_r_test_SOURCES): Define.
14990 (many_sections_r_test_DEPENDENCIES): Define.
14991 (many_sections_r_test_LDFLAGS): Define.
14992 (many_sections_r_test_LDADD): Define.
14993 (many_sections_r_test.o): New target.
14994 * testsuite/Makefile.in: Rebuild.
14995
c5818ff1
CC
149962008-04-17 Cary Coutant <ccoutant@google.com>
14997
14998 * errors.cc (Errors::info): New function.
14999 (gold_info): New function.
15000 * errors.h (Errors::info): New function.
15001 * gold.h (gold_info): New function.
15002 * object.cc (Input_objects::add_object): Print trace output.
15003 * options.cc (options::parse_set): New function.
15004 (General_options::parse_wrap): Deleted.
15005 (General_options::General_options): Deleted initializer.
15006 * options.h (options::String_set): New typedef.
15007 (options::parse_set): New function.
15008 (DEFINE_set): New macro.
15009 (General_options::wrap): Changed to use DEFINE_set. Changed
15010 callers of any_wrap_symbols and is_wrap_symbol.
15011 (General_options::trace, General_options::trace_symbol):
15012 New options.
15013 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15014 (General_options::wrap_symbols_): Deleted.
15015 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15016
b5be4a7c
DM
150172008-04-17 David S. Miller <davem@davemloft.net>
15018
15019 * options.cc (General_options::parse_V): New function.
15020 * options.h: Add entries for -V and -Qy.
15021
155a0dd7
ILT
150222008-04-17 Ian Lance Taylor <iant@google.com>
15023
15024 * common.cc (Symbol_table::allocate_commons): Remove options
15025 parameter. Change caller.
15026 (Symbol_table::do_allocate_commons): Remove options parameter.
15027 Change caller. Just call do_allocate_commons_list twice.
15028 (Symbol_table::do_allocate_commons_list): New function, broken out
15029 of do_allocate_commons.
15030 * common.h (class Allocate_commons_task): Remove options_ field.
15031 Update constructor.
15032 * symtab.cc (Symbol_table::Symbol_table): Initialize
15033 tls_commons_.
15034 (Symbol_table::add_from_object): Put TLS common symbols on
15035 tls_commons_ list.
15036 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15037 which are IN_OUTPUT_DATA.
15038 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15039 allocate_commons and do_allocate_commons declarations. Declare
15040 do_allocate_commons_list.
15041 * gold.cc (queue_middle_tasks): Update creation of
15042 Allocate_commons_task to not pass options.
15043 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15044 (TLS_TEST_C_FLAGS): New variable.
15045 (tls_test_c_pic.o): New target.
15046 (tls_test_shared.so): Link in tls_test_c_pic.o.
15047 (tls_test_c_pic_ie.o): New target.
15048 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15049 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15050 (tls_test_c.o): New target.
15051 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15052 (tls_pic_test_LDADD): Likewise.
15053 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15054 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15055 (tls_test_c_gnu2.o): New target.
15056 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15057 tls_test_c_gnu2.o.
15058 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15059 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15060 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15061 * testsuite/tls_test.cc: Include "config.h".
15062 (t_last): Call t11_last.
15063 * testsuite/tls_test.h (t11, t11_last): Declare.
15064 * testsuite/tls_test_c.c: New file.
15065 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15066 * configure.ac: Check for OpenMP support.
15067 * configure, config.in, Makefile.in: Rebuild.
15068 * testsuite/Makefile.in: Rebuild.
15069
edfbb029
CC
150702008-04-16 Cary Coutant <ccoutant@google.com>
15071
15072 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15073 (Target_i386::tls_base_symbol_defined_): New field.
15074 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15075 (Target_i386::Scan::global): Likewise.
15076 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15077 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15078 (Target_x86_64::tls_base_symbol_defined_): New field.
15079 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15080 (Target_x86_64::Scan::global): Likewise.
15081
f3c69fca
CC
150822008-04-16 Cary Coutant <ccoutant@google.com>
15083
15084 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15085 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15086 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15087 building shared libraries.
15088 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15089 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15090 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15091 * testsuite/Makefile.in: Rebuild.
15092 * testsuite/weak_undef.h: New file.
15093 * testsuite/weak_undef_file1.cc: Add extra test cases.
15094 * testsuite/weak_undef_file2.cc: Likewise.
15095 * testsuite/weak_undef_test.cc: Likewise.
15096
7c414435
DM
150972008-04-16 David S. Miller <davem@davemloft.net>
15098
32b769e1
DM
15099 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15100 Add issued_non_pic_error_ field. Declare check_non_pic.
15101 (Target_sparc::Scan::check_non_pic): New function.
15102 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15103 (Target_sparc::Scan::global): Likewise.
15104
11936fb1
DM
15105 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15106 * configure: Rebuild.
15107
7c414435
DM
15108 * options.h (DEFINE_enable): New macro.
15109 (new_dtags): New enable option.
15110 (initfirst, interpose, loadfltr, nodefaultlib,
15111 nodelete, nodlopen, nodump): New -z options.
15112 * layout.cc (Layout:finish_dynamic_section): If new
15113 dtags enabled, emit DT_RUNPATH. Also, emit a
15114 DT_FLAGS_1 containing any specified -z flags.
15115
85c7bf8b
ILT
151162008-04-16 Ian Lance Taylor <iant@google.com>
15117
12c0daef
ILT
15118 * copy-relocs.cc: New file.
15119 * copy-relocs.h: New file.
15120 * reloc.cc: Remove Copy_relocs code.
15121 * reloc.h: Likewise.
15122 * reloc-types.h (struct Reloc_types) [both versions]: Add
15123 get_reloc_addend_noerror.
15124 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15125 variants of add_global which take an addend which must be zero.
15126 * i386.cc: Include "copy-relocs.h".
15127 (class Target_i386): Change type of copy_relocs_ to variable,
15128 update initializer.
15129 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15130 Change all callers.
15131 (Target_i386::do_finalize_sections): Change handling of
15132 copy_relocs_.
15133 * sparc.cc: Include "copy-relocs.h".
15134 (class Target_sparc): Change type of copy_relocs_ to variable,
15135 update initializer.
15136 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15137 Change all callers.
15138 (Target_sparc::do_finalize_sections): Change handling of
15139 copy_relocs_.
15140 * x86_64.cc: Include "copy-relocs.h".
15141 (class Target_x86_64): Change type of copy_relocs_ to variable,
15142 update initializer.
15143 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15144 class. Change all callers.
15145 (Target_x86_64::do_finalize_sections): Change handling of
15146 copy_relocs_.
15147 * Makefile.am (CCFILES): Add copy-relocs.cc.
15148 (HFILES): Add copy-relocs.h.
15149
4f4995b6
ILT
15150 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15151
85c7bf8b
ILT
15152 * testsuite/script_test_4.sh: Permit leading zeroes.
15153
4f2a9edd
ILT
151542008-04-15 Ian Lance Taylor <iant@google.com>
15155
e6188289
ILT
15156 * script-sections.cc (Script_sections::create_segments): Use
15157 header_size_adjustment even when there is enough room for the
15158 headers.
15159 * testsuite/script_test_4.sh: New file.
15160 * testsuite/script_test_4.t: New file.
15161 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15162 (check_DATA): Add script_test_4.stdout.
15163 (MOSTLYCLEANFILES): Likewise.
15164 (script_test_4): New target.
15165 (script_test_4.stdout): New target.
15166 * testsuite/Makefile.in: Rebuild.
15167
4f2a9edd
ILT
15168 * sparc.cc: Add definitions for Output_data_plt_sparc class
15169 constants.
15170
f5314dd5
DM
151712008-04-14 David S. Miller <davem@davemloft.net>
15172
15173 * sparc.cc: New file.
15174 * Makefile.am (TARGETSOURCES): Add sparc.cc
15175 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15176 * configure.tgt: Document targ_extra_size and
15177 targ_extra_big_endian. Add entries for sparc-* and
15178 sparc64-*.
15179 * configure.ac: Handle targ_extra_size and
15180 targ_extra_big_endian.
15181 * Makefile.in: Rebuild.
15182 * configure: Likewise.
15183 * po/POTFILES.in: Likewise.
15184 * po/gold.pot: Likewise.
15185
154e0e9a
ILT
151862008-04-14 Ian Lance Taylor <iant@google.com>
15187
15188 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15189 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15190 in the name/type/flags to section mapping. Don't call
15191 allocate_output_section.
15192 (Layout::choose_output_section): Change parameter from adjust_name
15193 to is_input_section. Don't permit input sections after sections
15194 are attached to segments. Don't call allocate_output_section.
15195 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15196 not write_enable_output_section.
15197 (Layout::make_output_section): Don't push to
15198 unattached_section_list_ nor call attach_to_segment. Call
15199 attach_section_to_segment if sections are attached.
15200 (Layout::attach_sections_to_segments): New function.
15201 (Layout::attach_section_to_segment): New function.
15202 (Layout::attach_allocated_section_to_segment): Rename from
15203 attach_to_segment. Remove flags parameter.
15204 (Layout::allocate_output_section): Remove function.
15205 (Layout::write_enable_output_section): Remove function.
15206 * layout.h (class Layout): Update for above changes. Add new
15207 field sections_are_attached_.
15208 * output.h (Output_section::update_flags_for_input_section): New
15209 function.
15210 * output.cc (Output_section::add_input_section): Call
15211 update_flags_for_input_section.
15212 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15213
009a67a2
CC
152142008-04-11 Cary Coutant <ccoutant@google.com>
15215
15216 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15217 thought unnecessary.
15218 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15219
759b1a24
ILT
152202008-04-11 Ian Lance Taylor <iant@google.com>
15221
15222 * output.h (class Output_section_data): Remove inline definition
15223 of set_addralign.
15224 * output.cc (Output_section_data::set_addralign): New function.
15225
c2b45e22
CC
152262008-04-11 Cary Coutant <ccoutant@google.com>
15227
15228 Add support for TLS descriptors for i386 and x86_64.
15229 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15230 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15231 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15232 GOT_TYPE_TLS_DESC.
15233 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15234 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15235 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15236 relocations.
15237 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15238 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15239 Fix problem with initial-exec relocations.
15240 (Target_i386::Relocate::relocate_tls): Likewise.
15241 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15242 relaxation.
15243 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15244 support for section-plus-offset dynamic table entries.
15245 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15246 (Output_data_dynamic::Dynamic_entry): Add support for
15247 section-plus-offset dynamic table entries.
15248 (Output_data_dynamic::Classification): Likewise.
15249 (Output_data_dynamic::classification_): Renamed offset_.
15250 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15251 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15252 (Target_x86_64::make_plt_section): New function.
15253 (Target_x86_64::reserve_tlsdesc_entries): New function.
15254 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15255 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15256 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15257 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15258 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15259 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15260 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15261 add extra PLT entry for TLS descriptors.
15262 (Output_data_plt_x86_64::got_): New field.
15263 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15264 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15265 fields.
15266 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15267 descriptors.
15268 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15269 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15270 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15271 R_386_TLS_DESC_CALL relocations.
15272 (Target_x86_64::Scan::global): Likewise.
15273 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15274 for TLS descriptors.
15275 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15276 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15277 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15278 GD-to-IE relaxation.
15279 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15280 and TLS_DESCRIPTORS.
15281 * Makefile.in: Rebuild.
15282 * configure: Rebuild.
15283 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15284 (tls_test_shared2.so): New target.
15285 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15286 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15287 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15288 (tls_shared_gd_to_ie_test_LDADD): New variable.
15289 (tls_shared_gnu2_gd_to_ie_test): New target.
15290 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15291 New targets.
15292 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15293 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15294 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15295 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15296 (tls_shared_gnu2_test): New target.
15297 (tls_test_gnu2_shared.so): New target.
15298 (tls_shared_gnu2_test_SOURCES): New variable.
15299 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15300 (tls_shared_gnu2_test_LDFLAGS): New variable.
15301 (tls_shared_gnu2_test_LDADD): New variable.
15302 * testsuite/Makefile.in: Rebuild.
15303 * testsuite/Makefile.
15304
83bfb6b7
ILT
153052008-04-11 Ian Lance Taylor <iant@google.com>
15306
15307 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15308 justsyms.t.
15309 * testsuite/Makefile.in: Rebuild.
15310
15311 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15312 long.
15313 * testsuite/script_test_2.cc (main): Adjust test.
15314
706e1f5e
ILT
153152008-04-11 David S. Miller <davem@davemloft.net>
15316 Ian Lance Taylor <iant@google.com>
15317
15318 * options.h (General_options): Add entries for '-Y' and
15319 '-relax'.
15320 * options.cc (General_options:finalize): If -Y was used, add those
15321 entries to the library path instead of the default "/lib" and
15322 "/usr/lib".
15323
7c98e6bb
DM
153242008-04-11 David S. Miller <davem@davemloft.net>
15325
15326 * testsuite/justsyms.t: Start at 0x100.
15327 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15328 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15329 long.
15330 * testsuite/script_test_2.cc: Adjust string and section length
15331 checks.
7c98e6bb 15332
99a37bfd
ILT
153332008-04-09 Ian Lance Taylor <iant@google.com>
15334
2cefc357
ILT
15335 PR gold/5996
15336 * script-sections.cc (Sections_element::allocate_to_segment): Add
15337 orphan parameter.
15338 (Output_section_definition::allocate_to_segment): Likewise.
15339 (Orphan_output_section::allocate_to_segment): Likewise.
15340 (Script_sections::attach_sections_using_phdrs_clause): Don't
15341 propagate non-PT_LOAD segments to orphan sections.
15342 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15343 readelf rather than objdump.
15344 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15345 .interp section and PT_INTERP segment are the same size.
15346 * testsuite/Makefile.in: Rebuild.
15347
99a37bfd
ILT
15348 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15349 aliases for symbols defined in the same object.
15350 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15351 (weak_alias_test_SOURCES): New variable.
15352 (weak_alias_test_DEPENDENCIES): New variable.
15353 (weak_alias_test_LDFLAGS): New variable.
15354 (weak_alias_test_LDADD): New variable.
15355 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15356 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15357 (weak_alias_test_3.o): New target.
15358 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15359 * testsuite/weak_alias_test_main.cc: New file.
15360 * testsuite/weak_alias_test_1.cc: New file.
15361 * testsuite/weak_alias_test_2.cc: New file.
15362 * testsuite/weak_alias_test_3.cc: New file.
15363
780e49c5
ILT
153642008-04-08 Ian Lance Taylor <iant@google.com>
15365
cdb0b8f5
ILT
15366 * options.h (class General_options): Add --noinhibit-exec option.
15367 * main.cc (main): Check --noinhibit-exec.
15368
0864d551
ILT
15369 * options.h (class General_options): Define --wrap as a special
15370 option. Add wrap_symbols_ field.
15371 (General_options::any_wrap_symbols): New function.
15372 (General_options::is_wrap_symbol): New function.
15373 * options.cc (General_options::parse_wrap): New function.
15374 (General_options::General_options): Initialize wrap_symbols_.
15375 * symtab.cc (Symbol_table::wrap_symbol): New function.
15376 (Symbol_table::add_from_object): Handle --wrap.
15377 * symtab.h (class Symbol_table): Declare wrap_symbol.
15378 * target.h (Target::wrap_char): New function.
15379 (Target::Target_info): Add wrap_char field.
15380 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15381 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15382 * testsuite/testfile.cc (Target_test::test_target_info):
15383 Likewise.
15384
789aa6de
ILT
15385 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15386 there is one.
15387
2c38906f
ILT
15388 * layout.h (class Layout): Add added_eh_frame_data_ field.
15389 * layout.cc (Layout::Layout): Initialize new field.
15390 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15391 output section until we find a section we merged successfully.
15392 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15393 that the size be non-zero.
15394
780e49c5
ILT
15395 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15396 qualifier.
15397
7fcd0256
ILT
153982008-04-08 Craig Silverstein <csilvers@google.com>
15399
15400 * configure.ac: Export new conditional variable HAVE_ZLIB.
15401 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15402 on HAVE_ZLIB.
15403 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15404 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15405
6835af53
ILT
154062008-04-07 Ian Lance Taylor <iant@google.com>
15407
e24f324c
ILT
15408 * version.cc (version_string): Set to "1.5".
15409
a036edd8
ILT
15410 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15411 Add issued_non_pic_error_ field. Declare check_non_pic.
15412 (Target_x86_64::Scan::check_non_pic): New function.
15413 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15414 (Target_x86_64::Scan::global): Likewise.
15415
624f8810
ILT
15416 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15417 addend parameter. Change caller. Handle merge sections.
15418 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15419 Address to Addend. Don't add in the result of
15420 local_section_offset, pass down the addend and use the returned
15421 value.
15422 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15423 Update declarations of local_section_offset and symbol_value.
15424 * testsuite/two_file_test_1.cc (t18): New function.
15425 * testsuite/two_file_test_2.cc (f18): New function.
15426 * testsuite/two_file_test_main.cc (main): Call t18.
15427 * testsuite/two_file_test.h (t18, f18): Declare.
15428
6835af53
ILT
15429 * configure.ac: Don't test for objdump, c++filt, or readelf.
15430 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15431 conditionals.
15432 (TEST_READELF): New variable.
15433 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15434 (check_PROGRAMS): Add two_file_strip_test.
15435 (two_file_strip_test): New target.
15436 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15437 (two_file_same_shared_strip_test_SOURCES): New variable.
15438 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15439 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15440 (two_file_same_shared_strip_test_LDADD): New variable.
15441 (two_file_shared_strip.so): New target.
15442 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15443 (ver_test_5.syms, ver_test_7.syms): Likewise.
15444 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15445 (strip_test_3.stdout): Use TEST_OBJDUMP.
15446 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15447
86925eef
CC
154482008-04-04 Cary Coutant <ccoutant@google.com>
15449
15450 * symtab.h (Symbol::is_weak_undefined): New function.
15451 (Symbol::is_strong_undefined): New function.
15452 (Symbol::is_absolute): New function.
15453 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15454 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15455 absolute symbols.
15456 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15457 (weak_undef_test): New target.
15458 * testsuite/Makefile.in: Rebuild.
15459 * testsuite/weak_undef_file1.cc: New file.
15460 * testsuite/weak_undef_file2.cc: New file.
15461 * testsuite/weak_undef_test.cc: New file.
15462
126f3ece
ILT
154632008-04-03 Craig Silverstein <csilvers@google.com>
15464
15465 * compressed_output.h (class Output_compressed_section): Use
15466 unsigned buffer.
15467 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15468 add zlib header.
15469 (zlib_compressed_suffix): Removed.
15470 (Output_compressed_section::set_final_data_size): Use unsigned
15471 buffers.
15472 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15473 Fix linker invocation.
15474 (flagstest_o_specialfile_and_compress_debug_sections):
15475 Likewise.
15476 * testsuite/Makefile.in: Regenerated.
15477
deae2a14
DM
154782008-04-02 David S. Miller <davem@davemloft.net>
15479
15480 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15481 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15482
70752818
ILT
154832008-04-02 Craig Silverstein <csilvers@google.com>
15484
15485 * TODO: New file.
15486
39d0cb0e
ILT
154872008-04-02 Ian Lance Taylor <iant@google.com>
15488
15489 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15490 parameters. Update for new key type to views_. Change all
15491 callers.
15492 (File_read::read): Adjust for byteshift in returned view.
15493 (File_read::add_view): New function, broken out of
15494 find_and_make_view.
15495 (File_read::make_view): New function, broken out of
15496 find_and_make_view.
15497 (File_read::find_or_make_view): Add offset and aligned
15498 parameters. Rewrite accordingly. Change all callers.
15499 (File_read::get_view): Add offset and aligned parameters. Adjust
15500 for byteshift in return value.
15501 (File_read::get_lasting_view): Likewise.
15502 * fileread.h (class File_read): Update declarations.
15503 (class File_read::View): Add byteshift_ field. Add byteshift to
15504 constructor. Add byteshift method.
15505 * archive.h (Archive::clear_uncached_views): New function.
15506 (Archive::get_view): Add aligned parameter. Change all callers.
15507 * object.h (Object::get_view): Add aligned parameter. Change all
15508 callers.
15509 (Object::get_lasting_view): Likewise.
15510
15511 * fileread.cc (File_read::release): Don't call clear_views if
15512 there are multiple objects.
15513 * fileread.h (File_read::clear_uncached_views): New function.
15514 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15515 on the archive.
15516
a1207466
CC
155172008-03-31 Cary Coutant <ccoutant@google.com>
15518
15519 Add thin archive support.
15520 * archive.cc (Archive::armagt): New const.
15521 (Archive::setup): Remove task parameter and calls to unlock.
15522 (Archive::unlock_nested_archives): New function.
15523 (Archive::read_header): Add nested_off parameter. Change
15524 all callers.
15525 (Archive::interpret_header): Likewise.
15526 (Archive::include_all_members): Change to handle thin
15527 archives.
15528 (Archive::include_member): Likewise.
15529 * archive.h (Archive::Archive): Add new parameters and
15530 initializers.
15531 (Archive::armagt): New const.
15532 (Archive::setup): Remove task parameter.
15533 (Archive::unlock_nested_archives): New function.
15534 (Archive::read_header): Add nested_off parameter.
15535 (Archive::interpret_header): Likewise.
15536 (Archive::Nested_archive_table): New typedef.
15537 (Archive::is_thin_archive_): New field.
15538 (Archive::nested_archives_): New field.
15539 (Archive::options_): New field.
15540 (Archive::dirpath_): New field.
15541 (Archive::task_): New field.
15542 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15543 for thin archives. Pass additional parameters to
15544 Archive::Archive. Unlock the archive file after calling
15545 Archive::setup.
cd536b21 15546
479f6503
ILT
155472008-03-29 Ian Lance Taylor <iant@google.com>
15548
686c8caf
ILT
15549 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15550 version symbol to be local.
15551 * testsuite/ver_test_4.sh: New file.
15552 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15553 (check_DATA): Add ver_test_4.syms.
15554 (ver_test_4.syms): New target.
15555 * testsuite/Makefile.in: Rebuild.
15556
ab794b6b
ILT
15557 * output.cc
15558 (Output_section::Input_section_sort_entry::has_priority): New
15559 function.
15560 (Output_section::Input_section_sort_entry::match_file_name): New
15561 function.
15562 (Output_section::Input_section_sort_entry::match_section_name):
15563 Remove.
15564 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15565 Remove.
15566 (Output_section::Input_section_sort_entry::match_section_file):
15567 Remove.
15568 (Output_section::Input_section_sort_compare::operator()): Rewrite
15569 using new Input_section_sort_entry functions. Sort crtbegin and
15570 crtend first. Sort sections with no priority before sections with
15571 a priority.
15572 * testsuite/initpri1.c (d3): Check j != 4.
15573 (cd5): New constructor/destructor function.
15574 (main): Check j != 2.
15575
479f6503
ILT
15576 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15577 new symbol when resolving, don't call set_is_default.
15578 * testsuite/ver_test_7.cc: New file.
15579 * testsuite/ver_test_7.sh: New file.
15580 * testsuite/Makefile.am (ver_test_7.so): New target.
15581 (ver_test_7.o): New target.
15582 (check_SCRIPTS): Add ver_test_7.sh.
15583 (check_DATA): Add ver_test_7.syms.
15584 (ver_test_7.syms): New target.
15585
2fd32231
ILT
155862008-03-28 Ian Lance Taylor <iant@google.com>
15587
15588 * layout.cc (Layout::layout): If we see an input section with a
15589 name that needs sorting, set the must_sort flag for the output
15590 section.
15591 (Layout::make_output_section): If the name of the output section
15592 indicates that it might require sorting, set the may_sort flag.
15593 * output.h (Output_section::may_sort_attached_input_sections): New
15594 function.
15595 (Output_section::set_may_sort_attached_input_sections): New
15596 function.
15597 (Output_section::must_sort_attached_input_sections): New
15598 function.
15599 (Output_section::set_must_sort_attached_input_sections): New
15600 function.
15601 (class Output_section): Declare Input_section_sort_entry. Define
15602 Input_section_sort_compare. Declare
15603 sort_attached_input_sections. Add new fields:
15604 may_sort_attached_input_sections_,
15605 must_sort_attached_input_sections_,
15606 attached_input_sections_are_sorted_.
15607 * output.cc (Output_section::Output_section): Initialize new
15608 fields.
15609 (Output_section::add_input_section): Add an entry to
15610 input_sections_ if may_sort or must_sort are true.
15611 (Output_section::set_final_data_size): Call
15612 sort_attached_input_sections if necessary.
15613 (Output_section::Input_section_sort_entry): Define new class.
15614 (Output_section::Input_section_sort_compare::operator()): New
15615 function.
15616 (Output_section::sort_attached_input_sections): New function.
15617 * configure.ac: Check whether the compiler supports constructor
15618 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15619 * testsuite/initpri1.c: New file.
15620 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15621 CONSTRUCTOR_PRIORITY.
15622 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15623 (initpri1_LDFLAGS): New variable.
15624 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15625
18e6b24e
ILT
156262008-03-27 Ian Lance Taylor <iant@google.com>
15627
49bdd526
ILT
15628 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15629 * testsuite/common_test_1.c: New file.
15630 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15631 (common_test_1_SOURCES): New variable.
15632 (common_test_1_DEPENDENCIES): New variable.
15633 (common_test_1_LDFLAGS): New variable.
15634
18e6b24e
ILT
15635 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15636 and commons_ correctly when NAME/VERSION does not override
15637 NAME/NULL.
15638 * testsuite/ver_test_6.c: New file.
15639 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15640 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15641 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15642
04bf7072
ILT
156432008-03-26 Ian Lance Taylor <iant@google.com>
15644
5871526f
ILT
15645 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15646 of an undefined symbol from a version script.
15647 * testsuite/Makefile.am (ver_test_5.so): New target.
15648 (ver_test_5.o): New target.
15649 (check_SCRIPTS): Add ver_test_5.sh.
15650 (check_DATA): Add ver_test_5.syms.
15651 (ver_test_5.syms): New target.
15652 * testsuite/ver_test_5.cc: New file.
15653 * testsuite/ver_test_5.script: New file.
15654 * testsuite/ver_test_5.sh: New file.
15655 * Makefile.in, testsuite/Makefile.in: Rebuild.
15656
04bf7072
ILT
15657 PR gold/5986
15658 Fix problems building gold with gcc 4.3.0.
15659 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15660 (gold_error_at_location, gold_warning_at_location): Use it.
15661 * configure.ac: Check whether we can compile and use a template
15662 function with a printf attribute.
15663 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15664 when jumping over bytes.
15665 * object.cc: Instantiate Object::read_section_data.
15666 * debug.h: Include <cstring>
15667 * dwarf_reader.cc: Include <algorithm>
15668 * main.cc: Include <cstring>.
15669 * options.cc: Include <cstring>.
15670 * output.cc: Include <cstring>.
15671 * script.cc: Include <cstring>.
15672 * script.h: Include <string>.
15673 * symtab.cc: Include <cstring> and <algorithm>.
15674 * target-select.cc: Include <cstring>.
15675 * version.cc: Include <string>.
15676 * testsuite/testmain.cc: Include <cstdlib>.
15677 * configure, config.in: Rebuild.
15678
874c5b28
ILT
156792008-03-25 Ian Lance Taylor <iant@google.com>
15680
819d6c3a
ILT
15681 * options.cc: Include "../bfd/bfdver.h".
15682 (options::help): Print bug reporting address.
15683
f4b2c6f5
ILT
15684 * version.cc (print_version): Adjust output for current value of
15685 BFD_VERSION_STRING.
15686
15687 * NEWS: New file.
15688
e96caa79
ILT
15689 * options.cc (options::help): Print list of supported targets.
15690 * target-select.h: Include <vector>.
15691 (class Target_selector): Make machine_, size_, and is_big_endian_
15692 fields const. Add bfd_name_ and instantiated_target_ fields.
15693 (Target_selector::Target_selector): Add bfd_name parameter.
15694 (Target_selector::recognize): Make non-virtual, call
15695 do_recognize.
15696 (Target_selector::recognize_by_name): Make non-virtual, call
15697 do_recognize_by_name.
15698 (Target_selector::supported_names): New function.
15699 (Target_selector::bfd_name): New function.
15700 (Target_selector::do_instantiate_target): New pure virtual
15701 function.
15702 (Target_selector::do_recognize): New virtual function.
15703 (Target_selector::do_recognize_by_name): New virtual function.
15704 (Target_selector::instantiate_target): New private function.
15705 (supported_target_names): Declare.
15706 * target-select.cc (Target_selector::Target_selector): Update for
15707 new parameter and fields.
15708 (select_target_by_name): Check that the name matches before
15709 calling recognize_by_name.
15710 (supported_target_names): New function.
15711 * i386.cc (class Target_selector_i386): Update Target_selector
15712 constructor call. Remove recognize and recognize_by_name. Add
15713 do_instantiate_target.
15714 * x86_64.cc (class Target_selector_x86_64): Likewise.
15715 * testsuite/testfile.cc (class Target_selector_test): Update for
15716 changes to Target_selector.
15717
874c5b28
ILT
15718 * README: Rewrite, with some notes on unsupported features.
15719
0a65a3a7
CC
157202008-03-24 Cary Coutant <ccoutant@google.com>
15721
15722 * i386.cc (Target_i386::Got_type): New enum declaration.
15723 (Target_i386::Scan::local): Updated callers of Output_data_got
15724 member functions.
15725 (Target_i386::Scan::global): Likewise.
15726 (Target_i386::Relocate::relocate): Likewise.
15727 (Target_i386::Relocate::relocate_tls): Likewise.
15728 * object.h (Got_offset_list): New class.
15729 (Sized_relobj::local_has_got_offset): Added got_type parameter.
15730 (Sized_relobj::local_got_offset): Likewise.
15731 (Sized_relobj::set_local_got_offset): Likewise.
15732 (Sized_relobj::local_has_tls_got_offset): Removed.
15733 (Sized_relobj::local_tls_got_offset): Removed.
15734 (Sized_relobj::set_local_tls_got_offset): Removed.
15735 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
15736 * output.cc (Output_data_got::add_global): Added got_type parameter.
15737 (Output_data_got::add_global_with_rel): Likewise.
15738 (Output_data_got::add_global_with_rela): Likewise.
15739 (Output_data_got::add_global_pair_with_rel): New function.
15740 (Output_data_got::add_global_pair_with_rela): New function.
15741 (Output_data_got::add_local): Added got_type parameter.
15742 (Output_data_got::add_local_with_rel): Likewise.
15743 (Output_data_got::add_local_with_rela): Likewise.
15744 (Output_data_got::add_local_pair_with_rel): New function.
15745 (Output_data_got::add_local_pair_with_rela): New function.
15746 (Output_data_got::add_global_tls): Removed.
15747 (Output_data_got::add_global_tls_with_rel): Removed.
15748 (Output_data_got::add_global_tls_with_rela): Removed.
15749 (Output_data_got::add_local_tls): Removed.
15750 (Output_data_got::add_local_tls_with_rel): Removed.
15751 (Output_data_got::add_local_tls_with_rela): Removed.
15752 * output.h (Output_data_got::add_global): Added got_type parameter.
15753 (Output_data_got::add_global_with_rel): Likewise.
15754 (Output_data_got::add_global_with_rela): Likewise.
15755 (Output_data_got::add_global_pair_with_rel): New function.
15756 (Output_data_got::add_global_pair_with_rela): New function.
15757 (Output_data_got::add_local): Added got_type parameter.
15758 (Output_data_got::add_local_with_rel): Likewise.
15759 (Output_data_got::add_local_with_rela): Likewise.
15760 (Output_data_got::add_local_pair_with_rel): New function.
15761 (Output_data_got::add_local_pair_with_rela): New function.
15762 (Output_data_got::add_global_tls): Removed.
15763 (Output_data_got::add_global_tls_with_rel): Removed.
15764 (Output_data_got::add_global_tls_with_rela): Removed.
15765 (Output_data_got::add_local_tls): Removed.
15766 (Output_data_got::add_local_tls_with_rel): Removed.
15767 (Output_data_got::add_local_tls_with_rela): Removed.
15768 * resolve.cc (Symbol::override_base_with_special): Removed
15769 reference to has_got_offset_ field.
15770 * symtab.cc (Symbol::init_fields): Replaced initialization
15771 of got_offset_ with got_offsets_. Removed initialization
15772 of has_got_offset_
53fcba31 15773 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
15774 (Symbol::got_offset): Likewise.
15775 (Symbol::set_got_offset): Likewise.
15776 (Symbol::has_tls_got_offset): Removed.
15777 (Symbol::tls_got_offset): Removed.
15778 (Symbol::set_tls_got_offset): Removed.
15779 (Symbol::got_offset_): Removed.
15780 (Symbol::tls_mod_got_offset_): Removed.
15781 (Symbol::tls_pair_got_offset_): Removed.
15782 (Symbol::got_offsets_): New field.
15783 (Symbol::has_got_offset): Removed.
15784 (Symbol::has_tls_mod_got_offset): Removed.
15785 (Symbol::has_tls_pair_got_offset): Removed.
15786 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
15787 (Target_x86_64::Scan::local): Updated callers of Output_data_got
15788 member functions.
15789 (Target_x86_64::Scan::global): Likewise.
15790 (Target_x86_64::Relocate::relocate): Likewise.
15791 (Target_x86_64::Relocate::relocate_tls): Likewise.
15792
bd52eafb
BE
157932008-03-25 Ben Elliston <bje@au.ibm.com>
15794
15795 * yyscript.y: Fix spelling error in comment.
15796
8b105e34
ILT
157972008-03-24 Ian Lance Taylor <iant@google.com>
15798
8ed814a9
ILT
15799 * options.h (class General_options): Define build_id option.
15800 * layout.h (class Layout): Declare write_build_id, create_note,
15801 create_build_id. Add build_id_note_ member.
15802 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
15803 "libiberty.h", "md5.h", "sha1.h".
15804 (Layout::Layout): Initialize eh_frame_data_,
15805 eh_frame_hdr_section_, and build_id_note_.
15806 (Layout::finalize): Call create_build_id.
15807 (Layout::create_note): New function, broken out of
15808 Layout::create_gold_note.
15809 (Layout::create_gold_note): Call create_note.
15810 (Layout::create_build_id): New function.
15811 (Layout::write_build_id): New function.
15812 (Close_task_runner::run): Call write_build_id.
15813
8b105e34
ILT
15814 * x86_64.cc: Correct license to GPLv3.
15815
086a1841
ILT
158162008-03-23 Ian Lance Taylor <iant@google.com>
15817
15818 * options.cc: Include "demangle.h".
15819 (parse_optional_string): New function.
15820 (parse_long_option): Handle takes_optional_argument.
15821 (parse_short_option): Update dash_z initializer. Handle
15822 takes_optional_argument.
15823 (General_options::General_options): Initialize do_demangle_.
15824 (General_options::finalize): Set do_demangle_. Handle demangling
15825 style.
15826 * options.h (parse_optional_string): Declare.
15827 (struct One_option): Add optional_arg field. Update constructor.
15828 Update call constructor calls. Add takes_optional_argument
15829 function.
15830 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
15831 (DEFINE_optional_string): Define.
15832 (General_options::demangle): Change from DEFINE_bool to
15833 DEFINE_optional_string.
15834 (General_options::no_demangle): New function.
15835 (General_options::do_demangle): New function.
15836 (General_options::set_do_demangle): New function.
15837 (General_options::execstack_status_): Move definition to end of
15838 class definition.
15839 (General_options::static_): Likewise.
15840 (General_options::do_demangle_): New field.
15841 * object.cc (big_endian>::get_symbol_location_info): Call
15842 Options::do_demangle, not Options::demangle.
15843 * symtab.cc (demangle): Likewise.
15844
cbb93e63
ILT
158452008-03-22 Ian Lance Taylor <iant@google.com>
15846
15847 * gold.h: Include <cstddef> and <sys/types.h>
15848 * options.h: Include <cstring>.
15849
ec531623
ILT
158502008-03-21 Ian Lance Taylor <iant@google.com>
15851
15852 * Added source code to GNU binutils.
752937aa 15853\f
4b95cf5c 15854Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
15855
15856Copying and distribution of this file, with or without modification,
15857are permitted in any medium without royalty provided the copyright
15858notice and this notice are preserved.
15859
15860Local Variables:
15861mode: change-log
15862left-margin: 8
15863fill-column: 74
15864version-control: never
15865End:
This page took 1.023155 seconds and 4 git commands to generate.