Rearrange awkwardly-nested conditionals
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
7cd4e5b7
AM
12014-08-06 Alan Modra <amodra@gmail.com>
2
3 PR 13227
4 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
5
5ad9b0a7
ST
62014-07-21 Sriraman Tallam <tmsriram@google.com>
7
8 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 9 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 10
e051745c
CC
112014-07-08 Cary Coutant <ccoutant@google.com>
12
13 * expression.cc (struct Expression::Expression_eval_info): Add
14 new fields type_pointer, vis_pointer, and nonvis_pointer.
15 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
16 nonvis_pointer parameters. Adjust all calls.
17 (Symbol_expression::value): Update type, visibility, and nonvis bits
18 in caller.
19 * script.cc (Symbol_assignment::sized_finalize): Update type,
20 visibility, and remaining st_other bits for new symbol.
21 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
22 vis_pointer, and nonvis_pointer parameters.
23 * symtab.h (Symbol::set_type): New method.
24
25 * testsuite/Makefile.am (defsym_test): New test.
26 * testsuite/Makefile.in: Regenerate.
27 * testsuite/defsym_test.c: New file.
28 * testsuite/defsym_test.sh: New file.
29
f35c4853
CC
302014-07-08 Cary Coutant <ccoutant@google.com>
31
32 PR gold/15639
33 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
34 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
35 (Sized_dynobj::base_read_symbols): ...new method.
36 * object.h (Sized_relobj_file::base_read_symbols): New method.
37 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
38 (Sized_relobj_file::base_read_symbols): ...new method.
39 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
40 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
41 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
42
2900af2d
AM
432014-07-04 Alan Modra <amodra@gmail.com>
44
45 * po/POTFILES.in: Regenerate.
46
053a4d68
JY
472014-07-02 Jing Yu <jingyu@google.com>
48
49 * aarch64.cc: New file
50 * Makefile.am (TARGETSOURCES): Add aarch64.cc
51 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
52 * Makefile.in: Regenerate.
53 * configure.tgt: Add entries for aarch64*.
54 * configure.ac: Likewise.
55 * configure: Likewise.
56
7b549045
AM
572014-06-27 Alan Modra <amodra@gmail.com>
58
59 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
60
cb818dbf
CC
612014-06-24 Cary Coutant <ccoutant@google.com>
62
63 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
64 sections.
65 (Dwo_file::sized_read_unit_index): Likewise.
66
9810d34d
SS
672014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
68
69 * mips.cc: New file.
70 * Makefile.am (TARGETSOURCES): Add mips.cc
71 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
72 * configure.tgt: Add entries for mips*.
73 * configure.ac: Likewise.
74 * Makefile.in: Regenerate.
75 * configure: Likewise.
76
9baa787b
CC
772014-06-09 Cary Coutant <ccoutant@google.com>
78
79 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
80 unit_length is within section bounds.
81
8f89af0a
CC
822014-06-09 Cary Coutant <ccoutant@google.com>
83
84 PR gold/16980
85 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
86 map.
87
a47622ac
AM
882014-06-07 Alan Modra <amodra@gmail.com>
89
90 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
91
4320c691
CC
922014-06-06 Cary Coutant <ccoutant@google.com>
93
94 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
95 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
96 (Dwarf_pubnames_table::read_header): Likewise.
97 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
98 .debug_gnu_pubtypes.
99
270c9937
JB
1002014-06-05 Joel Brobecker <brobecker@adacore.com>
101
102 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
103 * Makefile.in, configure: Regenerate.
104
397998fc
AM
1052014-06-03 Alan Modra <amodra@gmail.com>
106
107 * powerpc.cc (addis_12_2): Define.
108 (Stub_table::do_write): Support fusion on ELFv2 stubs.
109
61f5c66f
AM
1102014-06-03 Alan Modra <amodra@gmail.com>
111
112 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
113 st_other output.
114
f6971787
AM
1152014-06-02 Alan Modra <amodra@gmail.com>
116
117 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
118 Only ignore relocs on ELFv1.
119 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
120
f6fb8322
CC
1212014-05-30 Cary Coutant <ccoutant@google.com>
122
123 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
124 * testsuite/Makefile.in: Regenerate.
125 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
126
c23dd342
L
1272014-05-27 H.J. Lu <hongjiu.lu@intel.com>
128
129 PR gold/16945
130 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
131 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
132
5fe7ffdc
AM
1332014-05-15 Alan Modra <amodra@gmail.com>
134
135 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
136 Compare FDE contents with DW_CFA_nop rather than 0.
137
a82bef93
ST
1382014-05-13 Sriraman Tallam <tmsriram@google.com>
139
140 * symtab.h (may_need_copy_reloc): Remove check for position independent
141 code.
142 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
143 position independence before pc absolute may_need_copy_reloc call.
144 Add check for executable output befor pc relative may_need_copy_reloc
145 call.
146 * i386.cc: Ditto.
147 * arm.cc: Ditto.
148 * sparc.cc: Ditto.
149 * tilegx.cc: Ditto.
150 * powerpc.cc: Add check for no position independence before
151 may_need_copy_reloc calls.
152 * testsuite/pie_copyrelocs_test.cc: New file.
153 * testsuite/pie_copyrelocs_shared_test.cc: New file.
154 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 155 * Makefile.in: Regenerate.
a82bef93 156
53c66605
ML
1572014-05-08 Martin Liška <mliska@suse.cz>
158
159 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
160
57b2284c
CC
1612014-05-06 Cary Coutant <ccoutant@google.com>
162
163 PR gold/16900
164 * i386.cc (Output_data_got_plt_i386): New class.
165 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
166 parameter. Change all callers.
167 (Output_data_plt_i386::layout_): Remove.
168 (Output_data_plt_i386::got_plt_): Change type.
169 (Target_i386::got_plt_): Change type. Change all references.
170 (Target_i386::got_section): Create instance of new class.
171 (Output_data_got_plt_i386::do_write): New function.
172 * x86_64.cc (Output_data_got_plt_x86_64): New class.
173 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
174 parameter. Change all callers.
175 (Output_data_plt_x86_64::layout_): Remove.
176 (Output_data_plt_x86_64::got_plt_): Change type.
177 (Target_x86_64::got_plt_): Change type. Change all references.
178 (Target_x86_64::got_section): Create instance of new class.
179 (Output_data_got_plt_x86_64::do_write): New function.
180 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
181 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
182 class.
183
6b97515d 1842014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 185
6b97515d
CC
186 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
187 if we have pubnames/pubtypes.
188
d1bddd3c
CC
1892014-05-02 Cary Coutant <ccoutant@google.com>
190
5fe7ffdc
AM
191 * defstd.cc (in_segment): Define __ehdr_start here...
192 * layout.cc (Layout::finalize): ...Instead of here. Set the
193 output segment when known.
194 * resolve.cc (Symbol::override_base_with_special): Remember
195 the original binding.
196 * symtab.cc (Symbol::set_output_segment): New function.
197 (Symbol::set_undefined): New function.
198 * symtab.h (Symbol::is_weak_undefined): Check original undef
199 binding.
200 (Symbol::is_strong_undefined): New function.
201 (Symbol::set_output_segment): New function.
202 (Symbol::set_undefined): New function.
203 * target-reloc.h (is_strong_undefined): Remove.
204 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
205 Check for hidden undefs.
206 (relocate_section): Call Symbol::is_strong_undefined.
207
208 * testsuite/Makefile.am (ehdr_start_test_1)
209 (ehdr_start_test_2, ehdr_start_test_3)
210 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
211 * testsuite/Makefile.in: Regenerate.
212 * testsuite/ehdr_start_def.cc: New source file.
213 * testsuite/ehdr_start_test.cc: New source file.
214 * testsuite/ehdr_start_test.t: New linker script.
215 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 216
7849f6d8
CC
2172014-04-23 Cary Coutant <ccoutant@google.com>
218
bf2cc635 219 PR gold/16870
7849f6d8
CC
220 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
221
99fd8cff
CC
2222014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
223
224 * layout.cc (Layout::include_section): Allow a target to decide
225 whether to include a section.
226 * target.h (Target::should_include_section): New function.
227 (Target::do_should_include_section): New function.
228
91f43acd
CC
2292014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
230
231 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
232 inline into ...
233 (Copy_relocs::emit): ... here.
234 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
235 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
236 (Copy_reloc_entry::entries_): Change from private to protected.
237
c4eb27e1
ST
2382014-04-02 Sriraman Tallam <tmsriram@google.com>
239
240 * icf.cc (get_section_contents): Replace copies of reloc
241 vectors with const references.
242
ae447ddd
CC
2432014-04-02 Cary Coutant <ccoutant@google.com>
244
245 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
246 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
247 * configure: Regenerate.
248 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
249 -fno-use-linker-plugin.
250 (LINK1, CXXLINK1): Add it to the link command.
251 * testsuite/Makefile.in: Regenerate.
252
fa47fa92
AM
2532014-03-12 Alan Modra <amodra@gmail.com>
254
255 * Makefile.in: Regenerate.
256
9b12c500
CC
2572014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
258
259 * symtab.h (Symbol::set_nonvis): New function.
260
beacaa96
CC
2612014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
262
263 * symtab.cc (Sized_symbol<32>::init_output_data):
264 Instantiate the template.
265 (Sized_symbol<64>::init_output_data): Likewise.
266
800d9823
CC
2672014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
268
269 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
270 adjust dynamic symbol value.
271 * target.h (Target::adjust_dyn_symbol): New function.
272 (Target::do_adjust_dyn_symbol): New function.
273
918fc1f8 2742014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 275
918fc1f8
CC
276 * output.cc (Output_data_dynamic::Dynamic_entry::write):
277 Get the value of DYNAMIC_CUSTOM dynamic entry.
278 * output.h (Output_data_dynamic::add_custom): New function.
279 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
280 dynamic entry.
281 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
282 * target.h (Target::dynamic_tag_custom_value): New function.
283 (Target::do_dynamic_tag_custom_value): New function.
284
98ff9231
CC
2852014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
286
287 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
288 dynsym indexes.
289 * target.h (Target::has_custom_set_dynsym_indexes): New function.
290 (Target::do_has_custom_set_dynsym_indexes): New function.
291 (Target::set_dynsym_indexes): New function.
292 (Target::do_set_dynsym_indexes): New function.
293
b80eed39
AM
2942014-03-07 Alan Modra <amodra@gmail.com>
295
296 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
297 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
298 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
299 (Powerpc_relocate_functions::has_overflow_bitfield,
300 overflowed): Use the above.
301 (Target_powerpc::Relocate::relocate): Correct overflow checking
302 for a number of relocations. Modify overflow test for 16-bit
303 fields in instructions to signed/unsigned according to whether
304 the field takes a signed or unsigned value.
305
4b95cf5c
AM
3062014-03-05 Alan Modra <amodra@gmail.com>
307
308 Update copyright years.
309
45965137
AM
3102014-03-05 Alan Modra <amodra@gmail.com>
311
312 * powerpc.cc (Target_powerpc::Scan::local, global): Support
313 R_PPC64_ADDR64_LOCAL.
314 (Target_powerpc::Relocate::relocate): Likewise.
315
2c80b753
AM
3162014-03-03 Alan Modra <amodra@gmail.com>
317
318 * dwp.cc (print_version): Update copyright year to current.
319
c1c69e83
AM
3202014-02-10 Alan Modra <amodra@gmail.com>
321
322 * po/gold.pot: Regenerate.
323
dd0c4e70
CC
3242014-02-06 Cary Coutant <ccoutant@google.com>
325
326 Fix problem where -u is ignored when a weak undef is seen.
327
328 * archive.cc (Library_base::should_include_member): Reorder
329 code to check for -u option if a weak undef has already been seen.
330 * testsuite/Makefile.am (weak_undef_test_2): New test case.
331 * testsuite/Makefile.in: Regenerate.
332 * testsuite/weak_undef_file3.cc: New file.
333 * testsuite/weak_undef_file4.cc: New file.
334 * testsuite/weak_undef_test_2.cc: New file.
335
1a221d3d
CC
3362014-02-05 Cary Coutant <ccoutant@google.com>
337
338 Fix issues with gold undefined symbol diagnostics.
339
340 PR binutils/15435
341 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
342 check to here.
343 * target-reloc.h (is_strong_undefined): New function.
344 (relocate_section): Move undef vtable symbol check from here.
345 Check for is_strong_undefined.
346
e889f0a4 3472014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 348
e889f0a4
CC
349 Fix problems with the --dynamic-list option.
350
351 PR gold/13577
352 * options.cc (General_options::parse_dynamic_list):
353 Set have_dynamic_list_.
354 (General_options::General_options): Initialize have_dynamic_list_.
355 (General_options::finalize): Turn off -Bsymbolic and
356 -Bsymbolic-functions if --dynamic-list provided.
357 * options.h (General_options::have_dynamic_list): New function.
358 (General_options::have_dynamic_list_): New data member.
359 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
360 correctly.
5fe7ffdc 361
e889f0a4
CC
362 PR gold/16530
363 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
364 in --dynamic-list, mark it.
5fe7ffdc 365
e889f0a4
CC
366 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
367 (dynamic_list_2): New test case.
368 * testsuite/Makefile.in: Regenerate.
369 * testsuite/dynamic_list_2.cc: New file.
370 * testsuite/dynamic_list_2.t: New file.
371 * testsuite/dynamic_list_lib1.cc: New file.
372 * testsuite/dynamic_list_lib2.cc: New file.
373 * testsuite/gc_dynamic_list_test.c: New file.
374 * testsuite/gc_dynamic_list_test.sh: New file.
375 * testsuite/gc_dynamic_list_test.t: New file.
376
ec673e64
CC
3772014-01-28 Cary Coutant <ccoutant@google.com>
378
379 Add .gdb_index version 7 support.
380
381 * gold/dwarf_reader.cc: include <utility> (for make_pair).
382 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
383 debug sections.
384 (Dwarf_ranges_table::read_ranges_table): Likewise.
385 (Dwarf_pubnames_table::read_section): Check for GNU-style
386 sections, and for compressed debug sections.
387 (Dwarf_pubnames_table::read_header): Compute end address of table.
388 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
389 for end of list by offset, not by offset == 0.
390 (Dwarf_info_reader::do_read_string_table): Check for compressed
391 debug sections.
392 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
393 Initialize new data members.
394 (Dwarf_pubnames_table::next_name): return flag_byte.
395 (Dwarf_pubnames_table::end_of_table_): New data member.
396 (Dwarf_pubnames_table::is_gnu_style_): New data member.
397 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
398 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
399 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
400 read skeleton type unit DIEs.
401 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
402 (Gdb_index::do_write): Write flag_byte.
403 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
404 (Gdb_index::Cu_vector): Store flags along with cu indexes.
405 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
406 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
407
221fd5d5
L
4082014-01-08 H.J. Lu <hongjiu.lu@intel.com>
409
410 * version.cc (print_version): Update copyright year to 2014.
411
6c09fb0b
ILT
4122013-12-19 Dimitry Andric <dimitry@andric.com>
413
414 * stringpool.cc (Stringpool_template::reserve): Add
415 HAVE_UNORDERED_MAP case.
416 * stringpool.cc (Stringpool_template::print_stats): Likewise.
417
8356f2d0
CC
4182013-12-18 Cary Coutant <ccoutant@google.com>
419
420 * configure.ac: Check for <unordered_set> and <unordered_map>.
421 * config.in: Regenerate.
422 * configure: Regenerate.
423 * system.h: Use <unordered_set> and <unordered_map> if available.
424
f2c7d7ee
RM
4252013-12-10 Roland McGrath <mcgrathr@google.com>
426
427 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
428 with $(INSTALL_PROGRAM_ENV).
429 * Makefile.in: Regenerate.
430
6632e8cc
CC
4312013-11-22 Cary Coutant <ccoutant@google.com>
432
433 * configure.ac: Add check for which library is needed for
434 dlopen.
435 * configure: Regenerate.
436
0c075858
CC
4372013-11-22 Cary Coutant <ccoutant@google.com>
438
439 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
440 assembler.
441 * testsuite/Makefile.in: Regenerate.
442
f49fe902
L
4432013-11-17 H.J. Lu <hongjiu.lu@intel.com>
444
445 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
446 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
447 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
448 (Target_x86_64<size>::Scan::local): Likewise.
449 (Target_x86_64<size>::Scan::global): Likewise.
450 (Target_x86_64<size>::Relocate::relocate): Likewise.
451 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
452 Likewise.
453 (Target_x86_64<size>::Scan::check_non_pic(): Handle
454 R_X86_64_PC32_BND.
455
456 * testsuite/Makefile.am (check_PROGRAMS): Add
457 exception_x86_64_bnd_test.
458 (exception_x86_64_bnd_test_SOURCES): New macro.
459 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
460 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
461 (exception_x86_64_bnd_test_LDADD): Likewise.
462 (exception_x86_64_bnd_1.o): New rule.
463 (exception_x86_64_bnd_2.o): Likewise.
464 * testsuite/Makefile.in: Regenerated.
465
9055360d
AM
4662013-11-15 Alan Modra <amodra@gmail.com>
467
468 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
469 accessor.
470 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
471 Only call ppc64_local_entry_offset for 64-bit. Restrict
472 symval_for_branch lookup to ELFv1.
473 (Stub_table::add_plt_call_entry): Use unsigned int off.
474 (Output_data_glink::Address, invalid_address): New.
475 (Output_data_glink::add_eh_frame): Move out of line. Add
476 support for ELFv2.
477 (Output_data_glink::add_global_entry, find_global_entry,
478 global_entry_address): New functions.
479 (Output_data_glink::global_entry_stubs_, end_branch_table_,
480 ge_size): New variables.
481 (Output_data_glink::set_final_data_size): Add global entry
482 stub sizing.
483 (Output_data_glink::do_write): Write global entry stubs.
484 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
485 parameter. Return true for ELFv2. Adjust callers.
486 (Target_powerpc::Scan::local, global): Restrict opd lookup to
487 ELFv1. Similarly for ifunc and dynamic relocation processing
488 specific to ELFv1. Recognize that symbols are defined on
489 their plt entries for ELFv2.
490 (Target_powerpc::symval_for_branch): Assert if called for
491 ELFv2 or ppc32.
492 (Target_powerpc::Relocate::relocate): Use global entry plt
493 stub for symbol value if such exists on ELFv2.
494 (Target_powerpc::Relocate::relocate): Don't call
495 symval_for_branch when ELFv2. Do adjust for local entry
496 offset when ELFv2.
497 (Target_powerpc::do_dynsym_value): Set symbols to global entry
498 plt stub for ELFv2.
499 (Target_powerpc::do_plt_address_for_global): Similarly.
500
cafdd569
CC
5012013-11-14 Cary Coutant <ccoutant@google.com>
502
503 Revert patch -- this did not fix the problem, and there is
504 no race there.
505
506 2013-11-14 Cary Coutant <ccoutant@google.com>
507
508 PR gold/14860
509 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
510 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
511 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
512 updating fde_offsets_.
513 (Eh_frame_hdr::lock_): New data member.
514
94e49e16
CC
5152013-11-14 Cary Coutant <ccoutant@google.com>
516
517 * dwp.cc (Dwo_file_entry): New type.
518 (File_list): Use Dwo_file_entry.
519 (Dwo_file::verify): New function.
520 (Dwo_file::verify_dwo_list): New function.
521 (Dwo_file::sized_verify_dwo_list): New function.
522 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
523 list.
524 (Dwp_options): New enum type.
525 (dwp_options): Add --verify-only.
526 (usage): Likewise.
527 (main): Likewise.
528 * dwp.h (gold_info): Add declaration.
529
7cdd7d57
CC
5302013-11-14 Cary Coutant <ccoutant@google.com>
531
532 PR gold/14860
533 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
534 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
535 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
536 updating fde_offsets_.
537 (Eh_frame_hdr::lock_): New data member.
538
1d946cb3
CC
5392013-11-06 Cary Coutant <ccoutant@google.com>
540
541 PR gold/15758
542 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
543 before reloc sections.
544
4f65b40e
AM
5452013-11-04 Alan Modra <amodra@gmail.com>
546
547 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
548 (Symbol::needs_dynamic_reloc): Test new flag.
549 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
550 (Target_powerpc::Scan::get_reference_flags): Add target param.
551 Return FUNC_DESC_ABI for 64-bit ELFv1.
552 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
553 call.
554 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
555 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
556
908794a9
CC
5572013-10-31 Cary Coutant <ccoutant@google.com>
558
559 Restore support for dwp v2 DWARF package file format.
560
561 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
562 tu_length parameter. Adjust all callers.
563 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
564 * dwp.cc: Include dwarf.h.
565 (Section_bounds): New struct type.
566 (Unit_set): New struct type.
567 (Dwo_file::Dwo_file): Initialize new data member.
568 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
569 Combine and rename to...
570 (Dwo_file::read_unit_index): ...this.
571 (Dwo_file::sized_read_compunit_index)
572 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
573 (Dwo_file::sized_read_unit_index): ...this.
574 (Dwo_file::copy_section): Remove section_name, is_str_offsets
575 parameters; add section_id parameter.
576 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
577 (Dwo_file::add_unit_set): ...this.
578 (Dwo_file::shndx_map_): Remove.
579 (Dwo_file::sect_offsets_): New data member.
580 (Dwp_output_file::Dwp_output_file): Initialize new data members.
581 (Dwp_output_file::add_section): Rename to...
582 (Dwp_output_file::add_contribution): ...this.
583 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
584 (Dwp_output_file::add_tu_set): Likewise.
585 (Dwp_output_file::Contribution): New type.
586 (Dwp_output_file::Section::contributions): New data member.
587 (Dwp_output_file::Cu_or_tu_set): Remove.
588 (Dwp_output_file::Section::Section): New ctor.
589 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
590 (Dwp_output_file::Dwp_index::Section_table): New type.
591 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
592 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
593 parameter.
594 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
595 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
596 (Dwp_output_file::Dwp_index::section_table): New member function.
597 (Dwp_output_file::Dwp_index::section_table_end): New member function.
598 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
599 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
600 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
601 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
602 (Dwp_output_file::Dwp_index::section_table_): New data member.
603 (Dwp_output_file::Dwp_index::section_mask_): New data member.
604 (Dwp_output_file::add_output_section): New member function.
605 (Dwp_output_file::write_new_section): New member function.
606 (Dwp_output_file::write_contributions): New member function.
607 (Dwp_output_file::section_id_map_): New data member.
608 (class Dwo_id_info_reader): Remove.
609 (class Unit_reader): New class.
610 (get_dwarf_section_name): New function.
611 (Dwo_file::read_executable): Adjust initializations of class data.
612 (Dwo_file::read): Add support for v2 package file format.
613 (Dwo_file::read_unit_index): Likewise.
614 (Dwo_file::sized_read_unit_index): Likewise.
615 (Dwo_file::copy_section): Likewise.
616 (Dwo_file::add_unit_set): Likewise.
617 (Dwp_output_file::add_output_section): Likewise.
618 (Dwp_output_file::add_contribution): Likewise.
619 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
620 for empty slot.
621 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
622 file format.
623 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
624 slot.
625 (Dwp_output_file::initialize): Remove unused function.
626 (Dwp_output_file::finalize): Add support for v2 package file format.
627 (Dwp_output_file::write_index): Likewise.
628 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
629 function prototype.
630
2500c017
CC
6312013-10-31 Cary Coutant <ccoutant@google.com>
632
633 * configure.ac: Fix check for -fmerge-constants.
634 * configure.ac: Regenerate.
635
dd0845d7
RM
6362013-10-30 Roland McGrath <mcgrathr@google.com>
637
638 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
639 Correct 9-byte nop sequence to match what the assembler generates.
640
b4f7960d
AM
6412013-10-30 Alan Modra <amodra@gmail.com>
642
643 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
644 ppc64_local_entry_offset, ppc64_local_entry_offset,
645 do_read_symbols): New functions.
646 (Powerpc_relobj::e_flags_, st_other_): New vars.
647 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
648 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
649 (Powerpc_relobj::e_flags_): New var.
650 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
651 and adjust for ELFv2.
652 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
653 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
654 (Powerpc_dynobj::do_find_special_sections): Likewise.
655 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
656 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
657 to ELFv2 local entry.
658 (Target_powerpc::do_relax): No thread safe barriers needed for
659 ELFv2.
660 (Output_data_plt_powerpc::initial_plt_entry_size_,
661 plt_entry_size): Delete. Replace all uses with
662 first_plt_entry_offset() and plt_entry_size().
663 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
664 reserved_size parm. Update callers.
665 (Output_data_plt_powerpc::entry_count): Update.
666 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
667 and use Target_powerpc::first_plt_entry_offset().
668 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
669 rename to plt_entry_size.
670 (Output_data_plt_powerpc::add_ifunc_entry,
671 add_local_ifunc_entry): Adjust reloc for ELFv2.
672 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
673 (glink_eh_frame_fde_64v2): New.
674 (Stub_table::plt_call_size): Support ELFv2 sizing.
675 (Output_data_glink::add_eh_frame): Use the new FDE.
676 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
677 (Stub_table::do_write): Write ELFv2 stubs and glink.
678 (Target_powerpc::Relocate::relocate): Replaces nop after call
679 with ld 2,24(1) and adjust local offset destination for ELFv2.
680
f9c6b907
AM
6812013-10-30 Alan Modra <amodra@gmail.com>
682
683 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
684 (Target_powerpc::Scan::global, local): Likewise.
685 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
686 on all ppc64 @h and @ha relocs.
687
e84fe78f
AM
6882013-10-14 Alan Modra <amodra@gmail.com>
689
690 * output.h (Output_data_got::add_constant): Tidy.
691 (Output_data_got::add_constant_pair): New function.
692 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
693 methods used so as to first call reserve_ent().
694
679e4abf
RM
6952013-10-11 Roland McGrath <mcgrathr@google.com>
696
44dcb735
RM
697 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
698 add_got_entry and add_got_entry_pair.
699
13323c49
RM
700 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
701 (HAVE_PUBNAMES): Likewise.
702 * configure: Regenerate.
703
1496b446
RM
704 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
705 * testsuite/Makefile.in: Regenerate.
706
cc84c10b
RM
707 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
708 Remove const from declaration.
709 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
710 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
711 * output.h (Output_file_header): Remove const from member target_
712 and corresponding constructor argument.
713 * output.cc (Output_file_header::Output_file_header): Update prototype.
714 (Output_file_header::do_sized_write): Use this->target_ in place
715 of parameters()->target().
716
52f66a2c
RM
717 * testsuite/undef_symbol.cc (Foo::get_a): New method.
718
2b64b551
RM
719 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
720 * configure: Regenerate.
721 * Makefile.in: Regenerate.
722 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
723 * testsuite/merge_string_literals_2.c: Likewise.
724 * testsuite/Makefile.am
725 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
726 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
727 literal -fmerge-constants.
728 * testsuite/Makefile.in: Regenerate.
729
43819297
RM
730 * i386.cc (Target_i386): Remove unused member dynbss_.
731 * arm.cc (Target_arm): Likewise.
732 * powerpc.cc (Target_powerpc): Likewise.
733 * sparc.cc (Target_sparc): Likewise.
734 * tilegx.cc (Target_tilegx): Likewise.
735 * x86_64.cc (Target_x86_64): Likewise.
736 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
737 type_signature_, type_offset_.
738 * plugin.h (Plugin_hook): Remove unused member layout_.
739 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
740 mapfile_.
741 (Read_member): Remove unused members input_objects_, symtab_,
742 mapfile_, layout_.
743 (Check_library): Remove unused member symtab_.
744 * archive.h (Lib_group): Remove unused member lib_.
745 * archive.cc (Lib_group::Lib_group): Update initializer.
746 * incremental.h (Incremental_binary): Remove unused member target_.
747 (Incremental_script_entry): Removed unused member script_.
748 * layout.h (Write_symbols_task): Remove unused member input_objects_.
749 * icf.h (Icf): Remove unused member num_tracked_relocs.
750
39d9ead7
RM
751 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
752 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
753 its only use.
754 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
755
679e4abf
RM
756 * archive.h: Use struct rather than class for forward declaration
757 of Read_symbols_data.
758
54de2ea6
CC
7592013-10-07 Cary Coutant <ccoutant@google.com>
760
761 PR gold/16010
762 * testsuite/Makefile.am (icf_test): Fix dependencies.
763 (icf_safe_test): Likewise.
764 (icf_safe_so_test): Likewise.
765 (large_symbol_alignment): Add empty _LDADD rule.
766 * testsuite/Makefile.in: Regenerate.
767
b14016f0
L
7682013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
769
770 PR gold/15927
771 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
772 relocation for R_X86_64_32 on x32.
773
eb426534
RM
7742013-08-27 Roland McGrath <mcgrathr@google.com>
775
776 * output.cc (Output_segment::set_section_addresses): Take new
777 Target* argument. If target->isolate_execinstr() and the segment
778 is executable and starts at a target->abi_pagesize() boundary,
779 pad its end out to a target->abi_pagesize() boundary with code fill.
780 * output.h (Output_segment::set_section_addresses): Update decl.
781 * layout.h (Layout::check_output_data_for_reset_values): Take new
782 argument RELAX_OUTPUTS.
783 (Layout): New member relax_output_list_.
784 (Layout::add_relax_output): New method.
785 * layout.cc (Layout::Layout): Update constructor.
786 (Layout::reset_relax_output): New method.
787 (Layout::clean_up_after_relaxation): Call it.
788 (Layout::prepare_for_relaxation): Update caller.
789 (Layout::set_segment_offsets): Update callers of set_section_addresses.
790 Call reset_relax_output before re-processing segments for
791 isolate_execinstr case.
792 (Layout::write_data): Handle relax_output_list_.
793 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
794 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
795
9aff4b7a
NC
7962013-08-23 Yuri Chornoivan <yurchor@ukr.net>
797
798 PR binutils/15834
799 * object.h: Fix typos.
800
93f8221c
RM
8012013-08-16 Roland McGrath <mcgrathr@google.com>
802
803 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
804 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
805
e44c3715
CC
8062013-08-07 Cary Coutant <ccoutant@google.com>
807
808 Revert support for v2 DWP files:
809
810 2013-03-01 Cary Coutant <ccoutant@google.com>
811
812 Add dwp support for v2 DWARF package file format.
813 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
814 tu_length parameter. Adjust all callers.
815 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
816 * dwp.cc: Include dwarf.h.
817 (Section_bounds): New struct type.
818 (Unit_set): New struct type.
819 (Dwo_file::Dwo_file): Initialize new data member.
820 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
821 Combine and rename to...
822 (Dwo_file::read_unit_index): ...this.
823 (Dwo_file::sized_read_compunit_index)
824 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
825 (Dwo_file::sized_read_unit_index): ...this.
826 (Dwo_file::copy_section): Remove section_name, is_str_offsets
827 parameters; add section_id parameter.
828 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
829 (Dwo_file::add_unit_set): ...this.
830 (Dwo_file::shndx_map_): Remove.
831 (Dwo_file::sect_offsets_): New data member.
832 (Dwp_output_file::Dwp_output_file): Initialize new data members.
833 (Dwp_output_file::add_section): Rename to...
834 (Dwp_output_file::add_contribution): ...this.
835 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
836 (Dwp_output_file::add_tu_set): Likewise.
837 (Dwp_output_file::Contribution): New type.
838 (Dwp_output_file::Section::contributions): New data member.
839 (Dwp_output_file::Cu_or_tu_set): Remove.
840 (Dwp_output_file::Section::Section): New ctor.
841 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
842 (Dwp_output_file::Dwp_index::Section_table): New type.
843 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
844 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
845 parameter.
846 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
847 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
848 (Dwp_output_file::Dwp_index::section_table): New member function.
849 (Dwp_output_file::Dwp_index::section_table_end): New member function.
850 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
851 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
852 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
853 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
854 (Dwp_output_file::Dwp_index::section_table_): New data member.
855 (Dwp_output_file::Dwp_index::section_mask_): New data member.
856 (Dwp_output_file::add_output_section): New member function.
857 (Dwp_output_file::write_new_section): New member function.
858 (Dwp_output_file::write_contributions): New member function.
859 (Dwp_output_file::section_id_map_): New data member.
860 (class Dwo_id_info_reader): Remove.
861 (class Unit_reader): New class.
862 (get_dwarf_section_name): New function.
863 (Dwo_file::read_executable): Adjust initializations of class data.
864 (Dwo_file::read): Add support for v2 package file format.
865 (Dwo_file::read_unit_index): Likewise.
866 (Dwo_file::sized_read_unit_index): Likewise.
867 (Dwo_file::copy_section): Likewise.
868 (Dwo_file::add_unit_set): Likewise.
869 (Dwp_output_file::add_output_section): Likewise.
870 (Dwp_output_file::add_contribution): Likewise.
871 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
872 for empty slot.
873 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
874 file format.
875 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
876 slot.
877 (Dwp_output_file::initialize): Remove unused function.
878 (Dwp_output_file::finalize): Add support for v2 package file format.
879 (Dwp_output_file::write_index): Likewise.
880 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
881 function prototype.
882
c6905c28
CC
8832013-07-31 Cary Coutant <ccoutant@google.com>
884
885 * object.cc (Sized_relobj::do_output_section_address): New function.
886 (Sized_relobj): Instantiate explicitly.
887 * object.h (Object::output_section_address): New function.
888 (Object::do_output_section_address): New function.
889 (Sized_relobj::do_output_section_address): New function.
890 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
891
8922013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 893 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
894
895 * parameters.cc (Parameters::entry): Return target-specific entry
896 symbol name.
897 * target.h (Target::entry_symbol_name): New function.
898 (Target_info::entry_symbol_name): New data member.
899
900 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
901 * i386.cc (Target_i386::i386_info): Likewise.
902 (Target_i386_nacl::i386_nacl_info): Likewise.
903 * sparc.cc (Target_sparc::sparc_info): Likewise.
904 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
905 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
906 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
907 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
908
234d4ab8
SA
9092013-07-22 Sterling Augustine <saugustine@google.com>
910
911 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
912 Convert parameter shndx to local variable. Add parameters symtab
913 and symtab_size. Scan over section names. Find relocation
914 section corresponding to current section. Create and initialize
915 reloc_mapper_ and reloc_type_.
916 (Dwarf_pubnames_table::read_header): Add assertion. Change
917 unit_length to off_t. Initialize member unit_length_. Fill in field
918 cu_offset_.
919 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
920 Initialize new fields unit_length_ and cu_offset_.
921 (Dwarf_pubnames_table::read_section): Update prototype.
922 (Dwarf_pubnames_table::cu_offset): New member function.
923 (Dwarf_pubnames_table::subsection_size): Likewise.
924 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
925 New fields.
926 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
927 member functions public.
928 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
929 Update comment. Rework logic. Move repeated parts to...
930 (Gdb_index_info_reader::read_pubtable): ...here. New function.
931 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
932 pubtypes_table_, and stmt_list_offset.
933 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
934 Gdb_index::find_pubtype_offset,
935 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
936 (Gdb_index::pubnames_read): Update prototype and rework logic.
937 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
938 Forward declare.
939 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
940 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
941 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
942 Gdb_index::map_pubtable_to_dies):
943 Declare functions.
944 (Gdb_index::pubnames_read): Update declaration.
945 (Gdb_index::Pubname_offset_map): New type.
946 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
947 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
948 Gdb_index::stmt_list_offset): Declare.
949 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
950 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
951 Gdb_index::pubtypes_offset_): Remove.
952
a3ed37d8
RM
9532013-07-19 Roland McGrath <mcgrathr@google.com>
954
955 * options.h (General_options): Add -Trodata-segment option.
956 * parameters.cc (Parameters::check_rodata_segment): New function.
957 (Parameters::set_target_once): Call it.
958 * parameters.h (Parameters): Declare it (private member function).
959 * layout.cc (load_seg_unusable_for_headers): New function, broken
960 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
961 then validate rodata segment rather than text segment.
962 (relaxation_loop_body): Call that.
963 (is_text_segment): New function. Don't admit a non-executable
964 segment if TARGET->isolate_execinstr().
965 (set_segment_offsets): Call it. Honor -Trodata-segment option.
966
eb5b4ded
CC
9672013-07-15 Shawn Landden <shawnlandden@gmail.com>
968
969 PR gold/15070
970 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
971 * nacl.h (Sniff_file::View::View): Request aligned view.
972
4d5effb9
CC
9732013-07-11 Cary Coutant <ccoutant@google.com>
974
975 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
976 correct BRLT entry size.
977
ba8ca3e7
AM
9782013-07-03 Alan Modra <amodra@gmail.com>
979
980 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
981 comment.
982
267257d2
CC
9832013-07-01 Cary Coutant <ccoutant@google.com>
984
985 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
986 reloc_type_.
987 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
988 (Dwarf_ranges_table::lookup_reloc): New function.
989 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
990 reloc_type_.
991 (Dwarf_ranges_table::lookup_reloc): New function.
992 (Dwarf_ranges_table::reloc_type_): New data member.
993
06f30c9d
CC
9942013-06-27 Jing Yu <jingyu@google.com>
995
996 PR gold/15662
997 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
998 function.
999 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1000 (Target_powerpc::do_relax): Call the above.
1001
a2d7bf59
AM
10022013-06-27 Cary Coutant <ccoutant@google.com>
1003
1004 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1005 on garbage collected .opd section.
1006
10072013-06-27 Alan Modra <amodra@gmail.com>
1008
1009 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1010 is non-zero.
1011 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1012 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1013
32364e50
CC
10142013-06-14 Cary Coutant <ccoutant@google.com>
1015
1016 * resolve.cc (Symbol::override_base): Don't override st_type
1017 from plugin placeholder symbols.
1018 (Symbol_table::resolve): Likewise.
1019 (Symbol_table::should_override): Don't complain about TLS mismatch
1020 if the TO symbol is a plugin placeholder.
1021 * testsuite/Makefile.am (plugin_test_tls): New test.
1022 * testsuite/Makefile.in: Regenerate.
1023 * testsuite/plugin_test_tls.sh: New test script.
1024 * testsuite/two_file_test_2_tls.cc: New test source.
1025 * testsuite/two_file_test_tls.cc: New test source.
1026
7fb47cc9
CC
10272013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1028
1029 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1030 the maximum segment alignment is larger than the page size.
1031 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1032 correctly aligns the symbols with large alignemnt.
1033 * testsuite/Makefile.in: Regenerate.
1034 * testsuite/large_symbol_alignment.cc: New file.
1035
6934001a
CC
10362013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1037 Sriraman Tallam <tmsriram@google.com>
1038
1039 * options.h (sort_section): New option.
1040 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1041 Rename from Input_section_sort_section_name_special_ordering_compare.
1042 (Input_section_sort_section_name_compare): New struct.
1043 * output.cc (Output_section::Input_section_sort_section_name_compare::
1044 operator()): New function.
1045 (Output_section::sort_attached_input_sections): Use new sort function
1046 for .text if --sort-section=name is specified.
1047 * layout.cc (Layout::make_output_section):
1048 Add sorting by name when --sort-section=name is specified.
1049 * testsuite/Makefile.am (text_section_grouping): Test option
1050 --sort-section=name.
1051 * testsuite/Makefile.in: Regenerate.
1052 * testsuite/section_sorting_name.cc: New file.
1053 * testsuite/section_sorting_name.sh: New file.
1054
93acabad
CC
10552013-05-21 Cary Coutant <ccoutant@google.com>
1056
1057 * symtab.h (Symbol::is_cxx_vtable): New function.
1058 * target-reloc.h (relocate_section): Check for vtable symbol.
1059 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1060 * testsuite/Makefile.in: Regenerate.
1061 * testsuite/missing_key_func.cc: New test source.
1062 * testsuite/missing_key_func.sh: New test script.
1063
60e8b3fc
CC
10642013-05-21 Cary Coutant <ccoutant@google.com>
1065
2b64b551
RM
1066 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1067 type of enclosing symbol.
1068 (Relocate_info::location): Check symbol type when describing symbol.
1069 * object.h (Symbol_location_info): Remove unused line_number;
1070 add enclosing_symbol_type.
1071 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1072
9df9de2c
CC
10732013-05-13 Cary Coutant <ccoutant@google.com>
1074
2b64b551
RM
1075 * configure.ac: Export DEFAULT_TARGET.
1076 * configure: Regenerate.
1077 * Makefile.in: Regenerate.
1078 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1079 * testsuite/Makefile.in: Regenerate.
1080 * testsuite/debug_msg.sh: Delete duplicate tests.
1081 Don't check undef_int error message match for powerpc where the
1082 source file and line number aren't available.
9df9de2c 1083
bbc5ae17
RM
10842013-05-10 Roland McGrath <mcgrathr@google.com>
1085
1086 * options.h (General_options): Add --rosegment-gap option.
1087 * options.cc (finalize): --rosegment-gap implies --rosegment.
1088 * layout.cc (set_segment_offsets): Let user option override
1089 target->rosegment_gap().
1090
0c6e6c39
RM
10912013-05-10 Roland McGrath <mcgrathr@google.com>
1092
1093 * options.h (General_options): Remove leading space from help
1094 messages for -nostdlib and --rosegment.
1095
cde7cb01
MR
10962013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1097
1098 PR ld/15365
1099 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1100
f31ae5b8
AM
11012013-05-03 Alan Modra <amodra@gmail.com>
1102
1103 * merge.cc (Output_merge_string::do_add_input_section): Correct
1104 scan for number of strings. Rename vars to avoid shadowing.
1105 Include missing terminator in input_size_.
1106
d3a7cd45
L
11072013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1108
1109 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1110 Restore empty string handling.
1111
6ad3daba
CC
11122013-05-01 Cary Coutant <ccoutant@google.com>
1113
1114 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1115 uninitialized warning.
1116
e31908b6
CC
11172013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1118
1119 * output.cc (Output_section::add_merge_input_section): Allow
1120 to merge sections if the alignment is more than character size.
1121 * merge.h (Output_merge_string::Output_merge_string): Remove
1122 assert.
1123 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1124 only not-null strings. Check the alignment of strings.
1125 * stringpool.h
1126 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1127 alignment as the argument.
1128 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1129 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1130 Align non-zero length strings according to the addralign_.
1131 (Stringpool_template<Stringpool_char>::set_string_offsets):
1132 Updating offsets according to the given alignment.
1133 * testsuite/Makefile.am (text_section_grouping): Test if string
1134 literals are getting merged.
1135 * testsuite/Makefile.in: Regenerate.
1136 * testsuite/merge_string_literals_1.c: New file.
1137 * testsuite/merge_string_literals_2.c: Ditto.
1138 * testsuite/merge_string_literals.sh: Ditto.
1139
0e804863
ILT
11402013-04-26 Ian Lance Taylor <iant@google.com>
1141
1142 * target-reloc.h (relocate_section): If the reloc offset is out of
1143 range, pass VIEW as NULL to relocate.relocate.
1144 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1145 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1146 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1147 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1148 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1149 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1150
e7c5ea40
CC
11512013-04-26 Geoff Pike <gpike@chromium.org>
1152
1153 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1154 * layout.cc (Hash_task): New class.
1155 (Layout::queue_build_id_tasks): New function.
1156 (Layout::write_build_id): Handle single-thread portion of build ID
1157 computation. (In some cases, all of it is single-threaded.) Replace
1158 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1159 functionality in fewer lines of code.
1160 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1161 * options.h (General_options): make "--build-id" default to tree
1162 rather than sha1. Add two new options related to --build-id=tree:
1163 --build-id-chunk-size-for-treehash and
1164 --build-id-min-file-size-for-treehash.
1165 * Makefile.am: add testing of --build-id=tree and related new options
1166 (these tests will be invoked by "make check").
1167 * Makefile.in: Regenerate.
1168
49926cd0
AM
11692013-04-25 Alan Modra <amodra@gmail.com>
1170
1171 * configure.tgt: Add powerpcle and powerpc64le.
1172
a4034750
AM
11732013-04-22 Alan Modra <amodra@gmail.com>
1174
1175 PR gold/15355
1176 * layout.cc (Layout::segment_precedes): Allow more than one
1177 segment with the same type and flags.
1178
e79c84aa
CC
11792013-04-15 Cary Coutant <ccoutant@google.com>
1180
1181 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1182 allocate space in file for BSS sections.
1183
2199fbe7
CC
11842013-04-15 Cary Coutant <ccoutant@google.com>
1185
1186 * script-sections.cc (Orphan_output_section): Reset address
1187 to zero after each orphaned section for relocatable links.
1188
502e8a84
CC
11892013-04-15 Cary Coutant <ccoutant@google.com>
1190
a4034750
AM
1191 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1192 section starting address for relocatable link.
1193 * testsuite/Makefile.am (script_test_11): New test.
1194 * testsuite/Makefile.in: Regenerate.
1195 * testsuite/script_test_11.c: New source file.
1196 * testsuite/script_test_11.t: New linker script.
502e8a84 1197
0cfdc767
AM
11982013-04-13 Alan Modra <amodra@gmail.com>
1199
1200 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1201 owner when sections are not adjacent and exceed group size.
1202 (Target_powerpc::group_sections): Handle corner case.
1203 (Target_powerpc::Branch_info::make_stub): Handle case where
1204 stub table doesn't exist due to branches in non-exec sections.
1205 (Target_powerpc::Relocate::relocate): Likewise.
1206
6830ee24
AM
12072013-04-11 Alan Modra <amodra@gmail.com>
1208
1209 PR gold/15354
1210 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1211 .branch_lt to match bfd ld. Adjust comments throughout file.
1212
54a3d865
ILT
12132013-04-04 Ian Lance Taylor <iant@google.com>
1214
1215 GCC PR c++/56840
1216 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1217 sections before checking whether they are included in the link.
1218
9993ba11
ST
12192013-03-29 Sriraman Tallam <tmsriram@google.com>
1220
1221 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1222 object before calling the plugin claim_file handler. Pass the elf
1223 object of the archive to the plugin. Delete the elf object if the
1224 plugin claims the file.
1225
ebacd51e
AM
12262013-03-21 Alan Modra <amodra@gmail.com>
1227
1228 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1229 segment when omagic.
1230
117be58f
AM
12312013-03-21 Alan Modra <amodra@gmail.com>
1232
1233 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1234 comparison warning.
1235 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1236 uninitialized" warning.
1237
32e2b61d
AM
12382013-03-20 Alan Modra <amodra@gmail.com>
1239
1240 * symtab.h (Symbol::clear_version): New function.
1241 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1242 is_needed by weak references. Clear version for symbols defined
1243 in as-needed objects that are not needed.
1244
b3ccdeb5
AM
12452013-03-15 Alan Modra <amodra@gmail.com>
1246
1247 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1248 static and public. Add report_err param. Return false for data refs.
1249 (Target_powerpc::rela_dyn_section): New overloaded function.
1250 (Target_powerpc::plt_, iplt_): Elucidate.
1251 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1252 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1253 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1254 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1255 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1256 push_branch and make_plt_entry for ifunc syms when
1257 reloc_needs_plt_for_ifunc.
1258 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1259 for ifunc unless reloc_needs_plt_for_ifunc.
1260
ad3d8a2f
AM
12612013-03-15 Alan Modra <amodra@gmail.com>
1262
1263 * gc.h (gc_process_relocs): Don't look through function descriptors.
1264 * icf.cc (get_section_contents): Do so here instead.
1265
4d9aa155
AM
12662013-03-13 Alan Modra <amodra@gmail.com>
1267
1268 * powerpc.cc (is_branch_reloc): Forward declare.
1269 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1270 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1271 false for 64-bit, true for 32-bit non-branch relocs.
1272 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1273 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1274 nm output.
1275 (icf_safe_test): Generate linker map file as well as nm output.
1276 (icf_safe_so_test): Likewise.
1277 * testsuite/Makefile.in: Regenerate.
1278 * testsuite/icf_test.sh: Parse linker map file to determine
1279 section folding.
1280 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1281 * testsuite/icf_safe_so_test.sh: Likewise.
1282 (X86_32_or_ARM_specific_safe_fold): Merge into..
1283 (arch_specific_safe_fold): ..this.
1284 (X86_64_specific_safe_fold): Delete unused function.
1285
57420c20
AM
12862013-03-12 Alan Modra <amodra@gmail.com>
1287
1288 * gc.h (gc_process_relocs): Look through function descriptors
1289 to determine shndx, symvalue and addend used by ICF. Tidy
1290 variable duplication.
1291
dc3714f3
AM
12922013-03-11 Alan Modra <amodra@gmail.com>
1293
1294 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1295 * layout.cc (Layout_task_runner::run): ..to here.
1296 * symtab.h (struct Symbol_location): Extract from..
1297 (class Symbol_table): ..here.
1298 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1299 * target.h (class Target): Add function_location and
1300 do_function_location functions.
1301 (class Sized_target): Add do_function_location.
1302 * object.h (class Sized_relobj_file): Move find_shdr..
1303 (class Object): ..to here.
1304 * object.cc: Likewise. Update to suit. Instantiate.
1305 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1306 * powerpc.cc (class Powerpc_dynobj): New.
1307 (Target_powerpc::do_function_location): New function.
1308 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1309 (Powerpc_dynobj::do_read_symbols): New function.
1310 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1311
956b03bb
ILT
13122013-03-08 Ian Lance Taylor <iant@google.com>
1313
1314 * options.cc (General_options::string_to_object_format): Accept
1315 "default".
1316
4bead2d5
AM
13172013-03-08 Alan Modra <amodra@gmail.com>
1318
1319 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1320 pointer to Post_fde.
1321 (struct Post_fde): Move definition to here..
1322 * ehframe.cc (struct Post_fde): ..from here.
1323 (Cie::write): Don't alloc Post_fde.
1324 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1325
02e60bf7
AM
13262013-03-07 Alan Modra <amodra@gmail.com>
1327
1328 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1329 relocation referencing .LC0.
1330 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1331
8343f03a
AM
13322013-03-07 Alan Modra <amodra@gmail.com>
1333
1334 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1335 always_inline. Add assembly for powerpc to avoid GOT.
1336
3366d57c
AM
13372013-03-07 Alan Modra <amodra@gmail.com>
1338
1339 * testsuite/script_test_10.sh: Don't test .bss section
1340 header number.
1341
6c77229c
AM
13422013-03-06 Alan Modra <amodra@gmail.com>
1343
1344 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1345 (Target_powerpc::symval_for_branch): Add symtab param. Update
1346 all callers. Handle folded sections.
1347 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1348 to Powerpc_relobj.
1349 (Global_symbol_visitor_opd::operator()): Likewise.
1350
a39e4af6
AM
13512013-03-04 Alan Modra <amodra@gmail.com>
1352
1353 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1354 * testsuite/Makefile.in: Regenerate.
1355
d5834edb
CC
13562013-03-01 Cary Coutant <ccoutant@google.com>
1357
1358 Add dwp support for v2 DWARF package file format.
1359 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1360 tu_length parameter. Adjust all callers.
1361 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1362 * dwp.cc: Include dwarf.h.
1363 (Section_bounds): New struct type.
1364 (Unit_set): New struct type.
1365 (Dwo_file::Dwo_file): Initialize new data member.
1366 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1367 Combine and rename to...
1368 (Dwo_file::read_unit_index): ...this.
1369 (Dwo_file::sized_read_compunit_index)
1370 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1371 (Dwo_file::sized_read_unit_index): ...this.
1372 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1373 parameters; add section_id parameter.
1374 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1375 (Dwo_file::add_unit_set): ...this.
1376 (Dwo_file::shndx_map_): Remove.
1377 (Dwo_file::sect_offsets_): New data member.
1378 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1379 (Dwp_output_file::add_section): Rename to...
1380 (Dwp_output_file::add_contribution): ...this.
1381 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1382 (Dwp_output_file::add_tu_set): Likewise.
1383 (Dwp_output_file::Contribution): New type.
1384 (Dwp_output_file::Section::contributions): New data member.
1385 (Dwp_output_file::Cu_or_tu_set): Remove.
1386 (Dwp_output_file::Section::Section): New ctor.
1387 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1388 (Dwp_output_file::Dwp_index::Section_table): New type.
1389 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1390 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1391 parameter.
1392 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1393 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1394 (Dwp_output_file::Dwp_index::section_table): New member function.
1395 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1396 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1397 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1398 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1399 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1400 (Dwp_output_file::Dwp_index::section_table_): New data member.
1401 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1402 (Dwp_output_file::add_output_section): New member function.
1403 (Dwp_output_file::write_new_section): New member function.
1404 (Dwp_output_file::write_contributions): New member function.
1405 (Dwp_output_file::section_id_map_): New data member.
1406 (class Dwo_id_info_reader): Remove.
1407 (class Unit_reader): New class.
1408 (get_dwarf_section_name): New function.
1409 (Dwo_file::read_executable): Adjust initializations of class data.
1410 (Dwo_file::read): Add support for v2 package file format.
1411 (Dwo_file::read_unit_index): Likewise.
1412 (Dwo_file::sized_read_unit_index): Likewise.
1413 (Dwo_file::copy_section): Likewise.
1414 (Dwo_file::add_unit_set): Likewise.
1415 (Dwp_output_file::add_output_section): Likewise.
1416 (Dwp_output_file::add_contribution): Likewise.
1417 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1418 for empty slot.
1419 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1420 file format.
1421 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1422 slot.
1423 (Dwp_output_file::initialize): Remove unused function.
1424 (Dwp_output_file::finalize): Add support for v2 package file format.
1425 (Dwp_output_file::write_index): Likewise.
1426 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1427 function prototype.
1428
a68a081d
CC
14292013-03-01 Cary Coutant <ccoutant@google.com>
1430
1431 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1432 function into class definition in header file.
1433 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1434 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1435 New function.
1436 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1437
9d5781f8
AM
14382013-02-28 Alan Modra <amodra@gmail.com>
1439
1440 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1441 * target.cc (Target::do_plt_fde_location): New function.
1442 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1443 accessor function, and constructor param.
1444 (struct Post_fde, Post_fdes): Declare.
1445 (Cie::write): Add post_fdes param.
1446 * ehframe.cc (Fde::write): Use plt_fde_location.
1447 (struct Post_fde): Define.
1448 (Cie::write): Stash FDEs added post merge mapping.
1449 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1450 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1451 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1452 other FDEs.
1453 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1454 (Target_powerpc::has_glink): New function.
1455 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1456 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1457 glink_eh_frame_fde_32, default_fde): New data.
1458 (Stub_table::eh_frame_added_): New var.
1459 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1460 Make const.
1461 (Stub_table::add_eh_frame): New function.
1462 (Output_data_glink::add_eh_frame): New function.
1463 (Target_powerpc::make_glink_section): Call add_eh_frame.
1464
214383dd
ILT
14652013-02-15 Ian Lance Taylor <iant@google.com>
1466
1467 * options.h (DEFINE_uint64_alias): Define.
1468 (class General_options): Add -Ttext-segment as an alias for
1469 -Ttext.
1470
91c2b899
AM
14712013-02-15 Alan Modra <amodra@gmail.com>
1472
1473 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1474 (Stub_table::do_write): ..here, two places.
1475 (Stub_table::plt_call_size): Use it here too.
1476
20e2a8aa
ILT
14772013-02-11 Ian Lance Taylor <iant@google.com>
1478
1479 * descriptors.cc (Descriptors::close_all): New function.
1480 * descriptors.h (class Descriptors): Declare close_all.
1481 (close_all_descriptors): New inline function.
1482 * plugin.cc: Include "descriptors.h".
1483 (Plugin_manager::cleanup): Call close_all_descriptors.
1484
8952bc69
AM
14852013-02-06 Alan Modra <amodra@gmail.com>
1486
1487 * README: Update coding style link.
1488
29bd8b6b
CC
14892013-01-28 Cary Coutant <ccoutant@google.com>
1490
a4034750
AM
1491 * dwp.cc (File_list): New typedef.
1492 (Dwo_name_info_reader): New class.
1493 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1494 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1495 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1496 (Dwo_file::read_executable): New function.
1497 (Dwo_file::read): Move common setup code to ...
1498 (Dwo_file::make_object): ... here.
1499 (dwp_options): Add --exec/-e.
1500 (usage): Likewise.
1501 (main): Likewise.
29bd8b6b 1502
c6ac678d
ST
15032013-01-24 Sriraman Tallam <tmsriram@google.com>
1504
1505 * layout.cc (Layout::layout): Check for option text_reorder.
1506 (Layout::make_output_section): Ditto.
1507 * options.h (text_reorder): New option.
1508 * output.cc (Input_section_sort_compare): Remove special ordering
1509 of section names.
1510 (Output_section::
1511 Input_section_sort_section_name_special_ordering_compare::
1512 operator()): New function.
1513 (Output_section::sort_attached_input_sections): Use new sort function
1514 for .text.
1515 * output.h (Input_section_sort_section_name_special_ordering_compare):
1516 New struct.
1517 * testsuite/Makefile.am (text_section_grouping): Test option
1518 --no-text-reorder
1519 * testsuite/Makefile.in: Regenerate.
1520 * testsuite/text_section_grouping.sh: Check order of functions without
1521 default text reordering.
1522
50701cc1
MF
15232013-01-18 Mike Frysinger <vapier@gentoo.org>
1524
1525 * options.h (General_options): Change default to true for new_dtags.
1526
b1b00fcc
MF
15272013-01-18 Mike Frysinger <vapier@gentoo.org>
1528
1529 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1530 when enable_new_dtags is false. Only add DT_RUNPATH when
1531 enable_new_dtags is true.
1532
ec5b8187
AM
15332013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1534
1535 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1536 used in declaration and definition consistent.
1537 (Target_powerpc::symval_for_branch): Ditto.
1538
a880d4c4
ST
15392013-01-16 Sriraman Tallam <tmsriram@google.com>
1540
1541 * testsuite/plugin_final_layout.cc: Fix comment.
1542
7c381248
ST
15432013-01-16 Sriraman Tallam <tmsriram@google.com>
1544
1545 * layout.cc (Layout::layout): Do not do default sorting for
1546 text sections when section ordering is specified.
1547 (make_output_section): Ditto.
1548 * testsuite/plugin_final_layout.cc: Name the function sections
1549 to catch reordering issues.
1550
e2458743
AM
15512013-01-15 Alan Modra <amodra@gmail.com>
1552
1553 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1554 plt-thread-safe.
1555
431ed302
AM
15562013-01-15 Alan Modra <amodra@gmail.com>
1557
1558 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1559 * testsuite/Makefile.in: Regenerate.
1560
0ec6429b
AM
15612013-01-14 Alan Modra <amodra@gmail.com>
1562
1563 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1564 * testsuite/Makefile.in: Regenerate.
1565
0bf402d5
ILT
15662013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1567
36af3926 1568 PR bfd/14430
0bf402d5
ILT
1569 Fix mingw gold build with plugins enabled
1570 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1571 * configure.ac: Export DLOPEN_LIBS and add headers check.
1572 * plugin.cc: Handle non-dlfcn case.
1573 * Makefile.in: Regenerate.
1574 * config.in: Regenerate.
1575 * configure: Regenerate.
1576 * testsuite/Makefile.in: Regenerate.
1577
9e9143bc
ST
15782013-01-09 Sriraman Tallam <tmsriram@google.com>
1579
1580 * output.h (sort_attached_input_sections): Change to be public.
1581 * script-sections.cc
1582 (Output_section_definition::set_section_addresses): Sort
1583 attached input sections according to section order before linker
1584 script assigns section addresses.
1585 (Orphan_output_section::set_section_addresses): Sort
1586 attached input sections according to section order before linker
1587 script assigns section addresses.
1588 * Makefile.am (final_layout.sh): Use a simple linker script to
1589 check if section ordering still works.
1590 * Makefile.in: Regenerate.
1591
679af368
ILT
15922013-01-09 Ben Cheng <bccheng@google.com>
1593
1594 * arm.cc (Target_arm::attributes_accept_div): New function.
1595 (Target_arm::attributes_forbid_div): New function.
1596 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1597 attribute using the same new functions as what bfd/elf32_arm.c
1598 does.
1599
3136a00e
CC
16002013-01-07 Cary Coutant <ccoutant@google.com>
1601
1602 PR gold/14993
1603 * output.cc (Output_section::add_input_section): For incremental
1604 updates, don't track input sections that are allocated from patch
1605 space.
1606
f2a6224b
L
16072013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1608 Ian Lance Taylor <iant@google.com>
1609
1610 PR gold/14897
1611 * configure.ac (--enable-ld): Removed.
1612 (install_as_default): Set to yes only for --enable-gold=default
1613 or --disable-ld.
1614 * configure: Regenerated.
1615
4f46f626
L
16162013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1617
1618 * options.h (General_options): Add -fuse-ld= for GCC linker
1619 option compatibility.
1620
26e4ef59
CC
16212013-01-04 Cary Coutant <ccoutant@google.com>
1622
1623 * configure.ac: Fix typo restoring CXXFLAGS.
1624 * configure: Regenerate.
1625
3d587466
CC
16262013-01-04 Cary Coutant <ccoutant@google.com>
1627
4f46f626
L
1628 * testsuite/Makefile.am (CXXLINK_S): New macro.
1629 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1630 * testsuite/Makefile.in: Regenerate.
3d587466 1631
44db6695
L
16322013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1633
1634 * version.cc (print_version): Update copyright year to 2013.
1635
edcac0c1
ILT
16362012-12-20 Ian Lance Taylor <iant@google.com>
1637
1638 * layout.cc (Layout::special_ordering_of_input_section): New
1639 function.
1640 (Layout::layout): If input section requires special ordering, must
1641 sort input sections.
1642 (Layout::make_output_section): May sort .text input sections.
1643 (Layout::is_section_name_prefix_grouped): Remove.
1644 * layout.h (class Layout): Declare
1645 special_ordering_of_input_section. Don't declare
1646 is_section_name_prefix_grouped.
1647 * output.cc (Output_section::add_input_section): Revert last
1648 change.
1649 (Output_section::Input_section_sort::match_file_name): Don't crash
1650 if called on output section data.
1651 (Output_section::Input_section_sort_compare): Sort based on
1652 special ordering.
1653 (Output_section::Input_section_sort_section_order_index_compare):
1654 Revert last patch.
1655 (Output_section::sort_attached_input_sections): Likewise.
1656
28f2a4ac
ST
16572012-12-18 Sriraman Tallam <tmsriram@google.com>
1658
edcac0c1 1659 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
1660 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1661 * output.cc (Output_section::add_input_section): Check if section
1662 name contains special prefix. Keep input sections to sort such
1663 sections.
1664 (Output_section::Input_section_sort_section_order_index_compare
1665 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
1666 (Output_section::sort_attached_input_sections): Add condition to
1667 Input_section_entry constructor call.
28f2a4ac
ST
1668 * testsuite/Makefile.am (text_section_grouping): New test.
1669 * testsuite/Makefile.in: Regenerate.
1670 * testsuite/text_section_grouping.cc: New file.
1671 * testsuite/text_section_grouping.sh: New file.
1672
5bf135a7
NC
16732012-12-17 Nick Clifton <nickc@redhat.com>
1674
1675 * Makefile.am: Add copyright notice.
1676 * NEWS: Likewise.
1677 * README: Likewise.
1678 * configure.ac: Likewise.
1679 * ftruncate.c: Likewise.
1680 * Makefile.in: Regenerate.
1681
59965708
CC
16822012-12-14 Cary Coutant <ccoutant@google.com>
1683
a4034750
AM
1684 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1685 --no-as-needed flag.
1686 (exception_separate_shared_12_test): Likewise.
1687 (incremental_copy_test): Likewise.
1688 * testsuite/Makefile.in: Regenerate.
59965708 1689
2a77e2ab
CC
16902012-12-14 Cary Coutant <ccoutant@google.com>
1691
1692 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1693 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1694
e3deeb9c
AM
16952012-12-12 Alan Modra <amodra@gmail.com>
1696
1697 * powerpc.cc (class Track_tls): New.
1698 (class Relocate, class Scan): Inherit Track_tls.
1699 (Target_powerpc::Scan::local, global): Track tls optimization
1700 and avoid creating plt entry for __tls_get_addr if all uses
1701 are optimized away.
1702 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1703
d8f5a274
AM
17042012-12-12 Alan Modra <amodra@gmail.com>
1705
1706 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1707 Replace no_toc_optimize with toc_optimize.
1708 * output.h (Output_section::input_sections): Provide non-const variant.
1709 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1710 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1711 accessors.
1712 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1713 (class Sort_toc_sections): New.
1714 (Target_powerpc::do_finalize_sections): Sort toc sections.
1715 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1716
4c8a1de1
RM
17172012-12-10 Roland McGrath <mcgrathr@google.com>
1718
1719 * testsuite/binary_unittest.cc (read_all): New function.
1720 (Sized_binary_test): Use it instead of ::read.
1721 * fileread.cc (do_read): Don't assume pread always reads the whole
1722 amount in a single call.
1723
edc27beb
AM
17242012-12-10 Alan Modra <amodra@gmail.com>
1725
1726 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1727 Set EM_PPC64 or EM_PPC here.
1728 (Target_selector_powerpc::do_recognize): Delete.
1729
906b9150
AM
17302012-12-10 Alan Modra <amodra@gmail.com>
1731
1732 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1733 stub_table_.
1734 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1735
418c15ae
RM
17362012-12-07 Roland McGrath <mcgrathr@google.com>
1737
1738 * testsuite/binary_unittest.cc (Sized_binary_test):
1739 Use open_descriptor rather than ::open.
1740
decdd3bc
AM
17412012-12-07 Alan Modra <amodra@gmail.com>
1742
1743 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1744 typedef and invalid_address constant.
1745 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1746 instantiate constants.
1747
db399005
ILT
17482012-12-06 Roland McGrath <mcgrathr@google.com>
1749
1750 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1751 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1752 * aclocal.m4: Regenerate.
1753 * configure: Regenerate.
1754 * Makefile.in: Regenerate.
1755 * testsuite/Makefile.in: Regenerate.
1756
aba6bc71
AM
17572012-12-07 Alan Modra <amodra@gmail.com>
1758
1759 * options.h (General_options): Add no_toc_optimize.
1760 * powerpc.cc (ok_lo_toc_insn): New function.
1761 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1762
9e69ed50
AM
17632012-12-06 Alan Modra <amodra@gmail.com>
1764
1765 * options.h (General_options): Add plt_align, plt_static_chain,
1766 plt_thread_safe. Update stub_group_size help text.
1767 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1768 for new plt_thread_safe_ var.
1769 (use_plt_offset): Correct comments.
1770 (Target_powerpc::do_relax): Look for thread creation symbols to
1771 determine default plt_thread_safe value. Clear plt call stubs
1772 as well as branch stubs each iteration.
1773 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
1774 insn constants.
1775 (l, hi, ha, write_insn): Move earlier.
1776 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
1777 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
1778 plt stubs too.
1779 (Stub_table::update_size): Adjust.
1780 (Stub_table::prev_size, set_prev_size): Delete.
1781 (Stub_table::stub_align): Let --plt-align affect result.
1782 (Stub_table::plt_call_size): Calculate sizes for various stubs.
1783 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
1784 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
1785 (Stub_table::do_write): Support more stub variants.
1786
f43ba157
AM
17872012-12-04 Alan Modra <amodra@gmail.com>
1788
1789 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
1790 (Target_powerpc::do_define_standard_symbols): New function.
1791
34171bc5
AM
17922012-12-03 Alan Modra <amodra@gmail.com>
1793
1794 * output.h: Formatting, whitespace.
1795
dc9589e9 17962012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
1797
1798 * layout.h (Layout::get_executable_sections): Declare.
1799 * layout.cc (Layout::get_executable_sections): New function.
1800 * arm.cc (Target_arm::group_sections): Use it.
1801 (Arm_output_section::group_sections): Delete now redundant test.
1802 * output.cc (Output_reloc::Output_reloc): Add is_relative.
1803 param to handle relative relocs.
1804 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
1805 (Output_data_reloc::add_absolute): Adjust.
1806 (Output_data_reloc::add_relative): New function.
1807 (Output_data::reset_data_size): New function.
1808 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
1809 (Output_section::set_addralign): New function.
1810 (Output_section::checkpoint_set_addralign): New function.
1811 (Output_section::clear_section_offsets_need_adjustment): New function.
1812 (Output_section::input_sections): Make public.
1813 * powerpc.cc (class Output_data_brlt_powerpc): New.
1814 (class Stub_table, class Stub_control): New.
1815 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
1816 stub_table_, set_stub_table, stub_table): New vectors and accessor
1817 functions.
1818 (Target_powerpc::do_may_relax, do_relax, push_branch,
1819 new_stub_table, stub_tables, brlt_section, group_sections,
1820 add_branch_lookup_table, find_branch_lookup_table,
1821 write_branch_lookup_table, make_brlt_section): New functions.
1822 (Target_powerpc::struct Sort_sections, class Branch_info): New.
1823 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
1824 branch_info_): New vars.
1825 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
1826 make call stubs here.
1827 (Output_data_glink): Remove all call stub handling from this class.
1828 (Target_powerpc::Scan::local, global): Save interesting branch
1829 relocs and relocs for ifunc. Adjust calls to plt entry functions.
1830 (Target_powerpc::do_finalize_sections): Only make reg save/restore
1831 functions on final link.
1832 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
1833 Handle long branch destinations too.
1834 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
1835 do_plt_address_for_local): Adjust lookup of plt call stubs.
1836
627b30b7
AM
18372012-11-30 Alan Modra <amodra@gmail.com>
1838
1839 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
1840 relocs against protected symbols when building 32-bit shared libs.
1841
40b469d7
AM
18422012-11-30 Alan Modra <amodra@gmail.com>
1843
1844 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
1845 param. Call got_section() to make .got. Update all callers
1846 and their callers and so on.
1847
bb66a627
AM
18482012-11-30 Alan Modra <amodra@gmail.com>
1849
1850 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
1851 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
1852 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
1853 value if it already exists.
1854
d2cf1c6c
L
18552012-11-19 H.J. Lu <hongjiu.lu@intel.com>
1856
1857 PR gold/14858
1858 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
1859
edccdf7c
RM
18602012-11-14 Roland McGrath <mcgrathr@google.com>
1861
1862 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
1863 than bfc instruction for data sandboxing.
1864
6febeb74
AM
18652012-11-08 Alan Modra <amodra@gmail.com>
1866
1867 * po/POTFILES.in: Regenerate.
1868
0a6f1bf2
AM
18692012-11-05 Alan Modra <amodra@gmail.com>
1870
1871 * configure.ac: Apply 2012-09-10 change to config.in here.
1872 * configure: Regenerate.
1873
26a4e9cb
AM
18742012-11-05 Alan Modra <amodra@gmail.com>
1875
1876 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
1877 (struct Opd_ent): Use "Address" rather than "Offset".
1878 (Output_data_got_powerpc::got_base_offset): Return Valtype.
1879 (Target_powerpc::got_section): Make public.
1880 (Target_powerpc::scan_relocs): Move code setting symbols..
1881 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
1882 Create _SDA_BASE_ only when referenced.
1883
cc928013
RM
18842012-11-02 Roland McGrath <mcgrathr@google.com>
1885
1886 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
1887 from last change.
1888
50ed5eb1
RM
18892012-11-01 Roland McGrath <mcgrathr@google.com>
1890
62fe925a
RM
1891 * target.h (Sized_target::relocate_relocs): Use Elf_Off
1892 for offset_in_output_section parameter.
1893 (Sized_target::relocate_special_relocatable): Likewise.
1894 * arm.cc (Target_arm::relocate_relocs): Likewise.
1895 (Target_arm::relocate_special_relocatable): Likewise.
1896 * i386.cc (Target_i386::relocate_relocs): Likewise.
1897 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
1898 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
1899 * target-reloc.h (relocate_relocs): Likewise.
1900 * testsuite/testfile.cc (Target_test): Likewise.
1901 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
1902 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
1903
1904 * system.h: Move inclusion of <clocale> to after <libintl.h> in
1905 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
1906
1907 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
1908 parameter, which is unused in the [!F_SETFD] case.
1909
50ed5eb1
RM
1910 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
1911 SYMNDX to off_t before comparing it to this->data_size().
1912 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
1913 * incremental.cc (Output_section_incremental_inputs::do_write):
1914 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
1915
2cadc0bf
RM
1916 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
1917
3bfcb652
NC
19182012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
1919
1920 * gold.cc (Target_arm::do_adjust_elf_header): Add the
1921 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
1922 in EABI_VER5.
1923
c1a8d56e
CC
19242012-10-29 Cary Coutant <ccoutant@google.com>
1925
1926 * dwp.cc (usage): Add file and exit status parameters;
1927 add --help and --version options.
1928 (print_version): New function.
1929 (main): Add --help and --version options.
1930
b2490a7b
L
19312012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1932
1933 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
1934 final_layout_sequence.txt.
1935 * testsuite/Makefile.in: Regenerated.
1936
aa543512
L
19372012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1938
1939 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
1940 COMPILE generated by automake.
1941 (LINK1): Likewise.
1942 (CXXCOMPILE1): Likewise.
1943 (CXXLINK1): Likewise.
1944 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
1945 (LINK): Likewise.
1946 (CXXCOMPILE): Likewise.
1947 (CXXLINK): Likewise.
1948 * testsuite/Makefile.in: Regenerated.
1949
d361fafb
L
19502012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1951
1952 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
1953 on bad fwrite return.
1954
598c7410
L
19552012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1956
1957 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
1958 on val.
1959
35c813e2
CC
19602012-10-23 Cary Coutant <ccoutant@google.com>
1961
1962 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
1963 * testsuite/Makefile.in: Regenerate.
1964 * testsuite/dwp_test.h: New source file.
1965 * testsuite/dwp_test_1.cc: New source file.
1966 * testsuite/dwp_test_1.s: New source file.
1967 * testsuite/dwp_test_1.sh: New source file.
1968 * testsuite/dwp_test_1b.cc: New source file.
1969 * testsuite/dwp_test_1b.s: New source file.
1970 * testsuite/dwp_test_2.cc: New source file.
1971 * testsuite/dwp_test_2.s: New source file.
1972 * testsuite/dwp_test_2.sh: New source file.
1973 * testsuite/dwp_test_main.cc: New source file.
1974 * testsuite/dwp_test_main.s: New source file.
1975
77429909
CC
19762012-10-23 Cary Coutant <ccoutant@google.com>
1977
1978 * dwp.h: New header file.
1979 * dwp.cc: New source file.
1980 * gold.h: Move shared declarations to system.h.
1981 * system.h: New header file.
1982 * Makefile.am: Add dwp.
1983 * Makefile.in: Regenerate.
1984
ed5d6712
CC
19852012-10-23 Cary Coutant <ccoutant@google.com>
1986
1987 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1988 Dwarf_info_reader::read_from_pointer.
1989 (Dwarf_pubnames_table::read_header): Likewise.
1990 (Dwarf_pubnames_table::next_name): Likewise.
1991 (Dwarf_die::read_attributes): Likewise.
1992 (Dwarf_die::skip_attributes): Likewise.
1993 (Dwarf_info_reader::read_from_pointer): New function template.
1994 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1995 (Dwarf_pubnames_table): Likewise.
1996 (Dwarf_info_reader::read_from_pointer): New function template.
1997 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1998 Dwarf_pubnames_table ctor.
1999
8787852d
CC
20002012-10-23 Cary Coutant <ccoutant@google.com>
2001
2002 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2003 abbrev_shndx.
2004 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2005 abbrev_shndx_.
2006 (Dwarf_info_reader::set_abbrev_shndx): New method.
2007 (Dwarf_info_reader::abbrev_shndx_): New data member.
2008
9fc236f3
CC
20092012-10-23 Cary Coutant <ccoutant@google.com>
2010
2011 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2012 from object, not parameters.
2013 (Dwarf_info_reader::parse): Likewise.
2014 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2015 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2016 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2017 methods.
2018
effe8365
CC
20192012-10-23 Cary Coutant <ccoutant@google.com>
2020
2021 * fileread.cc (Input_file::Input_file): New constructor.
2022 * fileread.h (class Input_file): Add new constructor.
2023
1698990d
AM
20242012-10-18 Alan Modra <amodra@gmail.com>
2025
2026 PR gold/14727
2027 * object.cc (Relobj::is_section_name_included): Also match
2028 .sdata personality section.
2029
168a4726
AM
20302012-10-18 Alan Modra <amodra@gmail.com>
2031
2032 * target-reloc.h (class Default_comdat_behavior): New, package up..
2033 (get_comdat_behaviour): ..this.
2034 (relocate_section): Add Relocate_comdat_behavior template arg,
2035 adjust code to suit.
2036 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2037 (Target_arm::scan_reloc_section): Likewise.
2038 * i386.cc (Target_i386::relocate_section): Likewise.
2039 * sparc.cc (Target_sparc::relocate_section): Likewise.
2040 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2041 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2042 * powerpc.cc (class Relocate_comdat_behavior): New.
2043 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2044 gold::relocate_section with new template arg.
2045
acc276d8
AM
20462012-10-18 Alan Modra <amodra@gmail.com>
2047
2048 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2049 dynamic relocs for GOT_TPREL got entries, without symbol if
2050 resolving locally.
2051 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2052 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2053 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2054
e10f9870
AM
20552012-10-17 Alan Modra <amodra@gmail.com>
2056
2057 PR gold/14726
2058 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2059
ae034989
ST
20602012-10-16 Sriraman Tallam <tmsriram@google.com>
2061
2062 * layout.cc (Layout::include_section): Keep sections marked
2063 SHF_EXCLUDE when doing relocatable links.
2064
f3a0ed29
AM
20652012-10-16 Alan Modra <amodra@gmail.com>
2066
2067 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2068 (Target_powerpc::do_finalize_sections): Call it.
2069 (Output_data_save_res): New class and supporting functions.
2070 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2071 normal symbols defined in object files.
2072
c6de8ed4
AM
20732012-10-12 Alan Modra <amodra@gmail.com>
2074
2075 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2076 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2077 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2078 section if scan_opd_relocs not yet called.
2079 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2080
03e25981
AM
20812012-10-12 Alan Modra <amodra@gmail.com>
2082
2083 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2084 add_local_ifunc_entry): Revert last change.
2085 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2086
c9824451
AM
20872012-10-05 Alan Modra <amodra@gmail.com>
2088
2089 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2090 do_plt_address_for_global): New functions.
2091 (Output_data_got_powerpc::do_write): Don't segfault when linking
2092 statically.
2093 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2094 add_local_ifunc_entry): Return true on adding entry..
2095 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2096 glink->add_entry call. Remove unused symtab param. Adjust calls.
2097 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2098 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2099 set up symbols here.
2100 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2101 syms here. Do so even when no .iplt. Don't segfault when linking
2102 statically.
2103 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2104 new variants without reloc param.
2105 (Glink_sym_ent::Glink_sym_ent): Likewise.
2106 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2107 reloc when refs will resolve to plt call stub.
2108 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2109 R_PPC_PLTREL24 to resolve locally.
2110 (Target_powerpc::Scan::global): Correct ifunc handling.
2111 (Target_powerpc::Relocate::relocate): Correct local sym glink
2112 lookup. Don't destroy "value" when we have a plt call stub,
2113 and when checking plt call validity.
2114 (Target_powerpc::do_dynsym_value): Simplify.
2115
19fec8c1
AM
21162012-10-05 Alan Modra <amodra@gmail.com>
2117
2118 * i386.cc (Output_data_plt_i386::address_for_global,
2119 address_for_local): Add plt offset to returned value. Adjust uses.
2120 * sparc.cc (Output_data_plt_sparc::address_for_global,
2121 address_for_local): Likewise.
2122 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2123 address_for_local): Likewise.
2124 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2125 address_for_local): Likewise.
2126 * target.h (Target::plt_address_for_global, plt_address_for_local):
2127 Update comment.
2128 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2129 (Output_data_got::Got_entry::write): Nor here.
2130 * output.h: Comment fix.
2131
e867b647
WL
21322012-10-02 Jiong Wang <jiwang@tilera.com>
2133
2134 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2135 global_offset_table_ value for larget got.
2136 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2137
e5d5f5ed
AM
21382012-09-29 Alan Modra <amodra@gmail.com>
2139
2140 * powerpc.cc (Target_powerpc::iplt_): New output section.
2141 (Target_powerpc::iplt_section, make_iplt_section,
2142 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2143 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2144 Target_powerpc::plt_entry_count): Count iplt entries too.
2145 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2146 reloc section in constructor. New params.
2147 (Target_powerpc::make_plt_section): Create reloc section here instead.
2148 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2149 functions.
2150 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2151 (Output_data_glink::add_entry, find_entry): New functions to
2152 deal with local syms.
2153 (Glink_sym_ent): Add support for local syms.
2154 (Output_data_glink::do_write): Handle ifunc plt entries.
2155 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2156 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2157 (Target_powerpc::Relocate::relocate): Likewise.
2158 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2159
ec4dbad3
AM
21602012-09-25 Alan Modra <amodra@gmail.com>
2161
2162 * object.h (Sized_relobj_file::adjust_local_symbol,
2163 do_adjust_local_symbol): New functions.
2164 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2165 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2166 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2167 and irregular opd entry spacing.
2168 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2169 (Global_symbol_visitor_opd): New functor.
2170 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2171 on deleted opd entries.
2172
5c0b3823
WL
21732012-09-15 Jiong Wang <jiwang@tilera.com>
2174
2175 * tilegx.cc: New file.
2176 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2177 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2178 * configure.tgt: Add entries for tilegx*.
2179 * configure.ac: Likewise.
2180 * Makefile.in: Rebuild.
2181 * configure: Likewise.
2182 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2183 tilegx.
2184
bfdfa4cd
AM
21852012-09-13 Alan Modra <amodra@gmail.com>
2186
2187 * target-reloc.h (scan_relocs): Call scan.local for relocs
2188 against symbols in discarded sections. Pass is_discarded
2189 param.
2190 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2191 Add is_discarded param.
2192 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2193 is_discarded to flag opd entry as discarded. Don't emit dyn
2194 relocs on such entries.
2195 (Target_powerpc::Scan::global): Similarly detect and handle
2196 such opd entries.
2197 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2198 opd_ent_. Update all uses.
2199 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2200 (Target_powerpc::relocate_section): Zero out discarded opd
2201 entry relocs.
2202
d77a0555
ILT
22032012-09-12 Ian Lance Taylor <iant@google.com>
2204
2205 PR gold/14570
2206 * output.cc: Rename Output_data_got template parameter from size
2207 to got_size for all functions. Compile all variants of
2208 Output_data_got.
2209 (Output_data_got::Got_entry::write): Correct use of size for
2210 symbol value. Use local_is_tls rather than casting to
2211 Sized_relobj_file.
2212 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2213 (class Sized_relobj_file): Add do_local_is_tls.
2214 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2215
815a1205
AM
22162012-09-11 Alan Modra <amodra@gmail.com>
2217
2218 PR gold/14566
2219 * layout.cc (Layout::set_segment_offsets): When using
2220 common-page-size alignment, ensure we are on a new max-page-size
2221 page.
2222 * output.cc (Output_segment::set_section_addresses): Use
2223 abi_pagesize, not common_pagesize for relro boundary.
2224 (Output_segment::set_offset): Likewise.
2225
bd73a62d
AM
22262012-09-11 Alan Modra <amodra@gmail.com>
2227
2228 * output.h (Output_data_got::add_global_tls, add_local_tls,
2229 add_local_tls_pair): New functions.
2230 (Output_data_got::add_local_pair_with_rel): Remove second
2231 reloc param. Expand comment.
2232 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2233 use_plt_or_tls_offset_, similarly for constructor param.
2234 (Output_data_got::Got_entry::write): Add got_index param.
2235 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2236 add_local_tls_pair): New functions.
2237 (Output_data_got::Got_entry::write): Handle tls symbols
2238 with use_plt_or_tls_offset_ set specially.
2239 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2240 (Output_data_got::do_write): Replace iterator with index, pass
2241 index to entry write function.
2242 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2243 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2244 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2245 call.
2246 * i386.cc (Target_i386::Scan::local): Likewise.
2247 * sparc.cc (Target_sparc::Scan::local): Likewise.
2248 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2249 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2250 do_tls_offset_for_global): New functions.
2251 (Target_powerpc::Scan::local): Correct TLS relocations and got
2252 entry values.
2253 (Target_powerpc::Scan::global): Don't emit unnecessary
2254 dynamic relocations on TLS GOT entries.
2255
00716ab1
AM
22562012-09-10 Matthias Klose <doko@ubuntu.com>
2257
2258 * config.in: Disable sanity check for kfreebsd.
2259
c891b3f9
SA
22602012-09-10 Sterling Augustine <saugustine@google.com>
2261
2262 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2263 (Gdb_index::pubtypes_read): New parameter.
2264 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2265 to calls.
2266 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2267 pubtypes_object_.
2268
e81fea4d
AM
22692012-09-09 Alan Modra <amodra@gmail.com>
2270
2271 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2272 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2273 * gc.h (gc_process_relocs): Call target gc_add_reference.
2274 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2275 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2276 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2277 unnecessary cast.
2278 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2279 to cater for when we don't need code offset. Update use.
2280 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2281 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2282 set_opd_valid): New functions.
2283 (Target_powerpc::do_gc_add_reference): New function.
2284 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2285 stashed refs.
2286 (Target_powerpc::do_gc_mark_symbol): New function.
2287
d2d60eef
CC
22882012-09-06 Cary Coutant <ccoutant@google.com>
2289
2290 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2291 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2292 (Dwarf_die::skip_attributes): Likewise.
2293 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2294 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2295 (main): Call it.
2296 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2297
32ed4573
L
22982012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2299
2300 * testsuite/script_test_3.t: Add .got.plt output section
2301 statement.
2302 * testsuite/script_test_4.t: Likewise.
2303
f4baf0d4
AM
23042012-09-05 Alan Modra <amodra@gmail.com>
2305
2306 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2307 update all uses and lose "enum" when using type.
2308
864a1b56
AM
23092012-09-05 Alan Modra <amodra@gmail.com>
2310
2311 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2312 * configure: Regenerate.
2313 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2314 (plugin_final_layout.stdout): Likewise.
2315 (memory_test): Set page sizes to 0x1000.
2316 * testsuite/Makefile.in: Regenerate.
2317 * testsuite/discard_locals_test.sh: Add FIXME comment.
2318 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2319 * testsuite/pr14265.t: Add .got output section statement.
2320 * testsuite/script_test_2.t: Likewise.
2321 * testsuite/script_test_3.t: Likewise.
2322 * testsuite/script_test_4.t: Likewise.
2323 * testsuite/script_test_5.t: Likewise.
2324 * testsuite/script_test_6.t: Likewise.
2325 * testsuite/script_test_7.t: Likewise.
2326 * testsuite/script_test_9.t: Likewise.
2327
3ea0a085
AM
23282012-09-05 Alan Modra <amodra@gmail.com>
2329
2330 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2331 (Powerpc_relocate_functions::Status): New typedef.
2332 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2333 (Target_powerpc::Scan::local): Handle REL64.
2334 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2335 for REL32 and REL64.
2336 (Target_powerpc::symval_for_branch): New function, extracted from..
2337 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2338 checks. Report overflow errors.
2339
7404fe1b
AM
23402012-09-05 Alan Modra <amodra@gmail.com>
2341
2342 * object.h (Sized_relobj_file::emit_relocs): Delete.
2343 (Sized_relobj_file::emit_relocs_reltype): Delete.
2344 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2345 relocate_relocs for --emit-relocs.
2346 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2347 * output.h: Update comment.
2348 (Output_segment::first_section): New function.
2349 (Output_segment::first_section_load_address): Use first_section.
2350 * output.cc (Output_segment::first_section): New function extracted..
2351 (Output_segment::first_section_load_address): ..from here. Delete.
2352 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2353 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2354 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2355 adjust call to target.h function.
2356 * i386.cc (Target_i386): Likewise.
2357 * sparc.cc (Target_sparc): Likewise.
2358 * x86_64.cc (Target_x86_64): Likewise.
2359 * powerpc.cc (Target_powerpc): Likewise.
2360 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2361 first tls section has section symbol for optimised local dynamic
2362 output relocs.
2363 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2364 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2365 optimised tls code.
2366 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2367 Rename to relocate_relocs. Update error message.
2368
957564c9
AS
23692012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2370
2371 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2372 --just-symbols.
2373
dd93cd0a
AM
23742012-08-31 Alan Modra <amodra@gmail.com>
2375
2376 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2377 (Powerpc_relobj::toc_base_offset): New stub function.
2378 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2379 got_mod_index_offset to tlsld_got_offset. Update all refs.
2380 (Target_powerpc::Relocate::enum skip_tls): New.
2381 (Target_powerpc::call_tls_get_addr_): New var.
2382 (Target_powerpc::is_branch_reloc): Move to file scope.
2383 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2384 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2385 New functions.
2386 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2387 (powerpc_info): Correct common_pagesize for ppc64.
2388 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2389 (Powerpc_relocate_functions): Add overflow check enums and functions.
2390 Add non-shift version of rela, rela_ua. Delete all rel public
2391 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2392 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2393 addr16_ha3, addr14 functions.
2394 (Output_data_got_powerpc::add_constant_pair): New function.
2395 (Output_data_got_powerpc::got_base_offset): Likewise.
2396 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2397 (instruction constants): Sort, add some more.
2398 (Output_data_glink::do_write): Add and use Address typedef. Use
2399 object->toc_base_offset() stub for 64-bit.
2400 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2401 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2402 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2403 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2404 Always treat .opd relocs as against locally defined symbol.
2405 Correct condition for RELATIVE relocs.
2406 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2407 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2408 for 32-bit syms with a plt entry. Correct ppc64 toc base
2409 calculations. Handle TLS relocs, and more. Add overflow
2410 checking and adjust for Powerpc_relocate_functions changes.
2411 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2412 Reinstate --emit-relocs code with FIXME.
2413
a1373b60
AM
24142012-08-30 Alan Modra <amodra@gmail.com>
2415
2416 * layout.cc (Layout::set_segment_offsets): Set p_align to
2417 abi_pagesize, not common_pagesize.
2418 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2419 to determine whether file header can go in segment.
2420
703d02da
AM
24212012-08-30 Alan Modra <amodra@gmail.com>
2422
2423 * output.h (Output_reloc::Output_reloc <output section>): Add
2424 is_relative param. Adjust calls.
2425 (Output_reloc::add_output_section_relative): New functions.
2426 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2427 is_relative.
2428 (Output_reloc::symbol_value): Handle SECTION_CODE.
2429
16164a6b
ST
24302012-08-24 Sriraman Tallam <tmsriram@google.com>
2431
2432 * gold.cc (queue_middle_tasks): Call layout again when unique
2433 segments for sections is desired.
2434 * layout.cc (Layout::Layout): Initialize new members.
2435 (Layout::get_output_section_flags): New function.
2436 (Layout::choose_output_section): Call get_output_section_flags.
2437 (Layout::layout): Make output section for mapping to a unique segment.
2438 (Layout::insert_section_segment_map): New function.
2439 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2440 output sections marked so.
16164a6b
ST
2441 (Layout::segment_precedes): Check for unique segments when sorting.
2442 * layout.h (Layout::Unique_segment_info): New struct.
2443 (Layout::Section_segment_map): New typedef.
2444 (Layout::insert_section_segment_map): New function.
2445 (Layout::get_output_section_flags): New function.
2446 (Layout::is_unique_segment_for_sections_specified): New function.
2447 (Layout::set_unique_segment_for_sections_specified): New function.
2448 (Layout::unique_segment_for_sections_specified_): New member.
2449 (Layout::section_segment_map_): New member.
2450 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2451 Rename is_gc_pass_one to is_pass_one.
2452 Rename is_gc_pass_two to is_pass_two.
2453 Rename is_gc_or_icf to is_two_pass.
2454 Check for which pass based on whether symbols data is present.
2455 Make it two pass when unique segments for sections is desired.
2456 * output.cc (Output_section::Output_section): Initialize new
2457 members.
2458 * output.h (Output_section::is_unique_segment): New function.
2459 (Output_section::set_is_unique_segment): New function.
2460 (Output_section::is_unique_segment_): New member.
2461 (Output_section::extra_segment_flags): New function.
2462 (Output_section::set_extra_segment_flags): New function.
2463 (Output_section::extra_segment_flags_): New member.
2464 (Output_section::segment_alignment): New function.
2465 (Output_section::set_segment_alignment): New function.
2466 (Output_section::segment_alignment_): New member.
2467 (Output_segment::Output_segment): Initialize is_unique_segment_.
2468 (Output_segment::is_unique_segment): New function.
2469 (Output_segment::set_is_unique_segment): New function.
2470 (Output_segment::is_unique_segment_): New member.
2471 * plugin.cc (allow_unique_segment_for_sections): New function.
2472 (unique_segment_for_sections): New function.
2473 (Plugin::load): Add new functions to transfer vector.
2474 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2475 * Makefile.in: Regenerate.
2476 * testsuite/plugin_final_layout.sh: Check if unique segment
2477 functionality works.
2478 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2479 are available.
2480 (allow_unique_segment_for_sections): New global.
2481 (unique_segment_for_sections): New global.
2482 (claim_file_hook): Call allow_unique_segment_for_sections.
2483 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2484
1e2bee4f
CC
24852012-08-22 Cary Coutant <ccoutant@google.com>
2486
2487 * layout.cc (Layout::include_section): Don't assert on GROUP
2488 sections with --emit-relocs.
2489
1d5dfe78
CC
24902012-08-21 Cary Coutant <ccoutant@google.com>
2491
2492 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2493 if --export-dynamic-symbol names an undef symbol.
2494
c9269dff
AM
24952012-08-18 Alan Modra <amodra@gmail.com>
2496
2497 * powerpc.cc: Formatting and white space.
2498 (Powerpc_relobj): Rename got2_section_ to special_.
2499 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2500 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2501 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2502 (Target_powerpc): Add Address typedef and invalid_address. Use
2503 throughout.
2504 (Target_powerpc::is_branch_reloc): New function.
2505 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2506 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2507 for dst_mask, value and addend.
2508 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2509 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2510 (Output_data_glink::do_write): Correct toc base. Don't try to use
2511 uint16_t for 24-bit offset. Use get_output_section_offset and
2512 check return.
2513 (Target_powerpc::Scan::local): Handle more relocs.
2514 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2515 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2516 Plug in toc restoring insn after plt calls. Translate branches
2517 to function descriptor symbols to corresponding entry point.
2518 (Target_powerpc::relocate_for_relocatable): Check return from
2519 get_output_section_offset.
2520 * symtab.h: Comment typo.
2521
b1759dce
ILT
25222012-08-14 Ian Lance Taylor <iant@google.com>
2523
2524 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2525 unsupported_relocal_local to call unsupported_reloc_global.
2526
b9b2ae8b
NC
25272012-08-14 Nick Clifton <nickc@redhat.com>
2528
2529 PR ld/14265
2530 * script-sections.cc (Sections_element::output_section_name): Add
2531 keep return parameter.
2532 (Output_section_element::match_name): Add keep return parameter.
2533 Return the value of the keep_ member.
2534 * script-sections.h (class Output_section): Update
2535 output_section_name prototype.
2536 * layout.cc (Layout::keep_input_section): New public member
2537 function.
2538 (Layout::choose_output_section): Pass keep parameter to
2539 output_section_name.
2540 * layout.h (class Layout): Add keep_input_section.
2541 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2542 sections.
2543 * testsuite/Makefile.am: Add a test.
2544 * testsuite/Makefile.in: Regenerate.
2545 * testsuite/pr14265.c: Source file for the test.
2546 * testsuite/pr14265.t: Linker script for the test.
2547 * testsuite/pr14265.sh: Shell script for the test.
2548
921b5322
AM
25492012-08-14 Alan Modra <amodra@gmail.com>
2550
2551 * target.h (Target::output_section_name): New function.
2552 (Target::do_output_section_name): New function.
2553 * layout.cc (Layout::choose_output_section): Call the above.
2554 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2555
6ce78956
AM
25562012-08-14 Alan Modra <amodra@gmail.com>
2557
2558 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2559 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2560 for replace_constant call.
2561 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2562 (Output_data_glink::do_print_to_mapfile): New function.
2563 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2564 (Target_powerpc::Relocate::relocate): Likewise.
2565
d1a8cabd
AM
25662012-08-14 Alan Modra <amodra@gmail.com>
2567
2568 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2569 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2570 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2571 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2572 all references to shndx_. Handle special case for R_PPC_PLTREL24
2573 here.
2574 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2575 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2576 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2577 here.
2578 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2579 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2580
d83ce4e3
AM
25812012-08-12 Alan Modra <amodra@gmail.com>
2582
2583 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2584 (glink insn constants): Use uint32_t.
2585 (Output_data_glink::add_entry): Use insert, not [] operator.
2586
cf43a2fe
AM
25872012-08-11 Alan Modra <amodra@gmail.com>
2588
2589 * object.h (Sized_relobj_file::find_shdr): New function.
2590 (Sized_relobj_file::find_special_sections): New function.
2591 * object.cc (Sized_relobj_file::find_shdr): New function.
2592 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2593 (Sized_relobj_file::find_special_sections): New function, split out..
2594 (Sized_relobj_file::do_read_symbols): ..from here.
2595 * output.h (Output_data_got::replace_constant): New function.
2596 (Output_data_got::num_entries): New function.
2597 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2598 (Output_data_got::got_offset): Protected rather than private.
2599 (Output_data_got::replace_got_entry): New function.
2600 * output.cc (Output_data_got::replace_got_entry): New function.
2601 * powerpc.cc (class Powerpc_relobj): New.
2602 (class Powerpc_relocate_functions): Delete all psymval variants or
2603 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2604 Implement _ha functions using corresponding _hi function.
2605 (Powerpc_relobj::find_special_sections): New function.
2606 (Target_powerpc::do_make_elf_object): New function.
2607 (class Output_data_got_powerpc): New.
2608 (class Output_data_glink): New.
2609 (class Powerpc_scan_relocatable_reloc): New.
2610 Many more changes througout file.
2611
3c892704
NC
26122012-08-09 Nick Clifton <nickc@redhat.com>
2613
2614 * po/vi.po: Updated Vietnamese translation.
2615
82435b3b
ILT
26162012-08-07 Ian Lance Taylor <iant@google.com>
2617
2618 * layout.cc (Layout::add_target_dynamic_tags): If
2619 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2620 plt_rel.
2621
a6dc81d2
NC
26222012-07-30 Nick Clifton <nickc@redhat.com>
2623
2624 * po/gold.pot: Updated template.
2625 * po/es.po: Updated Spanish translation.
2626
f1415016
CC
26272012-07-18 Cary Coutant <ccoutant@google.com>
2628
2629 PR gold/14344
2630 * configure.ac: Add check for -gpubnames support.
2631 * configure: Regenerate.
2632 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2633 support; force -gno-pubnames.
2634 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2635 support.
2636 (gdb_index_test_4): New test.
2637 * testsuite/Makefile.in: Regenerate.
2638 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2639 * testsuite/gdb_index_test_2.sh: Likewise.
2640 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2641 * testsuite/gdb_index_test_4.sh: New script.
2642 * testsuite/gdb_index_test_comm.sh: New script with common code;
2643 don't look for space after colon.
2644
b7fd7c37
ST
26452012-07-16 Sriraman Tallam <tmsriram@google.com>
2646
2647 * gold.cc (queue_middle_tasks): Update function order only after
2648 deferred objects due to plugins are processed.
2649
1f3212db
ILT
26502012-07-11 Ian Lance Taylor <iant@google.com>
2651
2652 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2653 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2654 (Target_arm::scan_reloc_for_stub): Likewise.
2655 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2656 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2657 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2658 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2659 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2660
81c82a68
ILT
26612012-07-10 Dodji Seketeli <dodji@redhat.com>
2662 Ian Lance Taylor <iant@google.com>
2663
2664 PR gold/14309
2665 * configure.ac: Test whether std::tr1::hash<off_t> works.
2666 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2667 needed.
2668 * output.h (class Output_fill): Add virtual destructor.
2669 * configure, config.in: Rebuild.
2670
eabc84f4
RM
26712012-06-22 Roland McGrath <mcgrathr@google.com>
2672
2673 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2674
370e30b6
RÁE
26752012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2676
2677 * plugin.cc (Plugin::load): Handle position independent executables.
2678
fb1b895d
CC
26792012-06-06 Cary Coutant <ccoutant@google.com>
2680
2681 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2682 add .debug_macro.
2683 (lines_only_debug_sections): Likewise.
2684 (gdb_fast_lookup_sections): New static array.
2685 (is_gdb_debug_section): Rename formal parameter.
2686 (is_lines_only_debug_section): Likewise.
2687 (is_gdb_fast_lookup_section): New function.
2688 (Layout::include_section): Check for ".zdebug_" prefix; pass
2689 section name suffix to is_gdb_debug_section, et al.; check for
2690 fast-lookup sections when building .gdb_index.
2691 * options.h (--strip-debug-gdb): Update GDB version number.
2692
7c0640fa
CC
26932012-06-06 Cary Coutant <ccoutant@google.com>
2694
2695 * configure.ac: Add check for fallocate.
2696 * configure: Regenerate.
2697 * config.in: Regenerate.
2698
2699 * options.h (class General_options): Add --mmap-output-file and
2700 --posix-fallocate options.
2701 * output.cc: (posix_fallocate): Remove; replace with...
2702 (gold_fallocate): New function.
2703 (Output_file::map_no_anonymous): Call gold_fallocate.
2704 (Output_file::map): Check --mmap-output-file option.
2705
2a49eb69
DK
27062012-06-05 Jing Yu <jingyu@google.com>
2707
2708 * gold.h (textdomain): Add do {} to empty while(0).
2709 (bindtextdomain): Likewise.
2710
fad072ac
CC
27112012-06-04 Cary Coutant <ccoutant@google.com>
2712
2713 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2714 has_dynsym_index.
2715
8cc69fb6
ST
27162012-05-25 Sriraman Tallam <tmsriram@google.com>
2717
2718 * symtab.cc (Symbol_table::define_special_symbol):
2719 Initialize *poldsym to prevent uninitialized variable errors.
2720
1be75daa
CC
27212012-05-23 Cary Coutant <ccoutant@google.com>
2722
2723 * layout.cc (Layout::section_name_mapping): Add rules to handle
2724 exact match on .data.rel.ro.local or .data.rel.ro.
2725 (Layout::output_section_name): Check for exact matches.
2726
9b689de0
CC
27272012-05-23 Cary Coutant <ccoutant@google.com>
2728
2729 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2730 more carefully.
2731
b24fdbf5
CC
27322012-05-22 Cary Coutant <ccoutant@google.com>
2733
2734 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2735 object before exporting symbol.
2736
e550e1a2
L
27372012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2738
2739 * testsuite/tls_test.cc: Include "config.h" first.
2740 * testsuite/tls_test_c.c: Likewise.
2741
df7b86aa
NC
27422012-05-17 Daniel Richard G. <skunk@iskunk.org>
2743 Nick Clifton <nickc@redhat.com>
2744
2745 PR 14072
2746 * configure.in: Add check that sysdep.h has been included before
2747 any system header files.
2748 * configure: Regenerate.
2749 * config.in: Regenerate.
2750
1007b503
CC
27512012-05-14 Cary Coutant <ccoutant@google.com>
2752
2753 * layout.cc (Layout::make_output_section): Mark .tdata section
2754 as RELRO.
2755 * testsuite/relro_test.cc: Add a TLS variable.
2756
fd885f3a
L
27572012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2758
2759 PR gold/14091
2760 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2761 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2762 R_X86_64_64.
2763
80f5885c
CC
27642012-05-08 Cary Coutant <ccoutant@google.com>
2765
2766 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2767 (lines_only_debug_sections): Likewise.
2768
2e702c99
RM
27692012-05-02 Roland McGrath <mcgrathr@google.com>
2770
2771 * nacl.cc: New file.
2772 * nacl.h: New file.
2773 * Makefile.am (CCFILES, HFILES): Add them.
2774 * Makefile.in: Regenerate.
2775 * i386.cc (Output_data_plt_i386_nacl): New class.
2776 (Output_data_plt_i386_nacl_exec): New class.
2777 (Output_data_plt_i386_nacl_dyn): New class.
2778 (Target_i386_nacl): New class.
2779 (Target_selector_i386_nacl): New class.
2780 (target_selector_i386): Use it instead of Target_selector_i386.
2781 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
2782 (Target_x86_64_nacl): New class.
2783 (Target_selector_x86_64_nacl): New class.
2784 (target_selector_x86_64, target_selector_x32): Use it instead of
2785 Target_selector_x86_64.
2786 * arm.cc (Output_data_plt_arm_nacl): New class.
2787 (Target_arm_nacl): New class.
2788 (Target_selector_arm_nacl): New class.
2789 (target_selector_arm, target_selector_armbe): Use it instead of
2790 Target_selector_arm.
2791
2792 * target-select.cc (select_target): Take new Input_file* and off_t
2793 arguments, pass them on to recognize method of selector.
2794 * object.cc (make_elf_sized_object): Update caller.
2795 * parameters.cc (parameters_force_valid_target): Likewise.
2796 * incremental.cc (make_sized_incremental_binary): Likewise.
2797 * target-select.h: Update decl.
2798 (Target_selector::recognize): Take new Input_file* argument,
2799 pass it on to do_recognize.
2800 (Target_selector::do_recognize): Take new Input_file* argument.
2801 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
2802 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
2803 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
2804 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
2805
2806 * target.h (Target::Target_info): New members isolate_execinstr
2807 and rosegment_gap.
2808 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
2809 * arm.cc (Target_arm::arm_info): Update initializer.
2810 * i386.cc (Target_i386::i386_info): Likewise.
2811 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
2812 * sparc.cc (Target_sparc::sparc_info): Likewise.
2813 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2814 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2815 * layout.cc (Layout::attach_allocated_section_to_segment):
2816 Take new const Target* argument. If target->isolate_execinstr(), act
2817 like --rosegment.
2818 (Layout::find_first_load_seg): Take new const Target* argument;
2819 if target->isolate_execinstr(), reject PF_X segments.
2820 (Layout::relaxation_loop_body): Update caller.
2821 (Layout::set_segment_offsets): If target->isolate_execinstr(),
2822 reset file offset to zero when we hit LOAD_SEG, and then do a second
2823 loop over the segments before LOAD_SEG to reassign offsets after
2824 addresses have been determined. Handle target->rosegment_gap().
2825 (Layout::attach_section_to_segment): Take new const Target* argument;
2826 pass it to attach_allocated_section_to_segment.
2827 (Layout::make_output_section): Update caller.
2828 (Layout::attach_sections_to_segments): Take new const Target* argument;
2829 pass it to attach_section_to_segment.
2830 * gold.cc (queue_middle_tasks): Update caller.
2831 * layout.h (Layout): Update method decls with new arguments.
2832
2833 * arm.cc (Target_arm::Target_arm): Take optional argument for the
2834 Target_info pointer to use.
2835 (Target_arm::do_make_data_plt): New virtual method.
2836 (Target_arm::make_data_plt): New method that calls it.
2837 (Target_arm::make_plt_entry): Use it.
2838 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
2839 for the section alignment.
2840 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
2841 method.
2842 (Output_data_plt_arm::first_plt_entry_offset): Call it.
2843 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
2844 method.
2845 (Output_data_plt_arm::get_plt_entry_size): Call it.
2846 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
2847 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
2848 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
2849 method.
2850 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
2851 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
2852 method instead of sizeof(plt_entry).
2853 (Output_data_plt_arm::add_entry): Likewise.
2854 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
2855 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
2856 than static method.
2857 (Target_arm::plt_entry_size): Likewise.
2858 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
2859 Move to ...
2860 (Output_data_plt_arm_standard): ... here, new class.
2861 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
2862 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
2863 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
2864
2865 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2866 Take additional argument for the PLT entry size.
2867 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
2868 Use get_plt_entry_size method rather than plt_entry_size variable.
2869 (Output_data_plt_x86_64::reserve_slot): Likewise.
2870 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
2871 (Output_data_plt_x86_64::add_entry): Likewise.
2872 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
2873 (Output_data_plt_x86_64::address_for_global): Likewise.
2874 (Output_data_plt_x86_64::address_for_local): Likewise.
2875 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2876 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
2877 Make method non-static.
2878 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
2879 method.
2880 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
2881 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
2882 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
2883 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
2884 virtual method.
2885 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
2886 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
2887 virtual method.
2888 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
2889 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
2890 virtual method.
2891 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
2892 (Output_data_plt_x86_64::plt_entry_size)
2893 (Output_data_plt_x86_64::first_plt_entry)
2894 (Output_data_plt_x86_64::plt_entry)
2895 (Output_data_plt_x86_64::tlsdesc_plt_entry)
2896 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
2897 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
2898 (Output_data_plt_x86_64_standard): ... here, new class.
2899 (Target_x86_64::Target_x86_64): Take optional argument for the
2900 Target_info pointer to use.
2901 (Target_x86_64::do_make_data_plt): New virtual method.
2902 (Target_x86_64::make_data_plt): New method to call it.
2903 (Target_x86_64::init_got_plt_for_update): Use that.
2904 Call this->plt_->add_eh_frame method here.
2905 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
2906 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
2907 rather than static method.
2908 (Target_x86_64::plt_entry_size): Likewise.
2909 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
2910 rather than plt_entry_size variable. Move guts of PLT filling to...
2911 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
2912 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
2913 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
2914
2915 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
2916 additional argument for the section alignment.
2917 Don't do add_eh_frame_for_plt here.
2918 (Output_data_plt_i386::first_plt_entry_offset): Make the method
2919 non-static. Use get_plt_entry_size method rather than plt_entry_size
2920 variable.
2921 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
2922 method.
2923 (Output_data_plt_i386::get_plt_entry_size): Call it.
2924 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
2925 (Output_data_plt_i386::add_eh_frame): New method to call it.
2926 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
2927 method.
2928 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
2929 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
2930 method.
2931 (Output_data_plt_i386::fill_plt_entry): New method to call it.
2932 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
2933 method instead of plt_entry_size.
2934 (Output_data_plt_i386::plt_entry_size)
2935 (Output_data_plt_i386::plt_eh_frame_fde_size)
2936 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
2937 (Output_data_plt_i386_standard): ... here, new class.
2938 (Output_data_plt_i386_exec): New class.
2939 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
2940 (Output_data_plt_i386_exec::first_plt_entry): ... here.
2941 (Output_data_plt_i386::exec_plt_entry): Move to ...
2942 (Output_data_plt_i386_exec::plt_entry): ... here.
2943 (Output_data_plt_i386_dyn): New class.
2944 (Output_data_plt_i386::first_plt_entry): Move to ...
2945 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
2946 (Output_data_plt_i386::dyn_plt_entry): Move to ...
2947 (Output_data_plt_i386_dyn::plt_entry): ... here.
2948 (Target_i386::Target_i386): Take optional argument for the Target_info
2949 pointer to use.
2950 (Target_i386::do_make_data_plt): New virtual method.
2951 (Target_i386::make_data_plt): New method to call it.
2952 (Target_i386::make_plt_section): Use that.
2953 Call this->plt_->add_eh_frame method here.
2954 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
2955 rather than plt_entry_size variable.
2956 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
2957 (Output_data_plt_i386::address_for_local): Likewise.
2958 (Output_data_plt_i386::do_write): Likewise.
2959 Move guts of PLT filling to...
2960 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
2961 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
2962 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
2963 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
2964
b9b9f2ee
CC
29652012-05-01 Cary Coutant <ccoutant@google.com>
2966
2967 * dwarf_reader.cc (Dwarf_die::read_attributes)
2968 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
2969 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
2970 * reduced_debug_output.cc
2971 (Output_reduced_debug_info_section::get_die_end): Remove
2972 DW_FORM_GNU_ref_index. Add default case.
2973
57923f48
MW
29742012-04-26 Mark Wielaard <mjw@redhat.com>
2975
2976 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2977 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2978 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2979 DW_AT_high_pc as offset from DW_AT_low_pc.
2980
2981 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2982 * testsuite/Makefile.in: Regenerate.
2983 * testsuite/gdb_index_test_3.c: New test source file.
2984 * testsuite/gdb_index_test_3.sh: New test source file.
2985
2c54b4f4
ILT
29862012-04-25 Ian Lance Taylor <iant@google.com>
2987
2988 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2989 pointer.
2990 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2991 as a class, not a struct.
2992 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2993 (Target_arm::apply_cortex_a8_workaround): Likewise.
2994 * gc.h: Declare Reloc_types as a struct, not a class.
2995 * object.h: Declare Symbols_data as a struct.
2996 * reloc.h: Declare Read_relocs_data as a struct.
2997 * target.h: Declare Relocate_info as a struct.
2998
a5a5f7a3
DM
29992012-04-24 David S. Miller <davem@davemloft.net>
3000
3001 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3002 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3003 and R_SPARC_WPLT30.
3004
f038d496
CC
30052012-04-24 Cary Coutant <ccoutant@google.com>
3006
3007 * incremental-dump.cc (find_input_containing_global): Replace
3008 magic number with symbolic constant.
3009 (dump_incremental_inputs): Update version number.
3010 * incremental.cc (Output_section_incremental_inputs): Update version
3011 number; import symbolic constants from Incremental_inputs_reader.
3012 (Incremental_inputs::create_data_sections): Align relocations
3013 section correctly for 64-bit targets.
3014 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3015 constants; add padding.
3016 (Output_section_incremental_inputs::write_header): Add assert for
3017 header_size.
3018 (Output_section_incremental_inputs::write_input_files): Add assert
3019 for input_entry_size.
3020 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3021 add assert for object_info_size, input_section_entry_size,
3022 global_sym_entry_size.
3023 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3024 for data structure sizes; use them.
3025 (Incremental_input_entry_reader): Import symbolic constants from
3026 Incremental_inputs_reader; use them.
3027
a4d85145
DM
30282012-04-23 David S. Miller <davem@davemloft.net>
3029
3030 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3031 and elf_flags_set_.
3032 (Target_sparc::Target_sparc): Initialize new fields.
3033 (Target_sparc::do_make_elf_object): New function.
3034 (Target_sparc::do_adjust_elf_header): New function.
3035
1d509098
CC
30362012-04-23 Cary Coutant <ccoutant@google.com>
3037
3038 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3039 CU range table of gdb index.
3040
7ebeff7f
DM
30412012-04-20 David S. Miller <davem@davemloft.net>
3042
3043 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3044 instead of false.
3045
13cf9988
DM
30462012-04-16 David S. Miller <davem@davemloft.net>
3047
2a1079e8
DM
3048 * sparc.cc (Target_sparc::got_address): New function.
3049 (Sparc_relocate_functions::gdop_hix22): New function.
3050 (Sparc_relocate_functions::gdop_lox10): New function.
3051 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3052 relocs.
3053 (Target_sparc::Scan::local): Likewise if the global symbol is not
3054 preemptible and is not IFUNC.
3055 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3056 transformations for local and non-preemptible non-IFUNC global
3057 symbols.
3058
0bc964fc
DM
3059 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3060 writing out 64-bit part of ranges.
3061
661d7a80
DM
3062 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3063 -fpic and -fpie respectively.
3064 * Makefile.in: Regenerate.
3065
8c2bf391
DM
3066 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3067 (Target_sparc::Target_sparc): Initialize new field.
3068 (Target_sparc::do_plt_section_for_global): New function.
3069 (Target_sparc::do_plt_section_for_local): New function.
3070 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3071 (Target_sparc::make_plt_section): New function, broken out of
3072 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3073 (Target_sparc::make_plt_entry): Call make_plt_section.
3074 (Target_sparc::make_local_ifunc_plt_entry): New function.
3075 (Target_sparc::rela_ifunc_section): New function.
3076 (Target_sparc::plt_section): Remove const.
3077 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3078 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3079 and ifunc_count_ fields.
3080 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3081 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3082 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3083 (Output_data_plt_sparc::rela_ifunc): New function.
3084 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3085 (Output_data_plt_sparc::has_ifunc_section): New function.
3086 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3087 (Output_data_plt_sparc::address_for_global): New function.
3088 (Output_data_plt_sparc::address_for_local): New function.
3089 (Output_data_plt_sparc::plt_index_to_offset): New function.
3090 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3091 and entry_count.
3092 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3093 entry_count.
3094 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3095 R_SPARC_JMP_IREL to switch.
3096 (Target_sparc::Scan::check_non_pic): Likewise.
3097 (Target_sparc::Scan::local): Handle IFUNC symbols.
3098 (Target_sparc::Scan::local): Likewise.
3099 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3100 and plt_address_for_local.
3101 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3102 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3103
13cf9988
DM
3104 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3105 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3106 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3107 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3108 global relocs too.
3109 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3110 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3111 calls.
3112 * sparc.cc (Target_sparc::Scan::global): Likewise.
3113 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3114
31821be0
CC
31152012-04-16 Cary Coutant <ccoutant@google.com>
3116
3117 * archive.cc (Library_base::should_include_member): Check for
3118 --export-dynamic-symbol.
3119 * options.h (class General_options): Add --export-dynamic-symbol.
3120 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3121 --export-dynamic-symbol.
3122 (Symbol_table::gc_mark_undef_symbols): Likewise.
3123 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3124
2615994e
DM
31252012-04-12 David S. Miller <davem@davemloft.net>
3126
3127 * sparc.cc (Reloc::wdisp10): New relocation method.
3128 (Reloc::h34): Likewise.
3129 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3130 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3131 R_SPARC_WDISP10.
3132 (Target_sparc::Scan::local): Likewise.
3133 (Target_sparc::Scan::global): Likewise.
3134 (Target_sparc::Relocate::relocate): Likewise.
3135
6782735d
CC
31362012-04-09 Cary Coutant <ccoutant@google.com>
3137
3138 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3139 low_pc == 0.
3140
8c7a0b00
ILT
31412012-04-06 Ian Lance Taylor <iant@google.com>
3142
3143 * timer.cc: #include <unistd.h>.
3144
58797674
RM
31452012-04-06 Roland McGrath <mcgrathr@google.com>
3146
3147 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3148 * config.in: Regenerate.
3149 * configure: Regenerate.
3150
44350750
NC
31512012-04-05 Nick Clifton <nickc@redhat.com>
3152
3153 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3154 (AM_LC_MESSAGES): Add.
3155 * aclocal.m4: Regenerate.
3156 * config.in: Regenerate.
3157 * configure: Regenerate.
3158
c1027032
CC
31592012-03-21 Cary Coutant <ccoutant@google.com>
3160
3161 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3162 * Makefile.in: Regenerate.
3163 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3164 (Sized_elf_reloc_mapper::symbol_section): New function.
3165 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3166 (make_elf_reloc_mapper): New function.
3167 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3168 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3169 (Dwarf_abbrev_table::do_get_abbrev): New function.
3170 (Dwarf_ranges_table::read_ranges_table): New function.
3171 (Dwarf_ranges_table::read_range_list): New function.
3172 (Dwarf_pubnames_table::read_section): New function.
3173 (Dwarf_pubnames_table::read_header): New function.
3174 (Dwarf_pubnames_table::next_name): New function.
3175 (Dwarf_die::Dwarf_die): New function.
3176 (Dwarf_die::read_attributes): New function.
3177 (Dwarf_die::skip_attributes): New function.
3178 (Dwarf_die::set_name): New function.
3179 (Dwarf_die::set_linkage_name): New function.
3180 (Dwarf_die::attribute): New function.
3181 (Dwarf_die::string_attribute): New function.
3182 (Dwarf_die::int_attribute): New function.
3183 (Dwarf_die::uint_attribute): New function.
3184 (Dwarf_die::ref_attribute): New function.
3185 (Dwarf_die::child_offset): New function.
3186 (Dwarf_die::sibling_offset): New function.
3187 (Dwarf_info_reader::check_buffer): New function.
3188 (Dwarf_info_reader::parse): New function.
3189 (Dwarf_info_reader::do_parse): New function.
3190 (Dwarf_info_reader::do_read_string_table): New function.
3191 (Dwarf_info_reader::lookup_reloc): New function.
3192 (Dwarf_info_reader::get_string): New function.
3193 (Dwarf_info_reader::visit_compilation_unit): New function.
3194 (Dwarf_info_reader::visit_type_unit): New function.
3195 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3196 Sized_elf_reloc_mapper.
3197 (Sized_dwarf_line_info::symbol_section): Remove function.
3198 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3199 (Sized_dwarf_line_info::read_line_mappings): Remove object
3200 parameter, adjust callers.
3201 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3202 * dwarf_reader.h: Include <sys/types.h>.
3203 (class Track_relocs): Remove forward declaration.
3204 (class Elf_reloc_mapper): New class.
3205 (class Sized_elf_reloc_mapper): New class.
3206 (class Dwarf_abbrev_table): New class.
3207 (class Dwarf_range_list): New class.
3208 (class Dwarf_ranges_table): New class.
3209 (class Dwarf_pubnames_table): New class.
3210 (class Dwarf_die): New class.
3211 (class Dwarf_info_reader): New class.
3212 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3213 (Sized_dwarf_line_info::symbol_section): Remove member function.
3214 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3215 base class.
3216 * gdb-index.cc: New source file.
3217 * gdb-index.h: New source file.
3218 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3219 and .debug_types sections, call Layout::add_to_gdb_index.
3220 (Sized_relobj_incr::do_section_name): Implement.
3221 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3222 return type; Implement.
3223 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3224 return type.
3225 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3226 parameter list and return type.
3227 (Sized_incr_dynobj::do_section_contents): Likewise.
3228 * layout.cc: Include gdb-index.h.
3229 (Layout::Layout): Initialize gdb_index_data_.
3230 (Layout::init_fixed_output_section): Check for .gdb_index section.
3231 (Layout::add_to_gdb_index): New function. Instantiate.
3232 * layout.h: Add forward declaration for class Gdb_index.
3233 (Layout::add_to_gdb_index): New member function.
3234 (Layout::gdb_index_data_): New data member.
3235 * main.cc: Include gdb-index.h.
3236 (main): Print statistics for gdb index.
3237 * object.cc (Object::section_contents): Move code into
3238 do_section_contents.
3239 (need_decompressed_section): Check for sections needed when building
3240 gdb index.
3241 (build_compressed_section_map): Likewise.
3242 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3243 gdb index.
3244 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3245 sections; call Layout::add_to_gdb_index.
3246 (Sized_relobj_file::do_decompressed_section_contents): Call
3247 do_section_contents directly.
3248 * object.h (Object::do_section_contents): Adjust parameter list and
3249 return type.
3250 (Object::do_decompressed_section_contents): Call do_section_contents
3251 directly.
3252 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3253 return type.
3254 * options.h (class General_options): Add --gdb-index option.
3255 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3256 list and return type.
3257 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3258 * reloc.h (Track_relocs::checkpoint): New function.
3259 (Track_relocs::reset): New function.
3260
3261 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3262 New test cases.
3263 * testsuite/Makefile.in: Regenerate.
3264 * testsuite/gdb_index_test.cc: New test source file.
3265 * testsuite/gdb_index_test_1.sh: New test source file.
3266 * testsuite/gdb_index_test_2.sh: New test source file.
3267
647f1574
DK
32682012-03-19 Doug Kwan <dougkwan@google.com>
3269
3270 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3271 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3272 __exidx_start and __exidx_end. Make symbol table parameter
3273 anonymous as it is not used.
3274 * gold.cc (queue_middle_tasks): Call target hook to define any
3275 target-specific symbols.
3276 * target.h (Target::define_standard_symbols): New method.
3277 (Target::do_define_standard_symbols): Same.
3278 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3279 * testsuite/Makefile.in: Regenerate.
3280 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3281 and __exidx_end.
3282 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3283 relocations are generated for __exidx_start and __exidx_end.
3284
7c6109da
DK
32852012-03-16 Doug Kwan <dougkwan@google.com>
3286
3287 * testsuite/Makefile.am: Disable test initpri3b.
3288 * testsuite/Makefile.in: Regenerate.
3289
7b8957f8
DK
32902012-03-15 Doug Kwan <dougkwan@google.com>
3291
3292 * arm.cc (Target_arm::got_section): Make .got section read-only
3293 if -z now is given.
3294
14dc9ef7
ILT
32952012-03-15 Ian Lance Taylor <iant@google.com>
3296
3297 PR gold/13850
3298 * layout.cc (Layout::make_output_section): Correctly mark
3299 SHT_INIT_ARRAY, et. al., as relro.
3300
fa40b62a
DK
33012012-03-14 Doug Kwan <dougkwan@google.com>
3302
3303 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3304 dynamic relocations for protected symbols in shared objects.
3305
fd325007
ILT
33062012-03-13 Ian Lance Taylor <iant@google.com>
3307
3308 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3309 keep the larger alignment.
3310
e8dd54e1
CC
33112012-03-12 Cary Coutant <ccoutant@google.com>
3312
3313 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3314 handling of DW_LNE_define_file.
3315
feb5f3b0
CC
33162012-03-12 Cary Coutant <ccoutant@google.com>
3317
3318 * reduced_debug_output.cc
3319 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3320 codes to switch.
3321
a1fb4256
CC
33222012-02-29 Cary Coutant <ccoutant@google.com>
3323
3324 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3325
5dd8762a
CC
33262012-02-29 Cary Coutant <ccoutant@google.com>
3327
3328 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3329 Call Object::decompressed_section_contents.
3330 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3331 New dtor.
3332 (Sized_dwarf_line_info::buffer_start_): New data member.
3333 * merge.cc (Output_merge_data::do_add_input_section): Call
3334 Object::decompressed_section_contents.
3335 (Output_merge_string::do_add_input_section): Likewise.
3336 * object.cc (need_decompressed_section): New function.
3337 (build_compressed_section_map): Decompress sections needed later.
3338 (Sized_relobj_file::do_decompressed_section_contents): New function.
3339 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3340 * object.h (Object::decompressed_section_contents): New function.
3341 (Object::discard_decompressed_sections): New function.
3342 (Object::do_decompressed_section_contents): New function.
3343 (Object::do_discard_decompressed_sections): New function.
3344 (Compressed_section_info): New type.
3345 (Compressed_section_map): Include decompressed section contents.
3346 (Sized_relobj_file::do_decompressed_section_contents): New function.
3347 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3348
7b5de7ee
CC
33492012-02-16 Cary Coutant <ccoutant@google.com>
3350
3351 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3352 * testsuite/Makefile.in: Regenerate.
3353
f9fa4a63
CC
33542012-02-14 Cary Coutant <ccoutant@google.com>
3355
3356 * options.cc (General_options::finalize): Disallow -pie and -static.
3357
2c175ebc
DK
33582012-02-03 Doug Kwan <dougkwan@google.com>
3359
3360 * arm.cc (Arm_relocate_functions::abs8,
3361 Arm_relocate_functions::abs16): Use
3362 Bits::has_signed_unsigned_overflow32.
3363 (Arm_relocate_functions::thm_abs8): Correct range of
3364 overflow check.
3365 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3366 in assertions.
3367
90cff06f
DK
33682012-02-02 Doug Kwan <dougkwan@google.com>
3369
3370 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3371 position independent outputs, not just shared objects.
3372
63887f3d
L
33732012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3374
3375 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3376 * configure: Regenerated.
3377
bef2b434
ILT
33782012-01-27 Ian Lance Taylor <iant@google.com>
3379
3380 * reloc.h (Bits): New class with static functions, copied from
3381 namespace utils in arm.cc.
3382 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3383 instead.
3384
c335b55d
L
33852012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3386
3387 * incremental.cc (write_info_blocks): Correct relocation offset.
3388
41194d9f
L
33892012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3390
3391 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3392 (Relocate::tls_gd_to_le): Likewise.
3393
1bae613c
L
33942012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3395
3396 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3397
24482ca0
L
33982012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3399
3400 * configure.ac: Check if -mcmodel=medium works.
3401 * configure: Regenerated.
3402
c2c7840a
CC
34032012-01-24 Cary Coutant <ccoutant@google.com>
3404
3405 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3406 definition and ...
3407 (read_unsigned_LEB_128_x): ... this new function.
3408 (read_signed_LEB_128): Replaced with inline definition and ...
3409 (read_signed_LEB_128_x): ... this new function.
3410 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3411 (read_unsigned_LEB_128): Add inline definition.
3412 (read_signed_LEB_128_x): New function.
3413 (read_signed_LEB_128): Add inline definition.
3414 * testsuite/Makefile.am (leb128_unittest): New unit test.
3415 * testsuite/Makefile.in: Regenerate.
3416 * testsuite/leb128_unittest.cc: New unit test.
3417
833de760 34182012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3419
3420 PR gold/13617
3421 * i386.cc (Target_i386::do_code_fill): When using a jmp
3422 instruction, pad with nop instructions.
3423 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3424
618d6666
L
34252012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3426
3427 * x86_64.cc (gc_process_relocs): Add typename on types used in
3428 template.
3429 (scan_relocs): Likewise.
3430 (relocate_section): Likewise.
3431 (apply_relocation): Likewise.
3432
3660ff06
L
34332012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3434
3435 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3436 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3437 under x32.
3438
fc51264f
L
34392012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3440
3441 * x86_64.cc: Initial support for x32.
3442
dd74ae06
CC
34432012-01-03 Cary Coutant <ccoutant@google.com>
3444
3445 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3446 Use abstract base class for GOT.
3447 * gold/output.h (class Output_data_got_base): New abstract base class.
3448 (class Output_data_got): Derive from new base class, adjust ctors.
3449 (Output_data_got::reserve_slot): Make virtual; rename to
3450 do_reserve_slot; Adjust callers.
3451 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3452 pointer to abstract base class.
3453 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3454
83896202
ILT
34552011-12-18 Ian Lance Taylor <iant@google.com>
3456
3457 * object.h (Relobj::local_symbol_value): New function.
3458 (Relobj::local_plt_offset): New function.
3459 (Relobj::local_has_got_offset): New function.
3460 (Relobj::local_got_offset): New function.
3461 (Relobj::set_local_got_offset): New function.
3462 (Relobj::do_local_symbol_value): New pure virtual function.
3463 (Relobj::do_local_plt_offset): Likewise.
3464 (Relobj::do_local_has_got_offset): Likewise.
3465 (Relobj::do_local_got_offset): Likewise.
3466 (Relobj::do_set_local_got_offset): Likewise.
3467 (Sized_relobj::do_local_has_got_offset): Rename from
3468 local_has_got_offset.
3469 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3470 (Sized_relobj::do_set_local_got_offset): Rename from
3471 set_local_got_offset.
3472 (Sized_relobj_file::do_local_plt_offset): Rename from
3473 local_plt_offset.
3474 (Sized_relobj_file::do_local_symbol_value): New function.
3475 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3476 local_plt_offset.
3477 * output.cc (Output_data_got::Got_entry::write): Change object to
3478 Relobj. Use local_symbol_value.
3479 (Output_data_got::add_global_with_rel): Change rel_dyn to
3480 Output_data_reloc_generic*. Use add_global_generic.
3481 (Output_data_got::add_global_with_rela): Remove. Change all
3482 callers to use add_global_with_rel.
3483 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3484 Output_data_reloc_generic*. Use add_global_generic.
3485 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3486 callers to use add_global_pair_with_rel.
3487 (Output_data_got::add_local): Change object to Relobj*.
3488 (Output_data_got::add_local_plt): Likewise.
3489 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3490 change rel_dyn to Output_data_reloc_generic*. Use
3491 add_local_generic.
3492 (Output_data_got::add_local_with_rela): Remove. Change all
3493 callers to use all_local_with_rel.
3494 (Output_data_got::add_local_pair_with_rel): Change object to
3495 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3496 add_output_section_generic.
3497 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3498 callers to use add_local_pair_with_rel.
3499 (Output_data_got::reserve_local): Change object to Relobj*.
3500 * output.h: (class Output_data_reloc_generic): Add pure virtual
3501 declarations for add_global_generic, add_local_generic,
3502 add_output_section_generic.
3503 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3504 functions for Output_data_reloc_generic. Update declarations for
3505 changes listed in output.cc.
3506 (class Output_data_got): Change template parameter to got_size.
3507 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3508 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3509 function.
3510 (Sized_relobj_incr::do_local_plt_offset): New function.
3511 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3512 add_global_generic.
3513
76677ad0
CC
35142011-12-17 Cary Coutant <ccoutant@google.com>
3515
3516 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3517 * resolve.cc (Symbol_table::resolve): Likewise.
3518 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3519 arrays.
3520 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3521
8b8dd8d5
ILT
35222011-12-16 Ian Lance Taylor <iant@google.com>
3523
3524 * output.h (Output_data_reloc_generic::add): Only call
3525 add_dynamic_reloc if this is a dynamic reloc section.
3526
d55525b9
L
35272011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3528
3529 PR gold/13505
3530 * target-reloc.h (apply_relocation): Replace <64, false> with
3531 <size, big_endian>.
3532
ff81c7c1
NC
35332011-11-25 Nick Clifton <nickc@redhat.com>
3534
3535 * po/it.po: New Italian translation.
3536
628f39be
SA
35372011-11-17 Sterling Augustine <saugustine@google.com>
3538
3539 * script.cc (script_include_directive): Implement.
3540 (read_script_file): New local variables name and search_path. Update
3541 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3542 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3543 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3544
98ef3ea4
SA
35452011-11-11 Sterling Augustine <saugustine@google.com>
3546
3547 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3548 (file_or_sections_cmd): Likewise.
3549
f4a8b6d7
DK
35502011-11-11 Doug Kwan <dougkwan@google.com>
3551
3552 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3553 if --just-symbols is given.
3554
29ab395d
DK
35552011-11-10 Doug Kwan <dougkwan@google.com>
3556
3557 PR gold/13362
3558 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3559 when processing data relocs.
3560 * reloc.h (Relocate_functions::rel_unaligned): New method.
3561 (Relocate_functions::pcrel_unaligned): Ditto.
3562 (Relocate_functions::rel32_unaligned): Ditto.
3563 (Relocate_functions::pcrel32_unaligned): Ditto.
3564
2c339f71
DK
35652011-11-09 Doug Kwan <dougkwan@google.com>
3566
3567 PR gold/13362
3568 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3569 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3570 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3571 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3572 (Relocate_functions::rel_unaligned): New.
3573 (Relocate_functions::rel32_unaligned): New.
3574 * target-reloc.h (relocate_for_relocatable): Add code to handle
3575 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3576 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3577 arm_unaligned_reloc_r): New targets.
3578 * testsuite/Makefile.in: Regenerate.
3579 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3580 linking.
3581
3f3cddf1
ILT
35822011-11-02 Ian Lance Taylor <iant@google.com>
3583
3584 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3585 NATIVE_LINKER.
3586 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3587 * options.cc (General_options::finalize): Use library search path
3588 from configure script if specified. If not native and no sysroot,
3589 only search TOOLLIBDIR.
3590 * options.h (Search_directory::Search_directory): Change name to
3591 const std::string&.
3592 (General_options::add_to_library_path_with_sysroot): Change arg to
3593 const std::string&.
3594 * configure, Makefile.in, config.in: Rebuild.
3595
a8e2273b
ILT
35962011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3597
3598 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3599 we are working around the ARM1176 Erratum.
3600 * options.h (General_options::fix_arm1176): Add option.
3601 * testsuite/Makefile.am: Add testcases, and keep current ones
3602 working.
3603 * testsuite/Makefile.in: Regenerate.
3604 * testsuite/arm_fix_1176.s: New file.
3605 * testsuite/arm_fix_1176.sh: Likewise.
3606
cd6eab1c
ILT
36072011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3608
3609 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3610 may_use_blx_.
3611 (Target_arm::may_use_blx): Remove method.
3612 (Target_arm::set_may_use_blx): Likewise.
3613 (Target_arm::may_use_v4t_interworking): New method.
3614 (Target_arm::may_use_v5t_interworking): Likewise.
3615 (Target_arm::may_use_blx_): Remove member variable.
3616 (Arm_relocate_functions::arm_branch_common): Check for v5T
3617 interworking.
3618 (Arm_relocate_functions::thumb_branch_common): Likewise.
3619 (Reloc_stub::stub_type_for_reloc): Likewise.
3620 (Target_arm::do_finalize_sections): Correct interworking checks.
3621 * testsuite/Makefile.am: Add new tests.
3622 * testsuite/Makefile.in: Regenerate.
3623 * testsuite/arm_farcall_arm_arm.s: New test.
3624 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3625 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3626 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3627 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3628 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3629 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3630 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3631
286adcf4
CC
36322011-10-31 Cary Coutant <ccoutant@google.com>
3633
3634 PR gold/13023
3635 * expression.cc (Expression::eval_with_dot): Add
3636 is_section_dot_assignment parameter.
3637 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3638 absolute and assigning to dot within a section.
3639 * script-sections.cc
3640 (Output_section_element_assignment::set_section_addresses): Pass
3641 dot_section to set_if_absolute.
3642 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3643 as is_section_dot_assignment flag to eval_with_dot.
3644 (Output_section_element_dot_assignment::set_section_addresses):
3645 Likewise.
3646 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3647 parameter. Also set value if relative to dot_section; set the
3648 symbol's output_section.
3649 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3650 parameter. Adjust all callers.
3651 (Expression::eval_maybe_dot): Likewise.
3652 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3653 Adjust all callers.
3654 * testsuite/script_test_2.t: Test assignment of an absolute value
3655 to dot within an output section element.
3656
9634ed06
CC
36572011-10-31 Cary Coutant <ccoutant@google.com>
3658
3659 * options.h (class General_options): Add --[no-]gnu-unique options.
3660 * symtab.cc (Symbol_table::sized_write_globals): Convert
3661 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3662
de4101c7
CC
36632011-10-31 Cary Coutant <ccoutant@google.com>
3664
3665 PR gold/13359
3666 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3667 unnecessary assertion.
3668 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3669
7257cc92
ST
36702011-10-31 Sriraman Tallam <tmsriram@google.com>
3671
3672 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3673 gc_mark_symbol.
3674 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3675 gc_mark_symbol.
3676 Change to just keep the section associated with symbol.
3677 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3678 they are externally visible and --export-dynamic is turned on.
3679 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3680
bfc34b3f
ILT
36812011-10-19 Ian Lance Taylor <iant@google.com>
3682
3683 PR gold/13163
3684 * script-sections.cc
3685 (Output_section_element_dot_assignment::needs_output_section): New
3686 function.
3687
ea0d8c47
ILT
36882011-10-19 Ian Lance Taylor <iant@google.com>
3689
3690 PR gold/13204
3691 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3692 --section-start option was seen.
3693 * options.h (General_options::any_section_start): New function.
3694
abd242a9
DM
36952011-10-18 David S. Miller <davem@davemloft.net>
3696
3697 PR binutils/13301
3698 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3699 member to track relocation locations that have moved during TLS
3700 reloc optimizations.
3701 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3702 (Target_sparc::Relocate::relocate): Adjust view down by 4
3703 bytes if it matches reloc_adjust_addr_.
3704 (Target_sparc::Relocate::relocate_tls): Always move the
3705 __tls_get_addr call delay slot instruction forward 4 bytes when
3706 performing relaxation.
3707
bab9090f
CC
37082011-10-18 Cary Coutant <ccoutant@google.com>
3709
3710 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3711 (Output_file::map_no_anonymous): Check for non-zero
3712 return code from posix_fallocate.
3713
f7c5b166
CC
37142011-10-17 Cary Coutant <ccoutant@google.com>
3715
3716 PR gold/13245
3717 * plugin.cc (is_visible_from_outside): Check for symbols
3718 referenced from dynamic objects.
3719 * resolve.cc (Symbol_table::resolve): Don't count references
3720 from dynamic objects as references from real ELF files.
3721 * testsuite/plugin_test_2.sh: Adjust expected result.
3722
b490c0bb
CC
37232011-10-17 Cary Coutant <ccoutant@google.com>
3724
3725 * gold.cc: Include timer.h.
3726 (queue_middle_tasks): Stamp time.
3727 (queue_final_tasks): Likewise.
3728 * main.cc (main): Store timer in parameters. Print timers
3729 for each pass.
3730 * parameters.cc (Parameters::Parameters): Initialize timer_.
3731 (Parameters::set_timer): New function.
3732 (set_parameters_timer): New function.
3733 * parameters.h (Parameters::set_timer): New function.
3734 (Parameters::timer): New function.
3735 (Parameters::timer_): New data member.
3736 (set_parameters_timer): New function.
3737 * timer.cc (Timer::stamp): New function.
3738 (Timer::get_pass_time): New function.
3739 * timer.h (Timer::stamp): New function.
3740 (Timer::get_pass_time): New function.
3741 (Timer::pass_times_): New data member.
3742
f475cf7b
CC
37432011-10-17 Cary Coutant <ccoutant@google.com>
3744
3745 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3746 task for members of lib groups.
3747
cdd7e244
CC
37482011-10-17 Cary Coutant <ccoutant@google.com>
3749
3750 PR gold/13288
4f95c8b4 3751 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
3752 (File_read::make_view): Move bounds check (replace with assert)...
3753 (File_read::find_or_make_view): ... to here.
3754
dfb45471
CC
37552011-10-12 Cary Coutant <ccoutant@google.com>
3756
4f95c8b4 3757 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
3758 ::read returns less than requested size.
3759
53bbcc1b
CC
37602011-10-10 Cary Coutant <ccoutant@google.com>
3761
4f95c8b4 3762 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
3763 Initialize defined_count_.
3764 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3765 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3766 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3767 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3768 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 3769 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
3770 member.
3771 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 3772 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
3773 Return zeroes instead of internal error.
3774
397b129b
CC
37752011-10-10 Cary Coutant <ccoutant@google.com>
3776
3777 PR gold/13249
4f95c8b4 3778 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 3779 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 3780 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
3781 (Output_reloc::type_): Adjust size of bit field.
3782 (Output_reloc::use_plt_offset_): New bit field.
3783 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
3784 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
3785 flag. Adjust all callers.
4f95c8b4 3786 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
3787 creating RELATIVE relocations.
3788
d5698657
NC
37892011-10-10 Nick Clifton <nickc@redhat.com>
3790
3791 * po/es.po: Updated Spanish translation.
3792 * po/fi.po: Updated Finnish translation.
3793
6a59a5c2
DN
37942011-10-03 Diego Novillo <dnovillo@google.com>
3795
3796 * options.cc (parse_uint): Fix dereference of RETVAL.
3797
f0558624
ST
37982011-09-29 Sriraman Tallam <tmsriram@google.com>
3799
3800 * layout.h (section_order_map_): New member.
3801 (get_section_order_map): New member function.
3802 * output.cc (Output_section::add_input_section): Check for patterns
3803 only when --section-ordering-file is specified.
3804 * gold.cc (queue_middle_tasks): Delay updating order of sections till
3805 output_sections have been formed.
3806 * layout.cc (Layout_Layout): Initialize section_order_map_.
3807 * plugin.cc (update_section_order): Store order in order_map. Do not
3808 update the order.
3809 * testsuite/Makefile.am: Add test case for plugin_final_layout.
3810 * testsuite/Makefile.in: Regenerate.
3811 * testsuite/plugin_section_order.c: New file.
3812 * testsuite/plugin_final_layout.cc: New file.
3813 * testsuite/plugin_final_layout.sh: New file.
3814
a7dac153
CC
38152011-09-29 Cary Coutant <ccoutant@google.com>
3816
4f95c8b4 3817 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 3818 Check for NULL.
4f95c8b4 3819 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
3820 symbols during incremental update.
3821 (Symbol_table::add_from_dynobj): Likewise.
3822
eebd87a5
ILT
38232011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3824 Ian Lance Taylor <iant@google.com>
3825
3826 * symtab.cc (Symbol_table::define_special_symbol): Always
3827 canonicalize version string.
3828
403a3331
CC
38292011-09-26 Cary Coutant <ccoutant@google.com>
3830
4f95c8b4
CC
3831 * gold.cc (queue_initial_tasks): Move option checks ...
3832 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
3833 some options; make others fatal.
3834
235061c2
CC
38352011-09-26 Cary Coutant <ccoutant@google.com>
3836
3837 gcc PR lto/47247
3838 * plugin.cc (get_symbols_v2): New function.
3839 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
3840 (is_referenced_from_outside): New function.
3841 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
3842 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
3843 (get_symbols): Pass version parameter.
3844 (get_symbols_v2): New function.
3845 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
3846 parameter.
3847 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
3848 (onload): Add LDPT_GET_SYMBOLS_V2.
3849 (all_symbols_read_hook): Use get_symbols_v2; check for
3850 LDPR_PREVAILING_DEF_IRONLY_EXP.
3851 * testsuite/plugin_test_3.sh: Update expected results.
3852
dc87f620
ILT
38532011-09-23 Simon Baldwin <simonb@google.com>
3854
3855 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
3856 configuration options.
3857 * configure: Regenerate.
3858 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
3859 * Makefile.in: Regenerate.
3860 * testsuite/Makefile.in: Regenerate.
3861
a8279f82
ST
38622011-09-19 Sriraman Tallam <tmsriram@google.com>
3863
3864 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
3865
0c9350c8
CC
38662011-09-19 Cary Coutant <ccoutant@google.com>
3867
3868 * incremental.cc (can_incremental_update): Fix typo in comment.
3869 * incremental.h (can_incremental_update): Likewise.
3870
aa06ae28
CC
38712011-09-18 Cary Coutant <ccoutant@google.com>
3872
3873 * incremental.cc (can_incremental_update): New function.
3874 * incremental.h (can_incremental_update): New function.
3875 * layout.cc (Layout::init_fixed_output_section): Call it.
3876 (Layout::make_output_section): Don't allow patch space in .eh_frame.
3877 * object.cc (Sized_relobj_file::do_layout): Call
3878 can_incremental_update.
3879
ebb300b2
CC
38802011-09-13 Cary Coutant <ccoutant@google.com>
3881
3882 * configure.ac: Check for glibc support for gnu_indirect_function
3883 support with static linking, setting automake conditional
3884 IFUNC_STATIC.
3885 * Makefile.in: Regenerate.
3886 * configure: Regenerate.
3887
3888 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
3889 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
3890 for IFUNC_STATIC.
3891 * testsuite/Makefile.in: Regenerate.
3892
1206d0d5
CC
38932011-09-13 Cary Coutant <ccoutant@google.com>
3894
3895 * incremental.cc (Sized_relobj_incr::do_layout): Call
3896 report_comdat_group for kept comdat sections.
3897 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
3898 * testsuite/Makefile.in: Regenerate.
3899 * testsuite/incr_comdat_test_1.cc: New source file.
3900 * testsuite/incr_comdat_test_2_v1.cc: New source file.
3901 * testsuite/incr_comdat_test_2_v2.cc: New source file.
3902 * testsuite/incr_comdat_test_2_v3.cc: New source file.
3903
40b29874
ILT
39042011-09-13 Ian Lance Taylor <iant@google.com>
3905
3906 * object.cc (Sized_relobj_file::do_layout): Remove unused local
3907 variable external_symbols_offset.
3908
1b045aac
ILT
39092011-09-12 Ian Lance Taylor <iant@google.com>
3910
3911 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
3912 triggered if object has no symbols.
3913
24c6c55a
DM
39142011-09-09 David S. Miller <davem@davemloft.net>
3915
3916 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
3917 (Output_fill_debug_line::do_write): Likewise.
3918
66570254
CC
39192011-08-29 Cary Coutant <ccoutant@google.com>
3920
3921 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
3922 casts to match formatting specs.
3923 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
3924
8ea8cd50
CC
39252011-08-26 Cary Coutant <ccoutant@google.com>
3926
3927 * layout.cc (Free_list::allocate): Provide guarantee of minimum
3928 remaining hole size when allocating.
3929 (Layout::make_output_section): Set fill methods for debug sections.
3930 * layout.h (Free_list::Free_list_node): Move from private to
3931 public.
3932 (Free_list::set_min_hole_size): New function.
3933 (Free_list::begin, Free_list::end): New functions.
3934 (Free_list::min_hole_): New data member.
3935 * output.cc: Include dwarf.h.
3936 (Output_fill_debug_info::do_minimum_hole_size): New function.
3937 (Output_fill_debug_info::do_write): New function.
3938 (Output_fill_debug_line::do_minimum_hole_size): New function.
3939 (Output_fill_debug_line::do_write): New function.
3940 (Output_section::Output_section): Initialize new data member.
3941 (Output_section::set_final_data_size): Ensure patch space is larger
3942 than minimum hole size.
3943 (Output_section::do_write): Fill holes in debug sections.
3944 * output.h (Output_fill): New class.
3945 (Output_fill_debug_info): New class.
3946 (Output_fill_debug_line): New class.
3947 (Output_section::set_free_space_fill): New function.
3948 (Output_section::free_space_fill_): New data member.
3949 * testsuite/Makefile.am (incremental_test_3): Add
3950 --incremental-patch option.
3951 (incremental_test_4): Likewise.
3952 (incremental_test_5): Likewise.
3953 (incremental_test_6): Likewise.
3954 (incremental_copy_test): Likewise.
3955 (incremental_common_test_1): Likewise.
3956 * testsuite/Makefile.in: Regenerate.
3957
7cf80422
NC
39582011-08-26 Nick Clifton <nickc@redhat.com>
3959
3960 * po/es.po: Updated Spanish translation.
3961
c3f7b0e5
CC
39622011-08-01 Cary Coutant <ccoutant@google.com>
3963
3964 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
3965 * gold/testsuite/Makefile.in: Regenerate.
3966 * gold/testsuite/justsyms_exec.c: New source file.
3967 * gold/testsuite/justsyms_lib.c: New source file.
3968
9590bf25
CC
39692011-08-01 Cary Coutant <ccoutant@google.com>
3970
3971 * layout.cc (Layout::set_segment_offsets): Don't realign text
3972 segment if -Ttext was specified.
3973 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
3974 file type.
3975 * object.h (Sized_relobj_file::e_type): New function.
3976 (Sized_relobj_file::e_type_): New data member.
3977 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3978 base address for ET_EXEC files.
3979 * target.cc (Target::do_make_elf_object_implementation): Allow
3980 ET_EXEC files with --just-symbols option.
3981
dcd8d12e
CC
39822011-07-28 Cary Coutant <ccoutant@google.com>
3983
3984 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3985 Add thread_number parameter.
3986 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3987 * workqueue-threads.cc
3988 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3989 current thread if its thread number is greater than desired thread
3990 count.
3991 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3992 Add thread_number parameter.
3993 (Workqueue::should_cancel_thread): Likewise.
3994 (Workqueue::find_runnable_or_wait): Pass thread_number to
3995 should_cancel_thread.
3996 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3997 parameter.
3998
804eb480
ST
39992011-07-22 Sriraman Tallam <tmsriram@google.com>
4000
4001 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4002 only after checking if it cannot be forced local.
4003 * symtab.h (is_externally_visible): Check if the symbol is not forced
4004 local.
4005
f1ddb600
ILT
40062011-07-15 Ian Lance Taylor <iant@google.com>
4007
4008 * options.h (class General_options): Add --print-output-format.
4009 Move -EL next to -EB, for better --help output.
4010 * target-select.cc: Include <cstdio>, "options.h", and
4011 "parameters.h".
4012 (Target_selector::do_target_bfd_name): New function.
4013 (print_output_format): New function.
4014 * target-select.h (class Target_selector): Update declarations.
4015 (Target_selector::target_bfd_name): New function.
4016 (print_output_format): Declare.
4017 * main.cc: Include "target-select.h".
4018 (main): Handle --print-output-format.
4019 * gold.cc: Include "target-select.h".
4020 (queue_initial_tasks): Handle --print-output-format when there are
4021 no input files.
4022 * parameters.cc (parameters_force_valid_target): Give a better
4023 error message if -EB/-EL does not match target.
4024 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4025 function.
4026
7d172687
ILT
40272011-07-15 Ian Lance Taylor <iant@google.com>
4028
4029 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4030 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4031 (Output_data_plt_i386::do_write): Write address of .dynamic
4032 section to first entry in .got.plt section.
4033 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4034 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4035 Initialize layout_.
4036 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4037 section to first entry in .got.plt section.
4038 * layout.h (Layout::dynamic_section): New function.
4039
e9552f7e
ST
40402011-07-13 Sriraman Tallam <tmsriram@google.com>
4041
4042 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4043 to claim_file call.
4044 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4045 input_section_position_, and input_section_glob_.
4046 (read_layout_from_file): Call function section_ordering_specified.
4047 * layout.h (is_section_ordering_specified): New function.
4048 (section_ordering_specified): New function.
4049 (section_ordering_specified_): New boolean member.
4050 * main.cc(main): Call load_plugins after layout object is defined.
4051 * output.cc (Output_section::add_input_section): Use
4052 function section_ordering_specified to check if section ordering is
4053 needed.
4054 * output.cc (Output_section::add_relaxed_input_section): Use
4055 function section_ordering_specified to check if section ordering is
4056 needed.
4057 (Output_section::update_section_layout): New function.
4058 (Output_section::sort_attached_input_sections): Check if input section
4059 must be reordered.
4060 * output.h (Output_section::update_section_layout): New function.
4061 * plugin.cc (get_section_count): New function.
4062 (get_section_type): New function.
4063 (get_section_name): New function.
4064 (get_section_contents): New function.
4065 (update_section_order): New function.
58797674 4066 (allow_section_ordering): New function.
e9552f7e
ST
4067 (Plugin::load): Add the new interfaces to the transfer vector.
4068 (Plugin_manager::load_plugins): New parameter.
4069 (Plugin_manager::all_symbols_read): New parameter.
4070 (Plugin_manager::claim_file): New parameter. Save the elf object for
4071 unclaimed objects.
4072 (Plugin_manager::get_elf_object): New function.
4073 (Plugin_manager::get_view): Change to directly use the bool to check
4074 if get_view is called from claim_file_hook.
4075 * plugin.h (input_objects): New function
4076 (Plugin__manager::load_plugins): New parameter.
4077 (Plugin_manager::claim_file): New parameter.
4078 (Plugin_manager::get_elf_object): New function.
4079 (Plugin_manager::in_claim_file_handler): New function.
4080 (Plugin_manager::in_claim_file_handler_): New member.
4081 (layout): New function.
4082 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4083 handler with an extra parameter. Make the elf object before calling
4084 claim_file handler.
4085 * testsuite/plugin_test.c (get_section_count): New function pointer.
4086 (get_section_type): New function pointer.
4087 (get_section_name): New function pointer.
4088 (get_section_contents): New function pointer.
4089 (update_section_order): New function pointer.
4090 (allow_section_ordering): New function pointer.
4091 (onload): Check if the new interfaces exist.
4092
9446efde
ILT
40932011-07-13 Ian Lance Taylor <iant@google.com>
4094
4095 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4096 relro section.
4097 * x86_64.cc (Target_x86_64::got_section): Likewise.
4098 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4099 (relro_now_test_SOURCES): New variable.
4100 (relro_now_test_DEPENDENCIES): New variable.
4101 (relro_now_test_LDFLAGS): New variable.
4102 (relro_now_test_LDADD): New variable.
4103 (relro_now_test.so): New target.
4104 * testsuite/Makefile.in: Rebuild.
4105
07aa62f2
ILT
41062011-07-12 Ian Lance Taylor <iant@google.com>
4107
4108 PR gold/12980
4109 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4110 GLOB_DAT relocation rather than a RELATIVE relocation for a
4111 protected symbol when creating a shared library.
4112 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4113 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4114 * testsuite/protected_main_1.cc (main): Test that protected
4115 function has same address.
4116
e2153196
ILT
41172011-07-11 Ian Lance Taylor <iant@google.com>
4118
4119 PR gold/12979
4120 * options.h (class General_options): Add -Bgroup.
4121 * options.cc (General_options::finalize): If -Bgroup is set,
4122 default to --unresolved-symbols=report-all.
4123 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4124 * target-reloc.h (issue_undefined_symbol_error): Handle
4125 --unresolved-symbols=report-all.
4126
6daf5215
ILT
41272011-07-08 Ian Lance Taylor <iant@google.com>
4128
4129 PR gold/11985
4130 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4131 if linker script discards key sections.
4132 (Layout::create_dynamic_symtab): Likewise.
4133 (Layout::assign_local_dynsym_offsets): Likewise.
4134 (Layout::sized_create_version_sections): Likewise.
4135 (Layout::create_interp): Likewise.
4136 (Layout::finish_dynamic_section): Likewise.
4137 (Layout::set_dynamic_symbol_size): Likewise.
4138
beabb2c6
ILT
41392011-07-08 Ian Lance Taylor <iant@google.com>
4140
4141 PR gold/12386
4142 * options.h (class General_options): Add --unresolved-symbols.
4143 * target-reloc.h (issue_undefined_symbol_error): Check
4144 --unresolved-symbols. Add comments.
4145
9c16daf1
ILT
41462011-07-08 Ian Lance Taylor <iant@google.com>
4147
4148 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4149 expression more complex.
4150
191f1a2d
ILT
41512011-07-08 Ian Lance Taylor <iant@google.com>
4152
4153 PR gold/11317
4154 * target-reloc.h (issue_undefined_symbol_error): New inline
4155 function, broken out of relocate_section.
4156 (relocate_section): Call issue_undefined_symbol_error.
4157 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4158 there is no TLS segment if we are about to issue an undefined
4159 symbol error.
4160 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4161
62855347
ILT
41622011-07-08 Ian Lance Taylor <iant@google.com>
4163
4164 PR gold/12279
4165 * resolve.cc (Symbol_table::should_override): Add fromtype
4166 parameter. Change all callers. Give error when linking together
4167 TLS and non-TLS symbol.
4168 (Symbol_table::should_override_with_special): Add fromtype
4169 parameter. Change all callers.
4170 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4171 there is no TLS segment if we have reported some errors.
4172 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4173
67181c72
ILT
41742011-07-08 Ian Lance Taylor <iant@google.com>
4175
4176 PR gold/12372
4177 * target.h (Target::plt_address_for_global): New function.
4178 (Target::plt_address_for_local): New function.
4179 (Target::plt_section_for_global): Remove.
4180 (Target::plt_section_for_local): Remove.
4181 (Target::do_plt_address_for_global): New virtual function.
4182 (Target::do_plt_address_for_local): New virtual function.
4183 (Target::do_plt_section_for_global): Remove.
4184 (Target::do_plt_section_for_local): Remove.
4185 (Target::register_global_plt_entry): Add Symbol_table and Layout
4186 parameters.
4187 * output.cc (Output_data_got::Got_entry::write): Use
4188 plt_address_for_global and plt_address_for_local.
4189 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4190 address of output section.
4191 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4192 got_irelative_, and irelative_count_ fields. Update
4193 declarations.
4194 (Output_data_plt_i386::has_irelative_section): New function.
4195 (Output_data_plt_i386::entry_count): Add irelative_count_.
4196 (Output_data_plt_i386::set_final_data_size): Likewise.
4197 (class Target_i386): Add got_irelative_ and rel_irelative_
4198 fields. Update declarations.
4199 (Target_i386::Target_i386): Initialize new fields.
4200 (Target_i386::do_plt_address_for_global): New function replacing
4201 do_plt_section_for_global.
4202 (Target_i386::do_plt_address_for_local): New function replacing
4203 do_plt_section_for_local.
4204 (Target_i386::got_section): Create got_irelative_.
4205 (Target_i386::rel_irelative_section): New function.
4206 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4207 fields. Don't define __rel_iplt_{start,end}.
4208 (Output_data_plt_i386::add_entry): Add symtab and layout
4209 parameters. Change all callers. Use different PLT and GOT for
4210 IFUNC symbols.
4211 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4212 layout parameters. Change all callers. Use different PLT and
4213 GOT.
4214 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4215 (Output_data_plt_i386::rel_irelative): New function.
4216 (Output_data_plt_i386::address_for_global): New function.
4217 (Output_data_plt_i386::address_for_local): New function.
4218 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4219 IRELATIVE GOT when changing IFUNC GOT entries.
4220 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4221 reloc.
4222 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4223 if we didn't create an IRELATIVE GOT.
4224 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4225 plt_address_for_local.
4226 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4227 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4228 got_irelative_, and irelative_count_ fields. Update
4229 declarations.
4230 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4231 Initialize new fields. Remove symtab parameter. Change all
4232 callers.
4233 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4234 irelative_count_.
4235 (Output_data_plt_x86_64::has_irelative_section): New function.
4236 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4237 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4238 fields. Update declarations.
4239 (Target_x86_64::Target_x86_64): Initialize new fields.
4240 (Target_x86_64::do_plt_address_for_global): New function replacing
4241 do_plt_section_for_global.
4242 (Target_x86_64::do_plt_address_for_local): New function replacing
4243 do_plt_section_for_local.
4244 (Target_x86_64::got_section): Create got_irelative_.
4245 (Target_x86_64::rela_irelative_section): New function.
4246 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4247 all callers. Don't create __rel_iplt_{start,end}.
4248 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4249 parameters. Change all callers. Use different PLT and GOT for
4250 IFUNC symbols.
4251 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4252 layout parameters. Change all callers. Use different PLT and
4253 GOT.
4254 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4255 parameters. Change all callers. Use different PLT and GOT for
4256 IFUNC symbols.
4257 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4258 (Output_data_plt_x86_64::rela_irelative): New function.
4259 (Output_data_plt_x86_64::address_for_global): New function.
4260 (Output_data_plt_x86_64::address_for_local): New function.
4261 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4262 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4263 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4264 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4265 parameters.
4266 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4267 reloc.
4268 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4269 symbols if we didn't create an IRELATIVE GOT.
4270 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4271 plt_address_for_local.
4272 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4273 * testsuite/ifuncvar1.c: New test file.
4274 * testsuite/ifuncvar2.c: New test file.
4275 * testsuite/ifuncvar3.c: New test file.
4276 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4277 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4278 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4279 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4280 * testsuite/Makefile.in: Rebuild.
4281
33c15b45
CC
42822011-07-07 Cary Coutant <ccoutant@google.com>
4283
4284 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4285 (two_file_test_1_ndebug.o): Likewise.
4286 (two_file_test_1b_ndebug.o): Likewise.
4287 (two_file_test_2_ndebug.o): Likewise.
4288 (two_file_test_main_ndebug.o): Likewise.
4289 (incremental_test_2): Link with no-debug versions.
4290
f48b5fb7
CC
42912011-07-06 Cary Coutant <ccoutant@google.com>
4292
4293 * gold/incremental.cc
4294 (Output_section_incremental_inputs::write_info_blocks): Check for
4295 hidden and internal symbols.
4296
221597a5
CC
42972011-07-06 Cary Coutant <ccoutant@google.com>
4298
4299 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4300 Check disposition for startup file.
4301 (Incremental_inputs::report_command_line): Ignore
4302 --incremental-startup-unchanged option.
4303 * options.cc (General_options::parse_incremental_startup_unchanged):
4304 New function.
4305 (General_options::General_options): Initialize new data member.
4306 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4307 (General_options): Add --incremental-startup-unchanged option.
4308 (General_options::incremental_startup_disposition): New function.
4309 (General_options::incremental_startup_disposition_): New data member.
4310
e24719f6
CC
43112011-07-06 Cary Coutant <ccoutant@google.com>
4312
4313 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4314 input file index to Script_info ctor.
4315 (Sized_incremental_binary::do_file_has_changed): Find the
4316 command-line argument for files named in scripts.
4317 * incremental.h (Script_info::Script_info): New ctor
4318 with input file index.
4319 (Script_info::input_file_index): New function.
4320 (Script_info::input_file_index_): New data member.
4321 (Incremental_binary::get_library): Add const.
4322 (Incremental_binary::get_script_info): Add const.
4323 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4324 * testsuite/Makefile.am (incremental_test_5): New test case.
4325 (incremental_test_6): New test case.
4326 * testsuite/Makefile.in: Regenerate.
4327
8f7c81e8
CC
43282011-07-06 Cary Coutant <ccoutant@google.com>
4329
4330 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4331 debug output when command lines differ.
4332
9fbd3822
CC
43332011-07-06 Cary Coutant <ccoutant@google.com>
4334
4335 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4336 --incremental-patch option.
4337 * layout.cc (Free_list::allocate): Extend allocation beyond original
4338 end if enabled.
4339 (Layout::make_output_section): Mark sections that should get
4340 patch space.
4341 * options.cc (parse_percent): New function.
4342 * options.h (parse_percent): New function.
4343 (DEFINE_percent): New macro.
4344 (General_options): Add --incremental-patch option.
4345 * output.cc (Output_section::Output_section): Initialize new data
4346 members.
4347 (Output_section::add_input_section): Print section name when out
4348 of patch space.
4349 (Output_section::add_output_section_data): Likewise.
4350 (Output_section::set_final_data_size): Add patch space when
4351 doing --incremental-full.
4352 (Output_section::do_reset_address_and_file_offset): Remove patch
4353 space.
4354 (Output_segment::set_section_list_addresses): Print debug output
4355 only if --incremental-update.
4356 * output.h (Output_section::set_is_patch_space_allowed): New function.
4357 (Output_section::is_patch_space_allowed_): New data member.
4358 (Output_section::patch_space_): New data member.
4359 * parameters.cc (Parameters::incremental_full): New function.
4360 * parameters.h (Parameters::incremental_full): New function
4361 * testsuite/Makefile.am (incremental_test_2): Add test for
4362 --incremental-patch option.
4363 * testsuite/Makefile.in: Regenerate.
4364 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4365 (t18): Remove function body.
4366
f6cccc2c
DK
43672011-07-05 Doug Kwan <dougkwan@google.com>
4368
4369 PR gold/12771
4370 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4371 Arm_Address type for relocation result.
4372 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4373 overflow check.
4374 (Arm_relocate_functions::abs32): Use unaligned access.
4375 (Arm_relocate_functions::rel32): Ditto.
4376 (Arm_relocate_functions::prel31): Ditto.
4377 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4378 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4379 static data relocations.
4380 * testsuite/Makefile.in: Regnerate.
4381 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4382
28a13fec
ILT
43832011-07-05 Ian Lance Taylor <iant@google.com>
4384
4385 PR gold/12392
4386 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4387 symbols if necessary.
4388 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4389
24d47b34
ILT
43902011-07-05 Ian Lance Taylor <iant@google.com>
4391
4392 PR gold/12952
4393 * resolve.cc (Symbol::override_base_with_special): Simply override
4394 version with special symbol version, ignoring previous version.
4395
41f9cbbe
ILT
43962011-07-05 Ian Lance Taylor <iant@google.com>
4397
4398 * object.cc (Sized_relobj_file::include_section_group): Add
4399 information to comment about signature location.
4400
886288f1
ILT
44012011-07-02 Ian Lance Taylor <iant@google.com>
4402
4403 PR gold/12957
4404 * options.h (class General_options): Add -f and -F.
4405 * options.cc (General_options::finalize): Fatal error if -f/-F
4406 are used without -shared.
4407 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4408
ae3a6d4f
ILT
44092011-07-02 Ian Lance Taylor <iant@google.com>
4410
4411 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4412
21131061
ILT
44132011-07-01 Ian Lance Taylor <iant@google.com>
4414
4415 PR gold/12525
4416 PR gold/12952
4417 * resolve.cc (Symbol::override_base_with_special): Don't override
4418 the version if the overriding symbol has a different name.
4419 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4420 all callers. If we give an error about an undefined version,
4421 define the base version if necessary.
4422 * dynobj.h (class Versions): Update declaration.
4423 * testsuite/weak_alias_test_5.cc: New file.
4424 * testsuite/weak_alias_test.script: New file.
4425 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4426 and versioned_alias have the right value, and call t2.
4427 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4428 weak_alias_test_5.so.
4429 (weak_alias_test_LDADD): Likewise.
4430 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4431 * testsuite/Makefile.in: Rebuild.
4432
611062c0
ILT
44332011-07-01 Ian Lance Taylor <iant@google.com>
4434
4435 PR gold/12525
4436 * options.h (class General_options): Support -z notext.
4437 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4438 -Wl,-z,notext.
4439 (two_file_shared_nonpic.so): Likewise.
4440 (two_file_shared_mixed.so): Likewise.
4441 (two_file_shared_mixed_1.so): Likewise.
4442 (weak_undef_lib_nonpic.so): Likewise.
4443 (alt/weak_undef_lib_nonpic.so): Likewise.
4444 (tls_test_shared_nonpic.so): Likewise.
4445 * testsuite/Makefile.in: Rebuild.
4446
328c7c2f
ILT
44472011-07-01 Ian Lance Taylor <iant@google.com>
4448
4449 PR gold/12525
4450 * configure.ac: Test whether static linking works, setting
4451 the automake conditional HAVE_STATIC.
4452 * testsuite/Makefile.am: Disable tests using -static if
4453 HAVE_STATIC is not true.
4454 * configure, testsuite/Makefile.in: Rebuild.
4455
02d7cd44
ILT
44562011-07-01 Ian Lance Taylor <iant@google.com>
4457
4458 PR gold/12525
4459 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4460 Assert if we see DW_EH_PE_indirect.
4461 * target.h (Target::ehframe_datarel_base): New function.
4462 (Target::do_ehframe_datarel_base): New target function.
4463 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4464 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4465 function.
4466
07a60597
ILT
44672011-07-01 Ian Lance Taylor <iant@google.com>
4468
4469 PR gold/12571
4470 * options.h (class General_options): Add
4471 --ld-generated-unwind-info.
4472 * ehframe.cc (Fde::write): Add address parameter. Change all
4473 callers. If associated with PLT, fill in address and size.
4474 (Cie::set_output_offset): Only add merge mapping if there is an
4475 object.
4476 (Cie::write): Add address parameter. Change all callers.
4477 (Eh_frame::add_ehframe_for_plt): New function.
4478 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4479 input_offset_ fields into union u_, with new plt field.
4480 (Fde::Fde): Adjust for new union field.
4481 (Fde::Fde) [Output_data version]: New constructor.
4482 (Fde::add_mapping): Only add merge mapping if there is an object.
4483 (class Cie): Update declarations.
4484 (class Eh_frame): Declare add_ehframe_for_plt.
4485 * layout.cc (Layout::layout_eh_frame): Break out code into
4486 make_eh_frame_section, and call it.
4487 (Layout::make_eh_frame_section): New function.
4488 (Layout::add_eh_frame_for_plt): New function.
4489 * layout.h (class Layout): Update declarations.
4490 * merge.cc (Merge_map::add_mapping): Add assertion.
4491 * i386.cc: Include "dwarf.h".
4492 (class Output_data_plt_i386): Make first_plt_entry,
4493 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4494 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4495 and plt_eh_frame_fde.
4496 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4497 boundary. Call add_eh_frame_for_plt if appropriate.
4498 * x86_64.cc: Include "dwarf.h".
4499 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4500 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4501 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4502 and plt_eh_frame_fde.
4503 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4504 appropriate.
4505
14788a3f
ILT
45062011-06-29 Ian Lance Taylor <iant@google.com>
4507
4508 PR gold/12629
4509 * object.cc (Sized_relobj_file::layout_section): Change shdr
4510 parameter to be const.
4511 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4512 out of do_layout.
4513 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4514 appropriate. Call layout_eh_frame_section.
4515 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4516 sections.
4517 * object.h (class Sized_relobj_file): Update declarations.
4518
6c21fce1
ILT
45192011-06-29 Ian Lance Taylor <iant@google.com>
4520
37e41b03 4521 PR gold/12652
6c21fce1
ILT
4522 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4523 modifier.
4524 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4525
4d5e4e62
ILT
45262011-06-29 Ian Lance Taylor <iant@google.com>
4527
4528 PR gold/12675
4529 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4530 SHT_X86_64_UNWIND.
4531 * layout.cc (Layout::layout_eh_frame): Likewise.
4532
886f533a
ILT
45332011-06-29 Ian Lance Taylor <iant@google.com>
4534
4535 PR gold/12695
4536 * layout.cc (Layout::symtab_section_shndx): New function.
4537 * layout.h (class Layout): Declare symtab_section_shndx.
4538 * output.cc (Output_section::write_header): Call it.
4539
f3ae1b28
ILT
45402011-06-29 Ian Lance Taylor <iant@google.com>
4541
4542 PR gold/12818
4543 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4544 symbols which are not used in a relocation.
4545
aecf301f
ILT
45462011-06-28 Ian Lance Taylor <iant@google.com>
4547
4548 PR gold/12898
4549 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4550 script create indistinguishable segments.
4551 (Layout::set_segment_offsets): Use stable_sort when sorting
4552 segments. Pass this to Compare_segments constructor.
4553 * layout.h (class Layout): Make segment_precedes non-static.
4554 (class Compare_segments): Change from struct to class. Add
4555 layout_ field. Add constructor.
4556 * script-sections.cc
4557 (Script_sections::attach_sections_using_phdrs_clause): Rename
4558 local orphan to is_orphan. Don't report failure to put empty
4559 section in segment. On attachment failure, report name of
4560 section, and attach to first PT_LOAD segment.
4561
03ef7571
ILT
45622011-06-28 Ian Lance Taylor <iant@google.com>
4563
4564 PR gold/12934
4565 * target-select.cc (Target_selector::Target_selector): Add
4566 emulation parameter. Change all callers.
4567 (select_target_by_bfd_name): Rename from select_target_by_name.
4568 Change all callers.
4569 (select_target_by_emulation): New function.
4570 (supported_emulation_names): New function.
4571 * target-select.h (class Target_selector): Add emulation_ field.
4572 Update declarations.
4573 (Target_selector::recognize_by_bfd_name): Rename from
4574 recognize_by_name. Change all callers.
4575 (Target_selector::supported_bfd_names): Rename from
4576 supported_names. Change all callers.
4577 (Target_selector::recognize_by_emulation): New function.
4578 (Target_selector::supported_emulations): New function.
4579 (Target_selector::emulation): New function.
4580 (Target_selector::do_recognize_by_bfd_name): Rename from
4581 do_recognize_by_name. Change all callers.
4582 (Target_selector::do_supported_bfd_names): Rename from
4583 do_supported_names. Change all callers.
4584 (Target_selector::do_recognize_by_emulation): New function.
4585 (Target_selector::do_supported_emulations): New function.
4586 (select_target_by_bfd_name): Change name in declaration.
4587 (select_target_by_emulation): Declare.
4588 (supported_emulation_names): Declare.
4589 * parameters.cc (parameters_force_valid_target): Try to find
4590 target based on emulation from -m option.
4591 * options.h (class General_options): Change doc string for -m.
4592 * options.cc (help): Print emulations.
4593 (General_options::parse_V): Likewise.
4594 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4595 Add emulation parameter. Change all callers.
4596
200b2bb9
ILT
45972011-06-28 Ian Lance Taylor <iant@google.com>
4598
4599 * target.h (class Target): Add osabi_ field.
4600 (Target::osabi): New function.
4601 (Target::set_osabi): New function.
4602 (Target::Target): Initialize osabi_.
4603 (Target::do_adjust_elf_header): Make pure virtual.
4604 (Sized_target::do_adjust_elf_header): Declare.
4605 * target.cc (Sized_target::do_adjust_elf_header): New function.
4606 (class Sized_target): Instantiate all versions.
4607 * freebsd.h (class Target_freebsd): Remove.
4608 (Target_selector_freebsd::do_recognize): Call set_osabi on
4609 Target.
4610 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4611 (Target_selector_freebsd::set_osabi): Remove.
4612 * i386.cc (class Target_i386): Inherit from Sized_target rather
4613 than Target_freebsd.
4614 * x86_64.cc (class Target_x86_64): Likewise.
4615
b3ce541e
ILT
46162011-06-28 Ian Lance Taylor <iant@google.com>
4617
4618 * target.h (Target::can_check_for_function_pointers): Rewrite.
4619 Make non-virtual.
4620 (Target::can_icf_inline_merge_sections): Likewise.
4621 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4622 (Target::Target_info): Add can_icf_inline_merge_sections field.
4623 (Target::do_can_check_for_function_pointers): New virtual
4624 function.
4625 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4626 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4627 from can_check_for_function_pointers, move in file.
4628 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4629 section_may_have_icf_unsafe_poineters, move in file.
4630 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4631 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4632 Rename from can_check_for_function_pointers, move in file.
4633 (Target_i386::can_icf_inline_merge_sections): Remove.
4634 (Target_i386::i386_info): Initialize
4635 can_icf_inline_merge_sections.
4636 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4637 Initialize can_icf_inline_merge_sections.
4638 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4639 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4640 Rename from can_check_for_function_pointers, move in file.
4641 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4642 (Target_x86_64::x86_64_info): Initialize
4643 can_icf_inline_merge_sections.
4644 * testsuite/testfile.cc (Target_test::test_target_info):
4645 Likewise.
4646 * icf.cc (get_section_contents): Correct formatting.
4647
6d1c4efb
ILT
46482011-06-27 Ian Lance Taylor <iant@google.com>
4649
4650 * symtab.cc (Symbol::versioned_name): New function.
4651 (Symbol_table::add_to_final_symtab): Use versioned_name when
4652 appropriate.
4653 (Symbol_table::sized_write_symbol): Likewise.
4654 * symtab.h (class Symbol): Declare versioned_name.
4655 * stringpool.h (class Stringpool_template): Add variant of add
4656 which takes a std::basic_string.
4657 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4658 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4659 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4660 (ver_test_12.o): New target.
4661 * testsuite/Makefile.in: Rebuild.
4662
57eb9b50
DK
46632011-06-27 Doug Kwan <dougkwan@google.com>
4664
4665 * arm.cc (Arm_relocate_functions::thm_jump8,
4666 Arm_relocate_functions::thm_jump11): Use a wider signed
4667 type to compute offset.
4668 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4669 arm_thm_jump8.
4670 * testsuite/Makefile.in: Regenerate.
4671 * testsuite/arm_branch_in_range.sh: Check test results of
4672 arm_thm_jump11 and arm_thm_jump8.
4673 * testsuite/arm_thm_jump11.s: New test source file.
4674 * testsuite/arm_thm_jump11.t: New linker script.
4675 * testsuite/arm_thm_jump8.s: New test source file.
4676 * testsuite/arm_thm_jump8.t: New linker script.
4677
487b39df
ILT
46782011-06-24 Ian Lance Taylor <iant@google.com>
4679
4680 * layout.cc: Include "object.h".
4681 (ctors_sections_in_init_array): New static variable.
4682 (Layout::is_ctors_in_init_array): New function.
4683 (Layout::layout): Add entry to ctors_sections_in_init_array if
4684 appropriate.
4685 * layout.h (class Layout): Declare is_ctors_in_init_array.
4686 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4687 is_ctors_reverse_view is set.
4688 (Sized_relobj_file::write_sections): Add layout parameter. Change
4689 all callers. Set is_ctors_reverse_view field of View_size.
4690 (Sized_relobj_file::reverse_words): New function.
4691 * object.h (Sized_relobj_file::View_size): Add
4692 is_ctors_reverse_view field.
4693 (class Sized_relobj_file): Update declarations.
4694 * testsuite/initpri3.c: New test.
4695 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4696 initpri3b.
4697 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4698 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4699 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4700 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4701 * testsuite/Makefile.in: Rebuild.
4702
472076e4
CC
47032011-06-24 Cary Coutant <ccoutant@google.com>
4704
4705 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4706 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4707 (debug_msg_cdebug.err): New targets.
4708 * testsuite/Makefile.in: Regenerate.
4709 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4710 Fix checks for link with shared library.
4711
a60af0db
DK
47122011-06-24 Doug Kwan <dougkwan@google.com>
4713
4714 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4715 skip empty text sections.
4716 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4717
5393d741
ILT
47182011-06-22 Ian Lance Taylor <iant@google.com>
4719
4720 PR gold/12910
4721 * options.h (class General_options): Add --ctors-in-init-array.
4722 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4723 friends as SHT_PROGBITS for merging sections.
4724 (Layout::layout): Remove special handling of .init_array and
4725 friends. Don't sort if doing relocatable link. Sort for .ctors
4726 and .dtors if ctors_in_init_array.
4727 (Layout::make_output_section): Force correct section types for
4728 .init_array and friends. Don't sort if doing relocatable link,
4729 Don't sort .ctors and .dtors if ctors_in_init_array.
4730 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4731 (Layout::output_section_name): Add relobj parameter. Change all
4732 callers. Handle .ctors. and .dtors. in code rather than table.
4733 Handle .ctors and .dtors if ctors_in_init_array.
4734 (Layout::match_file_name): New function, moved from output.cc.
4735 * layout.h (class Layout): Update declarations.
4736 * output.cc: Include "layout.h".
4737 (Input_section_sort_entry::get_priority): New function.
4738 (Input_section_sort_entry::match_file_name): Just call
4739 Layout::match_file_name.
4740 (Output_section::Input_section_sort_init_fini_compare::operator()):
4741 Handle .ctors and .dtors. Sort by explicit priority rather than
4742 by name.
4743 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4744 * testsuite/initpri2.c: New test.
4745 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4746 (check_PROGRAMS): Add initpri2.
4747 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4748 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4749 * configure, testsuite/Makefile.in: Rebuild.
4750
e1f74f98
ILT
47512011-06-19 Ian Lance Taylor <iant@google.com>
4752
4753 PR gold/12880
4754 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4755 .interp section to a PT_INTERP segment even if we have seen a
4756 --dynamic-linker option. Don't do it if we have seen a PHDRS
4757 clause in a linker script.
4758 (Layout::finalize): Don't create a .interp section if we've
4759 already create a PT_INTERP segment.
4760 (Layout::create_interp): Always call choose_output_section (revert
4761 patch of 2011-06-17). Don't create PT_INTERP segment.
4762 * script-sections.cc
4763 (Script_sections::create_note_and_tls_segments): Add a .interp
4764 section to a PT_INTERP segment even if we have seen a
4765 --dynamic-linker option.
4766
766f91bb
ILT
47672011-06-18 Ian Lance Taylor <iant@google.com>
4768
4769 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
4770 merely because a non-PT_LOAD segment has a dynamic reloc.
4771
0d212c3a
ILT
47722011-06-18 Ian Lance Taylor <iant@google.com>
4773
4774 * layout.cc (Layout::finish_dynamic_section): Don't create
4775 DT_FLAGS entry if not needed.
4776
911a5072
ILT
47772011-06-18 Ian Lance Taylor <iant@google.com>
4778
4779 PR gold/12745
4780 * layout.cc (Layout::layout_eh_frame): Correct handling of
4781 writable .eh_frame section.
4782
534b4e5f
ILT
47832011-06-17 Ian Lance Taylor <iant@google.com>
4784
4785 PR gold/12893
4786 * resolve.cc (Symbol_table::resolve): Don't give an error if a
4787 symbol is redefined with the exact same object and value.
4788
10b4f102
ILT
47892011-06-17 Ian Lance Taylor <iant@google.com>
4790
4791 PR gold/12880
4792 * layout.h (class Layout): Add interp_segment_ field.
4793 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
4794 (Layout::attach_allocated_section_to_segment): If making shared
4795 library, put .interp section in PT_INTERP segment.
4796 (Layout::finalize): Also call create_interp if -dynamic-linker
4797 option was used.
4798 (Layout::create_interp): Assert that there is no PT_INTERP
4799 segment. If not using a SECTIONS clause, use make_output_section.
4800 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
4801 * script-sections.cc
4802 (Script_sections::create_note_and_tls_segments): If making shared
4803 library, put .interp section in PT_INTERP segment.
4804
a29b0dad
ILT
48052011-06-17 Ian Lance Taylor <iant@google.com>
4806
e588ea8d
ILT
4807 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
4808 when making a shared library.
4809
48102011-06-17 Ian Lance Taylor <iant@google.com>
4811
4812 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
4813 parameter. Change all callers. Don't issue warning about PC32
4814 against locally defined symbol.
a29b0dad 4815
9d3b0698
ILT
48162011-06-16 Ian Lance Taylor <iant@google.com>
4817
4818 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
4819 occurs in same object.
4820
85b0f90c
AM
48212011-06-14 Alan Modra <amodra@gmail.com>
4822
4823 * po/POTFILES.in: Regenerate.
4824
a94907d9
ILT
48252011-06-09 Ian Lance Taylor <iant@google.com>
4826
4827 * script-sections.cc
4828 (Orphan_output_section::set_section_addresses): For a relocatable
4829 link set address to 0.
4830
4fb3a1c3
CC
48312011-06-09 Cary Coutant <ccoutant@google.com>
4832
4833 PR gold/12804
4834 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
4835 used with --compress-debug-sections.
4836 * gold/object.cc (Sized_relobj_file::do_layout): Report
4837 uncompressed size of compressed input sections.
4838
61220854
CC
48392011-06-08 Cary Coutant <ccoutant@google.com>
4840
4841 PR gold/12804
4842 * testsuite/two_file_test_2_v1.cc: Change initialization of
4843 v2 to keep it in .data.
4844
e6455dfb
CC
48452011-06-07 Cary Coutant <ccoutant@google.com>
4846
4847 * common.cc (Symbol_table::do_allocate_commons_list): Call
4848 gold_fallback.
4849 * errors.cc (Errors::fatal): Adjust call to gold_exit.
4850 (Errors::fallback): New function.
4851 (gold_fallback): New function.
4852 * errors.h (Errors::fallback): New function.
4853 * gold.cc (gold_exit): Change status parameter to enum; adjust
4854 all callers.
4855 (queue_initial_tasks): Call gold_fallback.
4856 * gold.h: Include cstdlib.
4857 (Exit_status): New enum type.
4858 (gold_exit): Change status parameter to enum.
4859 (gold_fallback): New function.
4860 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
4861 (Layout::create_symtab_sections): Likewise.
4862 (Layout::create_shdrs): Likewise.
4863 * main.cc (main): Adjust call to gold_exit.
4864 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
4865 (Output_data_got::add_got_entry_pair): Likewise.
4866 (Output_section::add_input_section): Likewise.
4867 (Output_section::add_output_section_data): Likewise.
4868 (Output_segment::set_section_list_addresses): Likewise.
4869 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
4870
fb0e076f
CC
48712011-06-07 Cary Coutant <ccoutant@google.com>
4872
4873 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
4874 for incremental links.
4875 * output.cc (Output_segment::set_section_list_addresses): Remove
4876 FIXME and test for TLS or BSS.
4877
a5ee4d5d
CC
48782011-06-07 Cary Coutant <ccoutant@google.com>
4879
4880 * testsuite/Makefile.am: Add incremental_copy_test,
4881 incremental_common_test_1.
4882 * testsuite/Makefile.in: Regenerate.
4883 * testsuite/common_test_1_v1.c: New source file.
4884 * testsuite/common_test_1_v2.c: New source file.
4885 * testsuite/copy_test_v1.cc: New source file.
4886
5146f448
CC
48872011-06-07 Cary Coutant <ccoutant@google.com>
4888
4889 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
4890 update, allocate common from bss section's free list.
4891 * incremental-dump.cc (dump_incremental_inputs): Print flag for
4892 linker-defined symbols.
4893 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4894 Skip GOT and PLT entries that are no longer referenced.
4895 (Output_section_incremental_inputs::write_info_blocks): Mark
4896 linker-defined symbols.
4897 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
4898 * output.cc (Output_section::allocate): New function.
4899 * output.h (Output_section::allocate): New function.
4900 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
4901 linker-defined symbols.
4902 (Symbol::override_base_with_special): Copy is_predefined_ flag.
4903 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
4904 (Symbol::init_base_output_data): Likewise.
4905 (Symbol::init_base_output_segment): Likewise.
4906 (Symbol::init_base_constant): Likewise.
4907 (Sized_symbol::init_output_data): Likewise.
4908 (Sized_symbol::init_output_segment): Likewise.
4909 (Sized_symbol::init_constant): Likewise.
4910 (Symbol_table::do_define_in_output_data): Likewise.
4911 (Symbol_table::do_define_in_output_segment): Likewise.
4912 (Symbol_table::do_define_as_constant): Likewise.
4913 * symtab.h (Symbol::is_predefined): New function.
4914 (Symbol::init_base_output_data): Add is_predefined parameter.
4915 (Symbol::init_base_output_segment): Likewise.
4916 (Symbol::init_base_constant): Likewise.
4917 (Symbol::is_predefined_): New data member.
4918 (Sized_symbol::init_output_data): Add is_predefined parameter.
4919 (Sized_symbol::init_output_segment): Likewise.
4920 (Sized_symbol::init_constant): Likewise.
4921 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
4922
26d3c67d
CC
49232011-06-07 Cary Coutant <ccoutant@google.com>
4924
4925 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
4926 instead of emit_copy_reloc.
4927 (Copy_relocs::emit_copy_reloc): Refactor.
4928 (Copy_relocs::make_copy_reloc): New function.
4929 (Copy_relocs::add_copy_reloc): Remove.
4930 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
4931 section.
4932 (Copy_relocs::make_copy_reloc): New function.
4933 (Copy_relocs::add_copy_reloc): Remove.
4934 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
4935 unchanged input files.
4936 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
4937 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
4938 Reserve BSS space for COPY relocations.
4939 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4940 (Output_section_incremental_inputs::write_info_blocks): Record
4941 whether a symbol is copied from a shared object.
4942 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
4943 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
4944 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
4945 (Incremental_input_entry_reader::get_output_symbol_index): Add
4946 is_copy parameter.
4947 (Incremental_binary::emit_copy_relocs): New function.
4948 (Incremental_binary::do_emit_copy_relocs): New function.
4949 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4950 new data member.
4951 (Sized_incremental_binary::add_copy_reloc): New function.
4952 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4953 (Sized_incremental_binary::Copy_reloc): New struct.
4954 (Sized_incremental_binary::Copy_relocs): New typedef.
4955 (Sized_incremental_binary::copy_relocs_): New data member.
4956 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
4957 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
4958 * target.h (Sized_target::emit_copy_reloc): New function.
4959 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
4960
7cdb37d9
CC
49612011-06-02 Cary Coutant <ccoutant@google.com>
4962
4963 PR gold/12163
4964 * gold/archive.cc (Archive::Archive): Initialize new data member.
4965 (Archive::include_all_members): Return if archive has already been
4966 included.
4967 * gold/archive.h (Archive::include_all_members_): New data member.
4968
cc643b88
NC
49692011-06-02 Nick Clifton <nickc@redhat.com>
4970
4971 * dynobj.h: Fix spelling mistake in comment.
4972 * output.cc: Likewise.
4973
f62a3ca7 49742011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 4975 Asier Llano
f62a3ca7
DK
4976
4977 PR gold/12826
cc643b88 4978 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
4979 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4980 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4981 redundant arm_exidx_test.so.
4982 * testsuite/Makefile.in: Regenerate.
4983 (check_SCRIPTS): Add pr12826.sh
4984 (check_DATA): Add pr12826.stdout
4985 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4986 * testsuite/pr12826.sh: New file.
4987 * testsuite/pr12826_1.s: Ditto.
4988 * testsuite/pr12826_1.s: Ditto.
4989
8dbe1edc
ILT
49902011-05-30 Ian Lance Taylor <iant@google.com>
4991
4992 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4993 sections.
4994
c49875be
ILT
49952011-05-29 Ian Lance Taylor <iant@google.com>
4996
4997 PR gold/12804
4998 * testsuite/Makefile.am: Use different file name for two_file_test
4999 temporary file for each incremental test.
5000 * testsuite/Makefile.in: Rebuild.
5001
69d53f7a
ILT
50022011-05-29 Ian Lance Taylor <iant@google.com>
5003
5004 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5005 binary input file is empty.
5006
41d0ab5f
ILT
50072011-05-27 Ian Lance Taylor <iant@google.com>
5008
5009 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5010 (ver_test_9.so): Likewise.
5011 * testsuite/Makefile.in: Rebuild.
5012
89d8a36b
CC
50132011-05-26 Cary Coutant <ccoutant@google.com>
5014
5015 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5016 * incremental.cc (Incremental_inputs::report_input_section): Fix
5017 comment, indentation.
5018 (Incremental_inputs::report_comdat_group): New function.
5019 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5020 of data for incremental input file entry.
5021 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5022 group count, COMDAT group signatures.
5023 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5024 an unchanged input file.
5025 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5026 Initialize new data member.
5027 (Incremental_object_entry::add_comdat_group): New function.
5028 (Incremental_object_entry::get_comdat_group_count): New function.
5029 (Incremental_object_entry::get_comdat_signature_key): New function.
5030 (Incremental_object_entry::groups_): New data member.
5031 (Incremental_inputs::report_comdat_group): New function.
5032 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5033 data for incremental input file entry.
5034 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5035 (Incremental_input_entry_reader::get_input_section): Adjust size of
5036 data for incremental input file entry.
5037 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5038 (Incremental_input_entry_reader::get_comdat_group_signature): New
5039 function.
5040 * object.cc (Sized_relobj::include_section_group): Report kept
5041 COMDAT groups for incremental links.
5042
1706a06f
ILT
50432011-05-24 David Meyer <pdox@google.com>
5044
5045 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5046 with name parameter. Add found_name parameter.
5047 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5048 * dirsearch.h (class Dirsearch): Update declaration.
5049
a10ae760
ILT
50502011-05-24 Ian Lance Taylor <iant@google.com>
5051
5052 * archive.cc (Library_base::should_include_member): Pull in object
5053 from archive if it defines the entry symbol.
5054 * parameters.cc (Parameters::entry): New function.
5055 * parameters.h (class Parameters): Declare entry.
5056 * output.h (class Output_file_header): Remove entry_ field.
5057 * output.cc (Output_file_header::Output_file_header): Remove entry
5058 parameter. Change all callers.
5059 (Output_file_header::entry): Use parameters->entry.
5060 * gold.cc (queue_middle_tasks): Likewise.
5061 * plugin.cc (Plugin_hook::run): Likewise.
5062
aa92d6ed
CC
50632011-05-24 Cary Coutant <ccoutant@google.com>
5064
5065 * gold.cc (queue_initial_tasks): Pass incremental base filename
5066 to Output_file::open_base_file; don't print error message.
5067 * incremental-dump.cc (main): Adjust call to
5068 Output_file::open_for_modification.
5069 * incremental-dump.cc (main): Likewise.
5070 * incremental.cc (Incremental_inputs::report_command_line):
5071 Ignore --incremental-base option when comparing command lines.
5072 Ignore parameter when given as separate argument.
5073 * options.h (class General_options): Add --incremental-base.
5074 * output.cc (Output_file::Output_file):
5075 (Output_file::open_base_file): Add base_name and writable parameters;
5076 read base file into new file; print error message here.
5077 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5078 callers.
5079 * output.h (Output_file::open_for_modification): Rename to...
5080 (Output_file::open_base_file): ...this; add base_name and
5081 writable parameters; adjust all callers.
5082 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5083 callers.
5084 * testsuite/Makefile.am (incremental_test_4): Test
5085 --incremental-base.
5086 * testsuite/Makefile.in: Regenerate.
5087
2eedd706
CC
50882011-05-24 Cary Coutant <ccoutant@google.com>
5089
5090 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5091 incremental_test_4.
5092 * testsuite/Makefile.in: Regenerate.
5093 * testsuite/two_file_test_1_v1.cc: New test source file.
5094 * testsuite/two_file_test_1b_v1.cc: New test source file.
5095 * testsuite/two_file_test_2_v1.cc: New test source file.
5096
0f1c85a6
CC
50972011-05-24 Cary Coutant <ccoutant@google.com>
5098
5099 * dynobj.h (Dynobj::do_dynobj): New function.
5100 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5101 flag and soname for shared objects.
5102 * incremental.cc (Incremental_inputs::report_object): Make
5103 either Incremental_object_entry or Incremental_dynobj_entry; add
5104 soname to string table.
5105 (Incremental_inputs::report_input_section): Add assertion.
5106 (Output_section_incremental_inputs::set_final_data_size): Adjust
5107 type of input file entry for shared libraries; adjust size of
5108 shared library info entry.
5109 (Output_section_incremental_inputs::write_input_files): Write
5110 as_needed flag for shared libraries.
5111 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5112 of input file entry for shared libraries; write soname.
5113 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5114 soname from incremental info.
5115 * incremental.h (enum Incremental_input_flags): Add
5116 INCREMENTAL_INPUT_AS_NEEDED.
5117 (Incremental_input_entry::Incremental_input_entry): Initialize new
5118 data member.
5119 (Incremental_input_entry::set_as_needed): New function.
5120 (Incremental_input_entry::as_needed): New function.
5121 (Incremental_input_entry::do_dynobj_entry): New function.
5122 (Incremental_input_entry::as_needed_): New data member.
5123 (Incremental_object_entry::Incremental_object_entry): Don't check
5124 for shared library.
5125 (Incremental_object_entry::do_type): Likewise.
5126 (class Incremental_dynobj_entry): New class.
5127 (Incremental_input_entry_reader::as_needed): New function.
5128 (Incremental_input_entry_reader::get_soname): New function.
5129 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5130 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5131 size of shared library info entry.
58797674 5132 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5133 incremental link when adding DT_NEEDED entries.
5134 * object.h (Object::Object): Initialize new data member.
5135 (Object::dynobj): New function.
5136 (Object::set_as_needed): New function.
5137 (Object::as_needed): New function.
5138 (Object::do_dynobj): New function.
5139 (Object::as_needed_): New data member.
5140
6fa2a40b
CC
51412011-05-24 Cary Coutant <ccoutant@google.com>
5142
5143 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5144 info; adjust display of GOT entries.
5145 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5146 vector of input objects; remove file_status_.
5147 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5148 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5149 got_plt reader; call target hooks to reserve GOT entries.
5150 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5151 of input file info header and GOT info entry.
5152 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5153 relocation info.
5154 (Got_plt_view_info::got_descriptor): Remove.
5155 (Got_plt_view_info::sym_index): New data member.
5156 (Got_plt_view_info::input_index): New data member.
5157 (Local_got_offset_visitor::visit): Write input file index.
5158 (Global_got_offset_visitor::visit): Write 0 for input file index.
5159 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5160 with sym_index and input_index.
5161 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5162 incremental info GOT entry; replace got_descriptor with input_index.
5163 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5164 map from input file index to object.
5165 (Sized_relobj_incr::do_layout): Replace direct data member reference
5166 with accessor function.
5167 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5168 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5169 Adjust size of input file info header.
5170 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5171 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5172 (Incremental_input_entry_reader::get_input_section): Adjust size of
5173 input file info header.
5174 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5175 of incremental info GOT entry.
5176 (Incremental_got_plt_reader::get_got_desc): Remove.
5177 (Incremental_got_plt_reader::get_got_symndx): New function.
5178 (Incremental_got_plt_reader::get_got_input_index): New function.
5179 (Sized_incremental_binary::Sized_incremental_binary): Remove
5180 file_status_; add input_objects_.
5181 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5182 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5183 (Sized_incremental_binary::file_is_unchanged): Remove.
5184 (Sized_incremental_binary::set_input_object): New function.
5185 (Sized_incremental_binary::input_object): New function.
5186 (Sized_incremental_binary::file_status_): Remove.
5187 (Sized_incremental_binary::input_objects_): New data member.
5188 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5189 references.
5190 (Sized_relobj_incr::invalid_address): Move to base class.
5191 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5192 class.
5193 (Sized_relobj_incr::do_output_section_offset): Likewise.
5194 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5195 (Sized_relobj_incr::section_offsets_): Likewise.
5196 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5197 function.
5198 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5199 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5200 with accessor function.
5201 (Sized_relobj_file::do_layout): Likewise.
5202 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5203 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5204 (Sized_relobj_file::compute_final_local_value): Replace refs to
5205 section_offsets_ with accessor function.
5206 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5207 * object.h (Relobj::Relobj): Initialize new data members.
5208 (Relobj::add_dyn_reloc): New function.
5209 (Relobj::first_dyn_reloc): New function.
5210 (Relobj::dyn_reloc_count): New function.
5211 (Relobj::first_dyn_reloc_): New data member.
5212 (Relobj::dyn_reloc_count_): New data member.
5213 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5214 references.
5215 (Sized_relobj::Address): New typedef.
5216 (Sized_relobj::invalid_address): Move here from child class.
5217 (Sized_relobj::Sized_relobj): Initialize new data members.
5218 (Sized_relobj::sized_relobj): New function.
5219 (Sized_relobj::is_output_section_offset_invalid): Move here from
5220 child class.
5221 (Sized_relobj::get_output_section_offset): Likewise.
5222 (Sized_relobj::local_has_got_offset): Likewise.
5223 (Sized_relobj::local_got_offset): Likewise.
5224 (Sized_relobj::set_local_got_offset): Likewise.
5225 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5226 (Sized_relobj::clear_got_offsets): New function.
5227 (Sized_relobj::section_offsets): Move here from child class.
5228 (Sized_relobj::do_output_section_offset): Likewise.
5229 (Sized_relobj::do_set_section_offset): Likewise.
5230 (Sized_relobj::Local_got_offsets): Likewise.
5231 (Sized_relobj::local_got_offsets_): Likewise.
5232 (Sized_relobj::section_offsets_): Likewise.
5233 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5234 references.
5235 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5236 class.
5237 (Sized_relobj_file::sized_relobj): New function
5238 (Sized_relobj_file::local_has_got_offset): Move to base class.
5239 (Sized_relobj_file::local_got_offset): Likewise.
5240 (Sized_relobj_file::set_local_got_offset): Likewise.
5241 (Sized_relobj_file::get_output_section_offset): Likewise.
5242 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5243 (Sized_relobj_file::do_output_section_offset): Likewise.
5244 (Sized_relobj_file::do_set_section_offset): Likewise.
5245 (Sized_relobj_file::Local_got_offsets): Likewise.
5246 (Sized_relobj_file::local_got_offsets_): Likewise.
5247 (Sized_relobj_file::section_offsets_): Likewise.
5248 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5249 (all constructors).
5250 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5251 (Output_reloc::get_symbol_index): Likewise.
5252 (Output_reloc::local_section_offset): Likewise.
5253 (Output_reloc::get_address): Likewise.
5254 (Output_reloc::symbol_value): Likewise.
5255 (Output_data_got::reserve_slot): Move to class definition.
5256 (Output_data_got::reserve_local): New function.
5257 (Output_data_got::reserve_slot_for_global): Remove.
5258 (Output_data_got::reserve_global): New function.
5259 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5260 (all constructors, two instantiations).
5261 (Output_reloc::get_relobj): New function (two instantiations).
5262 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5263 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5264 (Output_data_reloc::add_global): Adjust type of relobj.
5265 (Output_data_reloc::add_global_relative): Likewise.
5266 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5267 (Output_data_reloc::add_local): Likewise.
5268 (Output_data_reloc::add_local_relative): Likewise.
5269 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5270 (Output_data_reloc::add_local_section): Likewise.
5271 (Output_data_reloc::add_output_section): Likewise.
5272 (Output_data_reloc::add_absolute): Likewise.
5273 (Output_data_reloc::add_target_specific): Likewise.
5274 (Output_data_got::reserve_slot): Move definition here.
5275 (Output_data_got::reserve_local): New function.
5276 (Output_data_got::reserve_global): New function.
5277 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5278 section_offsets_ with accessor function.
5279 (Sized_relobj_file::write_sections): Likewise.
5280 (Sized_relobj_file::do_relocate_sections): Likewise.
5281 * target.h (Sized_target::reserve_local_got_entry): New function.
5282 (Sized_target::reserve_global_got_entry): New function.
5283 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5284 (Target_x86_64::reserve_global_got_entry): New function.
5285 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5286
4829d394
CC
52872011-05-23 Cary Coutant <ccoutant@google.com>
5288
5289 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5290 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5291 bit when checking got_type.
5292 * incremental.cc (Sized_incremental_binary::setup_readers):
5293 Store symbol table and string table locations; initialize bit vector
5294 of file status flags.
5295 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5296 unchanged files.
5297 (Sized_incremental_binary::do_process_got_plt): New function.
5298 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5299 (Output_section_incremental_inputs::set_final_data_size): Record
5300 file index for each input file.
5301 (Output_section_incremental_inputs::write_got_plt): Store file index
5302 instead of input entry offset for each GOT entry.
5303 * incremental.h
5304 (Incremental_input_entry::Incremental_input_entry): Initialize new
5305 data member.
5306 (Incremental_input_entry::set_offset): Store file index.
5307 (Incremental_input_entry::get_file_index): New function.
5308 (Incremental_input_entry::file_index_): New data member.
5309 (Incremental_binary::process_got_plt): New function.
5310 (Incremental_binary::do_process_got_plt): New function.
5311 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5312 data members.
5313 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5314 (Sized_incremental_binary::set_file_is_unchanged): New function.
5315 (Sized_incremental_binary::file_is_unchanged): New function.
5316 (Sized_incremental_binary::do_process_got_plt): New function.
5317 (Sized_incremental_binary::file_status_): New data member.
5318 (Sized_incremental_binary::main_symtab_loc_): New data member.
5319 (Sized_incremental_binary::main_strtab_loc_): New data member.
5320 * output.cc (Output_data_got::Got_entry::write): Add case
5321 RESERVED_CODE.
5322 (Output_data_got::add_global): Call add_got_entry.
5323 (Output_data_got::add_global_plt): Likewise.
5324 (Output_data_got::add_global_with_rel): Likewise.
5325 (Output_data_got::add_global_with_rela): Likewise.
5326 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5327 (Output_data_got::add_global_pair_with_rela): Likewise.
5328 (Output_data_got::add_local): Call add_got_entry.
5329 (Output_data_got::add_local_plt): Likewise.
5330 (Output_data_got::add_local_with_rel): Likewise.
5331 (Output_data_got::add_local_with_rela): Likewise.
5332 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5333 (Output_data_got::add_local_pair_with_rela): Likewise.
5334 (Output_data_got::reserve_slot): New function.
5335 (Output_data_got::reserve_slot_for_global): New function.
5336 (Output_data_got::add_got_entry): New function.
5337 (Output_data_got::add_got_entry_pair): New function.
5338 (Output_section::add_output_section_data): Edit FIXME.
5339 * output.h
5340 (Output_section_data_build::Output_section_data_build): New
5341 constructor with size parameter.
5342 (Output_data_space::Output_data_space): Likewise.
5343 (Output_data_got::Output_data_got): Initialize new data member; new
5344 constructor with size parameter.
5345 (Output_data_got::add_constant): Call add_got_entry.
5346 (Output_data_got::reserve_slot): New function.
5347 (Output_data_got::reserve_slot_for_global): New function.
5348 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5349 (Output_data_got::add_got_entry): New function.
5350 (Output_data_got::add_got_entry_pair): New function.
5351 (Output_data_got::free_list_): New data member.
5352 * target.h (Sized_target::init_got_plt_for_update): New function.
5353 (Sized_target::register_global_plt_entry): New function.
5354 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5355 Initialize new data member; call init; add constructor with PLT count.
5356 (Output_data_plt_x86_64::init): New function.
5357 (Output_data_plt_x86_64::add_relocation): New function.
5358 (Output_data_plt_x86_64::reserve_slot): New function.
5359 (Output_data_plt_x86_64::free_list_): New data member.
5360 (Target_x86_64::init_got_plt_for_update): New function.
5361 (Target_x86_64::register_global_plt_entry): New function.
5362 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5363 incremental updates.
5364 (Output_data_plt_x86_64::add_relocation): New function.
5365 * testsuite/object_unittest.cc (Object_test): Set default options.
5366
ec69d6da
ILT
53672011-05-16 Ian Lance Taylor <iant@google.com>
5368
5369 * options.h (class General_options): Make -i a synonym for -r.
5370
732e31de
ILT
53712011-05-16 Ian Lance Taylor <iant@google.com>
5372
5373 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5374
403676b5
CC
53752011-05-10 Cary Coutant <ccoutant@google.com>
5376
5377 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5378 strip_all (-s).
5379
5b7b7d6e
ILT
53802011-05-06 Ian Lance Taylor <iant@google.com>
5381
5382 * layout.cc (Layout::layout): If the output section flags change,
5383 update the ordering.
5384
f0f9babf
CC
53852011-04-25 Cary Coutant <ccoutant@google.com>
5386
5387 * incremental-dump.cc (dump_incremental_inputs): Print local
5388 symbol info for each input file.
5389 * incremental.cc
5390 (Output_section_incremental_inputs::set_final_data_size): Add local
5391 symbol info to input file entries in incremental info.
5392 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5393 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5394 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5395 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5396 implementation.
5397 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5398 (Sized_incr_relobj::do_relocate): Write the local symbols.
5399 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5400 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5401 Adjust size of input file header.
5402 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5403 (Incremental_inputs_reader::get_local_symbol_count): New function.
5404 (Incremental_inputs_reader::get_input_section): Adjust size of input
5405 file header.
5406 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5407 (Sized_incr_relobj::This): New typedef.
5408 (Sized_incr_relobj::sym_size): New const data member.
5409 (Sized_incr_relobj::Local_symbol): New struct.
5410 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5411 (Sized_incr_relobj::do_local_symbol_offset): New function.
5412 (Sized_incr_relobj::local_symbol_count_): New data member.
5413 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5414 (Sized_incr_relobj::local_symbol_index_): New data member.
5415 (Sized_incr_relobj::local_symbol_offset_): New data member.
5416 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5417 (Sized_incr_relobj::local_symbols_): New data member.
5418 * object.h (Relobj::output_local_symbol_count): New function.
5419 (Relobj::local_symbol_offset): New function.
5420 (Relobj::do_output_local_symbol_count): New function.
5421 (Relobj::do_local_symbol_offset): New function.
5422 (Sized_relobj::do_output_local_symbol_count): New function.
5423 (Sized_relobj::do_local_symbol_offset): New function.
5424
d0a9ace3
ILT
54252011-04-22 Vladimir Simonov <sv@sw.ru>
5426
5427 * descriptors.cc (set_close_on_exec): New function.
5428 (Descriptors::open): Use set_close_on_exec.
5429 * output.cc (S_ISLNK): Define if not defined.
5430
94a3fc8b
CC
54312011-04-22 Cary Coutant <ccoutant@google.com>
5432
5433 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5434 global symbol map.
5435 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5436 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5437 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5438 relocations.
5439 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5440 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5441 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5442 * incremental.h
5443 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5444 function.
5445 (Incremental_binary::apply_incremental_relocs): New function.
5446 (Incremental_binary::do_apply_incremental_relocs): New function.
5447 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5448 data member.
5449 (Sized_incremental_binary::add_global_symbol): New function.
5450 (Sized_incremental_binary::global_symbol): New function.
5451 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5452 (Sized_incremental_binary::symbol_map_): New data member.
5453 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5454 * target.h (Sized_target::apply_relocation): New function.
5455 * target-reloc.h (apply_relocation): New function.
5456 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5457
c87e4302
DK
54582011-04-22 Doug Kwan <dougkwan@google.com>
5459
5460 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5461 flag of a SHT_ARM_EXIDX section.
2e702c99 5462 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5463 * testsuite/Makefile.in: Regenerate.
5464 * testsuite/arm_exidx_test.s: New file.
5465 * testsuite/arm_exidx_test.sh: Same.
5466
e7782cf6
CC
54672011-04-20 Cary Coutant <ccoutant@google.com>
5468
5469 PR gold/12689
5470 * archive.h (Incremental_archive_entry::Archive_member):
5471 Initialize arg_serial_ (second constructor).
5472
308ecdc7
ILT
54732011-04-17 Ian Lance Taylor <iant@google.com>
5474
5475 * object.cc (Relocate_info::location): Simplify location string.
5476 * errors.cc (Errors::error_at_location): Don't print program
5477 name.
5478 (Errors::warning_at_location): Likewise.
5479 (Errors::undefined_symbol): Likewise.
5480 * testsuite/debug_msg.sh: Update accordingly.
5481
bec5b579
CC
54822011-04-14 Cary Coutant <ccoutant@google.com>
5483
5484 * gold/layout.cc (Layout::symtab_section_offset): New function.
5485 * gold/layout.h (Layout::symtab_section_offset): New function.
5486 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5487
88597d34
ILT
54882011-04-12 Ian Lance Taylor <iant@google.com>
5489
5490 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5491 with MREMAP_MAYMOVE.
5492 * output.h (class Output_file): Add map_is_allocated_ field.
5493 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5494 not available, provide stubs. If mremap is not available, #define
5495 it to gold_mremap.
5496 (MREMAP_MAYMOVE): Define if not defined.
5497 (Output_file::Output_file): Initialize map_is_allocated_.
5498 (Output_file::resize): Check map_is_allocated_.
5499 (Output_file::map_anonymous): If mmap fails, use malloc.
5500 (Output_file::unmap): Don't do anything for an anonymous map.
5501 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5502 is not available, provide stubs.
5503 (File_read::View::~View): Use free rather than delete[].
5504 (File_read::make_view): Use malloc rather than new[]. If mmap
5505 fails, use malloc.
5506 (File_read::find_or_make_view): Use malloc rather than new[].
5507 * gold.h: Remove HAVE_REMAP code.
5508 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5509 exists. Rename mremap to gold_mremap. If mmap is not available
5510 don't do anything.
5511 * configure, config.in: Rebuild.
5512
11e361bc
ILT
55132011-04-11 Ian Lance Taylor <iant@google.com>
5514
5515 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5516 initialize local variable v.
5517
cdc29364
CC
55182011-04-11 Cary Coutant <ccoutant@google.com>
5519
5520 * archive.cc (Archive::include_member): Adjust call to
5521 report_object.
5522 (Add_archive_symbols::run): Track argument serial numbers.
5523 (Lib_group::include_member): Likewise.
5524 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5525 * archive.h (Incremental_archive_entry::Archive_member):
5526 Initialize arg_serial_.
5527 (Archive_member::arg_serial_): New data member.
5528 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5529 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5530 incremental link.
5531 (Sized_dynobj::do_for_all_local_got_entries): New function.
5532 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5533 function.
5534 * fileread.cc (get_mtime): New function.
5535 * fileread.h (get_mtime): New function.
5536 * gold.cc (queue_initial_tasks): Check for incremental update.
5537 (process_incremental_input): New function.
5538 (queue_middle_tasks): Don't force valid target for incremental
5539 update.
5540 * incremental-dump.cc (find_input_containing_global): Adjust
5541 size of symbol info entry.
5542 (dump_incremental_inputs): Dump argument serial number and
5543 in_system_directory flag; bias shndx by 1; print symbol names
5544 when dumping per-file symbol lists; use new symbol info readers.
5545 * incremental.cc
5546 (Output_section_incremental_inputs:update_data_size): New function.
5547 (Sized_incremental_binary::setup_readers): Setup input readers
5548 for each input file; build maps for files added from libraries
5549 and scripts.
5550 (Sized_incremental_binary::check_input_args): New function.
5551 (Sized_incremental_binary::do_check_inputs): Build map of argument
5552 serial numbers to input arguments.
5553 (Sized_incremental_binary::do_file_has_changed): Rename
5554 do_file_is_unchanged to this; compare file modification times.
5555 (Sized_incremental_binary::do_init_layout): New function.
5556 (Sized_incremental_binary::do_reserve_layout): New function.
5557 (Sized_incremental_binary::do_get_input_reader): Remove.
5558 (Sized_incremental_binary::get_symtab_view): New function.
5559 (Incremental_checker::can_incrementally_link_output_file): Remove.
5560 (Incremental_inputs::report_command_line): Exclude --debug options.
5561 (Incremental_inputs::report_archive_begin): Add parameter; track
5562 argument serial numbers; don't put input file entry for archive
5563 before archive members.
5564 (Incremental_inputs::report_archive_end): Put input file entry
5565 for archive after archive members.
5566 (Incremental_inputs::report_object): Add parameter; track argument
5567 serial numbers and in_system_directory flag.
5568 (Incremental_inputs::report_script): Add parameter; track argument
5569 serial numbers.
5570 (Output_section_incremental_inputs::set_final_data_size): Adjust
5571 size of symbol info entry; check for forwarding symbols.
5572 (Output_section_incremental_inputs::write_input_files): Write
5573 in_system_directory flag and argument serial number.
5574 (Output_section_incremental_inputs::write_info_blocks): Map section
5575 indices between incremental info and original input file; store
5576 input section index for each symbol.
5577 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5578 change operator() to visit().
5579 (class Global_got_offset_visitor): Likewise.
5580 (class Global_symbol_visitor_got_plt):
5581 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5582 classes.
5583 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5584 (Sized_incr_relobj::do_read_symbols): New function.
5585 (Sized_incr_relobj::do_layout): New function.
5586 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5587 (Sized_incr_relobj::do_add_symbols): New function.
5588 (Sized_incr_relobj::do_should_include_member): New function.
5589 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5590 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5591 (Sized_incr_relobj::do_section_size): New function.
5592 (Sized_incr_relobj::do_section_name): New function.
5593 (Sized_incr_relobj::do_section_contents): New function.
5594 (Sized_incr_relobj::do_section_flags): New function.
5595 (Sized_incr_relobj::do_section_entsize): New function.
5596 (Sized_incr_relobj::do_section_address): New function.
5597 (Sized_incr_relobj::do_section_type): New function.
5598 (Sized_incr_relobj::do_section_link): New function.
5599 (Sized_incr_relobj::do_section_info): New function.
5600 (Sized_incr_relobj::do_section_addralign): New function.
5601 (Sized_incr_relobj::do_initialize_xindex): New function.
5602 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5603 (Sized_incr_relobj::do_read_relocs): New function.
5604 (Sized_incr_relobj::do_gc_process_relocs): New function.
5605 (Sized_incr_relobj::do_scan_relocs): New function.
5606 (Sized_incr_relobj::do_count_local_symbols): New function.
5607 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5608 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5609 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5610 (Sized_incr_relobj::do_relocate): New function.
5611 (Sized_incr_relobj::do_set_section_offset): New function.
5612 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5613 (Sized_incr_dynobj::do_read_symbols): New function.
5614 (Sized_incr_dynobj::do_layout): New function.
5615 (Sized_incr_dynobj::do_add_symbols): New function.
5616 (Sized_incr_dynobj::do_should_include_member): New function.
5617 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5618 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5619 (Sized_incr_dynobj::do_section_size): New function.
5620 (Sized_incr_dynobj::do_section_name): New function.
5621 (Sized_incr_dynobj::do_section_contents): New function.
5622 (Sized_incr_dynobj::do_section_flags): New function.
5623 (Sized_incr_dynobj::do_section_entsize): New function.
5624 (Sized_incr_dynobj::do_section_address): New function.
5625 (Sized_incr_dynobj::do_section_type): New function.
5626 (Sized_incr_dynobj::do_section_link): New function.
5627 (Sized_incr_dynobj::do_section_info): New function.
5628 (Sized_incr_dynobj::do_section_addralign): New function.
5629 (Sized_incr_dynobj::do_initialize_xindex): New function.
5630 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5631 (make_sized_incremental_object): New function.
5632 (Incremental_library::copy_unused_symbols): New function.
5633 (Incremental_library::do_for_all_unused_symbols): New function.
5634 * incremental.h (enum Incremental_input_flags): New type.
5635 (class Incremental_checker): Remove.
5636 (Incremental_input_entry::Incremental_input_entry): Add argument
5637 serial number.
5638 (Incremental_input_entry::arg_serial): New function.
5639 (Incremental_input_entry::set_is_in_system_directory): New function.
5640 (Incremental_input_entry::is_in_system_directory): New function.
5641 (Incremental_input_entry::arg_serial_): New data member.
5642 (Incremental_input_entry::is_in_system_directory_): New data member.
5643 (class Script_info): Move here from script.h.
5644 (Script_info::Script_info): Add filename parameter.
5645 (Script_info::filename): New function.
5646 (Script_info::filename_): New data member.
5647 (Incremental_script_entry::Incremental_script_entry): Add argument
5648 serial number.
5649 (Incremental_object_entry::Incremental_object_entry): Likewise.
5650 (Incremental_object_entry::add_input_section): Build list of input
5651 sections with map to original shndx.
5652 (Incremental_object_entry::get_input_section_index): New function.
5653 (Incremental_object_entry::shndx_): New data member.
5654 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5655 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5656 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5657 serial number.
5658 (Incremental_inputs::report_archive_begin): Likewise.
5659 (Incremental_inputs::report_object): Likewise.
5660 (Incremental_inputs::report_script): Likewise.
5661 (class Incremental_global_symbol_reader): New class.
5662 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5663 and store flags and input file type.
5664 (Incremental_input_entry_reader::arg_serial): New function.
5665 (Incremental_input_entry_reader::type): Extract type from flags.
5666 (Incremental_input_entry_reader::is_in_system_directory): New function.
5667 (Incremental_input_entry_reader::get_input_section_count): Call
5668 accessor function for type.
5669 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5670 function for type; adjust size of global symbol entry.
5671 (Incremental_input_entry_reader::get_global_symbol_count): Call
5672 accessor function for type.
5673 (Incremental_input_entry_reader::get_object_count): Likewise.
5674 (Incremental_input_entry_reader::get_object_offset): Likewise.
5675 (Incremental_input_entry_reader::get_member_count): Likewise.
5676 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5677 (Incremental_input_entry_reader::get_member_offset): Likewise.
5678 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5679 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5680 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5681 (Incremental_input_entry_reader::get_global_symbol_reader): New
5682 function.
5683 (Incremental_input_entry_reader::get_output_symbol_index): New
5684 function.
5685 (Incremental_input_entry_reader::type_): Remove.
5686 (Incremental_input_entry_reader::flags_): New data member.
5687 (Incremental_inputs_reader::input_file_offset): New function.
5688 (Incremental_inputs_reader::input_file_index): New function.
5689 (Incremental_inputs_reader::input_file): Call input_file_offset.
5690 (Incremental_inputs_reader::input_file_at_offset): New function.
5691 (Incremental_relocs_reader::get_r_type): Reformat.
5692 (Incremental_relocs_reader::get_r_shndx): Reformat.
5693 (Incremental_relocs_reader::get_r_offset): Reformat.
5694 (Incremental_relocs_reader::data): New function.
5695 (Incremental_binary::Incremental_binary): Initialize new data members.
5696 (Incremental_binary::check_inputs): Add cmdline parameter.
5697 (Incremental_binary::file_is_unchanged): Remove.
5698 (Input_reader::arg_serial): New function.
5699 (Input_reader::get_unused_symbol_count): New function.
5700 (Input_reader::get_unused_symbol): New function.
5701 (Input_reader::do_arg_serial): New function.
5702 (Input_reader::do_get_unused_symbol_count): New function.
5703 (Input_reader::do_get_unused_symbol): New function.
5704 (Incremental_binary::input_file_count): New function.
5705 (Incremental_binary::get_input_reader): Change signature to use
5706 index instead of filename.
5707 (Incremental_binary::file_has_changed): New function.
5708 (Incremental_binary::get_input_argument): New function.
5709 (Incremental_binary::get_library): New function.
5710 (Incremental_binary::get_script_info): New function.
5711 (Incremental_binary::init_layout): New function.
5712 (Incremental_binary::reserve_layout): New function.
5713 (Incremental_binary::output_file): New function.
5714 (Incremental_binary::do_check_inputs): New function.
5715 (Incremental_binary::do_file_is_unchanged): Remove.
5716 (Incremental_binary::do_file_has_changed): New function.
5717 (Incremental_binary::do_init_layout): New function.
5718 (Incremental_binary::do_reserve_layout): New function.
5719 (Incremental_binary::do_input_file_count): New function.
5720 (Incremental_binary::do_get_input_reader): Change signature.
5721 (Incremental_binary::input_args_map_): New data member.
5722 (Incremental_binary::library_map_): New data member.
5723 (Incremental_binary::script_map_): New data member.
5724 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5725 new data members.
5726 (Sized_incremental_binary::output_section): New function.
5727 (Sized_incremental_binary::inputs_reader): Add const.
5728 (Sized_incremental_binary::symtab_reader): Add const.
5729 (Sized_incremental_binary::relocs_reader): Add const.
5730 (Sized_incremental_binary::got_plt_reader): Add const.
5731 (Sized_incremental_binary::get_symtab_view): New function.
5732 (Sized_incremental_binary::Inputs_reader): New typedef.
5733 (Sized_incremental_binary::Input_entry_reader): New typedef.
5734 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5735 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5736 (Sized_incremental_binary::do_file_has_changed): New function.
5737 (Sized_incremental_binary::do_init_layout): New function.
5738 (Sized_incremental_binary::do_reserve_layout): New function.
5739 (Sized_input_reader::Inputs_reader): Remove.
5740 (Sized_input_reader::Input_entry_reader): Remove.
5741 (Sized_input_reader::do_arg_serial): New function.
5742 (Sized_input_reader::do_get_unused_symbol_count): New function.
5743 (Sized_input_reader::do_get_unused_symbol): New function.
5744 (Sized_incremental_binary::do_input_file_count): New function.
5745 (Sized_incremental_binary::do_get_input_reader): Change signature;
5746 use index instead of filename.
5747 (Sized_incremental_binary::section_map_): New data member.
5748 (Sized_incremental_binary::input_entry_readers_): New data member.
5749 (class Sized_incr_relobj): New class.
5750 (class Sized_incr_dynobj): New class.
5751 (make_sized_incremental_object): New function.
5752 (class Incremental_library): New class.
5753 * layout.cc (Free_list::num_lists): New static data member.
5754 (Free_list::num_nodes): New static data member.
5755 (Free_list::num_removes): New static data member.
5756 (Free_list::num_remove_visits): New static data member.
5757 (Free_list::num_allocates): New static data member.
5758 (Free_list::num_allocate_visits): New static data member.
5759 (Free_list::init): New function.
5760 (Free_list::remove): New function.
5761 (Free_list::allocate): New function.
5762 (Free_list::dump): New function.
5763 (Free_list::print_stats): New function.
5764 (Layout_task_runner::run): Resize output file for incremental updates.
5765 (Layout::Layout): Initialize new data members.
5766 (Layout::set_incremental_base): New function.
5767 (Layout::init_fixed_output_section): New function.
5768 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
5769 incremental updates.
5770 (Layout::create_gold_note): Do not create gold note section for
5771 incremental updates.
5772 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
5773 for incremental updates.
5774 (Layout::set_section_offsets): For incremental updates, allocate space
5775 from free list.
5776 (Layout::create_symtab_sections): Layout with offsets relative to
5777 start of section; for incremental updates, allocate space from free
5778 list.
5779 (Layout::create_shdrs): For incremental updates, allocate space from
5780 free list.
5781 (Layout::finish_dynamic_section): For incremental updates, do not
5782 check --as-needed (fixed in subsequent patch).
5783 * layout.h (class Free_list): New class.
5784 (Layout::set_incremental_base): New function.
5785 (Layout::incremental_base): New function.
5786 (Layout::init_fixed_output_section): New function.
5787 (Layout::allocate): New function.
5788 (Layout::incremental_base_): New data member.
5789 (Layout::free_list_): New data member.
5790 * main.cc (main): Print Free_list statistics.
5791 * object.cc (Relobj::finalize_incremental_relocs): Add
5792 clear_counts parameter; clear counts only when clear_counts is set.
5793 (Sized_relobj::Sized_relobj): Initialize new base class.
5794 (Sized_relobj::do_layout): Don't report special sections.
5795 (Sized_relobj::do_for_all_local_got_entries): New function.
5796 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
5797 symtab_off to all symbol table offsets.
5798 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
5799 * object.h (class Got_offset_list): Move to top of file.
5800 (Object::Object): Allow case where input_file == NULL.
5801 (Object::~Object): Likewise.
5802 (Object::input_file): Assert that input_file != NULL.
5803 (Object::lock): Allow case where input_file == NULL.
5804 (Object::unlock): Likewise.
5805 (Object::is_locked): Likewise.
5806 (Object::token): Likewise.
5807 (Object::release): Likewise.
5808 (Object::is_incremental): New function.
5809 (Object::get_mtime): New function.
5810 (Object::for_all_local_got_entries): New function.
5811 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
5812 (Object::set_is_in_system_directory): New function.
5813 (Object::is_in_system_directory): New function.
5814 (Object::do_is_incremental): New function.
5815 (Object::do_get_mtime): New function.
5816 (Object::do_for_all_local_got_entries): New function.
5817 (Object::is_in_system_directory_): New data member.
5818 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
5819 (class Sized_relobj_base): New class.
5820 (class Sized_relobj): Derive from Sized_relobj_base.
5821 (class Sized_relobj::Symbols): Redeclare from base class.
5822 (class Sized_relobj::local_got_offset_list): Remove.
5823 (class Sized_relobj::Output_sections): Redeclare from base class.
5824 (class Sized_relobj::do_for_all_local_got_entries): New function.
5825 (class Sized_relobj::write_local_symbols): Add offset parameter.
5826 (class Sized_relobj::local_symbol_offset_): Update comment.
5827 (class Sized_relobj::local_dynsym_offset_): Update comment.
5828 * options.cc (Input_arguments::add_file): Remove const.
5829 * options.h (Input_file_argument::Input_file_argument):
5830 Initialize arg_serial_ (all constructors).
5831 (Input_file_argument::set_arg_serial): New function.
5832 (Input_file_argument::arg_serial): New function.
5833 (Input_file_argument::arg_serial_): New data member.
5834 (Input_arguments::Input_arguments): Initialize file_count_.
5835 (Input_arguments::add_file): Remove const.
5836 (Input_arguments::number_of_input_files): New function.
5837 (Input_arguments::file_count_): New data member.
5838 (Command_line::number_of_input_files): Call
5839 Input_arguments::number_of_input_files.
5840 * output.cc (Output_segment_headers::Output_segment_headers):
5841 Set current size.
5842 (Output_section::Input_section::current_data_size): New function.
5843 (Output_section::Output_section): Initialize new data members.
5844 (Output_section::add_input_section): Don't do merge sections for
5845 an incremental link; allocate space from free list for an
5846 incremental update.
5847 (Output_section::add_output_section_data): Allocate space from
5848 free list for an incremental update.
5849 (Output_section::update_data_size): New function.
5850 (Output_section::set_fixed_layout): New function.
5851 (Output_section::reserve): New function.
5852 (Output_segment::set_section_addresses): Remove const.
5853 (Output_segment::set_section_list_addresses): Remove const; allocate
5854 space from free list for an incremental update.
5855 (Output_segment::set_offset): Adjust size of RELRO segment for an
5856 incremental update.
5857 * output.h (Output_data::current_data_size): Move here from
5858 child classes.
5859 (Output_data::pre_finalize_data_size): New function.
5860 (Output_data::update_data_size): New function.
5861 (Output_section_headers::update_data_size): new function.
5862 (Output_section_data_build::current_data_size): Move to Output_data.
5863 (Output_data_strtab::update_data_size): New function.
5864 (Output_section::current_data_size): Move to Output_data.
5865 (Output_section::set_fixed_layout): New function.
5866 (Output_section::has_fixed_layout): New function.
5867 (Output_section::reserve): New function.
5868 (Output_section::update_data_size): New function.
5869 (Output_section::has_fixed_layout_): New data member.
5870 (Output_section::free_list_): New data member.
5871 (Output_segment::set_section_addresses): Remove const.
5872 (Output_segment::set_section_list_addresses): Remove const.
5873 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
5874 New function.
5875 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
5876 New function.
5877 * readsyms.cc (Read_symbols::do_read_symbols): Add library
5878 parameter when calling Add_symbols constructor; store argument
5879 serial number for members of a lib group.
5880 (Add_symbols::locks): Allow case where token == NULL.
5881 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
5882 (Read_member::~Read_member): New function.
5883 (Read_member::is_runnable): New function.
5884 (Read_member::locks): New function.
5885 (Read_member::run): New function.
5886 (Check_script::~Check_script): New function.
5887 (Check_script::is_runnable): New function.
5888 (Check_script::locks): New function.
5889 (Check_script::run): New function.
5890 (Check_library::~Check_library): New function.
5891 (Check_library::is_runnable): New function.
5892 (Check_library::locks): New function.
5893 (Check_library::run): New function.
5894 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
5895 (Add_symbols::library_): New data member.
5896 (class Read_member): New class.
5897 (class Check_script): New class.
5898 (class Check_library): New class.
5899 * reloc.cc (Read_relocs::is_runnable): Allow case where
5900 token == NULL.
5901 (Read_relocs::locks): Likewise.
5902 (Scan_relocs::locks): Likewise.
5903 (Relocate_task::locks): Likewise.
5904 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
5905 to clear counters.
5906 (Sized_relobj::incremental_relocs_scan): Fix comment.
5907 (Sized_relobj::do_relocate): Pass output file offset to
5908 write_local_symbols.
5909 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
5910 from class declaration.
5911 * script.cc (read_input_script): Allocate Script_info; pass
5912 argument serial number to report_script.
5913 * script.h (class Script_info): Move to incremental.h.
5914 * symtab.cc (Symbol_table::add_from_incrobj): New function.
5915 * symtab.h (Symbol_table::add_from_incrobj): New function.
5916 (Symbol_table::set_file_offset): New function.
5917
b961d0d7
CC
59182011-04-05 Cary Coutant <ccoutant@google.com>
5919
5920 * incremental-dump.cc (dump_incremental_inputs): Change signature
5921 to take a Sized_incremental_binary; change caller. Use readers
5922 in Sized_incremental_binary.
5923 * incremental.cc
5924 (Sized_incremental_binary::find_incremental_inputs_sections):
5925 Rename do_find_incremental_inputs_sections to this.
5926 (Sized_incremental_binary::setup_readers): New function.
5927 (Sized_incremental_binary::do_check_inputs): Check
5928 has_incremental_info_ flag; move setup code to setup_readers;
5929 use input readers.
5930 (Sized_incremental_binary::do_file_is_unchanged): New function.
5931 (Sized_incremental_binary::do_get_input_reader): New function.
5932 * incremental.h (class Incremental_binary): Move to end of file.
5933 (Incremental_binary::file_is_unchanged): New function.
5934 (Incremental_binary::do_file_is_unchanged): New function.
5935 (Incremental_binary::Input_reader): New class.
5936 (Incremental_binary::get_input_reader): New function.
5937 (class Sized_incremental_binary): Move to end of file.
5938 (Sized_incremental_binary::Sized_incremental_binary): Setup the
5939 input section reader classes.
5940 (Sized_incremental_binary::has_incremental_info): New function.
5941 (Sized_incremental_binary::inputs_reader): New function.
5942 (Sized_incremental_binary::symtab_reader): New function.
5943 (Sized_incremental_binary::relocs_reader): New function.
5944 (Sized_incremental_binary::got_plt_reader): New function.
5945 (Sized_incremental_binary::do_file_is_unchanged): New function.
5946 (Sized_incremental_binary::Sized_input_reader): New class.
5947 (Sized_incremental_binary::get_input_reader): New function.
5948 (Sized_incremental_binary::find_incremental_inputs_sections):
5949 Rename do_find_incremental_inputs_sections to this.
5950 (Sized_incremental_binary::setup_readers): New function.
5951 (Sized_incremental_binary::has_incremental_info_): New data member.
5952 (Sized_incremental_binary::inputs_reader_): New data member.
5953 (Sized_incremental_binary::symtab_reader_): New data member.
5954 (Sized_incremental_binary::relocs_reader_): New data member.
5955 (Sized_incremental_binary::got_plt_reader_): New data member.
5956 (Sized_incremental_binary::current_input_file_): New data member.
5957
a869183f
PP
59582011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
5959
5960 PR gold/12640
5961 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5962 violation.
5963
59642011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
5965
5966 * archive.cc (Archive::include_member): Adjust call to report_object.
5967 (Add_archive_symbols::run): Add script_info to call to
5968 report_archive_begin.
5969 (Lib_group::include_member): Adjust call to report_object.
5970 (Add_lib_group_symbols::run): Adjust call to report_object.
5971 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
5972 blocks. Add object count for script input files.
5973 * incremental.cc (Incremental_inputs::report_archive_begin): Add
5974 script_info parameter; change all callers.
5975 (Incremental_inputs::report_object): Add script_info parameter;
5976 change all callers.
5977 (Incremental_inputs::report_script): Store backpointer to
5978 incremental info entry.
5979 (Output_section_incremental_inputs::set_final_data_size): Record
5980 additional information for scripts.
5981 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5982 * incremental.h (Incremental_script_entry::add_object): New function.
5983 (Incremental_script_entry::get_object_count): New function.
5984 (Incremental_script_entry::get_object): New function.
5985 (Incremental_script_entry::objects_): New data member; adjust
5986 constructor.
5987 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5988 (Incremental_inputs::report_object): Add script_info parameter.
5989 (Incremental_inputs_reader::get_object_count): New function.
5990 (Incremental_inputs_reader::get_object_offset): New function.
5991 * options.cc (Input_arguments::add_file): Return reference to
5992 new input argument.
5993 * options.h (Input_argument::set_script_info): New function.
5994 (Input_argument::script_info): New function.
5995 (Input_argument::script_info_): New data member; adjust all
5996 constructors.
5997 (Input_file_group::add_file): Return reference to new input argument.
5998 (Input_file_lib::add_file): Likewise.
5999 (Input_arguments::add_file): Likewise.
6000 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6001 * script.cc (Parser_closure::Parser_closure): Add script_info
6002 parameter; adjust all callers.
6003 (Parser_closure::script_info): New function.
6004 (Parser_closure::script_info_): New data member.
6005 (read_input_script): Report scripts earlier to incremental info.
6006 (script_add_file): Set script_info in Input_argument.
6007 (script_add_library): Likewise.
6008 * script.h (Script_options::Script_info): Rewrite class.
6009
a869183f 60102011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6011
6012 * archive.cc (Library_base::should_include_member): Move
6013 method here from class Archive.
6014 (Archive::Archive): Initialize base class.
6015 (Archive::should_include_member): Move to base class.
6016 (Archive::do_for_all_unused_symbols): New function.
6017 (Add_archive_symbols::run): Remove redundant access to
6018 incremental_inputs.
6019 (Lib_group::Lib_group): Initialize base class.
6020 (Lib_group::do_filename): New function.
6021 (Lib_group::include_member): Pass pointer to Lib_group to
6022 report_object.
6023 (Lib_group::do_for_all_unused_symbols): New function.
6024 (Add_lib_group_symbols::run): Report archive information for
6025 incremental links.
6026 * archive.h (class Library_base): New base class.
6027 (class Archive): Derive from Library_base.
6028 (Archive::filename): Move to base class.
6029 (Archive::set_incremental_info): Likewise.
6030 (Archive::incremental_info): Likewise.
6031 (Archive::Should_include): Likewise.
6032 (Archive::should_include_member): Likewise.
6033 (Archive::Armap_entry): Remove.
6034 (Archive::Unused_symbol_iterator): Remove.
6035 (Archive::unused_symbols_begin): Remove.
6036 (Archive::unused_symbols_end): Remove.
6037 (Archive::do_filename): New function.
6038 (Archive::do_get_mtime): New function.
6039 (Archive::do_for_all_unused_symbols): New function.
6040 (Archive::task_): Move to base class.
6041 (Archive::incremental_info_): Likewise.
6042 (class Lib_group): Derive from Library_base.
6043 (Lib_group::do_filename): New function.
6044 (Lib_group::do_get_mtime): New function.
6045 (Lib_group::do_for_all_unused_symbols): New function.
6046 (Lib_group::task_): Move to base class.
6047 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6048 function.
6049 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6050 function.
6051 * incremental.cc (Incremental_inputs::report_archive_begin):
6052 Use Library_base; call library's get_mtime; add incremental inputs
6053 entry before members.
6054 (class Unused_symbol_visitor): New class.
6055 (Incremental_inputs::report_archive_end): Use Library_base; use
6056 visitor class to record unused symbols; don't add incremental inputs
6057 entry after members.
6058 (Incremental_inputs::report_object): Use Library_base.
6059 * incremental.h
6060 (Incremental_archive_entry::Incremental_archive_entry): Remove
6061 unused Archive parameter.
6062 (Incremental_inputs::report_archive_begin): Use Library_base.
6063 (Incremental_inputs::report_archive_end): Likewise.
6064 (Incremental_inputs::report_object): Likewise.
6065 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6066 function.
6067 * object.h (Object::for_all_global_symbols): New function.
6068 (Object::do_for_all_global_symbols): New function.
6069 (Sized_relobj::do_for_all_global_symbols): New function.
6070 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6071 function.
6072 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6073 function.
6074
61ab3e40
ILT
60752011-03-27 Ian Lance Taylor <iant@google.com>
6076
6077 * archive.cc (Archive::interpret_header): Return -1 if something
6078 goes wrong. Change callers accordingly.
6079
30e1f9e6
CC
60802011-03-25 Cary Coutant <ccoutant@google.com>
6081
6082 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6083 * testsuite/Makefile.in: Regenerate.
6084
9370ce59 60852011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6086
6087 * plugin.cc (get_view): New.
6088 (Plugin::load): Pass get_view to the plugin.
6089 (Plugin_manager::get_view): New.
6090
9312bb0a
ILT
60912011-03-21 Ian Lance Taylor <iant@google.com>
6092
6093 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6094 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6095
7e12ba9e
ST
60962011-03-21 Sriraman Tallam <tmsriram@google.com>
6097
6098 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6099 Change == to -eq.
6100 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6101 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6102 Change == to -eq.
6103 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6104 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6105
fd7a005d
ILT
61062011-03-14 Ian Lance Taylor <iant@google.com>
6107
6108 * script-sections.cc (Sort_output_sections::script_compare):
6109 Rename from is_before, change return type.
6110 (Sort_output_sections::operator()): Adjust accordingly.
6111
ed16fd1b
ILT
61122011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6113
6114 PR gold/12572
6115 * testsuite/odr_violation2.cc: Add comment to make all error line
6116 numbers double digits.
6117 * testsuite/debug_msg.sh: Adjust expected errors.
6118
71ff8986
ILT
61192011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6120
6121 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6122 but mark earlier ones as non-canonical
6123 (offset_to_iterator): Update search target and example
6124 (do_addr2line): Return extra lines in a vector*
6125 (format_file_lineno): Extract from do_addr2line
6126 (one_addr2line): Add vector* out-param
6127 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6128 when a lineno entry appeared last for its instruction
6129 (Dwarf_line_info): Add vector* out-param
6130 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6131 * symtab.cc (Odr_violation_compare): Include the lineno in the
6132 comparison again.
6133 (linenos_from_loc): New. Combine the canonical line for an
6134 address with its other lines.
6135 (True_if_intersect): New. Helper functor to make
6136 std::set_intersection a query.
6137 (detect_odr_violations): Compare sets of lines instead of just
6138 one line for each function. This became less deterministic, but
6139 has fewer false positives.
6140 * symtab.h: Declarations.
6141 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6142 mix an optimized and non-optimized object in the same binary
6143 (odr_violation2.so): Same.
6144 * testsuite/Makefile.in: Regenerate from Makefile.am.
6145 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6146 * testsuite/debug_msg.sh: Update line numbers and add
6147 assertions.
6148 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6149 non-optimized context.
6150 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6151 isn't inlined, and use OdrDerived in an optimized context.
6152 * testsuite/odr_header1.h: Defines OdrDerived, where
6153 optimization will change the
6154 first-instruction-in-the-destructor's file and line number.
6155 * testsuite/odr_header2.h: Defines OdrBase.
6156
a19fefdc
ILT
61572011-03-09 Ian Lance Taylor <iant@google.com>
6158
6159 * fileread.cc (File_read::clear_views): Don't delete the whole
6160 file view.
6161
ecb351e9
ILT
61622011-03-08 Ian Lance Taylor <iant@google.com>
6163
6164 PR gold/12525
6165 * fileread.cc: #include <climits>.
6166 (GOLD_IOV_MAX): Define.
6167 (File_read::read_multiple): Limit number of entries by iov_max.
6168 * fileread.h (class File_read): Always set max_readv_entries to
6169 128.
6170
b821d13c
ILT
61712011-03-07 Ian Lance Taylor <iant@google.com>
6172
6173 PR gold/12525
6174 * options.h (class General_options): Add -dy and -dn.
6175
89243142
CC
61762011-03-02 Cary Coutant <ccoutant@google.com>
6177
6178 * testsuite/script_test_9.t: Add TLS segment.
6179
d0773f31
ILT
61802011-03-02 Simon Baldwin <simonb@google.com>
6181
6182 * configure.ac: Add check for gnu_indirect_function support in
6183 the toolchain building binutils.
6184 * configure: Rebuild.
6185
9370ce59 61862011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6187
6188 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6189 plugin only symbols.
6190 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6191 in plugin files as not needed in the symbol table.
6192
4cf7a849
ST
61932011-02-11 Sriraman Tallam <tmsriram@google.com>
6194
6195 * output.cc (Output_section::add_input_section): Delay fill
6196 generation for section ordering.
6197
b578bd7d
ILT
61982011-02-09 Ian Lance Taylor <iant@google.com>
6199
6200 PR gold/12316
6201 * object.h (class Sized_relobj): Remove clear_local_symbols.
6202 * reloc.cc (Sized_relobj::do_relocate): Don't call
6203 clear_local_symbols.
6204
9370ce59 62052011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6206
6207 * plugin.cc (is_visible_from_outside): Return true for symbols
6208 in the -u option.
6209
55382fb7
ILT
62102011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6211
6212 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6213 filename.
6214
4e271fff
ST
62152011-02-02 Sriraman Tallam <tmsriram@google.com>
6216
6217 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6218 to std::string.
4e271fff 6219 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6220 section_name to be std::string.
4e271fff
ST
6221 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6222
d433c3ac
ILT
62232011-01-25 Ian Lance Taylor <iant@google.com>
6224
6225 * script.cc (script_add_extern): Rewrite to use
6226 add_symbol_reference.
6227
880473a6
DK
62282011-01-25 Doug Kwan <dougkwan@google.com>
6229
d433c3ac 6230 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6231
f30f86fa
ILT
62322011-01-24 Ian Lance Taylor <iant@google.com>
6233
6234 * options.h (class General_options): Accept
6235 --no-detect-odr-violations.
6236
8e51a0b9
ILT
62372011-01-24 Ian Lance Taylor <iant@google.com>
6238
6239 * version.cc (version_string): Bump to 1.11.
6240
0f3b89d8
ILT
62412011-01-24 Ian Lance Taylor <iant@google.com>
6242
6243 * plugin.cc (class Plugin_rescan): Define new class.
6244 (Plugin_manager::claim_file): Set any_claimed_.
6245 (Plugin_manager::save_archive): New function.
6246 (Plugin_manager::save_input_group): New function.
6247 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6248 necessary.
6249 (Plugin_manager::new_undefined_symbol): New function.
6250 (Plugin_manager::rescan): New function.
6251 (Plugin_manager::rescannable_defines): New function.
6252 (Plugin_manager::add_input_file): Set any_added_.
6253 * plugin.h (class Plugin_manager): define new fields rescannable_,
6254 undefined_symbols_, any_claimed_, and any_added_. Declare
6255 Plugin_rescan as friend. Declare new functions.
6256 (Plugin_manager::Rescannable): Define type.
6257 (Plugin_manager::Rescannable_list): Define type.
6258 (Plugin_manager::Undefined_symbol_list): Define type.
6259 (Plugin_manager::Plugin_manager): Initialize new fields.
6260 * archive.cc (Archive::defines_symbol): New function.
6261 (Add_archive_symbols::run): Pass archive to plugins if any.
6262 * archive.h (class Archive): Declare defines_symbol.
6263 * readsyms.cc (Input_group::~Input_group): New function.
6264 (Finish_group::run): Pass input_group to plugins if any.
6265 * readsyms.h (class Input_group): Declare destructor.
6266 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6267 any.
6268
3bb951e5
ILT
62692011-01-10 Ian Lance Taylor <iant@google.com>
6270
6271 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6272 section as relro.
6273 (Layout::set_segment_offsets): Reset increase_relro before calling
6274 set_section_addresses a second time.
6275
0aa45fac
CC
62762011-01-04 Cary Coutant <ccoutant@google.com>
6277
6278 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6279 sections before NOBITS sections.
6280
0db46eb4
L
62812011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6282
6283 * version.cc (print_version): Update copyright to 2011.
6284
829c9745
CC
62852010-12-23 Cary Coutant <ccoutant@google.com>
6286
6287 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6288 of OS to this->add. Add OD parameter to second form of the function.
6289
7500420b
ILT
62902010-12-20 Ian Lance Taylor <iant@google.com>
6291
6292 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6293 second of two consecutive entries with same offset.
6294
f8e9a930
RW
62952010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6296
6297 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6298 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6299 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6300 to avoid unneeded links against $(LDADD).
6301 * testsuite/Makefile.in: Regenerate.
6302
2fbb4320
ILT
63032010-12-15 Ian Lance Taylor <iant@google.com>
6304
6305 PR gold/12324
6306 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6307 for R_X86_64_32 and R_X86_64_PC32.
6308 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6309 ver_matching_def_pic.o.
6310 (ver_matching_def_pic.o): New target.
6311
fedb228d
RW
63122010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6313
6314 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6315 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6316 Move definition before File_read::View member definitions.
6317 (File_read::View::~View): Initialize and hold lock before
6318 updating current_mapped_bytes.
6319
9b547ce6
RW
63202010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6321
6322 * dwarf_reader.cc: Remove outdated comment.
6323 * gold-threads.cc: Fix typo in error message.
6324 * archive.cc: Fix typos in comments.
6325 * archive.h: Likewise.
6326 * arm-reloc-property.cc: Likewise.
6327 * arm-reloc-property.h: Likewise.
6328 * arm-reloc.def: Likewise.
6329 * arm.cc: Likewise.
6330 * attributes.h: Likewise.
6331 * cref.cc: Likewise.
6332 * ehframe.cc: Likewise.
6333 * fileread.h: Likewise.
6334 * gold.h: Likewise.
6335 * i386.cc: Likewise.
6336 * icf.cc: Likewise.
6337 * incremental.h: Likewise.
6338 * int_encoding.cc: Likewise.
6339 * layout.h: Likewise.
6340 * main.cc: Likewise.
6341 * merge.h: Likewise.
6342 * object.cc: Likewise.
6343 * object.h: Likewise.
6344 * options.cc: Likewise.
6345 * readsyms.cc: Likewise.
6346 * reduced_debug_output.cc: Likewise.
6347 * reloc.cc: Likewise.
6348 * script-sections.cc: Likewise.
6349 * sparc.cc: Likewise.
6350 * symtab.h: Likewise.
6351 * target-reloc.h: Likewise.
6352 * target.cc: Likewise.
6353 * target.h: Likewise.
6354 * timer.cc: Likewise.
6355 * timer.h: Likewise.
6356 * x86_64.cc: Likewise.
6357
83e17bd5
CC
63582010-12-09 Cary Coutant <ccoutant@google.com>
6359
6360 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6361 stack.
6362 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6363 parameter; change all callers.
6364 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6365 * options.h (warn_execstack): New option.
6366
017257f8
DK
63672010-12-07 Doug Kwan <dougkwan@google.com>
6368
6369 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6370 like function call relocations.
6371
c20cbc06
ILT
63722010-12-07 Ian Lance Taylor <iant@google.com>
6373
6374 * archive.cc (Archive::get_elf_object_for_member): Permit
6375 punconfigured to be NULL.
6376 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6377 (Archive::include_member): Pass NULL to get_elf_object_for_member
6378 if we searched for the archive and this is the first included
6379 object.
6380
4dbfafcc
ILT
63812010-12-01 Ian Lance Taylor <iant@google.com>
6382
6383 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6384 track_relocs_type_ field.
6385 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6386 Set track_relocs_type_.
6387 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6388 contents when using RELA relocs.
6389 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6390 reloc_map_.
6391 * reloc.cc (Track_relocs::next_addend): New function.
6392 * reloc.h (class Track_relocs): Declare next_addend.
6393
e5e19edd
ILT
63942010-12-01 Ian Lance Taylor <iant@google.com>
6395
6396 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6397 virtual destructor.
6398
9a5ce24c
ILT
63992010-12-01 Ian Lance Taylor <iant@google.com>
6400
6401 * README: Update compilers known to work and fail.
6402
c7791212
NC
64032010-11-23 Matthias Klose <doko@ubuntu.com>
6404
6405 * configure.in: For --enable-gold, handle value `default' instead of
6406 `both*'. Always install ld as ld.bfd, install as ld if gold is
6407 not the default.
6408 * configure: Regenerate.
6409
0ad220c9
DK
64102010-11-18 Doug Kwan <dougkwan@google.com>
6411
6412 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6413 and right_alignment to be zero. Store result alignment only if it is
6414 greater than existing alignment.
6415
ab8056e0
CC
64162010-11-16 Cary Coutant <ccoutant@google.com>
6417
6418 PR gold/12220
6419 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6420 Check for ".zdebug_line".
6421
fd064a5b
CC
64222010-11-16 Doug Kwan <dougkwan@google.com>
6423 Cary Coutant <ccoutant@google.com>
6424
6425 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6426 by reference; adjust all callers.
6427 * output.cc (Output_segment::set_section_addresses): Adjust references
6428 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6429 list is empty.
6430 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6431 end at page boundary.
6432
6fc6ea19
CC
64332010-11-16 Cary Coutant <ccoutant@google.com>
6434
6435 PR gold/12220
6436 * layout.cc (Layout::choose_output_section): Transform names of
6437 compressed sections even when using a script with a SECTIONS clause.
6438 (Layout::output_section_name): Remove code to transform
6439 compressed debug section names.
6440 * output.cc (Output_section::add_input_section): Use uncompressed
6441 section size when tracking input sections.
6442
95a2c8d6
RS
64432010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6444
6445 * symtab.h (Symbol::NON_PIC_REF): Remove.
6446 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6447 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6448 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6449 (Symbol::use_plt_offset): Take a flags argument and pass it
6450 directly to needs_dynamic_reloc. Restrict check for undefined
6451 weak symbols to function calls.
6452 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6453 (Target_arm::Scan::global): Use it.
6454 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6455 (Target_arm::Relocate::relocate): Likewise.
6456 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6457 parameter with an r_type parameter. Use get_reference_flags
6458 to get the flags.
6459 (Target_arm::Relocate::relocate): Update accordingly.
6460 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6461 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6462 (Target_i386::Scan::global): Likewise.
6463 (Target_i386::Relocate::relocate): Likewise.
6464 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6465 parameter with an r_type parameter. Use get_reference_flags
6466 to get the flags.
6467 (Target_i386::Relocate::relocate): Update accordingly.
6468 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6469 (Target_powerpc::Scan::global): Use it.
6470 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6471 (Target_powerpc::Relocate::relocate): Likewise.
6472 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6473 (Target_sparc::Scan::global): Use it.
6474 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6475 (Target_sparc::Relocate::relocate): Likewise.
6476 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6477 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6478 (Target_x86_64::Scan::global): Likewise.
6479 (Target_x86_64::Relocate::relocate): Likewise.
6480
f625ae50
DK
64812010-11-08 Doug Kwan <dougkwan@google.com>
6482 Cary Coutant <ccoutant@google.com>
6483
6484 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6485 (Arm_exidx_merge_section::section_contents_): New data member.
6486 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6487 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6488 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6489 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6490 in parameters instead of calling Object::section_contents without
6491 locking.
6492 (Arm_output_section::group_section): New parameter TASK. Pass it
6493 to callees that need locking objects.
6494 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6495 to lock EXIDX input sections. Fix a formatting issue. Call
6496 Arm_exidx_merged_section::build_contents to create merged section
6497 contents.
6498 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6499 to lock object of stub table owner.
6500 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6501 TEXT_SIZE to initialize data member TEXT_SIZE_.
6502 (Arm_exidx_input_section::addralign): Fix typo in comment.
6503 (Arm_exidx_input_section::text_size): New method.
6504 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6505 that require locking objects. Lock objects before scanning for stubs
6506 and updating local symbols.
6507 (Arm_input_section<big_endian>::init): Copy contents of original
6508 input section.
2e702c99 6509 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6510 original input section instead of calling Object::section_contents
6511 without locking.
6512 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6513 size without calling Object::section_size().
6514 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6515 for size. Allocate a buffer for merged EXIDX entries.
6516 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 6517 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
6518 building code to Arm_exidx_merged_section::build_contetns. Write
6519 out contetns in buffer instead of building it on the fly.
6520 (Arm_relobj::make_exidx_input_section): Also pass text section size
6521 to Arm_exidx_input_section constructor.
6522 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6523 (Arm_dynobj::do_read_symbols): Fix memory leak.
6524 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6525 * target.h: (class Task): Add forward declaration.
6526 (Target::relax): Add new parameter TASK and pass it to
6527 Target::do_relax().
6528 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6529
5f9bcf58
CC
65302010-11-05 Cary Coutant <ccoutant@google.com>
6531
6532 PR gold/10708
6533 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6534 object when reading from the file.
6535 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6536 second layout pass.
6537 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6538 when reading section contents.
6539 (get_section_contents): Likewise.
6540 (icf::find_identical_sections): Likewise.
6541 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6542 object when reading from the file.
6543 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6544 the object when doing deferred section layout.
6545
e597fa08
NC
65462010-11-03 Nick Clifton <nickc@redhat.com>
6547
6548 PR gold/12001
6549 * script.h (class Symbol_assignment: name): New member. Returns
6550 the name of the symbol.
6551 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6552 Returns true if the given symbol name is on the list of
6553 assignments wating to be processed.
6554 * archive.cc (should_incldue_member): If the symbol is undefined,
6555 check to see if it is on the list of symbols pending assignment.
6556
3f9a3278
ILT
65572010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6558
6559 * script-sections.cc (Script_sections::find_memory_region): Check
6560 for a NULL output section pointer.
6561
d06fb4d1
DK
65622010-10-29 Doug Kwan <dougkwan@google.com>
6563
6564 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6565 Output_section::add_relaxed_input_section.
6566 * output.cc (Output_section::add_relaxed_input_section): Add new
6567 arguments LAYOUT and NAME. Set section order index.
6568 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6569 Copy section order index.
6570 * output.h (Output_section::add_relaxed_input_section): Add new
6571 arguments LAYOUT and NAME.
6572
90e24de5
ILT
65732010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6574
6575 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 6576 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
6577 * testsuite/Makefile.in: Regenerate.
6578
c9484ea5
DK
65792010-10-20 Doug Kwan <dougkwan@google.com>
6580
6581 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6582 without SHF_LINK_ORDER flags.
6583 * layout.cc (Layout::choose_output_section): Do not filter
6584 SHF_LINK_ORDER flag in a relocatable link.
6585
5bc2f5be
CC
65862010-10-17 Cary Coutant <ccoutant@google.com>
6587
6588 * output.h (Output_segment::set_section_addresses): Change function
6589 signature. Update all callers.
6590 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6591 sections.
6592 (Output_segment::set_section_addresses): Align after last TLS
6593 section. Add padding before last relro section instead of after.
6594
0c91cf04
DK
65952010-10-17 Doug Kwan <dougkwan@google.com>
6596
6597 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6598 GOT output section to be writable.
6599
8c21d9d3
CC
66002010-10-14 Cary Coutant <ccoutant@google.com>
6601
6602 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
6603 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6604 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6605 mode.
6606 * incremental.cc (report_command_line): Ignore all forms of
6607 --incremental.
6608 * layout.cc (Layout::Layout): Check parameters for incremental link
6609 mode.
6610 * options.cc (General_options::parse_incremental): New function.
6611 (General_options::parse_no_incremental): New function.
6612 (General_options::parse_incremental_full): New function.
6613 (General_options::parse_incremental_update): New function.
6614 (General_options::incremental_mode_): New data member.
6615 (General_options::finalize): Check incremental_mode_.
6616 * options.h (General_options): Update help text for --incremental.
6617 Add --no-incremental, --incremental-full, --incremental-update.
6618 (General_options::Incremental_mode): New enum type.
6619 (General_options::incremental_mode): New function.
6620 (General_options::incremental_mode_): New data member.
6621 * parameters.cc (Parameters::incremental_mode_): New data member.
6622 (Parameters::set_options): Set incremental_mode_.
6623 (Parameters::set_incremental_full): New function.
6624 (Parameters::incremental): New function.
6625 (Parameters::incremental_update): New function.
6626 (set_parameters_incremental_full): New function.
6627 * parameters.h (Parameters::set_incremental_full): New function.
6628 (Parameters::incremental): New function.
6629 (Parameters::incremental_update): New function.
6630 (Parameters::incremental_mode_): New data member.
6631 (set_parameters_incremental_full): New function.
6632 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6633 incremental link mode.
6634 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6635 (Sized_relobj::do_relocate_sections): Likewise.
6636 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6637 option.
6638 * testsuite/Makefile.in: Regenerate.
6639 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 6640
bb32aa18 66412010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
6642
6643 * script-sections.h (class Script_sections): Make
6644 Sections_elements typedef public.
6645 * script-sections.cc (class Sort_output_sections): Add elements_
6646 field. Add constructor which sets it; change all callers.
6647 (Sort_output_sections::is_before): New function.
6648 (Sort_output_sections::operator()): Call is_before.
6649 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6650 conditional.
6651 * testsuite/script_test_10.sh: New test. Test script section
6652 order.
6653 * testsuite/script_test_10.t: Likewise.
6654 * testsuite/script_test_10.s: Likewise.
6655 * testsuite/Makefile.am: Wrap the cross linker tests and the
6656 common tests into NATIVE_OR_CROSS_LINKER.
6657 (check_SCRIPTS): Add script_test_10.sh.
6658 (check_DATA): Add script_test_10.stdout.
6659 (script_test_10.o, script_test_10): New targets.
6660 (script_test_10.stdout): New target.
6661 * configure, testsuite/Makefile.in: Regenerate.
6662
3cef7179
ILT
66632010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6664
6665 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6666 error for the deprecated relocations.
6667 (Target_arm::Scan::global): Likewise.
6668 (Target_arm::Relocate::relocate): Likewise.
6669
7411e9a8
RS
66702010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6671
6672 * fileread.cc (Input_file::find_file): Initialize *found_name
6673 and *namep when using the fallback search for case 4.
6674
6a9da32a
CC
66752010-10-11 Cary Coutant <ccoutant@google.com>
6676
6677 * options.h (class General_options): Redefine -z lazy as an alias for
6678 the negation of -z now.
6679
ac897c20
ILT
66802010-10-11 Ian Lance Taylor <iant@google.com>
6681
6682 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6683 binding.
6684
ea5cae92
NC
66852010-10-06 Nick Clifton <nickc@redhat.com>
6686
6687 * script-sections.cc(class Memory_region): Remove
6688 current_lma_offset_ field. Rename current_vma_offset_ to
6689 current_offset_. Add last_section_ field.
6690 (Memory_region::get_current_vma_address): Rename to
6691 get_current_address.
6692 (Memory_region::get_current_lma_address): Delete.
6693 (Memory_region::increment_vma_offset): Rename to
6694 increment_offset.
6695 (Memory_region::increment_lma_offset): Delete.
6696 (Memory_region::attributes_compatible): New method. Returns
6697 true if the provided section is compatible with the region.
6698 (Memory_region::get_last_section): New method. Returns the last
6699 section to use the region.
6700 (Memory_region::set_last_section): New method. Stores the last
6701 section to use the region.
6702 (Script_sections::block_in_region): New method. Returns true if
6703 a block of memory is contained within a region.
6704 (Script_sections::find_memory_region): New method. Locates a
6705 memory region to be used to set a VMA or LMA address.
6706 (Output_section_definition::set_section_addresses): Add code to
6707 check for addresses set by memory regions.
6708 (Output_segment::set_section_addresses): Remove memory region
6709 walking code.
6710 (Script_sections::create_segment): Add a warning if a header
6711 segment is created outside of any region.
6712 * script-sections.h (class Script_sections): Add prototypes for
6713 find_memory_region and block_in_region methods.
6714 * testsuite/memory_test.s: Use .long instead of .word.
6715 * testsuite/memory_test.t: Add some more output sections.
6716 * testsuite/memory_test.sh: Update expected output.
6717
a9bfd952
DK
67182010-10-02 Doug Kwan <dougkwan@google.com>
6719
6720 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6721 defintion to symtab.h
6722 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6723 declaration to defintion.
6724
bacff3ab
NC
67252010-10-01 Nick Clifton <nickc@redhat.com>
6726
6727 * expression.cc (eval): Replace dummy argument with NULL.
6728 (eval_maybe_dot): Check for a NULL result section pointer.
6729 (Symbol_expression::value): Likewise.
6730 (Dot_expression::value): Likewise.
6731 (BINARY_EXPRESSION): Likewise.
6732 (Max_expression::value): Likewise.
6733 (Min_expression::value): Likewise.
6734 (Absolute_expression::value): Likewise.
6735 (Addr_expression::value_from_output_section): Likewise.
6736 (Loaddddr_expression::value_from_output_section): Likewise.
6737 (Segment_start_expression::value): Likewise.
6738 * script-sections.cc
6739 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6740 argument with NULL.
6741 (Sections_elememt_dot_assignment::set_section_addresses):
6742 Likewise.
6743 (Output_data_expression::do_write_to_buffer): Likewise.
6744 (Output_section_definition::finalize_symbols): Likewise.
6745 (Output_section_definition::set_section_addresses): Likewise.
6746
f81bc8b5
DK
67472010-09-30 Doug Kwan <dougkwan@google.com>
6748
6749 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6750
c95e9f27
ST
67512010-09-28 Sriraman Tallam <tmsriram@google.com>
6752
6753 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 6754 function.
c95e9f27
ST
6755 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6756 virtual function.
6757 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6758 virtual function.
6759 * icf.cc (get_section_contents): Inline merge sections only when
6760 target allows it.
6761
3cac54d2
RW
67622010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6763
6764 * configure: Regenerate.
6765
2904037a
ILT
67662010-09-17 Ian Lance Taylor <iant@google.com>
6767
6768 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
6769 * testsuite/Makefile.am (memory_test.o): New target.
6770 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
6771 memory_test.t.
6772 * testsuite/Makefile.in: Rebuild.
2904037a 6773
bca7fb63
DK
67742010-09-17 Doug Kwan <dougkwan@google.com>
6775
6776 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
6777 defintion if relocation uses GOT entries of the symbol.
6778 * testsuite/icf_safe_test.sh: Fix test.
6779 * testsuite/icf_safe_so_test.sh: Fix test.
6780
4ef28648
CC
67812010-09-16 Cary Coutant <ccoutant@google.com>
6782
6783 * script_sections.cc (class Memory_region): Remove "NULL" from
6784 vector initializations.
6785
793990de
CC
67862010-09-15 Cary Coutant <ccoutant@google.com>
6787
6788 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
6789 Resolve forwarding symbols.
6790
81e015e2
DK
67912010-09-15 Doug Kwan <dougkwan@google.com>
6792
6793 * gold/testsuite/script_test_3.t: Add ARM special sections.
6794 * gold/testsuite/script_test_4.t: Same.
6795 * gold/testsuite/script_test_5.t: Same.
6796 * gold/testsuite/script_test_6.t: Same.
6797 * gold/testsuite/script_test_7.t: Same.
6798 * gold/testsuite/script_test_7.t: Same.
6799 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
6800
36171d64
CC
68012010-09-14 Cary Coutant <ccoutant@google.com>
6802
6803 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
6804 (Target_x86_64::Relocate::relocate_tls): Replace check for
6805 saw_tls_block_reloc_ with test for executable section.
6806
d89051bd
CC
68072010-09-12 Cary Coutant <ccoutant@google.com>
6808
6809 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
6810 position-independent executables to shared libraries need dynamic
6811 relocations.
6812 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
6813 position-independent executables.
6814 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
6815 * testsuite/Makefile.in: Regenerate.
6816
fca41f0f
NC
68172010-09-10 Nick Clifton <nickc@redhat.com>
6818
6819 PR gold/11997
6820 * testsuite/memory_test.t: Discard any sections that are not
6821 needed.
6822
6695e4b3
L
68232010-09-09 H.J. Lu <hongjiu.lu@intel.com>
6824
6825 PR gold/11996
6826 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
6827 "This::" to work around a bug in gcc 4.2.
6828
6829 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
6830
0f72bf6f
RÁE
68312010-09-09 Rafael Espindola <espindola@google.com>
6832
6833 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
6834 sections with different PF_X flags in the same segment.
6835 (Layout::find_first_load_seg): Search all segments to find the first
6836 one.
6837 * options.h (rosegment): New.
6838
68392010-09-08 Rafael Espindola <espindola@google.com>
a6577478 6840
05a79166 6841 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 6842
aa98ff75
DK
68432010-09-08 Doug Kwan <dougkwan@google.com>
6844
6845 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
6846 (Arm_relobj::do_relocate_sections): Add new parameter for output
6847 file to match the parent.
6848 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
6849 of local symbols instead of input values. Update code to track
6850 changes in gold::relocate_section.
6851 * object.cc (Sized_relobj::compute_final_local_value): New methods.
6852 (Sized_relobj::compute_final_local_value_internal): New methods.
6853 (Sized_relobj::do_finalize_local_symbols): Move code from loop
6854 body into private version of Sized_relobj::compute_final_local_value.
6855 Call the inline method.
6856 * object.h (Symbol_value::Symbol_value): Define destructor. Free
6857 merged symbol value if there is one.
6858 (Symbol_value::has_output_value): New method defintiion.
6859 (Sized_relobj::Compute_final_local_value_status): New enum type.
6860 (Sized_relobj::compute_final_local_value): New methods.
6861 (Sized_relobj::compute_final_local_value_internal): New methods.
6862 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
6863 and arm_cortex_a8.sh.
6864 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
6865 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
6866 New tests.
6867 * Makefile.in: Regenerate.
6868 * testsuite/arm_bl_out_of_range.s: Update test.
6869 * testsuite/thumb_bl_out_of_range.s: Ditto.
6870 * testsuite/thumb_blx_out_of_range.s: Ditto.
6871 * testsuite/arm_branch_out_of_range.sh: New file.
6872 * testsuite/arm_cortex_a8.sh: Ditto.
6873 * testsuite/arm_cortex_a8_b.s: Ditto.
6874 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
6875 * testsuite/arm_cortex_a8_b_local.s: Ditto.
6876 * testsuite/arm_cortex_a8_bl.s: Ditto.
6877 * testsuite/arm_cortex_a8_blx.s: Ditto.
6878 * testsuite/arm_cortex_a8_local.s: Ditto.
6879 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
6880 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
6881
05a79166
L
68822010-09-08 Rafael Espindola <espindola@google.com>
6883
6884 * Makefile.am (memory_test.stdout): Run readelf with -W.
6885 * Makefile.in: Regenerate.
6886 * testsuite/memory_test.sh: Make the regexps accept both 32 and
6887 64 bit output.
6888
33dbc701
RÁE
68892010-09-08 Rafael Espindola <espindola@google.com>
6890
6891 * script-sections.cc (Script_sections::add_memory_region): Convert
6892 field precision to int.
6893 * script.cc (script_set_section_region, script_set_section_region):
6894 Convert field precision to int.
6895
731ca54a
RÁE
68962010-09-08 Rafael Espindola <espindola@google.com>
6897
6898 * arm.cc (do_finalize_sections): Create the __exidx_start and
6899 __exdix_end symbols even when the section is missing.
6900
7f8cd844
NC
69012010-09-08 Nick Clifton <nickc@redhat.com>
6902
6903 * README: Remove claim that MEMORY is not supported.
6904 * expression.cc (script_exp_function_origin)
6905 (script_exp_function_length): Move from here to ...
6906 * script.cc: ... here.
6907 (script_set_section_region, script_add_memory)
6908 (script_parse_memory_attr, script_include_directive): New
6909 functions.
6910 * script-sections.cc
6911 (class Memory_region): New class.
6912 (class Output_section_definition): Add set_memory_region,
6913 set_section_vma, set_section_lma and get_section_name methods.
6914 (class Script_Sections): Add add_memory_region,
6915 find_memory_region, find_memory_region_origin,
6916 find_memory_region_length and set_memory_region methods.
6917 Have set_section_addresses method walk the list of set memory
6918 regions.
6919 Extend the print methos to display memory regions.
6920 * script-sections.h: Add prototypes for new methods.
6921 Add enum for MEMORY region attributes.
6922 * yyscript.y: Add support for parsing MEMORY regions.
6923 * script-c.h: Add prototypes for new functions.
6924 * testsuite/Makefile.am: Add test of MEMORY region functionality.
6925 * testsuite/Makefile.in: Regenerate.
6926 * testsuite/memory_test.sh: New script.
6927 * testsuite/memory_test.s: New assembler source file.
6928 * testsuite/memory_test.t: New linker script.
6929
a4649286
DK
69302010-08-27 Doug Kwan <dougkwan@google.com>
6931
6932 * gold/resolve.cc (Symbol_table::should_override): Let a weak
6933 reference override an existing dynamic weak reference.
6934 * testsuite/Makefile.am: Add new test dyn_weak_ref.
6935 * testsuite/Makefile.in: Regenerate.
6936 * testsuite/dyn_weak_ref.sh: New file.
6937 * testsuite/dyn_weak_ref_1.c: Ditto.
6938 * testsuite/dyn_weak_ref_2.c: Ditto.
6939
b56648ad
ILT
69402010-08-27 Ian Lance Taylor <iant@google.com>
6941
6942 * incremental.h (class Incremental_input_entry): Add virtual
6943 destructor.
6944
809313cb
ILT
69452010-08-27 Ian Lance Taylor <iant@google.com>
6946
6947 * testsuite/start_lib_test_3.c: Mark t3 as used.
6948
11e32464
NC
69492010-08-27 Nick Clifton <nickc@redhat.com>
6950
6951 * options.cc (version_script): Fix small typo in previous
6952 whitespace tidyup.
6953
ca09d69a
NC
69542010-08-25 Nick Clifton <nickc@redhat.com>
6955
6956 * archive.cc: Formatting fixes: Remove whitespace between
6957 typename and following asterisk. Remove whitespace between
6958 function name and opening parenthesis.
6959 * archive.h: Likewise.
6960 * arm.cc: Likewise.
6961 * attributes.cc: Likewise.
6962 * attributes.h: Likewise.
6963 * common.cc: Likewise.
6964 * copy-relocs.cc: Likewise.
6965 * dirsearch.h: Likewise.
6966 * dynobj.cc: Likewise.
6967 * ehframe.cc: Likewise.
6968 * ehframe.h: Likewise.
6969 * expression.cc: Likewise.
6970 * fileread.cc: Likewise.
6971 * fileread.h: Likewise.
6972 * gc.h: Likewise.
6973 * gold-threads.cc: Likewise.
6974 * gold.cc: Likewise.
6975 * i386.cc: Likewise.
6976 * icf.h: Likewise.
6977 * incremental-dump.cc: Likewise.
6978 * incremental.cc: Likewise.
6979 * layout.cc: Likewise.
6980 * layout.h: Likewise.
6981 * main.cc: Likewise.
6982 * merge.cc: Likewise.
6983 * merge.h: Likewise.
6984 * object.cc: Likewise.
6985 * object.h: Likewise.
6986 * options.cc: Likewise.
6987 * options.h: Likewise.
6988 * output.cc: Likewise.
6989 * output.h: Likewise.
6990 * plugin.cc: Likewise.
6991 * plugin.h: Likewise.
6992 * powerpc.cc: Likewise.
6993 * reloc.cc: Likewise.
6994 * script-c.h: Likewise.
6995 * script-sections.cc: Likewise.
6996 * script.cc: Likewise.
6997 * stringpool.cc: Likewise.
6998 * symtab.cc: Likewise.
6999 * symtab.h: Likewise.
7000 * target.cc: Likewise.
7001 * timer.cc: Likewise.
7002 * timer.h: Likewise.
7003 * version.cc: Likewise.
7004 * x86_64.cc: Likewise.
7005
b8fa8750
NC
70062010-08-24 Nick Clifton <nickc@redhat.com>
7007
7008 PR 11899
7009 * layout.cc (segment_precedes): Sort segments by their physical
7010 addresses, if they have been set.
7011
9919d93b
CC
70122010-08-23 Cary Coutant <ccoutant@google.com>
7013
7014 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7015 symbols data.
7016 (Lib_group::include_member): Unlock object after deleting its
7017 symbols data.
7018 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7019 the bug fixed here.
7020
97b4be1c
CC
70212010-08-19 Neil Vachharajani <nvachhar@google.com>
7022 Cary Coutant <ccoutant@google.com>
7023
7024 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7025 constructor, and set_blocker.
7026 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7027 readsyms_blocker_.
7028 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7029 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7030 * testsuite/Makefile.am (start_lib_test): New test case.
7031 * testsuite/Makefile.in: Regenerate.
7032 * testsuite/start_lib_test_main.c: New file.
7033 * testsuite/start_lib_test_1.c: New file.
7034 * testsuite/start_lib_test_2.c: New file.
7035 * testsuite/start_lib_test_3.c: New file.
7036
dd0b1884
ILT
70372010-08-19 Ian Lance Taylor <iant@google.com>
7038
7039 * Makefile.in: Rebuild with automake 1.11.1.
7040 * aclocal.m4: Likewise.
7041 * testsuite/Makefile.in: Likewise.
7042
7223e9ca
ILT
70432010-08-19 Ian Lance Taylor <iant@google.com>
7044
7045 PR 10893
7046 * i386.cc (class Output_data_plt_i386): Update declarations.
7047 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7048 local_ifuncs_ fields.
7049 (Target_i386::do_plt_section_for_global): New function.
7050 (Target_i386::do_plt_section_for_local): New function.
7051 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7052 parameter; change all callers. Initialize global_ifuncs_ and
7053 local_ifuncs_. If doing a static link define __rel_iplt_start and
7054 __rel_iplt_end.
7055 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7056 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7057 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7058 symbols.
7059 (Target_i386::make_plt_section): New function, broken out of
7060 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7061 (Target_i386::make_plt_entry): Call make_plt_section.
7062 (Target_i386::make_local_ifunc_plt_entry): New function.
7063 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7064 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7065 R_386_IRELATIVE to switch.
7066 (Target_i386::Scan::global): Likewise.
7067 (Target_i386::Relocate::relocate): Likewise.
7068 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7069 switch.
7070 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7071 (Target_x86_64::do_plt_section_for_global): New function.
7072 (Target_x86_64::do_plt_section_for_local): New function.
7073 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7074 parameter; change all callers. If doing a static link define
7075 __rela_iplt_start and __rela_iplt_end.
7076 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7077 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7078 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7079 to point to .plt.
7080 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7081 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7082 switch.
7083 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7084 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7085 R_X86_64_IRELATIVE to switch.
7086 (Target_x86_64::Scan::global): Likewise.
7087 (Target_x86_64::Relocate::relocate): Likewise.
7088 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7089 switch.
7090 * target.h (class Target): Add plt_section_for_global and
7091 plt_section_for_local functions. Add do_plt_section_for_global
7092 and do_plt_section_for_local virtual functions.
7093 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7094 clarifying comments.
7095 (Symbol::use_plt_offset): Handle IFUNC symbol.
7096 * object.cc (Sized_relobj::Sized_relobj): Initialize
7097 local_plt_offsets_.
7098 (Sized_relobj::local_has_plt_offset): New function.
7099 (Sized_relobj::local_plt_offset): New function.
7100 (Sized_relobj::set_local_plt_offset): New function.
7101 (Sized_relobj::do_count): Handle IFUNC symbol.
7102 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7103 a bit away from input_shndx_ field. Add set_is_func_symbol and
7104 is_ifunc_symbol functions.
7105 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7106 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7107 local_plt_offsets_ field.
7108 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7109 * output.h (class Output_section_data): Add non-const
7110 output_section function.
7111 (class Output_data_got): Update declarations.
7112 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7113 Add use_plt_offset parameter to global and local constructors.
7114 Change all callers. Change local_sym_index_ field to 31 bits.
7115 Change GSYM_CODE and CONSTANT_CODE accordingly.
7116 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7117 doing a static link don't set sh_link field.
7118 (Output_data_got::Got_entry::write): Use PLT offset if
7119 appropriate.
7120 (Output_data_got::add_global_plt): New function.
7121 (Output_data_got::add_local_plt): New function.
7122 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7123 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7124 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7125 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7126 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7127 IFUNC conditional.
7128 * testsuite/ifunc-sel.h: New file.
7129 * testsuite/ifuncmain1.c: New file.
7130 * testsuite/ifuncmain1vis.c: New file.
7131 * testsuite/ifuncmod1.c: New file.
7132 * testsuite/ifuncdep2.c: New file.
7133 * testsuite/ifuncmain2.c: New file.
7134 * testsuite/ifuncmain3.c: New file.
7135 * testsuite/ifuncmod3.c: New file.
7136 * testsuite/ifuncmain4.c: New file.
7137 * testsuite/ifuncmain5.c: New file.
7138 * testsuite/ifuncmod5.c: New file.
7139 * testsuite/ifuncmain6pie.c: New file.
7140 * testsuite/ifuncmod6.c: New file.
7141 * testsuite/ifuncmain7.c: New file.
7142 * configure, testsuite/Makefile.in: Rebuild.
7143
56f75c03
ILT
71442010-08-18 Ian Lance Taylor <iant@google.com>
7145
7146 * incremental.cc
7147 (Output_section_incremental_inputs::write_input_files): Add cast
7148 to avoid signed/unsigned comparison warning.
7149 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7150
55455f89
CC
71512010-08-12 Cary Coutant <ccoutant@google.com>
7152
7153 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7154
e2054bcb
ILT
71552010-08-13 Ian Lance Taylor <iant@google.com>
7156
7157 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7158
74f67560
DK
71592010-08-12 Cary Coutant <ccoutant@google.com>
7160 Doug Kwan <dougkwan@google.com>
7161
7162 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7163 defintion overrides non-weak undef, remember that the original undef
7164 is not weak.
7165 * symtab.cc (Symbol_table::sized_write_global): For undef without
7166 an original weak binding, set binding to global in output.
7167 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7168 * testsuite/Makefile.in: Regenerate.
7169 * testsuite/strong_ref_weak_def.sh: New file.
7170 * testsuite/strong_ref_weak_def_1.c: Ditto.
7171 * testsuite/strong_ref_weak_def_2.c: Ditto.
7172
d1238d12
CC
71732010-08-12 Cary Coutant <ccoutant@google.com>
7174
7175 * testsuite/incremental_test.sh: Rewrite.
7176 * testsuite/incremental_test_1.c: Rewrite.
7177 * testsuite/incremental_test_2.c: Rewrite.
7178
0e70b911
CC
71792010-08-12 Cary Coutant <ccoutant@google.com>
7180
7181 * arm.cc (Target_arm::got_size): Add const.
7182 (Target_arm::got_entry_count): New function.
7183 (Target_arm::plt_entry_count): New function.
7184 (Target_arm::first_plt_entry_offset): New function.
7185 (Target_arm::plt_entry_size): New function.
7186 (Output_data_plt_arm::entry_count): New function.
7187 (Output_data_plt_arm::first_plt_entry_offset): New function.
7188 (Output_data_plt_arm::get_plt_entry_size): New function.
7189 * i386.cc (Target_i386::got_size): Add const.
7190 (Target_i386::got_entry_count): New function.
7191 (Target_i386::plt_entry_count): New function.
7192 (Target_i386::first_plt_entry_offset): New function.
7193 (Target_i386::plt_entry_size): New function.
7194 (Output_data_plt_i386::entry_count): New function.
7195 (Output_data_plt_i386::first_plt_entry_offset): New function.
7196 (Output_data_plt_i386::get_plt_entry_size): New function.
7197 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7198 find_incremental_inputs_sections. Dump incremental_got_plt section.
7199 * incremental.cc: Include target.h.
7200 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7201 parameter. Adjust all callers. Find incremental_got_plt section.
7202 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7203 section.
7204 (Output_section_incremental_inputs::set_final_data_size): Calculate
7205 size of incremental_got_plt section.
7206 (Output_section_incremental_inputs::do_write): Write the
7207 incremental_got_plt section.
7208 (Got_plt_view_info): New struct.
7209 (Local_got_offset_visitor): New class.
7210 (Global_got_offset_visitor): New class.
7211 (Global_symbol_visitor_got_plt): New class.
7212 (Output_section_incremental_inputs::write_got_plt): New function.
7213 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7214 Add parameter. Adjust all callers.
7215 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7216 (Incremental_inputs::got_plt_section): New function.
7217 (Incremental_inputs::got_plt_section_): New data member.
7218 (Incremental_got_plt_reader): New class.
7219 * layout.cc (Layout::create_incremental_info_sections): Add the
7220 incremental_got_plt section.
7221 * object.h (Got_offset_list::get_list): New function.
7222 (Got offset_list::for_all_got_offsets): New function.
7223 (Sized_relobj::local_got_offset_list): New function.
7224 * powerpc.cc (Target_powerpc::got_size): Add const.
7225 (Target_powerpc::got_entry_count): New function.
7226 (Target_powerpc::plt_entry_count): New function.
7227 (Target_powerpc::first_plt_entry_offset): New function.
7228 (Target_powerpc::plt_entry_size): New function.
7229 (Output_data_plt_powerpc::entry_count): New function.
7230 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7231 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7232 * sparc.cc (Target_sparc::got_size): Add const.
7233 (Target_sparc::got_entry_count): New function.
7234 (Target_sparc::plt_entry_count): New function.
7235 (Target_sparc::first_plt_entry_offset): New function.
7236 (Target_sparc::plt_entry_size): New function.
7237 (Output_data_plt_sparc::entry_count): New function.
7238 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7239 (Output_data_plt_sparc::get_plt_entry_size): New function.
7240 * symtab.h (Symbol::got_offset_list): New function.
7241 (Symbol_table::for_all_symbols): New function.
7242 * target.h (Sized_target::got_entry_count): New function.
7243 (Sized_target::plt_entry_count): New function.
7244 (Sized_target::plt_entry_size): New function.
7245 * x86_64.cc (Target_x86_64::got_size): Add const.
7246 (Target_x86_64::got_entry_count): New function.
7247 (Target_x86_64::plt_entry_count): New function.
7248 (Target_x86_64::first_plt_entry_offset): New function.
7249 (Target_x86_64::plt_entry_size): New function.
7250 (Output_data_plt_x86_64::entry_count): New function.
7251 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7252 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7253
09ec0418
CC
72542010-08-12 Cary Coutant <ccoutant@google.com>
7255
7256 * archive.cc: Include incremental.h.
7257 (Archive::Archive): Initialize incremental_info_.
7258 (Archive::include_member): Record archive members in incremental info.
7259 (Add_archive_symbols::run): Record begin and end of an archive in
7260 incremental info.
7261 (Lib_group::include_member): Record objects in incremental info.
7262 * archive.h (Incremental_archive_entry): Forward declaration.
7263 (Archive::set_incremental_info): New member function.
7264 (Archive::incremental_info): New member function.
7265 (Archive::Unused_symbol_iterator): New class.
7266 (Archive::unused_symbols_begin): New member function.
7267 (Archive::unused_symbols_end): New member function.
7268 (Archive::incremental_info_): New data member.
7269 * incremental-dump.cc (find_input_containing_global): New function.
7270 (dump_incremental_inputs): Dump new incremental info sections.
7271 * incremental.cc: Include symtab.h.
7272 (Output_section_incremental_inputs): New class.
7273 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7274 new incremental info sections.
7275 (Sized_incremental_binary::do_check_inputs): Likewise.
7276 (Incremental_inputs::report_archive): Remove.
7277 (Incremental_inputs::report_archive_begin): New function.
7278 (Incremental_inputs::report_archive_end): New function.
7279 (Incremental_inputs::report_object): New function.
7280 (Incremental_inputs::finalize_inputs): Remove.
7281 (Incremental_inputs::report_input_section): New function.
7282 (Incremental_inputs::report_script): Rewrite.
7283 (Incremental_inputs::finalize): Do nothing but finalize string table.
7284 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7285 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7286 (Incremental_inputs::create_data_sections): New function.
7287 (Incremental_inputs::relocs_entsize): New function.
7288 (Output_section_incremental_inputs::set_final_data_size): New function.
7289 (Output_section_incremental_inputs::do_write): New function.
7290 (Output_section_incremental_inputs::write_header): New function.
7291 (Output_section_incremental_inputs::write_input_files): New function.
7292 (Output_section_incremental_inputs::write_info_blocks): New function.
7293 (Output_section_incremental_inputs::write_symtab): New function.
7294 * incremental.h (Incremental_script_entry): Forward declaration.
7295 (Incremental_object_entry): Forward declaration.
7296 (Incremental_archive_entry): Forward declaration.
7297 (Incremental_inputs): Forward declaration.
7298 (Incremental_inputs_header_data): Remove.
7299 (Incremental_inputs_header): Remove.
7300 (Incremental_inputs_header_write): Remove.
7301 (Incremental_inputs_entry_data): Remove.
7302 (Incremental_inputs_entry): Remove.
7303 (Incremental_inputs_entry_write): Remove.
7304 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7305 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7306 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7307 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7308 Likewise.
7309 (Incremental_input_entry): New class.
7310 (Incremental_script_entry): New class.
7311 (Incremental_object_entry): New class.
7312 (Incremental_archive_entry): New class.
7313 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7314 (Incremental_inputs::report_inputs): Remove.
7315 (Incremental_inputs::report_archive): Remove.
7316 (Incremental_inputs::report_archive_begin): New function.
7317 (Incremental_inputs::report_archive_end): New function.
7318 (Incremental_inputs::report_object): Change prototype.
7319 (Incremental_inputs::report_input_section): New function.
7320 (Incremental_inputs::report_script): Change prototype.
7321 (Incremental_inputs::get_reloc_count): New function.
7322 (Incremental_inputs::set_reloc_count): New function.
7323 (Incremental_inputs::create_data_sections): New function.
7324 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7325 (Incremental_inputs::inputs_section): New function.
7326 (Incremental_inputs::symtab_section): New function.
7327 (Incremental_inputs::relocs_section): New function.
7328 (Incremental_inputs::get_stringpool): Add const.
7329 (Incremental_inputs::command_line): Add const.
7330 (Incremental_inputs::inputs): Remove.
7331 (Incremental_inputs::command_line_key): New function.
7332 (Incremental_inputs::input_file_count): New function.
7333 (Incremental_inputs::input_files): New function.
7334 (Incremental_inputs::relocs_entsize): New function.
7335 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7336 (Incremental_inputs::finalize_inputs): Remove.
7337 (Incremental_inputs::Input_info): Remove.
7338 (Incremental_inputs::lock_): Remove.
7339 (Incremental_inputs::inputs_): Change type.
7340 (Incremental_inputs::inputs_map_): Remove.
7341 (Incremental_inputs::current_object_entry_): New data member.
7342 (Incremental_inputs::inputs_section_): New data member.
7343 (Incremental_inputs::symtab_section_): New data member.
7344 (Incremental_inputs::relocs_section_): New data member.
7345 (Incremental_inputs::reloc_count_): New data member.
7346 (Incremental_inputs_reader): New class.
7347 (Incremental_symtab_reader): New class.
7348 (Incremental_relocs_reader): New class.
7349 * layout.cc (Layout::finalize): Move finalization of incremental info
7350 and creation of incremental info sections to follow finalization of
7351 symbol table. Set offsets for postprocessing sections.
7352 (Layout::create_incremental_info_sections): Call
7353 Incremental_inputs::create_data_sections. Add incremental symtab
7354 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7355 sections to layout after input sections.
7356 * layout.h (struct Timespec): Forward declaration.
7357 (Layout::incremental_inputs): Add const.
7358 (Layout::create_incremental_info_sections): Add parameter.
7359 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7360 * object.cc: Include incremental.h.
7361 (Relobj::finalize_incremental_relocs): New function.
7362 (Sized_relobj::do_layout): Record input sections in incremental info.
7363 * object.h (Object::output_section): New function.
7364 (Object::output_section_offset): Moved from Relobj.
7365 (Object::get_incremental_reloc_base): New function.
7366 (Object::get_incremental_reloc_count): New function.
7367 (Object::do_output_section): New function.
7368 (Object::do_output_section_offset): Moved from Relobj.
7369 (Object::do_get_incremental_reloc_base): New function.
7370 (Object::do_get_incremental_reloc_count): New function.
7371 (Object::Object): Initialize new data members.
7372 (Relobj::output_section): Renamed do_output_section and moved to
7373 protected.
7374 (Relobj::output_section_offset): Moved to Object.
7375 (Relobj::do_get_incremental_reloc_base): New function.
7376 (Relobj::do_get_incremental_reloc_count): New function.
7377 (Relobj::allocate_incremental_reloc_counts): New function.
7378 (Relobj::count_incremental_reloc): New function.
7379 (Relobj::finalize_incremental_relocs): New function.
7380 (Relobj::next_incremental_reloc_index): New function.
7381 (Relobj::reloc_counts_): New data member.
7382 (Relobj::reloc_bases_): New data member.
7383 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7384 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7385 (Sized_relobj::incremental_relocs_scan): New function.
7386 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7387 (Sized_relobj::incremental_relocs_write): New function.
7388 (Sized_relobj::incremental_relocs_write_reltype): New function.
7389 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7390 incremental link.
7391 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7392 archives and object files elsewhere.
7393 (Add_symbols::run): Report object files here.
7394 (Finish_group::run): Report end of archive at end of group.
7395 * reloc.cc: Include layout.h, incremental.h.
7396 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7397 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7398 (Sized_relobj::incremental_relocs_scan): New function.
7399 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7400 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7401 (Sized_relobj::incremental_relocs_write): New function.
7402 (Sized_relobj::incremental_relocs_write_reltype): New function.
7403 * script.cc (read_input_script): Rewrite test for incremental link.
7404 Change call to Incremental_inputs::report_script.
7405 * symtab.h (Symbol_table::first_global_index): New function.
7406 (Symbol_table::output_count): New function.
7407
ce0d1972
DK
74082010-08-12 Doug Kwan <dougkwan@google.com>
7409
7410 * arm.cc (Target_arm::merge_object_attributes): Check command line
7411 options --no-wchar-size-warning and --no-enum-size-warning.
7412 * options.h (General_options): Add ld-compatible options
7413 --no-enum-size-warning and --no-wchar-size-warning.
7414
6e5710ce
ILT
74152010-08-04 Ian Lance Taylor <iant@google.com>
7416
7417 * x86_64.cc (Target_x86_64::Scan::local): Use
7418 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7419 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7420 (Target_x86_64::Scan::global): Likewise.
7421 (Target_x86_64::Relocate::relocate): Likewise.
7422 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7423 Likewise.
7424
fef830db
CC
74252010-08-03 Cary Coutant <ccoutant@google.com>
7426
7427 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7428 to reserve space in merged_strings vector. Keep total input size
7429 for stats.
7430 (Output_merge_string::do_print_merge_stats): Print total input size.
7431 * merge.h (Output_merge_string): Add input_size_ field.
7432 * stringpool.cc (Stringpool_template::string_length): Move
7433 implementations out of Stringpool_template class and place in
7434 stringpool.h.
7435 * stringpool.h (string_length): Move out of Stringpool_template.
7436
1e3811b0
ILT
74372010-08-03 Ian Lance Taylor <iant@google.com>
7438
7439 PR 11712
7440 * layout.cc (relaxation_loop_body): If address of load segment is
7441 set, adjust address to include headers if possible.
7442
7af0c620
ILT
74432010-08-03 Ian Lance Taylor <iant@google.com>
7444
7445 * version.cc (version_string): Bump to 1.10.
7446
22f0da72
ILT
74472010-08-03 Ian Lance Taylor <iant@google.com>
7448
7449 PR 11805
7450 * layout.h (enum Output_section_order): Define.
7451 (class Layout): Update declarations.
7452 * layout.cc (Layout::get_output_section): Add order parameter.
7453 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7454 is_first_non_relro parameters. Change all callers.
7455 (Layout::choose_output_section): Likewise.
7456 (Layout::add_output_section_data): Likewise.
7457 (Layout::make_output_section): Likewise. Set order.
7458 (Layout::default_section_order): New function.
7459 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7460 * output.cc (Output_section::Output_section): Initialize order_.
7461 Don't initialize deleted fields.
7462 (Output_segment::Output_segment): Don't initialize deleted
7463 fields.
7464 (Output_segment::add_output_section_to_load): New function
7465 replacing add_output_section. Change all callers to call this or
7466 add_output_section_to_nonload.
7467 (Output_segment::add_output_section_to_nonload): New function.
7468 (Output_segment::remove_output_section): Rewrite.
7469 (Output_segment::add_initial_output_data): Likewise.
7470 (Output_segment::has_any_data_sections): Likewise.
7471 (Output_segment::is_first_section_relro): Likewise.
7472 (Output_segment::maximum_alignment): Likewise.
7473 (Output_segment::has_dynamic_reloc): New function replacing
7474 dynamic_reloc_count. Change all callers.
7475 (Output_segment::has_dynamic_reloc_list): New function replacing
7476 dynamic_reloc_count_list. Change all callers.
7477 (Output_segment::set_section_addresses): Rewrite.
7478 (Output_segment::set_offset): Rewrite.
7479 (Output_segment::find_first_and_last_list): Remove.
7480 (Output_segment::set_tls_offsets): Rewrite.
7481 (Output_segment::first_section_load_address): Likewise.
7482 (Output_segment::output_section_count): Likewise.
7483 (Output_segment::section_with_lowest_load_address): Likewise.
7484 (Output_segment::write_section_headers): Likewise.
7485 (Output_segment::print_sections_to_map): Likewise.
7486 * output.h (class Output_data): Remove dynamic_reloc_count_
7487 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7488 (Output_data::add_dynamic_reloc): Rewrite.
7489 (Output_data::has_dynamic_reloc): New function.
7490 (Output_data::dynamic_reloc_count): Remove.
7491 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7492 is_last_relro_, is_first_non_relro_, is_interp_,
7493 is_dynamic_linker_section_ fields. Add order and set_order
7494 functions. Remove is_relro_local, set_is_relro_local,
7495 is_last_relro, set_is_last_relro, is_first_non_relro,
7496 set_is_first_non_relro functions, is_interp, set_is_interp,
7497 is_dynamic_linker_section, and set_is_dynamic_linker_section
7498 functions.
7499 (class Output_segment): Change Output_data_list from std::list to
7500 std:;vector. Add output_lists_ field. Remove output_data_ and
7501 output_bss_ fields. Update declarations.
7502
3ff2ccb0
ILT
75032010-08-02 Ian Lance Taylor <iant@google.com>
7504
7505 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7506 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7507 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7508
88a4108b
ILT
75092010-08-02 Ian Lance Taylor <iant@google.com>
7510
7511 PR 11855
7512 * script.cc (Script_options::Script_options): Initialize
7513 symbol_definitions_ and symbol_references_.
7514 (Script_options::add_symbol_assignment): Update
7515 symbol_definitions_ and symbol_references_.
7516 (Script_options::add_symbol_reference): New function.
7517 (script_symbol): New function.
7518 * script.h (class Script_options): Add symbol_definitions_ and
7519 symbol_references_ fields.
7520 (Script_options::referenced_const_iterator): New type.
7521 (Script_options::referenced_begin): New function.
7522 (Script_options::referenced_end): New function.
7523 (Script_options::is_referenced): New function.
7524 (Script_options::any_unreferenced): New function.
7525 * script-c.h (script_symbol): Declare.
7526 * yyscript.y (exp): Call script_symbol.
7527 * symtab.cc: Include "script.h".
7528 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7529 Change all callers. Check symbols referenced by scripts.
7530 (Symbol_table::add_undefined_symbols_from_command_line): Add
7531 layout parameter. Change all callers.
7532 (Symbol_table::do_add_undefined_symbols_from_command_line):
7533 Likewise. Break out loop body. Check symbols referenced by
7534 scripts.
7535 (Symbol_table::add_undefined_symbol_from_command_line): New
7536 function broken out of
7537 do_add_undefined_symbols_from_command_line.
7538 * symtab.h (class Symbol_table): Update declarations.
7539 * archive.cc: Include "layout.h".
7540 (Archive::should_include_member): Add layout parameter. Change
7541 all callers. Check for symbol mentioned in expression.
7542 * archive.h (class Archive): Update declaration.
7543 * object.cc (Sized_relobj::do_should_include_member): Add layout
7544 parameter.
7545 * object.h (Object::should_include_member): Add layout parameter.
7546 Change all callers.
7547 (Object::do_should_include_member): Add layout parameter.
7548 (class Sized_relobj): Update declaration.
7549 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7550 parameter.
7551 * dynobj.h (class Sized_dynobj): Update declaration.
7552 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7553 layout parameter.
7554 * plugin.h (class Sized_pluginobj): Update declaration.
7555
5f1ab67a
ILT
75562010-08-02 Ian Lance Taylor <iant@google.com>
7557
7558 PR 11866
7559 * output.cc (Output_segment::set_offset): Search for the first and
7560 last sections rather than assuming that the list is in order.
7561 (Output_segment::find_first_and_last_list): New function.
7562 * output.h (class Output_segment): Update declarations.
7563 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7564 (relro_strip_test_SOURCES): New variable.
7565 (relro_strip_test_DEPENDENCIES): New variable.
7566 (relro_strip_test_LDFLAGS): New variable.
7567 (relro_strip_test_LDADD): New variable.
7568 (relro_strip_test.so): New target.
7569
a8df5856
ILT
75702010-08-02 Ian Lance Taylor <iant@google.com>
7571
7572 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7573 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7574 (Target_i386::got_tlsdesc_section): New function.
7575 (Target_i386::got_section): Create space for GOT entries for
7576 TLSDESC relocations.
7577 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7578 R_386_TLS_GOTDESC.
7579 (Target_i386::Scan::global): Likewise.
7580 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7581 using TLSDESC GOT.
7582 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7583 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7584 (Target_x86_64::got_tlsdesc_section): New function.
7585 (Target_x86_64::got_section): Create space for GOT entries for
7586 TLSDESC relocations.
7587 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7588 R_386_TLS_GOTDESC.
7589 (Target_x86_64::Scan::global): Likewise.
7590 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7591 using TLSDESC GOT.
7592
0c10a0a6
ILT
75932010-08-02 Ian Lance Taylor <iant@google.com>
7594
7595 * testsuite/final_layout.sh: Use dc to convert from hex to
7596 decimal.
7597
41cbeecc
ST
75982010-07-29 Sriraman Tallam <tmsriram@google.com>
7599
7600 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7601 paramter to the call to gold::gc_process_relocs.
7602 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7603 paramter to the call to gold::gc_process_relocs.
7604 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7605 parameter to the call to gold::gc_process_relocs.
7606 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7607 template parameter to the call to gold::gc_process_relocs.
7608 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7609 paramter to the call to gold::gc_process_relocs.
7610 * gc.h (get_embedded_addend_size): New function.
7611 (gc_process_relocs): Save the size of the reloc for use by ICF.
7612 * icf.cc (get_section_contents): Get the addend from the text section
7613 for SHT_REL relocation sections.
7614 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7615 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7616 * int_encoding.h (read_from_pointer): New overloaded function.
7617 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7618 * testsuite/icf_sht_rel_addend_test.sh: New file.
7619 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7620 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7621
6ea55b82
RW
76222010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7623
7624 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7625 * Makefile.in: Regenerate.
7626 * testsuite/Makefile.in: Regenerate.
7627
9691462b
ILT
76282010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7629
7630 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7631 * gold/testsuite/debug_msg.cc: Likewise.
7632 * gold/testsuite/odr_violation1.cc
7633 * gold/testsuite/odr_violation2.cc
7634
76897331
CC
76352010-07-21 Cary Coutant <ccoutant@google.com>
7636
7637 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7638 string, and length fields.
7639 (Output_merge_string::Merged_strings_list): New type.
7640 (Output_merge_string::Merged_strings_lists): New typedef.
7641 (Output_merge_string): Replace merged_strings_ with
7642 merged_strings_lists_.
7643 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7644 Merged_strings_list per input object and section. Don't store pointer
7645 to the string. Don't store length with each merged string entry.
7646 (Output_merge_string::finalize_merged_data): Loop over list of merged
7647 strings lists. Recompute length of each merged string.
7648
78384e8f
CC
76492010-07-15 Cary Coutant <ccoutant@google.com>
7650
7651 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7652 here.
7653
783659f9
ILT
76542010-07-14 Ian Lance Taylor <iant@google.com>
7655
7656 * descriptors.cc (Descriptors::open): Report correct name in error
7657 message.
7658
131687b4
DK
76592010-07-13 Doug Kwan <dougkwan@google.com>
7660
7661 * arm.cc (Arm_input_section::Arm_input_section): For a
7662 SHT_ARM_EXIDX section, always keeps the input sections.
7663 (Arm_input_section::set_exidx_section_link): New method.
7664 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7665 has_errors_ to false.
7666 (Arm_exidx_input_section::has_errors,
7667 Arm_exidx_input_section::set_has_errors): New methods.
7668 (Arm_exidx_input_section::has_errors_): New data member.
7669 (Arm_relobj::get_exidx_shndx_list): New method.
7670 (Arm_output_section::append_text_sections_to_list): Do not skip
7671 section without SHF_EXECINSTR.
7672 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7673 errors.
2e702c99 7674 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
7675 section header. Make error messages more verbose. Check for
7676 a non-executable section linked to an EXIDX section.
7677 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7678 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7679 check that there is no deferred EXIDX section if we exit early.
7680 Instead of not making an EXIDX section in case of an error, make one
7681 and set the has_errors flag of it.
7682 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7683 in a relocatable link.
7684 (Target_arm::do_relax): Look for the EXIDX output section instead of
7685 assuming that it is called .ARM.exidx.
2e702c99 7686 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
7687 section list. Do not check for SHF_EXECINSTR section flags but
7688 skip any input section with errors.
7689 * output.cc (Output_section::Output_section): Initialize
7690 always_keeps_input_sections_ to false.
7691 (Output_section::add_input_section): Check for
7692 always_keeps_input_sections_.
7693 * output.h (Output_section::always_keeps_input_sections,
7694 Output_section::set_always_keeps_input_sections): New methods.
7695 (Output_section::always_keeps_input_sections): New data member.
7696
69517287
RÁE
76972010-07-13 Rafael Espindola <espindola@google.com>
7698
7699 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7700 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7701
82742395
ILT
77022010-07-13 Philip Herron <herron.philip@googlemail.com>
7703 Ian Lance Taylor <iant@google.com>
7704
7705 * output.h (Output_section_lookup_maps::add_merge_section):
7706 Correct check of whether value was inserted.
7707 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7708 (Output_section_lookup_maps::add_relaxed_input_section):
7709 Likewise.
7710 * arm.cc (Target_arm::got_section): Remove used local os.
7711 * i386.cc (Target_i386::got_section): Likewise.
7712 * x86_64.cc (Target_x86_64::got_section): Likewise.
7713 * sparc.cc (Target_sparc::got_section): Likewise.
7714 (Target_sparc::relocate): Remove unused local have_got_offset.
7715 * powerpc.cc (Target_powerpc::relocate): Likewise.
7716
f2d707b5
ILT
77172010-07-13 Ian Lance Taylor <iant@google.com>
7718
241531d6
ILT
7719 * compressed_output.cc (zlib_decompress): Fix signature in
7720 !HAVE_ZLIB_H case.
7721
f2d707b5
ILT
7722 * archive.cc (Archive::include_member): Unlock an external member
7723 of a thin archive. Don't bother to delete an object we know is
7724 NULL.
7725
a2e47362
CC
77262010-07-12 Cary Coutant <ccoutant@google.com>
7727
7728 * compressed_output.cc (zlib_decompress): New function.
7729 (get_uncompressed_size): New function.
7730 (decompress_input_section): New function.
7731 * compressed_output.h (get_uncompressed_size): New function.
7732 (decompress_input_section): New function.
7733 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7734 Handle compressed debug sections.
7735 * layout.cc (is_compressed_debug_section): New function.
7736 (Layout::output_section_name): Map compressed section names to
7737 canonical names.
7738 * layout.h (is_compressed_debug_section): New function.
7739 (is_debug_info_section): Recognize compressed debug sections.
7740 * merge.cc: Include compressed_output.h.
7741 (Output_merge_data::do_add_input_section): Handle compressed
7742 debug sections.
7743 (Output_merge_string::do_add_input_section): Handle compressed
7744 debug sections.
7745 * object.cc: Include compressed_output.h.
7746 (Sized_relobj::Sized_relobj): Initialize new data members.
7747 (build_compressed_section_map): New function.
7748 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7749 * object.h (Object::section_is_compressed): New method.
7750 (Object::do_section_is_compressed): New method.
7751 (Sized_relobj::Compressed_section_map): New type.
7752 (Sized_relobj::do_section_is_compressed): New method.
7753 (Sized_relobj::compressed_sections_): New data member.
7754 * output.cc (Output_section::add_input_section): Handle compressed
7755 debug sections.
7756 * reloc.cc: Include compressed_output.h.
7757 (Sized_relobj::write_sections): Handle compressed debug sections.
7758
ce279a62
CC
77592010-07-08 Cary Coutant <ccoutant@google.com>
7760
7761 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7762 weak when resolving to a dynamic def.
7763 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7764 for weak undef/dynamic def cases. Adjust callers.
7765 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7766 undef_binding_weak_.
7767 (Symbol_table::sized_write_globals): Adjust symbol binding.
7768 (Symbol_table::sized_write_symbol): Add binding parameter.
7769 * symtab.h (Symbol::set_undef_binding): New method.
7770 (Symbol::is_undef_binding_weak): New method.
7771 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
7772 (Symbol_table::should_override): Add new parameter.
7773 (Symbol_table::sized_write_symbol): Add new parameter.
7774
7775 * testsuite/weak_undef_file1.cc: Add new test case.
7776 * testsuite/weak_undef_file2.cc: Fix header comment.
7777 * testsuite/weak_undef_test.cc: Add new test case.
7778
b2286c10
DK
77792010-06-29 Doug Kwan <dougkwan@google.com>
7780
7781 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
7782 Initialize USE_SYMBOL_.
7783 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
7784 definition.
7785 (Arm_reloc_property::uses_symbol_): New data member declaration.
7786 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
7787 uses symbol value and symbol is undefined but not weakly undefined.
7788
4802450a
RÁE
77892010-06-28 Rafael Espindola <espindola@google.com>
7790
7791 * plugin.cc (Plugin::load): Use dlerror.
7792
e5ca47ba
ILT
77932010-06-26 Jeffrey Yaskin <jyasskin@google.com>
7794
7795 * symtab.cc (detect_odr_violations): When reporting an ODR
7796 violation, report an object where the symbol is defined.
7797
8a75a161
DK
77982010-06-25 Doug Kwan <dougkwan@google.com>
7799
7800 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
7801 (Target_arm::section_may_have_icf_unsafe_pointers): New method
7802 definition.
7803 (Target_arm::Scan::local_reloc_may_be_function_pointer,
7804 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
7805 target hook to detect function points.
7806 (Target_arm::Scan::possible_function_pointer_reloc): New method.
7807 * icf.h (Icf::check_section_for_function_pointers): Change type of
7808 parameter SECTION_NAME to const reference to std::string. Use
7809 target hook to determine if section may have unsafe pointers.
7810 * target.h (Target::section_may_have_icf_unsafe_pointers): New
7811 method definition.
7812
42218b9f
RÁE
78132010-06-21 Rafael Espindola <espindola@google.com>
7814
7815 * fileread.cc (Input_file::find_fie): New
7816 (Input_file::open): Use Input_file::find_fie.
7817 * fileread.h (Input_file::find_fie): New
7818 * plugin.cc (set_extra_library_path): New.
7819 (Plugin::load): Add set_extra_library_path to the transfer vector.
7820 (Plugin_manager::set_extra_library_path): New.
7821 (Plugin_manager::add_input_file): Use the extra search path if set.
7822 (set_extra_library_path(): New.
7823 * plugin.h (Plugin_manager): Add set_extra_library_path and
7824 extra_search_path_.
7825
a0506cca
CC
78262010-06-19 Cary Coutant <ccoutant@google.com>
7827
7828 * layout.cc (gdb_sections): Add .debug_types.
7829 (lines_only_debug_sections): Likewise.
7830
6508b958
RÁE
78312010-06-18 Rafael Espindola <espindola@google.com>
7832
7833 * plugin.cc (add_input_file,add_input_library)
7834 (Plugin_manager::add_input_file): Make filename arguments const.
7835 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
7836 const.
7837
3e235302
DK
78382010-06-16 Doug Kwan <dougkwan@google.com>
7839
7840 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
7841 .ARM.attributes section if we have not merged any input
7842 attributes sections.
7843
106e8a6c
DK
78442010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7845
7846 * arm.cc: Allow combining objects with no EABI version
7847 information.
7848
91ff43fe
RÁE
78492010-06-15 Rafael Espindola <espindola@google.com>
7850
7851 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
7852
68ed838c
ILT
78532010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7854
7855 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
7856 (struct iovec): Correct !HAVE_READV definition.
7857
f3a2388f
CC
78582010-06-10 Cary Coutant <ccoutant@google.com>
7859
7860 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
7861 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
7862 reloc sections.
7863 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
7864
7865 PR 11683
7866 * symtab.h (Symbol::is_placeholder): New member function.
7867 * target-reloc.h (relocate_section): Check for placeholder symbols.
7868
7869 * testsuite/Makefile.am (plugin_test_8): New test.
7870 (plugin_test_9): New test.
7871 * testsuite/Makefile.in: Regenerate.
7872
e1df38aa
NC
78732010-06-09 Nick Clifton <nickc@redhat.com>
7874
7875 * yyscript.y (input_list_element): Allow strings prefixed with
7876 the '-' character. Treat these as libraries.
7877 * script.cc (script_add_library): New function. Adds a library
7878 specified by "-l<name>" found in an input script.
7879 * script-c.h: Add prototype for script_add_library.
7880
25bbe950
DK
78812010-06-07 Doug Kwan <dougkwan@google.com>
7882
7883 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
7884 Restrict stub-group size to be within long conditional branch
7885 range when working around cortex-A8 erratum.
7886
0f32ea4c
ILT
78872010-06-07 Damien Diederen <dd@crosstwine.com>
7888
7889 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
7890 #ifdef typo.
7891
8fe2a369
ST
78922010-06-03 Sriraman Tallam <tmsriram@google.com>
7893
7894 PR gold/11658
7895 * output.cc
7896 (Output_section::Input_section_sort_entry::compare_section_ordering):
7897 Change to return non-zero correctly.
7898 (Output_section::Input_section_sort_section_order_index_compare
7899 ::operator()): Change to fix ambiguity in comparisons.
7900
6e9ba2ca
ST
79012010-06-01 Sriraman Tallam <tmsriram@google.com>
7902
7903 * gold.h (is_wildcard_string): New function.
7904 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
7905 (Layout::layout_eh_frame): Ditto.
7906 (Layout::find_section_order_index): New method.
7907 (Layout::read_layout_from_file): New method.
7908 * layout.h (Layout::find_section_order_index): New method.
7909 (Layout::read_layout_from_file): New method.
7910 (Layout::input_section_position_): New private member.
7911 (Layout::input_section_glob_): New private member.
7912 * main.cc (main): Call read_layout_from_file here.
7913 * options.h (--section-ordering-file): New option.
7914 * output.cc (Output_section::input_section_order_specified_): New
7915 member.
7916 (Output_section::Output_section): Initialize new member.
7917 (Output_section::add_input_section): Add new parameter.
7918 Keep input sections when --section-ordering-file is used.
7919 (Output_section::set_final_data_size): Sort input sections when
7920 section ordering file is specified.
7921 (Output_section::Input_section_sort_entry): Add new parameter.
7922 Check sorting type.
7923 (Output_section::Input_section_sort_entry::compare_section_ordering):
7924 New method.
7925 (Output_section::Input_section_sort_compare::operator()): Change to
7926 consider section_order_index.
7927 (Output_section::Input_section_sort_init_fini_compare::operator()):
7928 Change to consider section_order_index.
7929 (Output_section::Input_section_sort_section_order_index_compare
7930 ::operator()): New method.
7931 (Output_section::sort_attached_input_sections): Change to sort
7932 according to section order when specified.
e1df38aa
NC
7933 (Output_section::add_input_section<32, true>): Add new parameter.
7934 (Output_section::add_input_section<64, true>): Add new parameter.
7935 (Output_section::add_input_section<32, false>): Add new parameter.
7936 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
7937 * output.h (Output_section::add_input_section): Add new parameter.
7938 (Output_section::input_section_order_specified): New
7939 method.
7940 (Output_section::set_input_section_order_specified): New method.
7941 (Input_section::Input_section): Initialize section_order_index_.
7942 (Input_section::section_order_index): New method.
7943 (Input_section::set_section_order_index): New method.
7944 (Input_section::section_order_index_): New member.
7945 (Input_section::Input_section_sort_section_order_index_compare): New
7946 struct.
7947 (Output_section::input_section_order_specified_): New member.
7948 * script-sections.cc (is_wildcard_string): Delete and move modified
7949 method to gold.h.
7950 (Output_section_element_input::Output_section_element_input): Modify
7951 call to is_wildcard_string.
7952 (Output_section_element_input::Input_section_pattern
7953 ::Input_section_pattern): Ditto.
7954 (Output_section_element_input::Output_section_element_input): Ditto.
7955 * testsuite/Makefile.am (final_layout): New test case.
7956 * testsuite/Makefile.in: Regenerate.
7957 * testsuite/final_layout.cc: New file.
7958 * testsuite/final_layout.sh: New file.
7959
3537c84b
RÁE
79602010-06-01 Rafael Espindola <espindola@google.com>
7961
7962 * plugin.cc (Plugin::load): Pass the output name to the plugin.
7963
105b6afd
RÁE
79642010-06-01 Rafael Espindola <espindola@google.com>
7965
7966 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
7967 visibility of symbols.
7968
29e11421
DK
79692010-05-27 Doug Kwan <dougkwan@google.com>
7970
7971 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
7972 from start of output section instead of address for a local symbol
7973 in a merged or relaxed section when doing a relocatable link.
7974
5e0f337e
RÁE
79752010-05-26 Rafael Espindola <espindola@google.com>
7976
703d02da 7977 PR 11604
5e0f337e
RÁE
7978 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7979 adding sections the garbage collector removed.
7980 * gold/testsuite/Makefile.am: Add test.
7981 * gold/testsuite/Makefile.in: Regenerate.
7982 * gold/testsuite/plugin_test_7.sh: New.
7983 * gold/testsuite/plugin_test_7_1.c: New.
7984 * gold/testsuite/plugin_test_7_2.c: New.
7985
f4187277
RÁE
79862010-05-26 Rafael Espindola <espindola@google.com>
7987
7988 * script-sections.cc (Output_section_definition::set_section_addresses):
7989 Check for --section-start.
7990
5c388529
DK
79912010-05-26 Doug Kwan <dougkwan@google.com>
7992
7993 * arm.cc (Arm_scan_relocatable_relocs): New class.
7994 (Target_arm::relocate_special_relocatable): New method.
7995 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7996 (Arm_relocate_functions::thumb_branch_common): Same.
7997 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7998 instead of Default_scan_relocatable_relocs.
7999 * target-reloc.h (relocate_for_relocatable): Let target handle
8000 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8001 * target.h (Sized_target::relocate_special_relocatable): New method.
8002
bca1c3ae
ILT
80032010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8004
8005 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8006
0439c796
DK
80072010-05-23 Doug Kwan <dougkwan@google.com>
8008
8009 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8010 instead of a cast.
8011 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8012 with a direct branch, not a conditional branch, to a stub.
8013 * merge.cc (Output_merge_base::record_input_section): New method
8014 defintion.
8015 (Output_merge_data::do_add_input_section): Record input section if
8016 keeps-input-sections flag is set.
8017 (Output_merge_string::do_add_input_section): Ditto.
8018 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8019 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8020 INPUT_SECTIONS_.
8021 (Output_merge_base::keeps_input_sections,
8022 Output_merge_base::set_keeps_input_sections,
8023 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8024 method definitions.
8025 (Output_merge_base::Input_sections): New type declaration.
8026 (Output_merge_base::input_sections_begin,
8027 Output_merge_base::input_sections_end,
8028 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8029 (Output_merge_base::bool keeps_input_sections_,
8030 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8031 Output_merge_base::input_sections_): New data members.
8032 (Output_merge_data::do_set_keeps_input_sections): New method
8033 defintion.
8034 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8035 * output.cc (Output_section::Input_section::relobj): Move method
8036 defintion from class declaration to here and handle merge sections.
8037 (Output_section::Input_section::shndx): Ditto.
8038 (Output_section::Output_section): Remove initializations of removed
8039 data members and initialize new data member LOOKUP_MAPS_.
8040 (Output_section::add_input_section): Set keeps-input-sections flag
8041 for a newly created merge output section as appropriate. Adjust code
8042 to use Output_section_lookup_maps class.
8043 (Output_section::add_relaxed_input_section): Adjst code for lookup
8044 maps code refactoring.
2e702c99 8045 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8046 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8047 class. If adding input section to a newly created merge output
8048 section fails, remove the new merge section.
8049 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8050 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8051 (Output_section::find_merge_section): Ditto.
0439c796 8052 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8053 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8054 Output_section_lookup_maps class.
8055 (Output_section::get_input_sections): Export merge sections. Adjust
8056 code to use Output_section_lookup_maps class.
8057 (Output_section:::add_script_input_section): Adjust code to use
8058 Output_section_lookup_maps class. Update lookup maps for merge
8059 sections also.
8060 (Output_section::discard_states): Use Output_section_lookup_maps.
8061 (Output_section::restore_states): Same.
8062 * output.h (Merge_section_properties): Move class defintion out of
8063 Output_section.
8064 (Output_section_lookup_maps): New class.
8065 (Output_section::Input_section::is_merge_section): New method
8066 defintion.
8067 (Output_section::Input_section::relobj): Move defintion out of class
8068 defintion. Declare method only.
8069 (Output_section::Input_section::shndx): Ditto.
8070 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8071 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8072 (Output_section::Merge_section_by_properties_map,
8073 Output_section::Output_section_data_by_input_section_map,
8074 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8075 Remove types.
2e702c99 8076 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8077 KEEPS_INPUT_SECTIONS.
8078 (Output_section::build_lookup_maps): New method declaration.
8079 (Output_section::merge_section_map_,
8080 Output_section::merge_section_by_properties_map_,
8081 Output_section::relaxed_input_section_map_,
8082 Output_section::is_relaxed_input_section_map_valid_): Remove data
8083 members.
8084 (Output_section::lookup_maps_): New data member.
8085
76295588
L
80862010-05-21 Doug Kwan <dougkwan@google.com>
8087
8088 PR gold/11619
8089 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8090 avoid a compilation error.
8091
d103a984
RÁE
80922010-05-19 Rafael Espindola <espindola@google.com>
8093
8094 * script-sections.cc (Output_section_definition::allocate_to_segment):
8095 Update the phdrs_list even when the output section is NULL.
8096 * testsuite/Makefile.am: Add test.
8097 * testsuite/Makefile.in: Regenerate.
8098 * testsuite/script_test_9.cc: New.
8099 * testsuite/script_test_9.sh: New.
8100 * testsuite/script_test_9.t: New.
8101
6625d24e
DK
81022010-05-19 Doug Kwan <dougkwan@google.com>
8103
8104 * arm.cc (Arm_input_section::original_size): New method.
8105 (Arm_input_section::do_addralign): Add a cast.
8106 (Arm_input_section::do_output_offset): Remove static cast.
8107 (Arm_input_section::original_addralign,
8108 Arm_input_section::original_size_): Change type to uint32_t.
8109 (Arm_input_section::init): Add safe casts for section alignment
8110 and size.
8111 (Arm_input_section::set_final_data_size): Do not set address and
8112 offset of stub table.
8113 (Arm_output_section::fix_exidx_coverage): Change use of of
8114 Output_section::Simple_input_section to that of
8115 Output_section::Input_section.
8116 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8117 except for the first pass.
8118 * output.cc (Output_section::get_input_sections): Change type of
8119 input_sections to std::list<Input_section>.
8120 (Output_section::add_script_input_section): Rename from
8121 Output_section::add_simple_input_section. Change type of SIS
8122 parameter from Simple_input_section to Input_section.
8123 * output.h (Output_section::Simple_input_section): Remove class.
8124 (Output_section::Input_section): Change class visibility to public.
8125 (Output_section::Input_section::addralign): Use stored alignments
8126 for special input sections if set.
8127 (Output_section::Input_section::set_addralign): New method.
8128 (Output_section::get_input_sections): Change parameter type from
8129 list of Simple_input_section to list of Input_section.
8130 (Output_section::add_script_input_section): Rename from
8131 Output_section::add_simple_input_section. Change first parameter's
8132 type from Simple_input_section to Input_section and remove the
8133 second and third parameters.
8134 * script-sections.cc (Input_section::Input_section_list): Change
8135 type to list of Output_section::Input_section/
8136 (Input_section_info::Input_section_info): Change parameter type of
8137 INPUT_SECTION to Output_section::Input_section.
8138 (Input_section_info::input_section): Change return type.
8139 (Input_section_info::input_section_): Change type to
8140 Output_section::Input_section.
8141 (Output_section_element_input::set_section_addresses): Adjust code
8142 to use Output_section::Input_section instead of
8143 Output_section::Simple_input_section. Adjust code for renaming
8144 of Output_section::add_simple_input_section.
8145 (Orphan_output_section::set_section_addresses): Ditto.
8146
e1e82ea4
RW
81472010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8148
8149 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8150 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8151
91e75c8a
RÁE
81522010-05-18 Rafael Espindola <espindola@google.com>
8153
8154 * options.cc (General_options::finalize): Handle -nostdlib.
8155 * options.h (nostdlib): New option.
8156 * script.cc (script_add_search_dir): Handle -nostdlib.
8157
da59ad79
DK
81582010-05-12 Doug Kwan <dougkwan@google.com>
8159
8160 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8161 attributes section only if there no attributes section after merging.
8162 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8163 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8164 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8165 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8166 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8167 and arm_attr_merge_7.stdout.
8168 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8169 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8170 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8171 arm_attr_merge_7b.o): New rules.
8172 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8173 arm_attr_merge_7
8174 * testsuite/Makefile.in: Regenerate.
8175 * testsuite/arm_attr_merge.sh: New file.
8176 * testsuite/arm_attr_merge_[67][ab].s: Same.
8177
3e01a7fd
NC
81782010-05-05 Nick Clifton <nickc@redhat.com>
8179
8180 * po/es.po: Updated Spanish translation.
8181
7ad2014a
L
81822010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8183
8184 * Makefile.am (install-exec-local): Properly install gold as
8185 default cross linker.
8186 * Makefile.in: Regenerated.
8187
4fda8867
NC
81882010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8189 Nick Clifton <nickc@redhat.com>
8190
8191 * configure.ac (install_as_default): Define and set to false
8192 unless --enable-gold or --enable-gold=both/gold has been
8193 specified.
8194 * configure: Regenerate.
8195
8196 * Makefile.am (install-exec-local): Install the executable as
8197 'ld.gold'. If install_as_default is true then also install it as
8198 'ld'.
8199 * Makefile.in: Regenerated.
8200
bd288ea2
ILT
82012010-04-24 Ian Lance Taylor <iant@google.com>
8202
8203 * layout.cc (Layout::layout_reloc): In relocatable link don't
8204 combine reloc sections for grouped sections.
8205
ef38fd8a
ST
82062010-04-23 Sriraman Tallam <tmsriram@google.com>
8207
8208 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8209 sections that are not ordinary to icf.
8210 * icf.cc (get_section_contents): Handle relocation pointing to section
8211 with no object or shndx information.
8212 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8213 * testsuite/Makefile.in: Regenerate.
8214 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8215 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8216
f6973bdc
ILT
82172010-04-22 Ian Lance Taylor <iant@google.com>
8218
8219 * expression.cc (Expression::Expression_eval_info): Add
8220 result_alignment_pointer field.
8221 (Expression::eval_with_dot): Add result_alignment_pointer
8222 parameter. Change all callers.
8223 (Expression::eval_maybe_dot): Likewise.
8224 (class Binary_expression): Add alignment_pointer parameter to
8225 left_value and right_value. Change all callers.
8226 (BINARY_EXPRESSION): Set result alignment.
8227 (class Trinary_expression): Add alignment_pointer parameter to
8228 arg2_value and arg3_value. Change all callers.
8229 (Trinary_cond::value): Set result alignment.
8230 (Max_expression::value, Min_expression::value): Likewise.
8231 (Align_expression::value): Likewise.
8232 * script-sections.cc (class Sections_element): Add dot_alignment
8233 parameter to set_section_addresses virtual function. Update
8234 instantiations.
8235 (class Output_section_element): Likewise.
8236 (Script_sections::create_segments): Add dot_alignment parameter.
8237 Change all callers.
8238 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8239 (Script_sections::set_phdrs_clause_addresses): Likewise.
8240 * script-sections.h: Update declarations.
8241 * script.h: Update declarations.
8242 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8243 min_p_align.
8244 * testsuite/script_test_3.t: Set large alignment.
8245 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8246 segment has expected alignment.
8247
9c9c98a5
NC
82482010-04-22 Nick Clifton <nickc@redhat.com>
8249
8250 * po/gold.pot: Updated by the Translation project.
8251 * po/vi.po: Updated Vietnamese translation.
8252
2253bfba
L
82532010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8254
8255 * testsuite/Makefile.am (check_PROGRAMS): Add
8256 icf_virtual_function_folding_test.
8257 * testsuite/Makefile.in: Regenerated.
8258
85fdf906
AH
82592010-04-15 Andrew Haley <aph@redhat.com>
8260
8261 * options.h (merge_exidx_entries): New option.
8262 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8263 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8264 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8265 (Target_arm::merge_exidx_entries): New function.
8266 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8267 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8268 to Arm_exidx_fixup constructor.
8269 Add new arg, merge_exidx_entries.
8270 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8271 Arm_output_section::fix_exidx_coverage.
8272
ce97fa81
ST
82732010-04-18 Sriraman Tallam <tmsriram@google.com>
8274
8275 * icf.cc (get_section_contents): Check for preemptible functions.
8276 Ignore addend when appropriate.
8277 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8278 section folded.
8279 (add_from_relobj): Check for section folded.
8280 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8281 * symtab.h (should_add_dynsym_entry): Add new parameter.
8282 * target-reloc.h (scan_relocs): Check for section folded.
8283 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8284 Check reloc types for function pointers in shared objects.
8285 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8286 case.
8287 (icf_preemptible_functions_test): New test case.
8288 (icf_string_merge_test): New test case.
8289 * testsuite.Makefile.in: Regenerate.
8290 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8291 bar_glob. Refactor code.
8292 * testsuite/icf_preemptible_functions_test.cc: New file.
8293 * testsuite/icf_preemptible_functions_test.sh: New file.
8294 * testsuite/icf_string_merge_test.cc: New file.
8295 * testsuite/icf_string_merge_test.sh: New file.
8296 * testsuite/icf_virtual_function_folding_test.cc: New file.
8297 * testsuite/icf_virtual_function_folding_test.sh: New file.
8298
04ceb17c
DK
82992010-04-14 Doug Kwan <dougkwan@google.com>
8300
8301 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8302 for local symbol recounting if we remove a section due to ICF.
8303 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8304 there are no regular objects in input.
8305
153e7da4
DK
83062010-04-13 Doug Kwan <dougkwan@google.com>
8307
8308 * arm.cc (Arm_input_section::set_final_data_size): Compute
8309 accurate final data size instead of using current data size.
8310
4dbd9faf
DK
83112010-04-09 Doug Kwan <dougkwan@google.com>
8312
8313 * layout.cc (Layout::choose_output_section): Handle script section
8314 types.
8315 (Layout::make_output_section_for_script): Add section type parameter.
8316 Handle script section types.
8317 * layout.h (Layout::make_output_section_for_script): Add section
8318 type parameter.
8319 * output.cc (Output_section::Output_section): Initialize data member
8320 is_noload_.
8321 (Output_section::do_reset_address_and_file_offset): Do not set address
8322 to 0 if section is a NOLOAD section.
8323 * output.h (Output_section::is_noload): New method.
8324 (Output_section::set_is_noload): Ditto.
8325 (Output_section::is_noload_): New data member.
8326 * script-c.h (Script_section_type): New enum type.
8327 (struct Parser_output_section_header): Add new file section_type.
8328 * script-sections.cc (Sections_element::output_section_name): Add
8329 parameter for returning script section type.
8330 (Output_section_definition::output_section_name): Ditto.
8331 (Output_section_definition::section_type)P; New method.
8332 (Output_section_definiton::script_section_type_name): Ditto.
8333 (Output_section_definition::script_section_type_): New data member.
8334 (Output_section_definition::Output_section_definition): Initialize
8335 data member Output_section_definition::script_section_type_.
8336 (Output_section_definition::create_sections): Pass script section type
8337 to Layout::make_output_section_for_script.
8338 (Output_section_definition::output_section_name): Return script
8339 section type to caller.
8340 (Output_section_definition::set_section_address): Do not advance
8341 dot value and load address if section type is NOLOAD. Set address
8342 of NOLOAD sections regardless of section flags.
8343 (Output_section_definition::print): Print section type if it is
8344 not SCRIPT_SECTION_TYPE_NONE.
8345 (Output_section_definition::section_type): New method.
8346 (Output_section_definition::script_section_type_name): Ditto.
8347 (Script_sections::output_section_name): Add new parameter
8348 PSECTION_TYPE for returning script section type. Pass it to
8349 section elements. Handle discard sections.
8350 (Sort_output_sections::operator()): Handle NOLOAD sections.
8351 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8352 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8353 returning script section type.
8354 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8355 INFO and NOLOAD.
8356 * yyscript.y (union): Add new field SECTION_TYPE.
8357 (COPY, DSECT, INFO, NOLOAD): New tokens.
8358 (opt_address_and_section_type): Change type to output_section_header.
8359 (section_type): New non-terminal
8360 (section_header): Handle section type.
2253bfba 8361 (opt_address_and_section_type): Return section type value.
4dbd9faf 8362
721ea635
L
83632010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8364
8365 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8366 * testsuite/plugin_common_test_2.c (foo): Likewise.
8367
6bf924b0
DK
83682010-04-08 Doug Kwan <dougkwan@google.com>
8369
8370 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8371 Output_merge_data.
8372 * output.cc (Output_section::add_merge_input_section): Simplify
8373 code and return status of Output_merge_base::add_input_section.
e1df38aa 8374 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8375 returns true.
8376
24af6f92
DK
83772010-04-07 Doug Kwan <dougkwan@google.com>
8378
8379 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8380 if section is marked as containing instructions but has no mapping
8381 symbols.
8382 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8383 correct section index.
8384 (Arm_relobj::find_linked_text_section): Ditto.
8385
00698fc5
CC
83862010-04-07 Cary Coutant <ccoutant@google.com>
8387
8388 * archive.cc (include_member): Destroy Read_symbols_data object before
8389 releasing file.
8390 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8391 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8392 (Read_symbols_data::~Read_symbols_data) New destructor.
8393 (Section_relocs::Section_relocs) New constructor.
8394 (Section_relocs::~Section_relocs) New destructor.
8395 (Read_relocs_data::Read_relocs_data) New constructor.
8396 (Read_relocs_data::~Read_relocs_data) New destructor.
8397 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8398 pointers to NULL after deleting.
8399
7296d933
DK
84002010-04-07 Doug Kwan <dougkwan@google.com>
8401
8402 * arm.cc: Replace "endianity" with "endianness" in comments.
8403 (Arm_exidx_cantunwind): Ditto.
8404 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8405 (Arm_relobj::merge_flags_and_attributes): New method.
8406 (Arm_relobj::merge_flags_and_attributes_): New data member.
8407 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8408 (Arm_relobj::scan_sections_for_stubs): Ditto.
8409 (Arm_relobj::do_read_symbols): Check to see if we really want to
8410 merge processor-specific flags and attributes. Exit early if
8411 an object is empty except for section names and the undefined symbol.
8412 (Target_arm::do_finalize_sections): Move check for ELF format to
8413 Arm_relobj::do_read_symbols. Merge processor specific flags and
8414 attributes from a regular object only when we have determined that
8415 it is aapropriate. Do not create an .ARM.attributes section in
8416 output if there is no regular input object.
8417 (Target_arm::merge_processor_specific_flags): Check
8418 --warn-mismatch before printing any error.
8419 (Target_arm::merge_object_attributes): Ditto.
8420 * gold.cc (queue_middle_tasks): Handle the case in which there is
8421 no regular object in input.
8422 * options.cc (General_options::parse_EB): New method.
8423 (General_options::parse_EL): Same.
8424 (General_options::General_options): Initialize endianness_.
8425 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8426 New options.
8427 (General_options::Endianness): New enum.
8428 (General_options::endianness): New method.
8429 (General_options::endianness_): New data member.
8430 * parameters.cc (Parameters::set_options): Check target endianness.
8431 (Parameters::set_target_once): Ditto.
8432 (Parameters::check_target_endianness): New method.
8433 (parameters_force_valid_target): If either -EL or -EB is specified,
8434 use it to define endianness of default target.
8435 * parameters.h (Parameters::check_target_endianness): New method
8436 declaration.
8437 * target.h (class Target): Change "endianity" to "endianness"
8438 in comments.
8439
efc8d4f2
RW
84402010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8441
8442 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8443 * configure: Regenerate.
8444 * Makefile.in: Regenerate.
8445 * testsuite/Makefile.in: Regenerate.
8446
be234d88
CC
84472010-04-06 Cary Coutant <ccoutant@google.com>
8448
8449 gcc PR lto/42757
8450 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8451 prevailing definitions of common symbols.
8452 * testsuite/plugin_test_6.sh: New test case.
8453 * testsuite/plugin_common_test_1.c: New test case.
8454 * testsuite/plugin_common_test_2.c: New test case.
8455 * testsuite/Makefile.am (plugin_test_6): New test case.
8456 * testsuite/Makefile.in: Regenerate.
8457
bd32c6bd
NC
84582010-04-06 Nick Clifton <nickc@redhat.com>
8459
8460 * po/vi.po: New Vietnamese translation.
8461
323c532f
DK
84622010-03-30 Doug Kwan <dougkwan@google.com>
8463
8464 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8465
4fcd97eb
DK
84662010-03-25 Doug Kwan <dougkwan@google.com>
8467
8468 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8469 to avoid a conversion warning on a 32-bit host.
8470
4ebf39db
ILT
84712010-03-24 Ian Lance Taylor <iant@google.com>
8472
8473 * testsuite/script_test_3.t: Add a TLS segment.
8474 * testsuite/Makefile.am (check_PROGRAMS): Add
8475 tls_phdrs_script_test.
8476 (tls_phdrs_script_test_SOURCES): Define.
8477 (tls_phdrs_script_test_DEPENDENCIES): Define.
8478 (tls_phdrs_script_test_LDFLAGS): Define.
8479 (tls_phdrs_script_test_LDADD): Define.
8480 * testsuite/Makefile.in: Rebuild.
8481
4a599bdd
CC
84822010-03-23 Cary Coutant <ccoutant@google.com>
8483
8484 * fileread.cc (find_or_make_view): Fix comment.
8485
6c93b22c
ILT
84862010-03-23 Ian Lance Taylor <iant@google.com>
8487
8488 * script-sections.cc (class Orphan_section_placement): Define
8489 PLACE_TLS and PLACE_TLS_BSS.
8490 (Orphan_section_placement::Orphan_section_placement): Initialize
8491 new places.
8492 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8493 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8494 (tls_script_test_SOURCES): Define.
8495 (tls_script_test_DEPENDENCIES): Define.
8496 (tls_script_test_LDFLAGS): Define.
8497 (tls_script_test_LDADD): Define.
8498 * testsuite/Makefile.in: Rebuild.
8499
a2c7281b
DK
85002010-03-22 Doug Kwan <dougkwan@google.com>
8501
8502 * arm.cc (Arm_relocate_functions::abs8,
8503 Arm_relocate_functions::abs16): Use correct check for overflow
8504 specified in the ARM ELF specs.
8505 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8506 target of a BLX instruction specially.
8507 (Reloc_stub::stub_type_for_reloc): Ditto.
8508 (Relocate::relocate): Use symbolic names instead of numeric relocation
8509 codes to report error.
8510 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8511 workaround.
8512 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8513 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8514 thumb2_blx_out_of_range.stdout
8515 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8516 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8517 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8518 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8519 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8520 thumb2_blx_in_range, thumb2_blx_in_range.o,
8521 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8522 thumb2_blx_out_of_range.o): New rules.
2e702c99 8523 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
8524 thumb2_blx_in_range and thumb2_blx_out_of_range.
8525 * testsuite/Makefile.in: Regenerate.
8526 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8527 * testsuite/thumb_blx_in_range.s: New file.
8528 * testsuite/thumb_blx_out_of_range.s: New file.
8529
b0193076
RÁE
85302010-03-22 Rafael Espindola <espindola@google.com>
8531
8532 * archive.cc (Should_include): Move to archive.h.
8533 (should_include_member): Make it a member of Archive.
8534 (Lib_group): New.
8535 (Add_lib_group_symbols): New.
8536 * archive.h: Include options.h.
8537 (Archive_member): Moved from Archive.
8538 (Should_include): Moved from archive.cc.
8539 (Lib_group): New.
8540 (Add_lib_group_symbols): New.
8541 * dynobj.cc (do_should_include_member): New.
8542 * dynobj.h (do_should_include_member): New.
8543 * gold.cc (queue_initial_tasks): Update call to queue.
8544 * main.cc (main): Print lib group stats.
8545 * object.cc (do_should_include_member): New.
8546 * object.h: Include archive.h.
8547 (Object::should_include_member): New.
8548 (Object::do_should_include_member): New.
8549 (Sized_relobj::do_should_include_member): New.
8550 * options.cc (General_options::parse_start_lib): New.
8551 (General_options::parse_end_lib): New.
8552 (Input_arguments::add_file): Handle lib groups.
8553 (Input_arguments::start_group): Check we are not in a lib.
8554 (Input_arguments::start_lib): New.
8555 (Input_arguments::end_lib): New.
8556 * options.h (General_options): Add start_lib and end_lib.
8557 (Input_argument::lib_): New.
8558 (Input_argument::lib): New.
8559 (Input_argument::is_lib): New.
8560 (Input_file_lib): New.
8561 (Input_arguments::in_lib_): New.
8562 (Input_arguments::in_lib): New.
8563 (Input_arguments::start_lib): New.
8564 (Input_arguments::end_lib_): New.
8565 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8566 in unused members as preempted.
8567 (Sized_pluginobj::do_should_include_member): New.
8568 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8569 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8570 return the blocker.
8571 (Read_symbols::do_whole_lib_group): New.
8572 (Read_symbols::do_lib_group): New.
8573 (Read_symbols::do_read_symbols): Handle lib groups.
8574 (Read_symbols::get_name): Handle lib groups.
8575 * readsyms.h (Read_symbols): Add an archive member pointer.
8576 (Read_symbols::do_whole_lib_group): New.
8577 (Read_symbols::do_lib_group): New.
8578 (Read_symbols::member_): New.
8579 * script.cc (read_input_script): Update call to queue_soon.
8580
d099120c
DK
85812010-03-19 Doug Kwan <dougkwan@google.com>
8582
8583 * arm.cc (Stub_table::Stub_table): Initialize new data members
8584 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8585 (Stub_table::add_reloc_stub): Assign stub offset and update
8586 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8587 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8588 New data members.
2e702c99 8589 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
8590 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8591 instead of going over all reloc stubs.
2e702c99 8592 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
8593 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8594 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 8595 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
8596 Stringpool_template::offset_.
8597 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8598 Stringpool_template::offset_ to zero.
8599
1aa37384
DK
86002010-03-15 Doug Kwan <dougkwan@google.com>
8601
8602 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8603 offset_.
8604 (Stringpool_template::new_key_offset): New method.
8605 (Stringpool_template::add_string): Assign offsets when adding new
8606 strings.
8607 (Stringpool_template::set_string_offsets): Do not set string offsets
8608 when not optimizing.
8609 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8610 member size_.
2e702c99
RM
8611 (Chunked_vector::clear): Clear size_.
8612 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8613 (Chunked_vector::size): Return size_.
8614 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 8615 (Chunked_vector::size_): New data member.
1aa37384
DK
8616 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8617 (Stringpool_template::new_key_offset): New method declaration.
8618 (Stringpool_template::offset_): New data member.
8619
b672b057
RÁE
86202010-03-15 Rafael Espindola <espindola@google.com>
8621
8622 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8623 Add_symbols' constructor.
8624 * readsyms.h (Add_symbols): Remove the input_group member.
8625
b6848d3c
ILT
86262010-03-10 Ian Lance Taylor <iant@google.com>
8627
8628 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8629 target to ask whether a reference to a symbol requires a stack
8630 split.
8631 * target.h (Target::is_call_to_non_split): New function.
8632 (Target::do_is_call_to_non_split): Declare virtual function.
8633 * target.cc: Include "symtab.h".
8634 (Target::do_is_call_to_non_split): New function.
8635 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8636
a2a5469e
CC
86372010-03-10 Cary Coutant <ccoutant@google.com>
8638
8639 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8640 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8641 (File_read::open[2]): Add whole_file_view_ to list of views.
8642 (File_read::make_view): Remove test of whole_file_view_.
8643 (File_read::find_or_make_view): Create whole_file_view_ if
8644 necessary.
8645 (File_read::clear_views): Replace bool parameter with enum;
8646 adjust all callers. Don't delete views with permanent data;
8647 do delete cached views and views from archives if
8648 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8649 if clearing the corresponding view.
8650 * fileread.h (File_read::Clear_views_mode): New enum.
8651 (File_read::View::is_permanent_view): New method.
8652 (File_read::clear_views): Replace bool parameter
8653 with enum; adjust all callers.
8654 * options.h (General_options): Change keep_files_mapped option;
8655 add map_whole_files.
8656 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8657 releasing the file.
8658 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8659 the file.
8660
8861f32b
DM
86612010-03-10 David S. Miller <davem@davemloft.net>
8662
8663 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8664
d62d0f5f
ST
86652010-03-09 Sriraman Tallam <tmsriram@google.com>
8666
8667 * icf.cc (get_section_contents): Add '@' marker after processing the
8668 merge reloc.
8669
9177756d
DK
86702010-03-08 Doug Kwan <dougkwan@google.com>
8671
8672 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8673 due to a conversion warning.
8674 (Arm_relobj::update_output_local_symbol_count): Check for local
8675 symbol with unset output index.
8676
9e9e071b
ILT
86772010-03-05 Ian Lance Taylor <iant@google.com>
8678
8679 * options.h (class General_options): Add --spare-dynamic-tags.
8680 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8681 --spare-dynamic-tags.
8682
a81ee015
ILT
86832010-03-05 Ian Lance Taylor <iant@google.com>
8684
8685 * incremental.cc: Include "libiberty.h".
8686
44ec90b9
RO
86872010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8688
8689 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8690 function, is_info_ member.
8691 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8692 (Versions::Versions): Update caller.
8693 (Versions::define_base_version): Likewise.
8694 (Versions::add_def): Likewise.
8695
0897ed3b
ST
86962010-03-03 Sriraman Tallam <tmsriram@google.com>
8697
8698 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8699 (Scan::possible_function_pointer_reloc): New function.
8700 (Scan::local_reloc_may_be_function_pointer): Change to call
8701 possible_function_pointer_reloc.
8702 (Scan::global_reloc_may_be_function_pointer): Ditto.
8703 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8704 relocations in ".data.rel.ro._ZTV" section.
8705 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8706 * testsuite/icf_safe_so_test.cc: Ditto.
8707 * testsuite/icf_safe_test.cc: Ditto.
8708 * testsuite/icf_safe_test.sh: Ditto.
8709
d3bbad62
ILT
87102010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8711 Ian Lance Taylor <iant@google.com>
8712
8713 * target-reloc.h (relocate_section): Check the symbol table index
8714 for -1U before setting the local symbol index.
8715 (scan_relocatable_relocs): If copying the relocation, record that
8716 the local symbol is required.
8717 * object.h (Symbol_value::is_output_symtab_index_set): New
8718 function.
8719 (Symbol_value::may_be_discarded_from_output_symtab): New
8720 function.
8721 (Symbol_value::has_output_symtab_entry): New function.
8722 (Symbol_value::needs_output_symtab_entry): Remove.
8723 (Symbol_value::output_symtab_index): Make sure the symbol index is
8724 set.
8725 (Symbol_value::set_output_symtab_index): Make sure the symbol
8726 index is not set. Make sure the new index is valid.
8727 (Symbol_value::set_must_have_output_symtab_entry): New function.
8728 (Symbol_value::has_output_dynsym_entry): New function.
8729 (Symbol_value::set_output_dynsym_index): Make sure the new index
8730 is valid.
8731 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8732 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8733 local symbol if permitted.
8734 (Sized_relobj::do_finalize_local_symbols): Call
8735 is_output_symtab_index_set rather than needs_output_symtab_entry.
8736 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8737 rather than needs_output_symtab_entry. Call
8738 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8739 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8740 is_output_symtab_index_set rather than needs_output_symtab_entry.
8741 * testsuite/discard_locals_relocatable_test.c: New file.
8742 * testsuite/discard_locals_test.sh: Test -r.
8743 * testsuite/Makefile.am (check_DATA): Add
8744 discard_locals_relocatable_test1.syms,
8745 discard_local_relocatable_test2.syms.
8746 (MOSTLYCLEANFILES): Likewise. Also add
8747 discard_locals_relocatable_test1.lout and
8748 discard_locals_relocatable_test2.out.
8749 (discard_locals_relocatable_test1.syms): New target.
8750 (discard_locals_relocatable_test.o): New target.
8751 (discard_locals_relocatable_test1.out): New target.
8752 (discard_locals_relocatable_test2.syms): New target.
8753 (discard_locals_relocatable_test2.out): New target.
8754 (various): Add missing ../ld-new dependencies.
8755 * testsuite/Makefile.in: Rebuild.
8756
7e8ccf26
NC
87572010-03-03 Nick Clifton <nickc@redhat.com>
8758
8759 * po/fi.po: New Finnish translation.
8760
2a0ff005
DK
87612010-03-01 Doug Kwan <dougkwan@google.com>
8762
8763 * layout.cc (Layout::Layout): Force section types of .init_array*,
8764 .preinit_array* and .fini_array* sections.
8765 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8766 Fix check of return value of std::string::find.().
8767 (Output_section::Input_section_sort_compare::operator()): Remove
8768 comment about .init_array.
8769 (Output_section::Input_section_sort_init_fini_compare::operator()):
8770 New method.
8771 (Output_section::sort_attached_input_sections): Handle .init_array
8772 and .fini_array specially.
8773 * output.h (Output_section::Inut_section_sort_compare): Update
8774 comment.
8775 (Output_section::Input_section_sort_init_fini_compare): New struct.
8776
c3e4ae29
DK
87772010-02-26 Doug Kwan <dougkwan@google.com>
8778
8779 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
8780 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
8781 * testsuite/debug_msg.sh: Avoid matching source line number for
8782 use of global variable undef_int.
8783
2fd9ae7a
DK
87842010-02-26 Doug Kwan <dougkwan@google.com>
8785
8786 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
8787 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
8788 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
8789 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
8790 * options.cc (General_options::General_options): Initialize member
8791 fix_v4bx_.
8792 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
8793 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
8794 and rm_no_fix_v4bx.stdout
8795 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
8796 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
8797 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
8798 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
8799 and arm_no_fix_v4bx.
8800 * Makefile.in: Regenerate.
8801 * testsuite/arm_fix_v4bx.s: New file.
8802 * testsuite/arm_fix_v4bx.sh: Ditto.
8803
67ec7d0b
DK
88042010-02-24 Doug Kwan <dougkwan@google.com>
8805
8806 * arm.cc (Target_arm::got_section): Make the .got section the first
8807 non RELRO section in the data segment.
8808 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
8809 suffixes of section names.
8810
10165461
DK
88112010-02-24 Doug Kwan <dougkwan@google.com>
8812
8813 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
8814 flags and attributes merging if an input file is a binary file.
8815 * fileread.cc (Input_file::open): Record format of original file.
8816 * fileread.h (Input_file::Format): New enum type.
2e702c99 8817 (Input_file::Input_file): Initialize data member format_.
10165461
DK
8818 (Input_file::format): New method definition.
8819 (Input_file::format_):: New data member.
8820
4a54abbb
DK
88212010-02-24 Doug Kwan <dougkwan@google.com>
8822
8823 * arm.cc (Arm_output_data_got): New class.
8824 (ARM_TCB_SIZE): New constant
8825 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
8826 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
8827 If user uses a script with a SECTIONS clause, issue only a warning
8828 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 8829 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
8830 garbage collection.
8831 (Target_arm::got_mode_index_entry): Handle static linking.
8832 (Target_arm::Scan::local): Ditto.
8833 (Target_arm::Scan::global): Ditto.
8834 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
8835 all incorrectly implemented relocations.
e1df38aa 8836 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
8837 Arm_output_section::fix_exidx_coverage.
8838 * layout.cc (Layout::section_name_mapping): Remove trailing dots
8839 from ".ARM.exidx." and ".ARM.extab.".
8840
ca419a6f
ILT
88412010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8842
8843 * arm.cc (Target_arm::do_finalize_sections): Create attribute
8844 section if it does not already exist.
8845 * attributes.cc (Attributes_section_data::Attributes_section_data):
8846 Don't crash if size is zero.
8847
135b9c78
ILT
88482010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8849 Ian Lance Taylor <iant@google.com>
8850
8851 * gold.cc (queue_middle_tasks): If no input files were opened,
8852 exit.
8853 * workqueue.h (Task_function::Task_function): Assert that there is
8854 a blocker.
8855
bb0bfe4f
DK
88562010-02-22 Doug Kwan <dougkwan@google.com>
8857
8858 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
8859 * icf.cc (get_section_contents): Cast snprintf arguments to long long
8860 types to avoid warnings due to different uint64_t implementations
8861 on different hosts.
8862
2a2b6d42
DK
88632010-02-21 Doug Kwan <dougkwan@google.com>
8864
8865 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
8866 handling of the maximum backward branch offset.
2e702c99 8867 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
8868 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
8869 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 8870 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
8871 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
8872 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
8873 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
8874 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
8875 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
8876 thumb_bl_out_of_range thumb_bl_out_of_range.o,
8877 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
8878 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
8879 thumb2_bl_out_of_range.o): New rules.
8880 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
8881 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
8882 thumb2_bl_out_of_range
8883 * testsuite/Makefile.in: Regenerate.
8884 * testsuite/arm_bl_in_range.s: New file.
8885 * testsuite/arm_bl_out_of_range.s: Ditto.
8886 * testsuite/arm_branch_in_range.sh: Ditto.
8887 * testsuite/arm_branch_range.t: Ditto.
8888 * testsuite/thumb2_branch_range.t: Ditto.
8889 * testsuite/thumb_bl_in_range.s: Ditto.
8890 * testsuite/thumb_bl_out_of_range.s: Ditto.
8891 * testsuite/thumb_branch_range.t: Ditto.
8892
b487ad64
ST
88932010-02-20 Sriraman Tallam <tmsriram@google.com>
8894
8895 * gc.h (gc_process_relocs): Change vectors to point to the new list.
8896 Add reloc offset information.
8897 * icf.cc (get_section_contents): Change iterators to point to the new
8898 vectors. Add reloc offset information to the contents.
8899 * icf.h (Icf::Sections_reachable_info): New typedef.
8900 (Icf::Sections_reachable_list): New typedef.
8901 (Icf::Offset_info): New typedef.
8902 (Icf::Reloc_info): New struct typedef.
8903 (Icf::Reloc_info_list): New typedef.
8904 (Icf::symbol_reloc_list): Delete method.
8905 (Icf::addend_reloc_list): Delete method.
8906 (Icf::section_reloc_list): Delete method.
8907 (Icf::reloc_info_list): New method.
8908 (Icf::reloc_info_list_): New member.
8909
f96accdf
DK
89102010-02-19 Doug Kwan <dougkwan@google.com>
8911
8912 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
8913 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
8914 * arm.cc (Arm_relocation_functions): New forward declaration.
8915 (Target_arm::Target_arm): Initialize new data members
8916 got_mod_index_offset_ and tls_base_symbol_defined_.
8917 (Target_arm::Relocate::relocate_tls): New method.
8918 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
8919 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
8920 New methods.
2e702c99 8921 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
8922 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
8923 (Target_arm::got_mod_index_offset_,
8924 Target_arm::tls_base_symbol_defined_): New data members.
8925 (Target_arm::Scan::local, Target::Scan::global,
8926 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
8927 relocations.
8928
c8761b9a
DK
89292010-02-18 Doug Kwan <dougkwan@google.com>
8930
8931 * arm.cc (Arm_relobj::find_linked_text_section): New method.
8932 (Arm_relobj::make_exidx_input_section): Pass section index of linked
8933 text section as a parameter becuase some broken tools may not set
8934 the link in section header.
8935 (Target_arm::has_got_section): New method.
8936 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
8937 without any mapping symbol as data only. Remove warning.
8938 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
8939 link in its section header, try to discover the link by inspecting the
8940 REL31 relocation at the beginning of the section.
8941 (Target_arm::Scan::check_non_pic): Report name of offending relocation
8942 in error message.
8943 (Target_arm::Scan::global): Treat any reference to the symbol
8944 _GLOBAL_OFFSET_TABLE_ as a GOT access.
8945
21bb3914
ST
89462010-02-12 Sriraman Tallam <tmsriram@google.com>
8947
8948 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
8949 (Scan::global_reloc_may_be_function_pointer): New function.
8950 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8951 (Scan::global_reloc_may_be_function_pointer): New function.
8952 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8953 (Scan::global_reloc_may_be_function_pointer): New function.
8954 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
8955 (Scan::global_reloc_may_be_function_pointer): New function.
8956 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
8957 (Scan::global_reloc_may_be_function_pointer): New function.
8958 (Scan::possible_function_pointer_reloc): New function.
8959 (Target_x86_64::can_check_for_function_pointers): New function.
8960 * gc.h (gc_process_relocs): Scan relocation types to determine if
8961 function pointers were taken for targets that support it.
8962 * icf.cc (Icf::find_identical_sections): Include functions for
8963 folding in safe ICF whose pointer is not taken.
8964 * icf.h (Secn_fptr_taken_set): New typedef.
8965 (fptr_section_id_): New member.
8966 (section_has_function_pointers): New function.
8967 (set_section_has_function_pointers): New function.
8968 (check_section_for_function_pointers): New function.
8969 * options.h: Fix comment for safe ICF option.
8970 * target.h (can_check_for_function_pointers): New function.
8971 * testsuite/Makefile.am: Add icf_safe_so_test test case.
8972 Modify icf_safe_test for X86-64.
8973 * testsuite/Makefile.in: Regenerate.
8974 * testsuite/icf_safe_so_test.cc: New file.
8975 * testsuite/icf_safe_so_test.sh: New file.
8976 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8977 (main): Change to take pointer to function kept_func_3.
8978 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8979 folding is done correctly for X86-64.
8980
0da6fa6c
DM
89812010-02-12 David S. Miller <davem@davemloft.net>
8982
8983 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8984 is_symbolless parameter.
8985 (Output_reloc<SHT_REL>::is_symbolless): New.
8986 (Output_reloc<SHT_REL>::is_symbolless_): New.
8987 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8988 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8989 (Output_reloc<SHT_RELA>::is_symbolless): New.
8990 (Output_data_reloc::add_global): Handle is_symbolless.
8991 (Output_data_reloc::add_global_relative): Likewise.
8992 (Output_data_reloc::add_local): Likewise.
8993 (Output_data_reloc::add_local_relative): Likewise.
8994 (Output_data_reloc::add_symbolless_global_addend): New.
8995 (Output_data_reloc::add_symbolless_local_addend): New.
8996 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8997 is_symbolless.
8998 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8999 instead of ->is_relative_
9000 (Output_reloc::write): Likewise.
9001 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9002 (Output_reloc::write_rel): Simplify.
9003
9004 * sparc.cc (Target_sparc::Scan::local): Use
9005 ->add_symbolless_local_addend as needed.
9006 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9007 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9008 based upon relocation offset.
9009
e4782e83
DK
90102010-02-11 Doug Kwan <dougkwan@google.com>
9011
9012 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9013 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9014 beginning of function.
9015 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9016 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9017 parameter is_32bit in calls to should_apply_static_reloc.
9018 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9019 (check_DATA): Add arm_abs_global.stdout.
9020 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9021 arm_abs_global.stdout): New rules.
9022 (MOSTLLYCLEANFILES): Add arm_abs_global
9023 * Makefile.in: Regenerate.
9024 * testsuite/arm_abs_global.s: New file.
9025 * testsuite/arm_abs_global.sh: Ditto.
9026 * testsuite/arm_abs_lib.s: Ditto.
9027
93ceb764
ILT
90282010-02-11 Ian Lance Taylor <iant@google.com>
9029
9030 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9031 Read_relocs task.
9032 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9033 Allocate_commons_task first.
9034 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9035 task, rather than symtab_lock_.
9036 (Gc_process_relocs::~Gc_process_relocs): New function.
9037 (Gc_process_relocs::is_runnable): Check this_blocker_.
9038 (Gc_process_relocs::locks): Use next_blocker_ rather than
9039 blocker_.
9040 (Scan_relocs::~Scan_relocs): New function.
9041 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9042 symtab_lock_.
9043 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9044 next_blocker_.
9045 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9046 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9047 constructor accordingly.
9048 (class Gc_process_relocs): Likewise.
9049 (class Scan_relocs): Likewise.
9050 * common.h (class Allocate_commons_task): Remove symtab_lock_
9051 field, and corresponding constructor parameter.
9052 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9053 symtab_lock_.
9054 (Allocate_commons_task::locks): Likewise.
9055
114dfbe1
ILT
90562010-02-11 Ian Lance Taylor <iant@google.com>
9057
9058 * gold-threads.h (class Once): Define.
9059 (class Initialize_lock): Rewrite as child of Once.
9060 * gold-threads.cc (class Once_initialize): Define.
9061 (once_pointer_control): New static variable.
9062 (once_pointer, once_arg): New static variables.
9063 (c_run_once): New static function.
9064 (Once::Once, Once::run_once, Once::internal_run): New functions.
9065 (class Initialize_lock_once): Remove.
9066 (initialize_lock_control): Remove.
9067 (initialize_lock_pointer): Remove.
9068 (initialize_lock_once): Remove.
9069 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9070 (Initialize_lock::initialize): Rewrite.
9071 (Initialize_lock::do_run_once): New function.
9072 * archive.cc (Archive::interpret_header): Only clear name if it is
9073 not already empty.
9074 * fileread.cc: Include "gold-threads.h"
9075 (file_counts_lock): New static variable.
9076 (file_counts_initialize_lock): Likewise.
9077 (File_read::release): Only increment counts when using --stats.
9078 Use a lock around the increment.
9079 * parameters.cc (class Set_parameters_target_once): Define.
9080 (set_parameters_target_once): New static variable.
9081 (Parameters::Parameters): Move here from parameters.h.
9082 (Parameters::set_target): Rewrite.
9083 (Parameters::set_target_once): New function.
9084 (Parameters::clear_target): Move here and rewrite.
9085 * parameters.h (class Parameters): Update declarations. Add
9086 set_parameters_target_once_ field.
9087 (Parameters::Parameters): Move to parameters.cc.
9088 (Parameters::clear_target): Likewise.
9089 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9090 task.
9091 (Start_group::~Start_group): New function.
9092 (Start_group::is_runnable): New function.
9093 (Start_group::locks, Start_group::run): New functions.
9094 (Finish_group::run): Change saw_undefined to size_t.
9095 * readsyms.h (class Start_group): Define.
9096 (class Finish_group): Change saw_undefined_ field to size_t.
9097 (Finish_group::Finish_group): Remove saw_undefined and
9098 this_blocker parameters. Change all callers.
9099 (Finish_group::set_saw_undefined): New function.
9100 (Finish_group::set_blocker): New function.
9101 * symtab.h (class Symbol_table): Change saw_undefined to return
9102 size_t. Change saw_undefined_ field to size_t.
9103 * target-select.cc (Set_target_once::do_run_once): New function.
9104 (Target_selector::Target_selector): Initialize set_target_once_
9105 field. Don't initialize lock_ and initialize_lock_ fields.
9106 (Target_selector::instantiate_target): Rewrite.
9107 (Target_selector::set_target): New function.
9108 * target-select.h (class Set_target_once): Define.
9109 (class Target_selector): Update declarations. Make
9110 Set_target_once a friend. Remove lock_ and initialize_lock_
9111 fields. Add set_target_once_ field.
9112
fa17a3f4
ILT
91132010-02-10 Ian Lance Taylor <iant@google.com>
9114
9115 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9116 queueing any tasks.
9117 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9118 (queue_middle_tasks): Add all blockers before queueing any tasks.
9119 (queue_final_tasks): Likewise.
9120 * token.h (Task_token::add_blockers): New function.
9121 * object.h (Input_objects::number_of_relobjs): New function.
9122
c7177d31
ILT
91232010-02-10 Ian Lance Taylor <iant@google.com>
9124
5de0e392
ILT
9125 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9126 shared, not if not position independent.
9127 * x86_64.cc (Relocate::relocate_tls): Likewise.
9128 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9129 (tls_pie_pic_test): New target.
9130 * testsuite/Makefile.in: Rebuild.
9131
c7177d31
ILT
9132 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9133 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9134 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9135 * testsuite/Makefile.in: Rebuild.
9136
684b268a
DM
91372010-02-09 David S. Miller <davem@davemloft.net>
9138
9139 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9140 R_SPARC_RELATIVE using ->add_local_relative().
9141 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9142
612a8d3d
DM
9143 * output.h (Output_data_dynamic::add_section_size): New method
9144 that takes two Output_data objects.
9145 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9146 entry param. Handle it in initializers.
9147 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9148 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9149 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9150 arg.
9151 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9152 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9153 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9154 for dynrel_includes_plt.
9155 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9156 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9157 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9158 before .rela.plt
9159 (Target_sparc::do_finalize_sections): Update to pass true for
9160 dynrel_includes_plt.
9161 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9162 output before .rela.plt
9163 (Target_powerpc::do_finalize_sections): Update to pass true for
9164 dynrel_includes_plt when 32-bit.
9165
cb1be87e
DK
91662010-02-08 Doug Kwan <dougkwan@google.com>
9167
9168 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9169 method.
9170 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9171 Arm_relobj::scan_section_for_cortex_a8_stubs,
9172 Arm_relobj::do_relocation_section): Instead of calling
9173 Output_section::output_address, use faster
9174 Arm_relobj::simple_input_section_output_address.
9175
705b5121
DM
91762010-02-08 David S. Miller <davem@davemloft.net>
9177
9178 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9179 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9180 relocation helper function.
9181
024c4466
DM
9182 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9183 just like R_SPARC_GOT{10,13,22}.
9184 (Target_sparc::Scan::local): Likewise.
9185 (Target_sparc::Relocate:relocate): Likewise.
9186
9109c078
ILT
91872010-02-06 Ian Lance Taylor <iant@google.com>
9188
9189 * configure.ac: Rewrite targetobjs duplicate removal code to use
9190 only shell constructs.
9191 * configure: Rebuild.
9192
cf846138
DK
91932010-02-05 Doug Kwan <dougkwan@google.com>
9194
9195 PR 11247
9196 * arm.cc (Arm_relobj::section_is_scannable): New method.
9197 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9198 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9199
6cfaf60b
DK
92002010-02-04 Doug Kwan <dougkwan@google.com>
9201
9202 PR 11247
9203 * arm-reloc-property.cc (cstdio): Include.
9204 * configure.ac (targetobjs): Remove duplicates.
9205 * configure: Regenerate.
9206 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9207 big and little endian version for a given address size.
9208
5c57f1be
DK
92092010-02-03 Doug Kwan <dougkwan@google.com>
9210
9211 * arm-reloc-property.cc
9212 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9213 definition.
9214 * arm-reloc-property.h
9215 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9216 New method definition.
9217 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9218 declaration.
9219 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9220 overflow to N.
9221 (GOT_PREL): Change implemented to Y.
9222 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9223 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9224 (Arm_relocate_functions::movw_abs_nc): Remove method.
9225 (Arm_relocate_functions::movt_abs): Ditto.
9226 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9227 (Arm_relocate_functions::thm_movt_abs): Ditto.
9228 (Arm_relocate_functions::movw_rel_nc): Ditto.
9229 (Arm_relocate_functions::movw_rel): Ditto.
9230 (Arm_relocate_functions::movt_rel): Ditto.
9231 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9232 (Arm_relocate_functions:thm_movw_rel): Ditto.
9233 (Arm_relocate_functions:thm_movt_rel): Ditto.
9234 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9235 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9236 New method definitions.
9237 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9238 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9239 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9240 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9241 (Target_arm::Relocate::relocate): Check for non-static or
9242 unimplemented relocation code and exit early. Change calls to
9243 Target_arm::reloc_uses_thumb_bit and
9244 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9245 instead. Refactor code to handle similar relocations to increase
9246 code sharing. Remove check for unsupported relocation code in switch
9247 statement.
9248 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9249 relocation property table to find out size. Change error message to
9250 print out the name of a relocation code instead of the numeric value.
9251 (Target_arm::scan_reloc_for_stub): Use relocation property table
9252 instead of calling Target_arm::reloc_uses_thumb_bit().
9253
218c5831
DK
92542010-02-02 Doug Kwan <dougkwan@google.com>
9255
9256 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9257 types of relaxed input section.
9258
0d31c79d
DK
92592010-02-02 Doug Kwan <dougkwan@google.com>
9260
9261 * Makefile.am (HFILES): Add arm-reloc-property.h.
9262 (DEFFILES): New.
2e702c99
RM
9263 (TARGETSOURCES): Add arm-reloc-property.cc
9264 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9265 (libgold_a_SOURCES): $(DEFFILES)
9266 * Makefile.in: Regenerate.
9267 * arm-reloc-property.cc: New file.
9268 * arm-reloc-property.h: New file.
9269 * arm-reloc.def: New file.
9270 * arm.cc: Update comments.
9271 (arm-reloc-property.h): New included header.
9272 (arm_reloc_property_table): New global variable.
9273 (Target_arm::do_select_as_default_target): New method definition.
9274 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9275 arm-reloc-property to targ_extra_obj.
9276 * parameters.cc (set_parameters_target): Call
9277 Target::select_as_default_target().
9278 * target.h (Target::select_as_default_target): New method definition.
9279 (Target::do_select_as_default_target): Same.
9280
546c7457
DK
92812010-02-01 Doug Kwan <dougkwan@google.com>
9282
9283 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9284 first_output_text_section_.
9285 (Arm_exidx_fixup::first_output_text_section): New method definition.
9286 (Arm_exidx_fixup::first_output_text_section_): New data member.
9287 (Arm_exidx_fixup::process_exidx_section): Record the first text
9288 output section seen.
9289 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9290 and entsize in output section header.
9291
11b861d5
DK
92922010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9293
9294 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9295 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9296 (Arm_relocate_functions::thm_alu11): New Method.
9297 (Arm_relocate_functions::thm_pc8): New Method.
9298 (Arm_relocate_functions::thm_pc12): New Method.
9299 (Target_arm::Scan::local): Handle the relocations.
9300 (Target_arm::Scan::global): Likewise.
9301 (Target_arm::Relocate::relocate): Likewise.
9302 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9303
c9a2c125
DK
93042010-01-29 Doug Kwan <dougkwan@google.com>
9305
9306 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9307 of relocation types as ld.
9308
1521477a
DK
93092010-01-29 Doug Kwan <dougkwan@google.com>
9310
9311 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9312 to public.
9313 (Arm_relocate_functions::thumb_branch_common): Ditto.
9314 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9315 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9316 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9317 Arm_relocate_functions::jump24): Remove.
9318 (Target_arm::Relocate::relocate): Adjust code to call
9319 Arm_relocation_functions::arm_branch_common and
9320 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9321 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9322
e7eca48c
DK
93232010-01-29 Doug Kwan <dougkwan@google.com>
9324
9325 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9326 output_local_symbol_count_needs_update_.
9327 (Arm_relobj::output_local_symbol_count_needs_update,
9328 Arm_relobj::set_output_local_symbol_count_needs_update,
9329 Arm_relobj::update_output_local_symbol_count): New methods.
9330 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9331 member.
9332 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9333 of pointed function as in a R_ARM_PREL31 relocation.
9334 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9335 for output local symbol count updating.
9336 (Target_arm::do_relax): Update output local symbol counts in objects
9337 if necessary.
9338 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9339
02961d7e
ILT
93402010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9341
9342 * arm.cc: Added support for the ARM relocations:
9343 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9344 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9345 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9346 movw_prel_nc).
9347 (Arm_relocate_functions::movw_rel): New method.
9348 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9349 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9350 thm_movw_prel_nc).
9351 (Arm_relocate_functions::thm_movw_rel): New method.
9352 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9353 thm_movt_prel).
9354 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9355 relocations.
9356 (Target_arm::Scan::global): Likewise.
9357 (Target_arm::Relocate::relocate): Likewise.
9358 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9359 Likewise.
9360
b10d2873
ILT
93612010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9362
9363 * arm.cc: Added support for ARM group relocations.
9364 (Target_arm::reloc_needs_sym_origin): New method.
9365 (Arm_relocate_functions::calc_grp_kn): New method.
9366 (Arm_relocate_functions::calc_grp_residual): New method.
9367 (Arm_relocate_functions::calc_grp_gn): New method.
9368 (Arm_relocate_functions::arm_grp_alu): New Method.
9369 (Arm_relocate_functions::arm_grp_ldr): New Method.
9370 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9371 (Arm_relocate_functions::arm_grp_ldc): New Method.
9372 (Target_arm::Scan::local): Handle the ARM group relocations.
9373 (Target_arm::Scan::global): Likewise.
9374 (Target_arm::Relocate::relocate): Likewise.
9375 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9376 Likewise.
9377
2b328d4e
DK
93782010-01-26 Doug Kwan <dougkwan@google.com>
9379
9380 * arm.cc (set): Include.
9381 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9382 pointer type.
2e702c99 9383 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9384 (Arm_output_section::append_text_sections_to_list): New method.
9385 (Arm_output_section::fix_exidx_coverage): Ditto.
9386 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9387 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9388 Relobj::set_section_offset() instead of
9389 Sized_relobj::invalidate_section_offset().
2e702c99 9390 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9391 parameter for section headers. Ignore relocation sections for
9392 unallocated sections and EXIDX sections.
9393 (Target_arm::fix_exidx_coverage): New method.
9394 (Target_arm::output_section_address_less_than): New type.
9395 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9396 linked text section instead of the EXIDX section.
9397 (Arm_output_section::create_stub_group): Add an assertion to check
9398 that this is not an EXIDX output section.
9399 (Arm_output_section::append_text_sections_to_list): New method.
9400 (Arm_output_section::fix_exidx_coverage): Ditto.
9401 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9402 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9403 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9404 first pass.
9405 (Target_arm::fix_exidx_coverage): New method.
9406 * object.h (Relobj::set_output_section): New method.
9407 (Sized_relobj::invalidate_section_offset): Remove method.
9408 (Sized_relobj::do_invalidate_section_offset): Remove method.
9409 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9410
c7f3c371
DK
94112010-01-25 Doug Kwan <dougkwan@google.com>
9412
9413 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9414 Fix warning due to signed and unsigned comparison on a 32-bit host.
9415
8923b24c
DK
94162010-01-22 Doug Kwan <dougkwan@google.com>
9417
9418 * arm.cc (Target_arm::do_relax): Record an output section for section
9419 offset adjustment it contains any stub table that has changed.
9420 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9421 offsets in an output section if necessary.
9422 * output.cc (Output_section::Output_section): Initialize
9423 section_offsets_need_adjustments_.
9424 (Output_section::add_input_section_for_script): Renamed to
9425 Output_section::add_simple_input_section.
9426 (Output_section::save_states): Add a comment.
9427 (Output_section::discard_states): New method defintion.
9428 (Output_section::adjust_section_offsets): Same.
9429 * output.h (Output_section::add_input_section_for_script): Renamed to
9430 Output_section::add_simple_input_section.
9431 (Output_section::discard_states): New method declaration.
9432 (Output_section::adjust_section_offsets): Same.
9433 (Output_section::section_offsets_need_adjustment,
9434 Output_section::set_section_offsets_need_adjustment): New method
9435 definitions.
9436 (Output_section::section_offsets_need_adjustment_): New data member.
9437 * script-sections.cc
9438 (Output_section_element_input::set_section_address): Adjust code for
9439 renaming of Output_section::add_input_section_for_script.
9440 (Orphan_output_section::set_section_address): Same.
9441
9b2fd367
DK
94422010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9443
9444 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9445 Fix_v4bx enum values .
9446 * gold/options.h (General_options): New option definitions.
9447 (General_options::fix_v4bx): New method.
9448 (General_options::Fix_v4bx): New enum.
9449 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9450 (General_options::parse_fix_v4bx_interworking): New method.
9451
80d0d023
DK
94522010-01-22 Doug Kwan <dougkwan@google.com>
9453
9454 * arm.cc (Arm_exidx_fixup): New class.
9455
af2cdeae
DK
94562010-01-21 Doug Kwan <dougkwan@google.com>
9457
9458 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9459 classes.
9460 (Arm_exidx_section_offset_map): New type.
9461
993d07c1
DK
94622010-01-21 Doug Kwan <dougkwan@google.com>
9463
9464 * arm.cc (Arm_exidx_input_section): New class.
9465 (Arm_relobj::exidx_input_section_by_link,
9466 Arm_relobj::exidx_input_section_by_shndx,
9467 Arm_relobj::make_exidx_input_section): New methods.
9468 (read_arm_attributes_section): Remove.
9469 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9470 information about them.
9471 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9472 to here.
9473
5ac169d4
DK
94742010-01-20 Doug Kwan <dougkwan@google.com>
9475
9476 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9477 Input_section_specifier to Section_id.
9478 (Target_arm::new_arm_input_section: Adjust code for change of key
9479 type.
9480 (Target_arm::find_arm_input_section): Ditto.
9481 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9482 (Section_id): Remove.
9483 (Garbage_collection::Section_id_hash): Remove.
9484 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9485 (Section_id): Remove.
9486 (Icf::Section_id_hash): Remove.
9487 * object.h (Section_id, Const_section_id, Section_id_hash,
9488 Const_section_id_hash): New type definitions.
9489 * output.cc (Output_section::add_relaxed_input_section): Change to
9490 use Const_section_id instead of Input_section_specifier as key type.
9491 (Output_section::add_merge_input_section): Ditto.
9492 (Output_section::build_relaxation_map): Change to use Section_id
9493 instead of Input_section_specifier as key type.
2e702c99 9494 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9495 Ditto.
9496 (Output_section::convert_input_sections_to_relaxed_sections): Change
9497 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9498 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9499 (Output_section::find_relaxed_input_section): Ditto.
9500 * output.h (Input_section_specifier): Remove class.
9501 (Output_section::Output_section_data_by_input_section_map): Change
9502 key type to Const_section_id.
9503 (Output_section::Output_relaxed_input_section_by_input_section_map):
9504 Ditto.
9505 (Output_section::Relaxation_map): Change key type to Section_id.
9506
a2162063
ILT
95072010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9508
9509 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9510 (class Arm_v4bx_stub): New class.
9511 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9512 (Stub_factory::make_arm_v4bx_stub): New method.
9513 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9514 (Stub_table::empty): Handle v4bx stubs.
9515 (Stub_table::add_arm_v4bx_stub): New method.
9516 (Stub_table::find_arm_v4bx_stub): New method.
9517 (Arm_relocate_functions::v4bx): New method.
9518 (Target_arm::fix_v4bx): New method.
9519 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9520 (Stub_table::relocate_stubs): Likewise.
9521 (Stub_table::do_write): Likewise.
9522 (Stub_table::update_data_size_and_addralign): Likewise.
9523 (Stub_table::finalize_stubs): Likewise.
9524 (Target_arm::Scan::local): Likewise.
9525 (Target_arm::Scan::global): Likewise.
9526 (Target_arm::do_finalize_sections): Likewise.
9527 (Target_arm::Relocate::relocate): Likewise.
9528 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9529 Likewise.
9530 (Target_arm::scan_reloc_for_stub): Likewise.
9531 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9532
5696ab0b
ILT
95332010-01-19 Ian Lance Taylor <iant@google.com>
9534
9535 * output.cc (Output_section_headers::do_sized_write): Write large
9536 segment count to sh_info field.
9537 (Output_file_header::do_sized_write): For large segment count,
9538 write PN_XNUM to e_phnum field.
9539
800d0f56
ILT
95402010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9541
9542 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9543 (Arm_relocate_functions::thm_jump8): New function.
9544 (Arm_relocate_functions::thm_jump11): New function.
9545 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9546 R_ARM_THM_JUMP11.
9547 (Target_arm::Scan::global): Likewise.
9548 (Target_arm::Relocate::relocate): Likewise.
9549 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9550 Likewise.
9551
41263c05
DK
95522010-01-14 Doug Kwan <dougkwan@google.com>
9553
9554 * arm.cc (map, utility): Include headers.
9555 (Target_arm::apply_cortex_a8_workaround): New method.
9556 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9557 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9558 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9559 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9560 the --[no-]fix-cortex-a8 command line options.
9561 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9562 (Target_arm::relocate_stub): Use addend in instruction template.
9563 * options.h (DEFINE_bool): Set the user-set flag.
9564 (General_options): Add --[no-]-fix-cortex options.
9565 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 9566 : Update fast look-up map after conversion.
41263c05 9567
459e9b03
ST
95682010-01-14 Sriraman Tallam <tmsriram@google.com>
9569
9570 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9571 in the first pass of do_layout.
9572
b521dfe4
DK
95732010-01-13 Doug Kwan <dougkwan@google.com>
9574
9575 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9576 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9577 apparent compiler problem of not folding static constant integral
9578 data members of elfcpp::Elf_sizes<32>.
9579
44272192
DK
95802010-01-13 Doug Kwan <dougkwan@google.com>
9581
9582 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9583 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9584 Arm_relobj::scan_section_for_cortex_a8_erratum,
9585 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9586 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9587 sections to scan for relocation stubs into a new method
9588 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9589 relocation and Cortex-A8 stub scanning.
9590 (Target_arm::do_relax): Force stubs to be after stubbed sections
9591 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 9592 the beginning of a new relaxation pass. Update a comment.
44272192
DK
9593 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9594
44b71ece
ILT
95952010-01-12 Ian Lance Taylor <iant@google.com>
9596
9597 * target-reloc.h (visibility_error): New inline function.
9598 (relocate_section): Call visibility_error.
9599 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9600 (MOSTLYCLEANFILES): Likewise.
9601 (protected_4_pic.o, protected_3.err): New targets.
9602 * testsuite/protected_4.cc: New file.
9603
a120bc7f
DK
96042010-01-12 Doug Kwan <dougkwan@google.com>
9605
9606 * arm.cc (Cortex_a8_reloc): New class.
9607 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9608 and cortex_a8_relocs_info_.
9609 (Target_arm::fix_cortex_a8): New method definition.
9610 (Target_arm::Cortex_a8_relocs_info): New type.
9611 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9612 New data member declarations.
9613 (Target_arm::scan_reloc_for_stub): Record information about
9614 relocations for THUMB branches that might be exempted from the
9615 Cortex-A8 workaround.
9616 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9617 at the beginning of a relaxation pass.
9618
20138696
DK
96192010-01-12 Doug Kwan <dougkwan@google.com>
9620
9621 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9622 (Arm_relobj::Mapping_symbol_position,
9623 Arm_reloj::Mapping_symbol_position_less,
9624 Arm_relobj::Mapping_symbols_info): New types.
9625 (Target_arm::is_mapping_symbol_name): New method definition.
9626 (Arm_relobj::do_count_local_symbols): Save information about mapping
9627 symbols.
9628
089d69dc
DK
96292010-01-11 Doug Kwan <dougkwan@google.com>
9630
9631 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9632 Arm_relocate_functions::thumb32_branch_upper,
9633 Arm_relocate_functions::thumb32_branch_lower,
9634 Arm_relocate_functions::thumb32_cond_branch_offset,
9635 Arm_relocate_functions::thumb32_cond_branch_upper,
9636 Arm_relocate_functions::thumb32_cond_branch_lower,
9637 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9638 branch offset encoding.
9639 (Arm_relocate_functions::thumb_branch_common): Use new branch
9640 offset encoding methods to avoid code duplication.
9641 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9642 (Stub_addend_reader::operator()): Use new branch encoding method
9643 to avoid code duplication.
9644
99e5bff2
DK
96452010-01-11 Doug Kwan <dougkwan@google.com>
9646
9647 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9648 (Target_arm::do_finalize_sections): Define special EXIDX section
9649 symbols only if referenced.
9650 * gc.h (Garbage_collection::add_reference): New method.
9651 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9652 code duplication.
9653
98e090bd
ILT
96542010-01-11 Ian Lance Taylor <iant@google.com>
9655
d0a91bd8
ILT
9656 * script.cc (Version_script_info::build_expression_list_lookup):
9657 Change complaing about duplicate wildcard match from error to
9658 warning.
9659
98e090bd
ILT
9660 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9661 of 2009-12-30.
9662 (Version_script_info::Version_script_info): Initialize globs_,
9663 default_version_, default_is_global_, and exact_. Don't
9664 initialize globals_ or locals_.
9665 (Version_script_info::build_lookup_tables): Build local symbols
9666 first.
9667 (Version_script_info::unquote): New function.
9668 (Version_script_info::add_exact_match): New function.
9669 (Version_script_info::build_expression_list_lookup): Remove lookup
9670 parameter. Add is_global parameter. Change all callers. Handle
9671 wildcard pattern specially. Unquote pattern. Call
9672 add_exact_match.
9673 (Version_script_info::get_name_to_match): New function.
9674 (Version_script_info::get_symbol_version): New function.
9675 (Version_script_info::get_symbol_version_helper): Remove.
9676 (Version_script_info::check_unmatched_names): Call unquote.
9677 * script.h (class Version_script_info): Change get_symbol_version
9678 to be non-inline and add is_global parameter; change all callers.
9679 Rewrite symbol_is_local. Update declarations. Define struct
9680 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9681 Remove globals_ and locals_ members. Add exact_, globs_,
9682 default_version_, is_global_.
9683 (Version_script_info::Glob): Remove pattern, add expression and
9684 is_global. Update constructor. Change all callers.
9685 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9686 default version.
9687 (Versions::symbol_section_contents): If a symbol is undefined, or
9688 defined in a dynamic object, set the version index to
9689 VER_NDX_LOCAL.
9690 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9691 symbol_is_local.
9692 (Symbol_table::add_from_pluginobj): Likewise.
9693 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9694
d56962d3
DK
96952010-01-11 Doug Kwan <dougkwan@google.com>
9696
9697 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9698 (incremental_dump_LDADD): Add linking option for libintl.
9699 * Makefile.in: Regenerate.
9700
94e6ee91
L
97012010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9702
9703 PR gold/11144
9704 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9705 instead of -Ds.
9706 * testsuite/Makefile.in: Regenerated.
9707
e96c574b
DK
97082010-01-10 Doug Kwan <dougkwan@google.com>
9709
9710 * options.h (DEFINE_var): Use parentheses around argument varname__
9711 in macro body to avoid any unintended subsequent substitutions.
9712
7198066b
ILT
97132010-01-10 Ian Lance Taylor <iant@google.com>
9714
ba4d53bf
ILT
9715 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9716 candidates before doing symbol resolution.
9717
7198066b
ILT
9718 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9719 ODR candidates if only one is weak.
9720
a2beed37
ILT
97212010-01-08 Ian Lance Taylor <iant@google.com>
9722
9723 * script.cc (Version_script_info::build_expression_list_lookup):
9724 Don't warn about ambiguous version, just record the ambiguity.
9725 (Version_script_info::get_symbol_version_helper): Give error if
9726 version is ambiguous.
9727
2fb7225c
DK
97282010-01-08 Doug Kwan <dougkwan@google.com>
9729
9730 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
9731 prev_data_size_ and prev_addralign_. Remove initializer for
9732 deleted data member has_been_changed_.
9733 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9734 to determine if the table is empty.
9735 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9736 Remove.
9737 (Stub_table::add_reloc_stub): Define method in class definition
9738 instead of just declaring it there.
9739 (Stub_table::add_cortex_a8_stub): New method definition.
9740 (Stub_table::update_data_size_and_addralign): Ditto.
9741 (Stub_table::finalize_stubs): Ditto.
9742 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9743 (Stub_table::do_addralign_): Return address alignment in the
9744 (Stub_table::do_reset_address_and_file_offset): Define method in
9745 class definition instead of declaring it there. Set current data
9746 size to be the data size of the previous pass.
9747 (Stub_table::set_final_data_size): Use current data size as the
9748 final data size.
9749 (Stub_table::relocate_stub): Change parameter type of stub from
9750 Reloc_stub pointer to Stub pointer.
9751 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9752 (Stub_table::Cortex_a8_stub_list): New typedef.
9753 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9754 Stub_table::prev_addralign_): New data member.
9755 (Arm_relobj::Arm_relobj): Initialize data member
9756 section_has_cortex_a8_workaround_.
9757 (Arm_relobj::section_has_cortex_a8_workaround,
9758 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9759 definitions.
9760 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9761 declarations.
9762 (Target_arm::relocate_stub): Change parameter type of stub from
9763 Reloc_stub pointer to Stub pointer.
9764 (Insn_template::size, Insn_template::alignment): Handle
9765 THUMB16_SPECIAL_TYPE.
9766 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9767 Stub_table::update_data_size_and_addralign,
9768 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
9769 definitions.
9770 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
9771 (Stub_table::do_write): Ditto.
9772 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 9773
880cd20d
ILT
97742010-01-08 Ian Lance Taylor <iant@google.com>
9775
9776 PR 11108
9777 * symtab.h (class Symbol): Remove fields is_target_special_ and
9778 has_plt_offset_. Add field is_defined_in_discarded_section_.
9779 (Symbol::is_defined_in_discarded_section): New function.
9780 (Symbol::set_is_defined_in_discarded_section): New function.
9781 (Symbol::has_plt_offset): Rewrite.
9782 (Symbol::set_plt_offset): Verify that new offset is not -1U.
9783 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
9784 Don't initialize is_target_special_ or has_plt_offset_.
9785 Initialize is_defined_in_discarded_section_.
9786 (Symbol_table::add_from_relobj): If appropriate, set
9787 is_defined_in_discarded_section.
9788 * resolve.cc (Symbol::override_base_with_special): Don't test
9789 is_target_special_. Change has_plt_offset_ to has_plt_offset().
9790 * target-reloc.h (relocate_section): Do special handling for
9791 symbols defined in discarded sections for global symbols as well
9792 as local symbols.
9793
2703e3eb
ILT
97942010-01-08 Ian Lance Taylor <iant@google.com>
9795
9796 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
9797 the SHT_SYMTAB case.
9798
339d40a3
ILT
97992010-01-08 Ian Lance Taylor <iant@google.com>
9800
9801 * object.cc (Sized_relobj::do_layout): Don't get confused if
9802 layout_eh_frame returns NULL.
9803
abecea76
ILT
98042010-01-08 Ian Lance Taylor <iant@google.com>
9805
9806 PR 11084
9807 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
9808 dynamic symbol table, use the normal symbol table.
9809 (Sized_dynobj::do_read_symbols): Remove assertion about type of
9810 symbol table.
9811
6b7dd3f3
ILT
98122010-01-08 Ian Lance Taylor <iant@google.com>
9813
9814 PR 11072
9815 * layout.cc (Layout::include_section): Remove .gnu_debuglink
9816 sections.
9817
36c50e63
L
98182010-01-08 H.J. Lu <hongjiu.lu@intel.com>
9819
9820 * version.cc (print_version): Change to "Copyright 2010".
9821
e291e7b9
ILT
98222010-01-08 Ian Lance Taylor <iant@google.com>
9823
9824 PR 10287
9825 PR 11063
9826 * i386.cc (class Target_i386): Change return type of plt_section
9827 to be non-const.
9828 (class Output_data_plt_i386): Add tls_desc_rel_ field.
9829 (Output_data_plt_i386::Output_data_plt_i386): Initialize
9830 tls_desc_rel_ field.
9831 (Output_data_plt_i386::rel_tls_desc): New function.
9832 (Target_i386::rel_tls_desc_section): New function.
9833 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
9834 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
9835 R_386_TLS_DESC reloc in rel_tls_desc_section.
9836 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
9837 Define struct Tlsdesc_info.
9838 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
9839 (Target_x86_64::do_reloc_symbol_index): New function.
9840 (Target_x86_64::add_tlsdesc_info): New function.
9841 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
9842 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
9843 tlsdesc_rel_ field.
9844 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
9845 all callers.
9846 (Output_data_plt_x86_64::rela_tlsdesc): New function.
9847 (Target_x86_64::rela_tlsdesc_section): New function.
9848 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
9849 handling.
9850 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
9851 (Target_x86_64::do_reloc_addend): New function.
9852 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
9853 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
9854 declarations. Define TARGET_CODE. Add arg field to u1_ union.
9855 (Output_reloc::type): New function.
9856 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
9857 (Output_reloc::is_target_specific): New function.
9858 (Output_reloc::target_arg): New function.
9859 (class Output_reloc) [SHT_RELA]: Add four new constructors for
9860 absolute relocs and target specific relocs.
9861 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
9862 add_target_specific.
9863 (class Output_data_reloc) [SHT_RELA]: Likewise.
9864 * output.cc (Output_reloc::Output_reloc): Add four new versions
9865 for absolute relocs and target specific relocs.
9866 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
9867 (Output_reloc::get_symbol_index): Likewise.
9868 (Output_reloc::local_section_offset): Check that local_sym_index_
9869 is not TARGET_CODE or 0.
9870 (Output_reloc::symbol_value): Likewise.
9871 (Output_reloc::write) [SHT_RELA]: Call target for target specific
9872 reloc.
9873 * target.h (class Target): Add reloc_symbol_index and reloc_addend
9874 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
9875 functions.
9876 * layout.cc (add_target_dynamic_tags): Use output section for
9877 DT_PLTRELSZ and DT_JMPREL.
9878
3a44184e
ILT
98792010-01-07 Ian Lance Taylor <iant@google.com>
9880
9881 PR 11061
9882 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
9883 function.
9884 (class Output_data_reloc_generic): Define.
9885 (class Output_data_reloc_base): Change base class to
9886 Output_data_reloc_generic. Change add() method to call
9887 bump_relative_reloc_count for a relative reloc. Remove
9888 sort_relocs_ field.
9889 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
9890 to sort_relocs().
9891 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
9892 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
9893 appropriate.
9894 * layout.h (class Layout): Update declaration.
9895
ea715a34
ILT
98962010-01-07 Ian Lance Taylor <iant@google.com>
9897
9898 * output.h (class Output_data): Add const version of
9899 output_section and do_output_section.
9900 (class Output_section_data): Add const version of
9901 do_output_section.
9902 (class Output_section): Likewise.
9903 * layout.cc (Layout::add_target_dynamic_tags): New function.
9904 * layout.h (class Layout): Update declarations.
9905 * arm.cc (Target_arm::do_finalize_sections): Use
9906 add_target_dynamic_tags.
9907 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9908 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9909 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9910 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9911
659948a4
ILT
99122010-01-07 Ian Lance Taylor <iant@google.com>
9913
9914 PR 11042
9915 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
9916 object as needed.
9917
9d3b86f6
ILT
99182010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
9919 Ian Lance Taylor <iant@google.com>
9920
9921 PR 11019
9922 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
9923 Xindex::read_symtab_xindex.
9924
bb0d3eb0
DK
99252010-01-07 Doug Kwan <dougkwan@google.com>
9926
9927 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
9928 (Insn_template::thumb16_bcond_insn): New method declaration.
9929 (Insn_template): Fix spelling.
9930 (Stub::thumb16_special): New method declaration.
9931 (Stub::do_write): Define virtual method which was previously pure
9932 virtual.
9933 (Stub::do_thumb16_special): New method declaration.
9934 (Stub::do_fixed_endian_write): New template member.
9935 (Reloc_stub::do_write): Remove.
9936 (Reloc_stub::do_fixed_endian_write): Remove.
9937 (Cortex_a8_stub): New class definition.
9938 (Stub_factory::make_cortex_a8_stub): New method definition.
9939 (Stub_factory::Stub_factory): Add missing static storage class
9940 qualifier for elf32_arm_stub_a8_veneer_blx.
9941
ffeef7df
ILT
99422010-01-07 Ian Lance Taylor <iant@google.com>
9943
dc3f80fe
ILT
9944 PR 10980
9945 * options.h (class General_options): Add --warn-unresolved-symbols
9946 and --error-unresolved-symbols.
9947 * errors.cc (Errors::undefined_symbol): Implement
9948 --warn-unresolved-symbols.
9949
ffeef7df
ILT
9950 * options.h (class General_options): Add -z text and -z textoff.
9951 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
9952
f1ec9ded
ST
99532010-01-06 Sriraman Tallam <tmsriram@google.com>
9954
9955 * gc.h (Garbage_collection::Cident_section_map): New typedef.
9956 (Garbage_collection::cident_sections): New function.
9957 (Garbage_collection::add_cident_section): New function.
9958 (Garbage_collection::cident_sections_): New member.
9959 (gc_process_relocs): Add references to sections whose names are C
9960 identifiers.
9961 * gold.h (cident_section_start_prefix): New constant.
9962 (cident_section_stop_prefix): New constant.
9963 (is_cident): New function.
9964 * layout.cc (Layout::define_section_symbols): Replace string constants
9965 with the newly defined constants.
9966 * object.cc (Sized_relobj::do_layout): Track sections whose names are
9967 C identifiers.
9968 * testsuite/Makefile.am: Add gc_orphan_section_test.
9969 * testsuite/Makefile.in: Regenerate.
9970 * testsuite/gc_orphan_section_test.cc: New file.
9971 * testsuite/gc_orphan_section_test.sh: New file.
9972
6eda8c29
ILT
99732010-01-06 Ian Lance Taylor <iant@google.com>
9974
b9674e17
ILT
9975 PR 10980
9976 * options.h (class General_options): Add --warn-shared-textrel.
9977 * layout.cc (Layout::finish_dynamic_section): Implement
9978 --warn-shared-textrel.
9979
6eda8c29
ILT
9980 PR 10980
9981 * options.h (class General_options): Add --warn-multiple-gp.
9982
32dcd44e
ILT
99832010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9984
9985 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9986 $(THREADSLIB) and $(LIBDL).
9987 * Makefile.in: Rebuild.
9988
a192ba05
ILT
99892010-01-06 Ian Lance Taylor <iant@google.com>
9990
9991 PR 10980
9992 * options.cc (General_options::parse_section_start): New function.
9993 (General_options::section_start): New function.
9994 (General_options::General_options): Initialize all members.
9995 * options.h: Include <map>
9996 (class General_options): Add --section-start. Add section_starts_
9997 member.
9998 * layout.cc (Layout::attach_allocated_section_to_segment): If
9999 --section-start was used, set the address of the segment. Remove
10000 local sort_sections.
10001 (Layout::relaxation_loop_body): If the address of the load segment
10002 has been set by --section-start, don't use it.
10003 * output.h (Output_segment::update_flags_for_output_section): New
10004 function.
10005 * output.cc (Output_segment::add_output_section): Call
10006 update_flags_for_output_section.
10007
dde3f402
ILT
100082010-01-05 Ian Lance Taylor <iant@google.com>
10009
62dfdd4d
ILT
10010 PR 10980
10011 * options.h (class General_options): Add --undefined-version.
10012 * script.cc (struct Version_expression): Add was_matched_by_symbol
10013 field.
10014 (Version_script_info::matched_symbol): New function.
10015 (Version_script_info::get_symbol_version_helper): Call
10016 matched_symbol.
10017 (Version_script_info::check_unmatched_names): New function.
10018 * script.h (class Version_script_info): Update declarations.
10019 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10020
9c4ae156
ILT
10021 * options.h (class General_options): Use DEFINE_bool_alias for
10022 allow_multiple_definition.
10023 * resolve.cc (Symbol_table::should_override): Don't test
10024 allow_multiple_definition.
10025
dde3f402
ILT
10026 PR 10980
10027 * options.h (class General_options): Add --cref.
10028 * main.cc (main): Print cref table if --cref. Don't close mapfile
10029 until after printing cref table.
10030 * cref.cc: Include "symtab.h".
10031 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10032 (Cref_table_compare::operator()): New function.
10033 (Cref_inputs::gather_cref): New function.
10034 (filecol): New static const.
10035 (Cref_inputs::print_cref): New function.
10036 (Cref::print_cref): New function.
10037 * cref.h: Include <cstdio>.
10038 (class Cref): Update declarations.
10039 * mapfile.h (Mapfile::file): New function.
10040 * object.h (class Object): Define Symbols. Declare virtual
10041 do_get_global_symbols.
10042 (Object::get_global_symbols): New function.
10043 * object.cc (Input_objects::add_object): Pass object to cref_ if
10044 --cref.
10045 (Input_objects::archive_start): Likewise.
10046 (Input_objects::archive_stop): Likewise.
10047 (Input_objects::print_cref): New function.
10048 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10049 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10050 --cref.
10051 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10052 function.
10053 * plugin.h (class Sized_pluginobj): Update declarations.
10054
8781f709
ILT
100552010-01-05 Ian Lance Taylor <iant@google.com>
10056
10057 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10058 to is_default_version. Rename insdef to insdefault.
10059 (Symbol_table::add_from_relobj): Rename def to is_default_version
10060 and local to is_forced_local.
10061 (Symbol_table::add_from_pluginobj): Likewise.
10062 (Symbol_table::add_from_dynobj): Likewise.
10063 (Symbol_table::define_special_symbol): Rename insdef to
10064 insdefault.
10065
fe35d28d
ILT
100662010-01-04 Ian Lance Taylor <iant@google.com>
10067
30bc8c46
ILT
10068 PR 10980
10069 * options.h (class General_options): Add
10070 --allow-multiple-definition and -z muldefs.
10071 * resolve.cc (Symbol_table::should_override): Don't warn about a
10072 multiple symbol definition if --allow-multiple-definition or -z
10073 muldefs.
10074
7eaea549
ILT
10075 PR 10980
10076 * options.h (class General_options): Add --add-needed and
10077 --copy-dt-needed-entries. Tweak --as-needed help entry.
10078 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10079 error if --copy-dt-needed-entries aka --add-needed is used and
10080 would cause a change in behaviour.
10081
fe35d28d
ILT
10082 PR 10980
10083 * options.h (class General_options): Add -G as a short version of
10084 --shared. Add no-op options -assert, -g, and -i.
10085
55a2bb35
ST
100862010-01-04 Sriraman Tallam <tmsriram@google.com>
10087
10088 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10089 check for .text or .gnu.linkonce.t sections.
10090 * icf.cc (Icf::find_identical_sections): Ditto.
10091 Change the detection for mangled function name within the section
10092 name.
10093 * icf.h (is_section_foldable_candidate): New function.
10094
719328e1
ILT
100952009-12-30 Ian Lance Taylor <iant@google.com>
10096
10097 PR 10980
10098 * options.h (class General_options): Permit two dashes with
10099 --retain-symbols-file.
10100
d7bb5745
ILT
101012009-12-30 Ian Lance Taylor <iant@google.com>
10102
403a15dd
ILT
10103 PR 10979
10104 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10105 don't put the file header and segment headers in the text
10106 segment.
10107
eda294df
ILT
10108 PR 10979
10109 * common.cc (Sort_commons::operator()): Stabilize sort when both
10110 entries are NULL.
10111 (Symbol_table::do_allocate_commons_list): When allocating common
10112 symbols, skip a symbol which is no longer common.
10113 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10114 an object before checking its type.
10115 * testsuite/common_test_2.c: New file.
10116 * testsuite/common_test_3.c: New file.
10117 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10118 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10119 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10120 (common_test_2_pic.o, common_test_2.so): New targets.
10121 (common_test_3_pic.o, common_test_3.so): New targets.
10122 * testsuite/Makefile.in: Rebuild.
10123
d7bb5745
ILT
10124 PR 10979
10125 * script.cc (read_input_script): If we see a new SECTIONS clause,
10126 and we have added an input section, give an error.
10127 * layout.h (class Layout): Add have_added_input_section function.
10128 Add have_added_input_section_ field.
10129 * layout.cc (Layout::Layout): Initialize
10130 have_added_input_section_.
10131 (Layout::layout): Set have_added_input_section_.
10132 (Layout::layout_eh_frame): Likewise.
10133
fc59c572
ILT
101342009-12-30 Ian Lance Taylor <iant@google.com>
10135
10136 PR 10931
10137 * options.h (class General_options): Add --sort-common option.
10138 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10139 * common.cc (Sort_common): Add sort_order parameter to
10140 constructor. Add sort_order_ field.
10141 (Sort_commons::operator): Check sort_order_.
10142 (Symbol_table::allocate_commons): Determine the sort order.
10143 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10144 Change all callers.
10145 (Symbol_table::do_allocate_commons_list): Likewise.
10146
1c74fab0
ILT
101472009-12-30 Ian Lance Taylor <iant@google.com>
10148
10149 PR 10916
10150 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10151 symbols from this object, don't change the visibility of an
10152 undefined symbol.
10153 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10154
6affe781
ILT
101552009-12-30 Ian Lance Taylor <iant@google.com>
10156
10157 PR 10861
10158 * script.h (class Version_script_info): Define Language enum.
10159 Update declarations. Define Glob, Exact, and Lookup types. Add
10160 new fields globals_, locals_, and is_finalized_.
10161 * script.cc: Various formatting fixes.
10162 (class Parser_closure): Change language_stack_ from a vector of
10163 std::string to one of Version_script_info::Language. Adjust all
10164 uses accordingly.
10165 (class Lazy_demangler): Remove.
10166 (struct Version_expression): Change language from std::string to
10167 Version_script_info::Language.
10168 (Version_script_info::Version_script_info): New function.
10169 (Version_script_info::~Version_script_info): Don't call clear.
10170 (Version_script_info::finalize): New function.
10171 (Version_script_info::build_lookup_tables): New function.
10172 (Version_script_info::build_expression_list_lookup): New
10173 function.
10174 (Version_script_info::get_symbol_version_helper): Rewrite to use
10175 lookup tables.
10176 (Version_script_info::print_expression_list): Adjust to use
10177 Version_script_info::Language.
10178 (script_push_lex_into_version_mode): Check that the version script
10179 has not been finalized.
10180 (version_script_push_lang): Change language string to
10181 Version_script_info::Language.
10182 * options.cc (Command_line::version_script): New function.
10183 * options.h (class General_options): Add finalize_dynamic_list
10184 function. Change version_script from declaration to definition.
10185 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10186 * testsuite/version_script.map: Remove duplicate def of foo.
10187 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10188 version_script.map.
10189 * testsuite/Makefile.in: Rebuild.
10190
818bf354
ILT
101912009-12-30 Ian Lance Taylor <iant@google.com>
10192
10193 PR 10843
10194 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10195 if the input symbol index is 0, make the output symbol index 0.
10196
ebcc8304
ILT
101972009-12-30 Ian Lance Taylor <iant@google.com>
10198
10199 PR 10670
10200 * options.h (class General_options): Add -x/--discard-all.
10201 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10202 --discard-all. If the local symbol needs a dynamic entry, check
10203 that before handling --discard-locals.
10204
176fe33f
ILT
102052009-12-30 Ian Lance Taylor <iant@google.com>
10206
bb321bb1
ILT
10207 PR 10450
10208 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10209 flags to PF_R.
10210 (Output_segment::add_output_section): Don't change the flags if
10211 the type is PT_TLS.
10212
176fe33f
ILT
10213 PR 10450
10214 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10215 GNU hash table if they need a dynamic value. Otherwise, don't add
10216 them if they are defined in a dynamic object or are forced local.
10217
e8cd95c7
ILT
102182009-12-29 Ian Lance Taylor <iant@google.com>
10219
1b81fb71
ILT
10220 PR 10450
10221 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10222 .gnu.hash table for a 32-bit target.
10223
8d6d383d
ILT
10224 PR 10450
10225 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10226 regular and a dynamic object only needs a dynamic symbol table
10227 entry if it is externally visible.
10228
e785ec03
ILT
10229 PR 10450
10230 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10231 constructor. Add global_offset_table_ field.
10232 (Target_i386::got_section): Set global_offset_table_.
10233 (Target_i386::do_finalize_sections): Set global_offset_table_
10234 size.
10235 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10236 in constructor. Add global_offset_table_ field.
10237 (Target_x86_64::got_section): Set global_offset_table_.
10238 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10239 size.
10240
1a2dff53
ILT
10241 * layout.cc (Layout::Layout): Initialize increase_relro_.
10242 (Layout::get_output_section): Add is_relro, is_last_relro, and
10243 is_first_non_relro parameters. Change all callers.
10244 (Layout::choose_output_section): Likewise.
10245 (Layout::add_output_section_data): Likewise.
10246 (Layout::make_output_section): Likewise.
10247 (Layout::set_segment_offsets): Clear increase_relro when using a
10248 linker script.
10249 * layout.h (class Layout): Add increase_relro method. Add
10250 increase_relro_ field. Update declarations.
10251 * output.cc (Output_section::Output_section): Initialize
10252 is_last_relro_ and is_first_non_relro_.
10253 (Output_segment::add_output_section): Group relro sections is
10254 do_sort is true. Handle is_last_relro and is_first_non_relro.
10255 (Output_segment::maximum_alignment): Remove relro handling.
10256 (Output_segment::set_section_addresses): Add increase_relro
10257 parameter. Change all callers. Add initial alignment to align
10258 relro sections on separate page. Remove old relro handling.
10259 (Output_segment::set_section_list_addresses): Remove in_relro
10260 parameter. Change all callers.
10261 (Output_segment::set_offset): Add increase parameter. Change all
10262 callers. Remove old relro handling.
10263 * output.h (class Output_section): Add new methods: is_last_relro,
10264 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10265 Add is_last_relro_ and is_first_non_relro_ fields.
10266 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10267 Create separate .got.plt section. Call increase_relro.
10268 * x86_64.cc (Target_x86_64::got_section): Likewise.
10269 * testsuite/relro_script_test.t: Add .got.plt.
10270
f0ba79e2
ILT
10271 PR 10450
10272 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10273 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10274 (Layout::finalize): Call set_dynamic_symbol_size.
10275 (Layout::set_dynamic_symbol_size): New function.
10276 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10277 set_dynamic_symbol_size.
10278
e8cd95c7
ILT
10279 PR 10450
10280 * output.h (class Output_section): Add is_entsize_zero_ field.
10281 * output.cc (Output_section::Output_section): Initialize
10282 is_entsize_zero_.
10283 (Output_section::set_entsize): If two different entsizes are
10284 requested, force it to zero.
10285 (Output_section::add_input_section): Set flags for .debug_str
10286 before updating section flags. Set entsize.
10287 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10288 and SHF_STRING if all input sections have those flags.
10289
3e1b9a8a
RÁE
102902009-12-29 Rafael Espindola <espindola@google.com>
10291
10292 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10293 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10294 reporting.
3e1b9a8a 10295
3dcad376
ST
102962009-12-29 Sriraman Tallam <tmsriram@google.com>
10297
10298 * options.cc (General_options::parse_version): Allow -v to exit
10299 without an error if there is nothing to link.
10300
084e2665
ILT
103012009-12-29 Ian Lance Taylor <iant@google.com>
10302
10303 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10304 using a version of gcc before 4.1.
10305 * configure: Rebuild.
10306
250acde3
CD
103072009-12-28 Chris Demetriou <cgd@google.com>
10308
10309 * attributes.cc (Output_attributes_section_data::do_write): Use
10310 std::vector::front rather than std::vector::data.
10311
99fff23b
ILT
103122009-12-28 Ian Lance Taylor <iant@google.com>
10313
10314 * symtab.h (class Symbol_table): Add enum Defined.
10315 * resolve.cc (Symbol_table::should_override): Add defined
10316 parameter. Change all callers. Test whether object is NULL
10317 before calling a method on it.
10318 (Symbol_table::report_resolve_problem): Add defined parameter.
10319 Change all callers.
10320 (Symbol_table::should_override_with_special): Likewise.
10321 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10322 parameter. Change all callers.
10323 (Symbol_table::do_define_in_output_data): Likewise.
10324 (Symbol_table::define_in_output_segment): Likewise.
10325 (Symbol_table::do_define_in_output_segment): Likewise.
10326 (Symbol_table::define_as_constant): Likewise.
10327 (Symbol_table::do_define_as_constant): Likewise.
10328 * script.h (class Symbol_assignment): Add is_defsym parameter to
10329 constructor; change all callers.
10330 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10331 parameter. Change all callers. Add is_defsym_ field.
10332 (class Parser_closure): Add parsing_defsym parameter to
10333 constructor; change all callers. Add parsing_defsym accessor
10334 function. Add parsing_defsym_ field.
10335
556bd683
ILT
103362009-12-28 Ian Lance Taylor <iant@google.com>
10337
10338 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10339 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10340
1782c879
ILT
103412009-12-23 Ian Lance Taylor <iant@google.com>
10342
10343 * i386.cc (Target_i386::do_calls_non_split): Recognize
10344 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10345 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10346 -fsplit-stack prologue when using %r11.
1782c879 10347
329ca2b1
ST
103482009-12-21 Sriraman Tallam <tmsriram@google.com>
10349
10350 * options.cc (General_options::parse_version): Make -v continue and do
10351 the link like GNU ld does.
10352
d675ff46
RÁE
103532009-12-17 Rafael Avila de Espindola <espindola@google.com>
10354
10355 * Makefile.am (CCFILES): Add timer.cc.
10356 (HFILES): Add timer.h.
10357 * configure.ac: Check for sysconf and times.
10358 * main.cc: include timer.h.
10359 (main): Use Timer instead of get_run_time.
10360 * timer.cc: New.
10361 * timer.h: New.
10362 * workqueue.cc: include timer.h.
10363 (Workqueue::find_and_run_task):
10364 Report user, sys and wall time.
10365 * Makefile.in: Regenerate.
10366 * config.in: Regenerate.
10367 * configure: Regenerate.
10368
d6344fb5
DK
103692009-12-16 Doug Kwan <dougkwan@google.com>
10370
10371 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10372 sections.
10373 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10374 relaxed input sections.
10375 * output.cc (Output_section::find_relaxed_input_section): Change
10376 return type to Output_relaxed_input_section pointer. Adjust code
10377 for new type of relaxed_input_section_map_.
10378 * output.h (Output_section::find_relaxed_input_section): Change
10379 return type to Output_relaxed_input_section pointer.
10380 (Output_section::Output_relaxed_input_section_by_input_section_map):
10381 New type.
10382 (Output_section::relaxed_input_section_map_): Change type to
10383 Output_section::Output_relaxed_input_section_by_input_section_map.
10384 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10385 input section.
10386
0e0d5469
ILT
103872009-12-15 Ian Lance Taylor <iant@google.com>
10388
10389 * layout.cc (Layout::create_shstrtab): Only write out after input
10390 sections if we are compressing debug sections.
10391
0649a889
ILT
103922009-12-15 Ian Lance Taylor <iant@google.com>
10393
10394 * archive.cc (Archive::add_symbols): Only look up a symbol without
10395 a version if there is, in fact, a version.
10396
2ea97941
ILT
103972009-12-14 Ian Lance Taylor <iant@google.com>
10398
10399 Revert -Wshadow changes, all changes from:
10400 2009-12-11 Doug Kwan <dougkwan@google.com>
10401 2009-12-11 Nick Clifton <nickc@redhat.com>
10402 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10403
b0eec2cc
DK
104042009-12-11 Doug Kwan <dougkwan@google.com>
10405
10406 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10407 due to -Wshadow.
10408 * attributes.cc (Object_attribute::size): Ditto.
10409 (Attributes_section_data::size): Ditto.
10410 (Attributes_section_data::Attributes_section_data): Ditto.
10411 (Output_attributes_section_data::do_write): Ditto.
10412 * attributes.h (Object_attribute::set_type): Ditto.
10413 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10414
91d6fa6a
NC
104152009-12-11 Nick Clifton <nickc@redhat.com>
10416
10417 * archive.cc: Fix shadowed variable warnings.
10418 * arm.cc: Likewise.
10419 * compressed_output.cc: Likewise.
10420 * compressed_output.h: Likewise.
10421 * configure: Likewise.
10422 * dwarf_reader.cc: Likewise.
10423 * dynobj.cc: Likewise.
10424 * dynobj.h: Likewise.
10425 * ehframe.cc: Likewise.
10426 * ehframe.h: Likewise.
10427 * errors.cc: Likewise.
10428 * expression.cc: Likewise.
10429 * fileread.cc: Likewise.
10430 * fileread.h: Likewise.
10431 * freebsd.h: Likewise.
10432 * i386.cc: Likewise.
10433 * icf.cc: Likewise.
10434 * incremental.h: Likewise.
10435 * layout.cc: Likewise.
10436 * layout.h: Likewise.
10437 * mapfile.cc: Likewise.
10438 * merge.cc: Likewise.
10439 * merge.h: Likewise.
10440 * object.cc: Likewise.
10441 * object.h: Likewise.
10442 * options.h: Likewise.
10443 * output.cc: Likewise.
10444 * output.h: Likewise.
10445 * parameters.cc: Likewise.
10446 * plugin.cc: Likewise.
10447 * powerpc.cc: Likewise.
10448 * reduced_debug_output.cc: Likewise.
10449 * reduced_debug_output.h: Likewise.
10450 * reloc.cc: Likewise.
10451 * reloc.h: Likewise.
10452 * resolve.cc: Likewise.
10453 * script-sections.cc: Likewise.
10454 * script.cc: Likewise.
10455 * script.h: Likewise.
10456 * sparc.cc: Likewise.
10457 * symtab.cc: Likewise.
10458 * symtab.h: Likewise.
10459 * target-select.cc: Likewise.
10460 * target-select.h: Likewise.
10461 * token.h: Likewise.
10462 * workqueue.cc: Likewise.
10463 * workqueue.h: Likewise.
10464 * x86_64.cc: Likewise.
10465
a0351a69
DK
104662009-12-10 Doug Kwan <dougkwan@google.com>
10467
10468 * arm.cc (attributes.h): New include.
10469 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10470 (Arm_relobj::~Arm_relobj): Delete object pointed by
10471 attributes_section_data_.
10472 (Arm_relobj::attributes_section_data): New method definition.
10473 (Arm_relobj::attributes_section_data_): New data member declaration.
10474 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10475 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10476 attributes_section_data_.
10477 (Arm_dynobj::attributes_section_data): New method definition.
10478 (Arm_dynobj::attributes_section_data_): New data member declaration.
10479 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10480 initialization value of may_use_blx_ to false.
2e702c99 10481 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10482 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10483 object attributes to compute results instead of hard-coding.
10484 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10485 Target_arm::get_secondary_compatible_arch,
10486 Target_arm::set_secondary_compatible_arch
10487 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10488 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10489 New method declarations.
10490 (Target_arm::get_aeabi_object_attribute): New method definition.
10491 (Target_arm::attributes_section_data_): New data member declaration.
10492 (read_arm_attributes_section): New template definition.
10493 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10494 (Arm_dynobj::do_read_symbols): Ditto.
10495 (Target_arm::do_finalize_sections): Merge attributes sections from
10496 input. Check for BLX use after attributes section merging.
10497 Fix __exidx_start and __exidx_end visibility. Create an
10498 .ARM.attributes section if necessary.
10499 (Target_arm::get_secondary_compatible_arch,
10500 Target_arm::set_secondary_compatible_arch,
10501 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10502 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10503 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10504 New method definitions.
10505
b59befec
ILT
105062009-12-09 Ian Lance Taylor <iant@google.com>
10507
10508 * plugin.cc (Plugin::load): Don't cast from void* to a function
10509 pointer.
10510
1276bc89
ILT
105112009-12-09 Ian Lance Taylor <iant@google.com>
10512
10513 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10514 information fields.
10515
2f2de248
L
105162009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10517
10518 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10519 Replace two_file_shared_1.so with two_file_shared_2.so.
10520 * testsuite/Makefile.in: Regenerated.
10521
4f787271
DK
105222009-12-08 Doug Kwan <dougkwan@google.com>
10523
10524 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10525 (HFILES): Add attributes.h and int_encoding.h.
10526 * Makefile.in: Regenerate.
10527 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10528 function definitions to int_encoding.cc
10529 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10530 prototypes to int_encoding.h
10531 * reduced_debug_output.cc (int_encoding.h): New include.
10532 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10533 function definitions to int_encoding.cc
10534 (insert_into_vector, read_from_pointer): Move template definitions to
10535 int_encoding.h
10536 * attributes.cc: New file.
10537 * attributes.h: New file.
10538 * int_encoding.cc: New file.
10539 * int_encoding.h: New file.
10540
20b52f1a
RÁE
105412009-12-07 Rafael Avila de Espindola <espindola@google.com>
10542
10543 PR gold/11055
10544 * incremental-dump.cc (dump_incremental_inputs): New.
10545 (main): Use dump_incremental_inputs.
10546
53d7974c
L
105472009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10548
10549 PR gold/10893
10550 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10551 checking elfcpp::STT_FUNC.
10552 (Target_i386::Relocate::relocate): Likewise.
10553 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10554
10555 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10556 symbols from shared libraries into normal FUNC symbols.
10557
10558 * symtab.h (Symbol): Add is_func and use it.
10559
05a352e6
DK
105602009-12-05 Doug Kwan <dougkwan@google.com>
10561
10562 * arm.cc (Target_arm::arm_info): Initialize new fields
10563 attributes_section and attributes_vendor.
10564 * i386.cc (Target_i386::i386_info): Same.
10565 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10566 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10567 fields attributes_section and attributes_vendor.
53d7974c 10568 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
10569 * target.h (Target::attributes_section, Target::attributes_vendor,
10570 Target::is_attributes_section, Target::attribute_arg_type,
10571 Target::attributes_order): New method definitions.
10572 (Target::Target_info::attributes_section,
10573 Target::Target_info::attributes_vendor): New fields.
10574 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10575 virtual method definitions.
10576 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10577 attributes_section and attributes_vendor.
10578 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10579
f4e5969c
DK
105802009-12-05 Doug Kwan <dougkwan@google.com>
10581
10582 * arm.cc: Update comments about interworking and stub generation.
10583 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10584 considered as non-PIC.
10585 (Arm_relocate_functions::base_abs): Fix formatting.
10586 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10587 of function to use GOT entry address instead of offset.
10588 (Target_arm::Scan::global): Issue an error if a symbol would need a
10589 PLT does not get one because it is untyped. Remove code to create
10590 dynamic symbols for relative branches.
10591 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10592 takes unsigned integer instead of boolean.
10593
1abce4a6
L
105942009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10595
10596 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10597 (two_file_test_LDADD): Likewise.
10598 (common_test_1_LDADD): Likewise.
10599 (exception_test_LDADD) Likewise.
10600 (weak_test_LDADD): Likewise.
10601 (many_sections_test_LDADD): Likewise.
10602 (initpri1_LDADD): Likewise.
10603 (script_test_1_LDADD): Likewise.
10604 (script_test_2_LDADD): Likewise.
10605 (justsyms_LDADD): Likewise.
10606 (binary_test_LDADD): Likewise.
10607 (large_LDADD): Likewise.
10608 * testsuite/Makefile.in: Regenerated.
10609
adcf2816 106102009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 10611
adcf2816
L
10612 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10613 (Symbol_table::override_with_special): Likewise.
10614 (Symbol_table::add_from_object): Likewise.
10615
28e67f5d
RÁE
106162009-12-04 Rafael Avila de Espindola <espindola@google.com>
10617
10618 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10619 Don't set the data_offset twice.
10620
ae10a101
RÁE
106212009-12-04 Rafael Avila de Espindola <espindola@google.com>
10622
10623 * testsuite/Makefile.in: Regenerate.
10624
f59f41f3
DK
106252009-12-03 Doug Kwan <dougkwan@google.com>
10626
10627 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10628 (Target_arm::do_finalize_sections): Add parameter for symbol table
10629 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10630 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10631 parameter for symbol table pointer.
10632 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10633 an additional parameter for a pointer to symbol table.
10634 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10635 parameter for a symbol table pointer.
10636 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10637 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10638 Ditto.
10639 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10640 parameter for a symbol table pointer.
10641
ca55d848
RÁE
106422009-12-03 Rafael Avila de Espindola <espindola@google.com>
10643
10644 * incremental.cc (Incremental_inputs_header)
10645 (Incremental_inputs_header_write, Incremental_inputs_entry)
10646 (Incremental_inputs_entry_write): Move ...
10647 * incremental.h (Incremental_inputs_header)
10648 (Incremental_inputs_header_write, Incremental_inputs_entry)
10649 (Incremental_inputs_entry_write): here.
10650
3aec4f9c
RÁE
106512009-12-02 Rafael Avila de Espindola <espindola@google.com>
10652
10653 * incremental.cc (make_sized_incremental_binary): Set the target.
10654 Error if it is incompatible.
10655 * output.h (Output_file): Add filename method.
10656
9c0ae74d
RÁE
106572009-12-02 Rafael Avila de Espindola <espindola@google.com>
10658
10659 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10660 from the get_* methods.
10661
a45500ae
RÁE
106622009-12-02 Rafael Avila de Espindola <espindola@google.com>
10663
10664 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10665 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10666 Write 0 for the data_offset of scripts.
10667
325e6408
RÁE
106682009-12-02 Rafael Avila de Espindola <espindola@google.com>
10669
10670 * testsuite/Makefile.am: Add the incremental_test.sh test.
10671 * testsuite/incremental_test.sh: New.
10672 * testsuite/incremental_test_1.c: New.
10673 * testsuite/incremental_test_2.c: New.
10674
954c3e2e
RÁE
106752009-12-01 Rafael Avila de Espindola <espindola@google.com>
10676
703d02da 10677 * incremental-dump.cc (main): Fix typos.
954c3e2e 10678
f8086623
RÁE
106792009-11-27 Rafael Avila de Espindola <espindola@google.com>
10680
10681 PR gold/11025
10682 * incremental-dump.cc (main): Use llu to print 64 bit values.
10683
3b0dd6ac
L
106842009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10685 H.J. Lu <hongjiu.lu@intel.com>
10686
10687 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10688 $(LIBDL).
10689 (incremental_dump_LDADD): Likewise.
10690 * Makefile.in: Regenerated.
10691
a6d1ef57 106922009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 10693
a6d1ef57
DK
10694 Revert:
10695
10696 2009-11-25 Doug Kwan <dougkwan@google.com>
10697
10698 * arm.cc (Target_arm::Target_arm): Move method definition
10699 outside of class definition. Add code to handle
10700 --target1-rel, --target1-abs and --target2= options.
10701 (Target_arm::get_reloc_reloc_type): Change method to be
10702 non-static and const.
10703 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10704 New data member declaration.
10705 (Target_arm::Scan::local, Target_arm::Scan::global,
10706 Target_arm::Relocate::relocate,
10707 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10708 Adjust call to Target_arm::get_real_reloc_type.
10709 (Target_arm::get_real_reloc_type): Use command line options
10710 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10711 * options.h (--target1-rel, --target1-abs, --target2): New
10712 ARM-only options.
10713
50aeb7d4
DK
107142009-11-25 Doug Kwan <dougkwan@google.com>
10715
10716 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10717 class definition. Add code to handle --target1-rel, --target1-abs
10718 and --target2= options.
10719 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10720 and const.
10721 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10722 member declaration.
10723 (Target_arm::Scan::local, Target_arm::Scan::global,
10724 Target_arm::Relocate::relocate,
10725 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10726 call to Target_arm::get_real_reloc_type.
10727 (Target_arm::get_real_reloc_type): Use command line options to
10728 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10729 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10730 options.
10731
51938283
DK
107322009-11-25 Doug Kwan <dougkwan@google.com>
10733
10734 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10735 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10736 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10737 formatting.
10738 (Arm_relocate_functions::thm_call): Replace body with a call to
10739 Arm_relocate_functions::thumb_branch_common.
10740 (Arm_relocate_functions::thm_jump24,
10741 Arm_relocate_functions::thm_xpc22): New method definitions.
10742 (Arm_relocate_functions::thumb_branch_common): New method definition.
10743 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10744 operator.
10745 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10746 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10747
e2b8f3c4
RÁE
107482009-11-24 Rafael Avila de Espindola <espindola@google.com>
10749
10750 * Makefile.am: Build incremental-dump
10751 * Makefile.in: Regenerate.
10752 * incremental-dump.cc: New.
10753 * incremental.cc (Incremental_inputs_header_data,
10754 Incremental_inputs_entry_data): Move to incremental.h
10755 * incremental.h: (Incremental_inputs_header_data,
10756 Incremental_inputs_entry_data): Move from incremental.cc
10757
bcba9aec
RÁE
107582009-11-24 Rafael Avila de Espindola <espindola@google.com>
10759
10760 * incremental.cc (Incremental_inputs_header,
10761 Incremental_inputs_header_write, Incremental_inputs_entry,
10762 Incremental_inputs_entry_write): Add a typedef with the data type.
10763
7c3afe08
RÁE
107642009-11-24 Rafael Avila de Espindola <espindola@google.com>
10765
10766 * incremental.cc (Incremental_inputs_header,
10767 Incremental_inputs_header_write, Incremental_inputs_entry,
10768 Incremental_inputs_entry_write): Update comment about which
10769 type has the filed descriptions.
10770
d204b6e9
DK
107712009-11-15 Doug Kwan <dougkwan@google.com>
10772
10773 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
10774 (Arm_relocate_functions::arm_branch_common): Change method defintion
10775 in class definition to a method declaration and update list of formal
10776 parameters.
10777 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
10778 Arm_relocation_functions::jump24): Adjust call to
10779 Arm_relocate_functions::arm_branch_common. Update list of formal
10780 parameters.
10781 (Arm_relocate_functions::xpc25): New method definition.
10782 (Arm_relocate_functions::arm_branch_common): Move method defintion
10783 out from class definition. Use stubs for mode-switching and extending
10784 branch ranges.
10785 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
10786 specially. Change code to enable use of stubs in ARM branches.
10787
43d12afe
DK
107882009-11-10 Doug Kwan <dougkwan@google.com>
10789
10790 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
10791 in method declaration.
10792 (Target_arm::relocate_stub): New method declaration.
10793 (Target_arm::default_target): Change to return a pointer instead of
10794 a const reference.
10795 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
10796 Target_arm::default_target.
10797 (Arm_Relobj::do_relocate_sections): Remove options paramater in
10798 method definition.
10799 (Target_arm::relocate_section): Adjust view.
10800 (Target_arm::relocate_stub): New method definition.
10801
ac33a407
DK
108022009-11-10 Doug Kwan <dougkwan@google.com>
10803
10804 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
10805 a format warning.
10806 * incremental.cc (open_incremental_binary): Initialized local
10807 variables to avoid warnings.
10808 * object.cc (make_elf_object): Ditto.
10809 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
10810 a format warning.
e1df38aa 10811
88ee28e9
L
10812009-11-09 H.J. Lu <hongjiu.lu@intel.com>
10813
10814 PR gold/10930
10815 * testsuite/plugin_test.c: Include "config.h".
10816
2daedcd6
DK
108172009-11-09 Doug Kwan <dougkwan@google.com>
10818
10819 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
10820 (arm_symbol_value): Remove.
10821 (Arm_relocate_functions::arm_branch_common,
10822 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
10823 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
10824 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
10825 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
10826 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
10827 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
10828 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
10829 Arm_relocate_functions::thm_mobw_abs_nc,
10830 Arm_relocate_functions::thm_mov_abs,
10831 Arm_relocate_functions::movw_prel_nc,
10832 Arm_relocate_functions::thm_movt_abs,
10833 Arm_relocate_functions::movt_prel,
10834 Arm_relocate_functions::thm_movw_prel_nc,
10835 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
10836 (Target_arm::Relocate::relocate): Only decompose address into two
10837 parts if relocation type uses the thumb-bit and pass the actual
10838 bit instead of a flag indicating that the thumb-bit is used. Adjust
10839 calls to methods in Arm_relocate_functions for this change.
10840
1276bc89 108412009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
10842
10843 PR 10925
10844 * reloc.cc: Instantiate
10845 Sized_relobj::initialize_input_to_output_maps and
10846 Sized_relobj:free_input_to_output_maps.
10847
e53ad1b5
ILT
108482009-11-06 Ian Lance Taylor <iant@google.com>
10849
10850 PR 10876
10851 * defstd.cc (in_segment): Set only_if_ref true for "end".
10852
eb44217c
DK
108532009-11-06 Doug Kwan <dougkwan@google.com>
10854
10855 * arm.cc (class Reloc_stub): Correct a comment.
10856 (Target_arm::Target_arm): Initialize arm_input_section_map_.
10857 (Target_arm::scan_section_for_stubs): New method declaration.
10858 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
10859 Change methods from private to protected.
10860 (Target_arm::do_may_relax): New method definition.
10861 (Target_arm::do_relax, Target_arm::group_sections,
10862 Target_arm::scan_reloc_for_stub,
10863 Target_arm::scan_reloc_section_for_stubs): New method declarations.
10864 (Target_arm::arm_input_section_map_): New data member declaration.
10865 (Target_arm::scan_reloc_for_stub,
10866 Target_arm::scan_reloc_section_for_stubs,
10867 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
10868 Target_arm::do_relax): New method definitions.
10869
5d329b7d
ILT
108702009-11-06 Mikolaj Zalewski <mikolaj@google.com>
10871
10872 * configure.ac: Check for (struct stat)::st_mtim
10873 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
10874 * config.in: Regenerate.
10875 * configure: Regenerate.
10876
96a0d71b
ILT
108772009-11-05 Ian Lance Taylor <iant@google.com>
10878
10879 PR 10910
10880 * output.cc (Output_segment::add_output_section): Add missing
10881 return statement.
10882
594c8e5e
ILT
108832009-11-04 Ian Lance Taylor <iant@google.com>
10884
10885 PR 10880
10886 * object.h (class Object): Add is_needed and set_is_needed
10887 methods. Add is_needed_ field. Make bool fields into bitfields.
10888 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
10889 defined in a dynamic object and referenced by a regular object,
10890 set is_needed for the dynamic object.
10891 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
10892 if the file is marked with as_needed and it is not needed.
10893
22b127cc
ILT
108942009-11-04 Ian Lance Taylor <iant@google.com>
10895
10896 PR 10887
10897 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
10898 tags if data is discarded by linker script.
10899 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10900 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10901 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10902 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10903
f5c870d2
ILT
109042009-11-04 Ian Lance Taylor <iant@google.com>
10905
10906 * layout.cc (Layout::get_output_section): Add is_interp and
10907 is_dynamic_linker_section parameters. Change all callers.
10908 (Layout::choose_output_section): Likewise.
10909 (Layout::make_output_section): Likewise.
10910 (Layout::add_output_section_data): Add is_dynamic_linker_section
10911 parameter. Change all callers.
10912 * layout.h (class Layout): Update declarations.
10913 * output.h (class Output_section): Add is_interp, set_is_interp,
10914 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
10915 Add is_interp_, is_dynamic_linker_section_ fields. Change
10916 generate_code_fills_at_write_ to a bitfield.
10917 * output.cc (Output_section::Output_sections): Initialize new
10918 fields.
10919 (Output_segment::add_output_section): Add do_sort parameter.
10920 Change all callers.
10921
1ae4d23b
ILT
109222009-11-03 Ian Lance Taylor <iant@google.com>
10923
10924 PR 10860
10925 * options.h (class General_options): Add --warn-common.
10926 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
10927 merging two common symbols.
10928 (Symbol_table::should_override): Handle --warn-common when merging
10929 a common symbol with a defined symbol. Use report_resolve_problem
10930 for multiple definitions.
10931 (Symbol_table::report_resolve_problem): New function.
10932 * symtab.h (class Symbol_table): Declare report_resolve_problem.
10933
55da9579
DK
109342009-11-03 Doug Kwan <dougkwan@google.com>
10935
10936 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
10937 stub_factory_.
10938 (Target_arm::stub_factory): New method definition.
10939 (Target_arm::new_arm_input_section,
10940 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
10941 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 10942 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
10943 New type definitions.
10944 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
10945 member declarations.
10946 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
10947 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
10948 New method definitions.
10949
37a9ac43
ILT
109502009-11-03 Ian Lance Taylor <iant@google.com>
10951
10952 * options.h (class General_options): Add --warn_constructors.
10953
b3d6a3d4
ILT
109542009-11-03 Ian Lance Taylor <iant@google.com>
10955
10956 PR 10893
10957 * defstd.cc (in_section): Add entries for __rel_iplt_start,
10958 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
10959
934b01dd
ILT
109602009-11-03 Ian Lance Taylor <iant@google.com>
10961
10962 PR 10895
10963 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
10964 --msgid-bugs-address.
10965 (install-pdf): New target.
10966 (install-data_yes): Look up one directory to find mkinstalldirs.
10967
03c1939b
L
109682009-11-03 H.J. Lu <hongjiu.lu@intel.com>
10969
10970 * po/Make-in (.po.gmo): Don't generate .gmo files in source
10971 tree.
10972
ebd95253
DK
109732009-10-30 Doug Kwan <dougkwan@google.com>
10974
10975 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10976
e9bbb538
DK
109772009-10-30 Doug Kwan <dougkwan@google.com>
10978
10979 * arm.cc (Stub_addend_reader): New struct template definition
10980 and partial specializations.
10981 (Stub_addend_reader::operator()): New method definition for a
10982 partially specialized template.
10983
d5b40221
DK
109842009-10-30 Doug Kwan <dougkwan@google.com>
10985
10986 * arm.cc (Arm_relobj::processor_specific_flags): New method
10987 definition.
10988 (Arm_relobj::do_read_symbols): New method declaration.
10989 (Arm_relobj::processor_specific_flags_): New data member declaration.
10990 (Arm_dynobj): New class definition.
10991 (Target_arm::do_finalize_sections): Add input_objects parameter.
10992 (Target_arm::do_adjust_elf_header): New method declaration.
10993 (Target_arm::are_eabi_versions_compatible,
10994 (Target_arm::merge_processor_specific_flags): New method declaration.
10995 (Target_arm::do_make_elf_object): New overloaded method definitions
10996 and declaration.
10997 (Arm_relobj::do_read_symbols): New method definition.
10998 (Arm_dynobj::do_read_symbols): Ditto.
10999 (Target_arm::do_finalize_sections): Add input_objects parameters.
11000 Merge processor-specific flags from all input objects.
11001 (Target_arm::are_eabi_versions_compatible,
11002 Target_arm::merge_processor_specific_flags,
11003 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11004 New method definitions.
11005 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11006 Input_objects pointer type parameter.
11007 * layout.cc (Layout::finalize): Pass input objects to target's.
11008 finalize_sections function.
11009 * output.cc (Output_file_header::do_sized_write): Set ELF file
11010 header's processor-specific flags.
11011 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11012 Input_objects pointer type parameter.
11013 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11014 * target.h (Input_objects): New forward class declaration.
11015 (Target::processor_specific_flags,
11016 Target::are_processor_specific_flags_sect): New method definitions.
11017 (Target::finalize_sections): Add input_objects parameter.
11018 (Target::Target): Initialize processor_specific_flags_ and
11019 are_processor_specific_flags_set_.
11020 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11021 parameter.
11022 (Target::set_processor_specific_flags): New method definition.
11023 (Target::processor_specific_flags_,
11024 Target::are_processor_specific_flags_set_): New data member
11025 declarations.
11026 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11027 Input_objects pointer type parameter.
11028
ebabffbd
DK
110292009-10-30 Doug Kwan <dougkwan@google.com>
11030
11031 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11032
ad0f2072
ILT
110332009-10-28 Ian Lance Taylor <iant@google.com>
11034
11035 * object.h (class Relobj): Drop options parameter from
11036 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11037 do_scan_relocs, do_relocate. Change all callers.
11038 (class Sized_relobj): Drop options parameters from
11039 do_gc_process_relocs, do_scan_relocs, do_relocate,
11040 do_relocate_sections, relocate_sections, emit_relocs_scan,
11041 emit_relocs_scan_reltype. Change all callers.
11042 (struct Relocate_info): Remove options field and all references to
11043 it.
11044 * reloc.h (class Read_relocs): Remove options constructor
11045 parameter and options_ field. Change all callers.
11046 (class Gc_process_relocs, class Scan_relocs): Likewise.
11047 (class Relocate_task): Likewise.
11048 * target-reloc.h (scan_relocs): Remove options parameter. Change
11049 all callers.
11050 (scan_relocatable_relocs): Likewise.
11051 * target.h (class Sized_target): Remove options parameter from
11052 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11053 all callers.
11054 * gc.h (gc_process_relocs): Remove options parameter. Change all
11055 callers.
11056 * arm.cc: Update functions to remove options parameters.
11057 * i386.cc: Likewise.
11058 * powerpc.cc: Likewise.
11059 * sparc.cc: Likewise.
11060 * x86_64.cc: Likewise.
11061 * testsuite/testfile.cc: Likewise.
11062
8ffa3667
DK
110632009-10-28 Doug Kwan <dougkwan@google.com>
11064
11065 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11066 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11067 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11068 New method definitions.
11069
40f36857
CC
110702009-10-28 Cary Coutant <ccoutant@google.com>
11071
11072 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11073 (Plugin::cleanup_done_): New member.
11074 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11075 (Plugin_manager::cleanup_done_): Remove.
11076 (Plugin_manager::add_input_file): Edit error message.
11077 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11078 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11079
2c849493
ILT
110802009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11081
11082 * fileread.cc: (File_read::View::~View): Use the new
11083 data_ownership_ filed.
11084 (File_read::~File_read): Dispose the new whole_file_view_.
11085 (File_read::open): Mmap the whole file if needed.
11086 (File_read::open): Use whole_file_view_ instead of contents_.
11087 (File_read::find_view): Use whole_file_view_ if applicable.
11088 (File_read::do_read): Use whole_file_view_ instead of contents_.
11089 (File_read::make_view): Use whole_file_view_ instead of contents_,
11090 update File_read::View::View call.
11091 (File_read::find_or_make_view): Update File_read::View::View
11092 call.
11093 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11094 remove contents_
11095 (File_read::View::Data_ownership): New enum.
11096 (File_read::View::View): Replace bool mapped_ with Data_ownership
11097 argument.
11098 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11099 (File_read::View::data_ownership_): New field.
11100 (File_read::contents_): Remove (replaced by whole_file_view_).
11101 (File_read::whole_file_view_): New field.
11102 * options.h (class General_options): Add --keep-files-mapped.
11103
24998053
CC
111042009-10-27 Cary Coutant <ccoutant@google.com>
11105
11106 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11107 * testsuite/Makefile.am (plugin_test_5): New test case.
11108 * testsuite/Makefile.in: Regenerate.
11109
72adc4fa
DK
111102009-10-25 Doug Kwan <dougkwan@google.com>
11111
11112 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11113 from private to protected to allow access by child class.
11114 (Sized_relobj::do_relocate_sections): New method declaration.
11115 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11116 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11117 Sized_relobj::relocate_sections. Instantiate template explicitly
11118 for different target sizes and endianity.
11119
07f508a2
DK
111202009-10-24 Doug Kwan <dougkwan@google.com>
11121
11122 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11123 (Arm_input_section::as_arm_input_section): New method.
11124 (Arm_output_section): New class definition.
11125 (Arm_output_section::create_stub_group,
11126 Arm_output_section::group_sections): New method definitions.
11127
10ad9fe5
DK
111282009-10-22 Doug Kwan <dougkwan@google.com>
11129
11130 * arm.cc (Arm_input_section): New class definition.
11131 (Arm_input_section::init, Arm_input_section:do_write,
11132 Arm_input_section::set_final_data_size,
11133 Arm_input_section::do_reset_address_and_file_offset): New method
11134 definitions.
11135
56ee5e00
DK
111362009-10-21 Doug Kwan <dougkwan@google.com>
11137
11138 * arm.cc (Stub_table, Arm_input_section): New forward class
11139 declarations.
11140 (Stub_table): New class defintion.
11141 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11142 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11143 New method definition.
11144
b569affa
DK
111452009-10-21 Doug Kwan <dougkwan@google.com>
11146
11147 * arm.cc: Update copyright comments.
11148 (Target_arm): New forward class template declaration.
11149 (Arm_address): New type.
11150 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11151 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11152 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11153 constants.
11154 (Insn_template): Same.
11155 (DEF_STUBS): New macro.
11156 (Stub_type): New enum type.
11157 (Stub_template): New class definition.
11158 (Stub): Same.
11159 (Reloc_stub): Same.
11160 (Stub_factory): Same.
11161 (Target_arm::Target_arm): Initialize may_use_blx_ and
11162 should_force_pic_veneer_.
11163 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11164 Target_arm::should_force_pic_veneer,
11165 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11166 Target_arm::using_thumb_only, Target_arm:;default_target): New
11167 method defintions.
11168 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11169 New data member declarations.
11170 (Insn_template::size, Insn_template::alignment): New method defintions.
11171 (Stub_template::Stub_template): New method definition.
11172 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11173 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11174 (Stub_factory::Stub_factory): New method definition.
11175 * gold.h (string_hash): New template.
11176 * output.h (Input_section_specifier::hash_value): Use
11177 gold::string_hash.
11178 (Input_section_specifier::string_hash): Remove.
11179 * stringpool.cc (Stringpool_template::string_hash): Use
11180 gold::string_hash.
11181
6c172549
DK
111822009-10-20 Doug Kwan <dougkwan@google.com>
11183
11184 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11185 symbols of relaxed input sections.
11186 * output.h (Output_section::find_relaxed_input_section): Make
11187 method public.
11188
c5617f2f
DK
111892009-10-16 Doug Kwan <dougkwan@google.com>
11190
11191 * dynobj.cc (Versions::Versions): Initialize version_script_.
11192 Only insert base version symbol definition for a shared object
11193 if version script defines any version versions.
11194 (Versions::define_base_version): New method definition.
11195 (Versions::add_def): Check that base version is not needed.
11196 (Versions::add_need): Define base version lazily.
11197 * dynobj.h (Versions::define_base_version): New method declaration.
11198 (Versions::needs_base_version_): New data member declaration.
11199 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11200 (check_DATA): Add no_version_test.stdout.
11201 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11202 New make rules.
11203 * testsuite/Makefile.in: Regenerate.
11204 * testsuite/no_version_test.c: New file.
11205 * testsuite/no_version_test.sh: Ditto.
11206
3c12dcdb
DK
112072009-10-16 Doug Kwan <dougkwan@google.com>
11208
11209 * expression.cc (class Segment_start_expression): New class definition.
11210 (Segment_start_expression::value): New method definition.
11211 (script_exp_function_segment_start): Return a new
11212 Segment_start_expression.
11213 * gold/script-c.h (script_saw_segment_start_expression): New function
11214 prototype.
11215 * script-sections.cc (Script_sections::Script_sections): Initialize
11216 SAW_SEGMENT_START_EXPRESSION_ to false.
11217 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11218 and -Tbbs options to specify section addresses if given in
11219 command line and no SEGMENT_START expression is seen in a script.
11220 * script-sections.h (Script_sections::saw_segment_start_expression,
11221 Script_sections::set_saw_segment_start_expression): New method
11222 definition.
11223 (Script_sections::saw_segment_start_expression_): New data member
11224 declaration.
11225 * script.cc (script_saw_segment_start_expression): New function.
11226 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11227 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11228 script_test_7.sh and script_test_8.sh.
11229 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11230 script_test_8.stdout.
11231 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11232 (script_test_6, script_test_6.stdout, script_test_7,
11233 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11234 * Makefile.in: Regenerate.
11235 * testsuite/script_test_6.sh: New file.
11236 * testsuite/script_test_6.t: Same.
11237 * testsuite/script_test_7.sh: Same.
11238 * testsuite/script_test_7.t: Same.
11239 * testsuite/script_test_8.sh: Same.
11240
64b1ae37
DK
112412009-10-16 Doug Kwan <dougkwan@google.com>
11242
11243 * output.cc (Output_segment::set_section_list_address): Cast
11244 expressions to unsigned long long type to avoid format warnings.
11245
661be1e2
ILT
112462009-10-15 Ian Lance Taylor <iant@google.com>
11247
12edd763 11248 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11249 dot assignment to script_sections_.
12edd763
ILT
11250 * script-sections.cc (Script_sections::add_dot_assignment):
11251 Initialize if necessary.
11252
68b6574b
ILT
11253 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11254 program headers with no load segment if there is a linker script.
11255
661be1e2
ILT
11256 * layout.cc (Layout::set_segment_offsets): Align the file offset
11257 to the segment aligment for -N or -n with no load segment.
11258 * output.cc (Output_segment::add_output_section): Don't crash if
11259 the first section is a TLS section.
11260 (Output_segment::set_section_list_addresses): Print an error
11261 message if the address moves backward in a linker script.
11262 * script-sections.cc
11263 (Output_section_element_input::set_section_addresses): Don't
11264 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11265 (Orphan_output_section::set_section_addresses): Likewise.
11266
f15f61a7
DK
112672009-10-15 Doug Kwan <dougkwan@google.com>
11268
11269 * layout.cc (Layout::finish_dynamic_section): Generate tags
11270 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11271 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11272 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11273
82bb573a
ILT
112742009-10-14 Ian Lance Taylor <iant@google.com>
11275
11276 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11277 fields.
11278 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11279 data_shdr fields of relinfo.
11280 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11281 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11282 R_386_TLS_LDO_32, adjust based on section flags.
11283 (Target_i386::Relocate::fix_up_ldo): Remove.
11284
374ad285
ILT
112852009-10-13 Ian Lance Taylor <iant@google.com>
11286
11287 Add support for -pie.
11288 * options.h (class General_options): Add -pie and
11289 --pic-executable.
11290 (General_options::output_is_position_independent): Test -pie.
11291 (General_options::output_is_executable): Return true if not shared
11292 and not relocatable.
11293 (General_options::output_is_pie): Remove.
11294 * options.cc (General_options::finalize): Reject incompatible uses
11295 of -pie.
11296 * gold.cc (queue_middle_tasks): A -pie link is not static.
11297 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11298 * symtab.cc (Symbol::final_value_is_known): Return false if
11299 output_is_position_independent.
11300 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11301 output_is_position_independent.
11302 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11303 output_is_position_independent.
11304 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11305 output_is_position_independent.
11306 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11307 two_file_pie_test.
11308 (basic_pie_test.o, basic_pie_test): New targets.
11309 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11310 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11311 (two_file_pie_test): New target.
11312 * testsuite/Makefile.in: Rebuild.
11313 * README: Remove note saying that -pie is not supported.
11314
c6585162
ILT
113152009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11316
11317 * options.h (class General_options): Add -init and -fini.
11318 * layout.cc (Layout::finish_dynamic_section): Emit
11319 given init and fini functions.
11320
032ce4e9
ST
113212009-10-13 Sriraman Tallam <tmsriram@google.com>
11322
11323 * gc.h (gc_process_relocs): Check if icf is enabled using new
11324 function.
11325 * gold.cc (queue_initial_tasks): Likewise.
11326 (queue_middle_tasks): Likewise.
11327 * object.cc (do_layout): Likewise.
11328 * symtab.cc (is_section_folded): Likewise.
11329 * main.cc (main): Likewise.
11330 * reloc.cc (Read_relocs::run): Likewise.
11331 (Sized_relobj::do_scan_relocs): Likewise.
11332 * icf.cc (is_function_ctor_or_dtor): New function.
11333 (Icf::find_identical_sections): Check if function is ctor or dtor when
11334 safe icf is chosen.
11335 * options.h (General_options::icf): Change option to be an enum.
11336 (Icf_status): New enum.
11337 (icf_enabled): New method.
11338 (icf_safe_folding): New method.
11339 (set_icf_status): New method.
11340 (icf_status_): New variable.
11341 * (options.cc) (General_options::finalize): Set icf_status_.
11342 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11343 icf_test and icf_keep_unique_test to use the --icf enum flag.
11344 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11345 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11346
f345227a
ST
113472009-10-12 Sriraman Tallam <tmsriram@google.com>
11348
11349 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11350 includes to gc.h and icf.h.
11351 * arm.cc: Include gc.h.
11352 * gold.cc: Likewise.
11353 * i386.cc: Likewise.
11354 * powerpc.cc: Likewise.
11355 * sparc.cc: Likewise.
11356 * x86_64.cc: Likewise.
11357 * gc.h: Include icf.h.
11358
1c7814ed
ILT
113592009-10-11 Ian Lance Taylor <iant@google.com>
11360
11361 * plugin.cc: Include "gold.h" before other header files.
11362
ae3b5189
CD
113632009-10-10 Chris Demetriou <cgd@google.com>
11364
11365 * options.h (Input_file_argument::Input_file_type): New enum.
11366 (Input_file_argument::is_lib_): Replace with...
11367 (Input_file_argument::type_): New member.
11368 (Input_file_argument::Input_file_argument): Take Input_file_type
11369 'type' rather than boolean 'is_lib' as second argument.
11370 (Input_file_argument::is_lib): Use type_.
11371 (Input_file_argument::is_searched_file): New function.
11372 (Input_file_argument::may_need_search): Handle is_searched_file.
11373 * options.cc (General_options::parse_library): Support -l:filename.
11374 (General_options::parse_just_symbols): Update for Input_file_argument
11375 changes.
11376 (Command_line::process): Likewise.
11377 * archive.cc (Archive::get_file_and_offset): Likewise.
11378 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11379 * script.cc (read_script_file, script_add_file): Likewise.
11380 * fileread.cc (Input_file::Input_file): Likewise.
11381 (Input_file::will_search_for): Handle is_searched_file.
11382 (Input_file::open): Likewise.
11383 * readsyms.cc (Read_symbols::get_name): Likewise.
11384 * testsuite/Makefile.am (searched_file_test): New test.
11385 * testsuite/Makefile.in: Regenerate.
11386 * testsuite/searched_file_test.cc: New file.
11387 * testsuite/searched_file_test_lib.cc: New file.
11388
f3048a1d
ILT
113892009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11390 Ian Lance Taylor <iant@google.com>
11391
11392 * descriptor.cc: Include <cstdio> and "binary-io.h".
11393 (Descriptors::open): Open the files in binary mode always.
11394 * script.cc (Lex::get_token): Treat \r as whitespace.
11395
d4780e57
ILT
113962009-10-09 Ian Lance Taylor <iant@google.com>
11397
11398 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11399
d9a893b8
ILT
114002009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11401 Ian Lance Taylor <iant@google.com>
11402
11403 * configure.ac: Check for readv function also.
11404 * fileread.cc (readv): Define if not HAVE_READV.
11405 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11406 does not exist.
11407 * config.in: Regenerate.
11408 * configure: Regenerate.
11409
c0a62865
DK
114102009-10-09 Doug Kwan <dougkwan@google.com>
11411
11412 * layout.cc (Layout::make_output_section): Call target hook to make
11413 ordinary output section.
11414 (Layout::finalize): Adjust parameter list of call the
11415 Target::may_relax().
11416 * layout.h (class Layout::section_list): New method.
11417 * merge.h (Output_merge_base::entsize): Change visibility to public.
11418 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11419 New methods.
11420 (Output_merge_string::do_is_string): New method.
11421 * object.cc (Sized_relobj::do_setup): renamed from
11422 Sized_relobj::set_up.
11423 * object.h (Sized_relobj::adjust_shndx,
11424 Sized_relobj::initializ_input_to_output_maps,
11425 Sized_relobj::free_input_to_output_maps): Change visibilities to
11426 protected.
11427 (Sized_relobj::setup): Virtualize.
11428 (Sized_relobj::do_setup): New method declaration.
11429 (Sized_relobj::invalidate_section_offset,
11430 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11431 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11432 * options.cc (parse_int): New function.
11433 * options.h (parse_int): New declaration.
11434 (DEFINE_int): New macro.
11435 (stub_group_size): New option.
11436 * output.cc (Output_section::Output_section): Initialize memebers
11437 merge_section_map_, merge_section_by_properties_map_,
11438 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11439 (Output_section::add_input_section): Handled deferred code-fill
11440 generation and remove an old comment.
11441 (Output_section::add_relaxed_input_section): New method definition.
11442 (Output_section::add_merge_input_section): Use merge section by
11443 properties map to speed to search. Update merge section maps
11444 as appropriate.
11445 (Output_section::build_relaxation_map): New method definition.
11446 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11447 Same.
11448 (Output_section::relax_input_section): Renamed to
11449 Output_section::convert_input_sections_to_relaxed_sections and change
11450 interface to take a vector of pointers to relaxed sections.
11451 (Output_section::find_merge_section,
11452 Output_section::find_relaxed_input_section): New method definitions.
11453 (Output_section::is_input_address_mapped,
11454 Output_section::output_offset, Output_section::output_address):
11455 Use output section data maps to speed up searching.
11456 (Output_section::find_starting_output_address): Add comments.
11457 (Output_section::do_write,
11458 Output_section::write_to_postprocessing_buffer): Do code-fill
11459 generation as appropriate.
11460 (Output_section::get_input_sections): Invalidate relaxed input section
11461 map.
11462 (Output_section::restore_states): Adjust type of checkpoint .
11463 Invalidate relaxed input section map.
11464 * output.h (Output_merge_base): New class declaration.
11465 (Input_section_specifier): New class defintion.
11466 (class Output_relaxed_input_section) Change base class to
11467 Output_section_data_build.
11468 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11469 base class initializer.
11470 (Output_section::add_relaxed_input_section): New method declaration.
11471 (Output_section::Input_section): Change visibility to protected.
2e702c99 11472 (Output_section::Input_section::relobj,
c0a62865
DK
11473 Output_section::Input_section::shndx): Handle relaxed input sections.
11474 Output_section::input_sections) Change visibility to protected. Also
11475 define overload to return a non-const pointer.
11476 (Output_section::Merge_section_properties): New class defintion.
11477 (Output_section::Merge_section_by_properties_map,
11478 Output_section::Output_section_data_by_input_section_map,
11479 Output_section::Relaxation_map): New types.
11480 (Output_section::relax_input_section): Rename method to
11481 Output_section::convert_input_sections_to_relaxed_sections and change
11482 interface to take a vector of relaxed section pointers.
11483 (Output_section::find_merge_section,
11484 Output_section::find_relaxed_input_section,
11485 Output_section::build_relaxation_map,
11486 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11487 New method declarations.
11488 (Output_section::merge_section_map_
11489 Output_section::merge_section_by_properties_map_,
11490 Output_section::relaxed_input_section_map_,
11491 Output_section::is_relaxed_input_section_map_valid_,
11492 Output_section::generate_code_fills_at_write_): New data members.
11493 * script-sections.cc
11494 (Output_section_element_input::set_section_addresses): Call
11495 current_data_size and addralign methods of relaxed input sections.
11496 (Orphan_output_section::set_section_addresses): Call current_data_size
11497 and addralign methods of relaxed input sections.
11498 * symtab.cc (Symbol_table::compute_final_value): Extract template
11499 from the body of Symbol_table::sized_finalize_symbol.
11500 (Symbol_table::sized_finalized_symbol): Call
11501 Symbol_table::compute_final_value.
11502 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11503 (Symbol_table::compute_final_value): New templated method declaration.
11504 * target.cc (Target::do_make_output_section): New method defintion.
11505 * target.h (Target::make_output_section): New method declaration.
11506 (Target::relax): Add more parameters for input objects, symbol table
11507 and layout. Adjust call to do_relax.
11508 (Target::do_make_output_section): New method declaration.
11509 (Target::do_relax): Add parameters for input objects, symbol table
11510 and layout.
11511
d446d6c4
ILT
115122009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11513
11514 * pread.c: Include stdio.h.
11515
bc06c745
ILT
115162009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11517
11518 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11519 defined.
11520
75aea3d0
ILT
115212009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11522
11523 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11524 Change read_shndx type to unsigned int.
11525 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11526 int.
11527 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11528 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11529 Change read_shndx type to unsigned int.
11530 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11531 int.
11532 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11533 * layout.cc (Layout::create_symtab_sections): Cast the result of
11534 local_symcount * symsize to off_t in the gold_assert.
11535
be8fcb75
ILT
115362009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11537
11538 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11539 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11540 R_ARM_BASE_ABS.
11541 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11542 (Arm_relocate_functions::thm_abs5): New function.
11543 (Arm_relocate_functions::abs12): New function.
11544 (Arm_relocate_functions::abs16): New function.
11545 (Arm_relocate_functions::base_abs): New function.
11546 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11547 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11548 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11549 R_ARM_BASE_ABS.
11550 (Scan::global): Likewise.
11551 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11552 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11553 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11554 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11555 R_ARM_BASE_ABS.
11556
c2a122b6
ILT
115572009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11558
11559 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11560 (Arm_relocate_functions::movt_prel): New function.
11561 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11562 (Arm_relocate_functions::thm_movt_prel): New function.
11563 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11564 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11565 (Scan::global, Relocate::relocate): Likewise.
11566 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11567
c4aa1e2d
ILT
115682009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11569
11570 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11571 Incremental_checker.
11572 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11573 unsigned int.
11574 (class Incremental_inputs_header): New class.
11575 (Incremental_inputs_header_writer): Edit comment.
11576 (Incremental_inputs_entry): New class.
11577 (Incremental_inputs_entry_writer): Edit comment.
11578 (Sized_incremental_binary::do_find_incremental_inputs_section):
11579 Add *strtab_shndx parameter, fill it.
11580 (Sized_incremental_binary::do_check_inputs): New method.
11581 (Incremental_checker::can_incrementally_link_output_file): Use
11582 Sized_incremental_binary::check_inputs.
11583 (Incremental_inputs::report_command_line): Save command line in
11584 command_line_.
11585 * incremental.h:
11586 (Incremental_binary::find_incremental_inputs_section): New
11587 method.
11588 (Incremental_binary::do_find_incremental_inputs_section): Add
11589 strtab_shndx parameter.
11590 (Incremental_binary::do_check_inputs): New pure virtual method.
11591 (Sized_incremental_binary::do_check_inputs): Declare.
11592 (Incremental_checker::Incremental_checker): Add incremental_inputs
11593 parameter, use it to initialize incremental_inputs_.
11594 (Incremental_checker::incremental_inputs_): New field.
11595 (Incremental_checker::command_line): New method.
11596 (Incremental_checker::inputs): New method.
11597 (Incremental_checker::command_line_): New field.
11598
c549a694
ILT
115992009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11600
11601 * incremental.cc: Include <cstdarg> and "target-select.h".
11602 (vexplain_no_incremental): New function.
11603 (explain_no_incremental): New function.
11604 (Incremental_binary::error): New method.
11605 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11606 method.
11607 (make_sized_incremental_binary): New function.
11608 (open_incremental_binary): New function.
11609 (can_incrementally_link_file): Add checks if output is ELF and has
11610 inputs section.
11611 * incremental.h: Include "elfcpp_file.h" and "output.h".
11612 (Incremental_binary): New class.
11613 (Sized_incremental_binary): New class.
11614 (open_incremental_binary): Declare.
11615 * object.cc (is_elf_object): Use
11616 elfcpp::Elf_recognizer::is_elf_file.
11617 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11618 * output.h (Output_file::filesize): New method.
11619
fd3c5f0b
ILT
116202009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11621
11622 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11623 New function.
11624 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11625 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11626 function.
11627 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11628 function.
11629 (Arm_relocate_functions::movw_abs_nc): New function.
11630 (Arm_relocate_functions::movt_abs): New function.
11631 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11632 (Arm_relocate_functions::thm_movt_abs): New function.
11633 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11634 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11635 (Scan::global): Likewise.
11636 (Relocate::relocate): Likewise.
11637 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11638
7f5309a5
ILT
116392009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11640
11641 * arm.cc (Arm_relocate_functions::got_prel) New function.
11642 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11643 (Relocate::relocate): Likewise.
11644 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11645
364c7fa5
ILT
116462009-10-06 Ian Lance Taylor <iant@google.com>
11647
11648 * options.h (class General_options): Define
11649 split_stack_adjust_size parameter.
11650 * object.h (class Object): Add uses_split_stack_ and
11651 has_no_split_stack_ fields. Add uses_split_stack and
11652 has_no_split_stack accessor functions. Declare
11653 handle_split_stack_section.
11654 (class Reloc_symbol_changes): Define.
11655 (class Sized_relobj): Define Function_offsets. Declare
11656 split_stack_adjust, split_stack_adjust_reltype, and
11657 find_functions.
11658 * object.cc (Object::handle_split_stack_section): New function.
11659 (Sized_relobj::do_layout): Call handle_split_stack_section.
11660 * dynobj.cc (Sized_dynobj::do_layout): Call
11661 handle_split_stack_section.
11662 * reloc.cc (Sized_relobj::relocate_sections): Call
11663 split_stack_adjust for executable sections in split_stack
11664 objects. Pass reloc_map to relocate_section.
11665 (Sized_relobj::split_stack_adjust): New function.
11666 (Sized_relobj::split_stack_adjust_reltype): New function.
11667 (Sized_relobj::find_functions): New function.
11668 * target-reloc.h: Include "object.h".
11669 (relocate_section): Add reloc_symbol_changes parameter. Change
11670 all callers.
11671 * target.h (class Target): Add calls_non_split method. Declare
11672 do_calls_non_split virtual method. Declare match_view and
11673 set_view_to_nop.
11674 * target.cc: Include "elfcpp.h".
11675 (Target::do_calls_non_split): New function.
11676 (Target::match_view): New function.
11677 (Target::set_view_to_nop): New function.
11678 * gold.cc (queue_middle_tasks): Give an error if mixing
11679 split-stack and non-split-stack objects with -r.
11680 * i386.cc (Target_i386::relocate_section): Add
11681 reloc_symbol_changes parameter.
11682 (Target_i386::do_calls_non_split): New function.
11683 * x86_64.cc (Target_x86_64::relocate_section): Add
11684 reloc_symbol_changes parameter.
11685 (Target_x86_64::do_calls_non_split): New function.
11686 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11687 parameter.
11688 * powerpc.cc (Target_powerpc::relocate_section): Add
11689 reloc_symbol_changes parameter.
11690 * sparc.cc (Target_sparc::relocate_section): Add
11691 reloc_symbol_changes parameter.
11692 * configure.ac: Call AM_CONDITIONAL for the default target.
11693 * configure: Rebuild.
11694 * testsuite/Makefile.am (TEST_AS): New variable.
11695 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11696 (check_DATA): Add split_i386 and split_x86_64 files.
11697 (SPLIT_DEFSYMS): Define.
11698 (split_i386_[1234n].o): New targets.
11699 (split_i386_[124]): New targets.
11700 (split_i386_[1234r].stdout): New targets.
11701 (split_x86_64_[1234n].o): New targets.
11702 (split_x86_64_[124]): New targets.
11703 (split_x86_64_[1234r].stdout): New targets.
11704 (MOSTLYCLEANFILES): Add new executables.
11705 * testsuite/split_i386.sh: New file.
11706 * testsuite/split_x86_64.sh: New file.
11707 * testsuite/split_i386_1.s: New file.
11708 * testsuite/split_i386_2.s: New file.
11709 * testsuite/split_i386_3.s: New file.
11710 * testsuite/split_i386_4.s: New file.
11711 * testsuite/split_i386_n.s: New file.
11712 * testsuite/split_x86_64_1.s: New file.
11713 * testsuite/split_x86_64_2.s: New file.
11714 * testsuite/split_x86_64_3.s: New file.
11715 * testsuite/split_x86_64_4.s: New file.
11716 * testsuite/split_x86_64_n.s: New file.
11717 * testsuite/testfile.cc (Target_test): Update relocation_section
11718 function.
11719 * testsuite/Makefile.in: Rebuild.
11720
e8a9fcda
ILT
117212009-10-06 Ian Lance Taylor <iant@google.com>
11722
11723 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11724 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11725 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11726 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11727 the address on ldo_addrs_.
11728 (Target_i386::Relocate::fix_up_ldo): New function.
11729
e99daf92
ILT
117302009-10-06 Rafael Espindola <espindola@google.com>
11731
11732 * plugin.cc (add_input_library): New.
11733 (Plugin::load): Add add_input_library to tv.
11734 (Plugin_manager::add_input_file): Add the is_lib argument.
11735 (add_input_file): Update call to Plugin_manager::add_input_file.
11736 (add_input_library): New.
11737 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11738
966d4097
DK
117392009-09-30 Doug Kwan <dougkwan@google.com>
11740
11741 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11742 symbol and call Symbol::may_need_copy_reloc to determine if
11743 a copy reloc is needed.
11744 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11745 nocopyreloc is given in command line.
11746 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11747 given in command line.
11748 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11749 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11750 of the removed Target_i386::may_need_copy_reloc.
11751 * options.h (copyreloc): New option with default value false.
11752 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11753 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11754 instead of the removed Target_powerpc::may_need_copy_reloc.
11755 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11756 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11757 instead of the removed Target_sparc::may_need_copy_reloc.
11758 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11759 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11760 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11761 instead of the removed Target_x86_64::may_need_copy_reloc.
11762
029ba973
ILT
117632009-09-30 Ian Lance Taylor <iant@google.com>
11764
11765 * object.h (class Object): Remove target_ field, and target,
11766 sized_target, and set_target methods.
11767 (Object::sized_target): Remove.
11768 (class Sized_relobj): Update declarations. Remove sized_target.
11769 * object.cc (Sized_relobj::setup): Remove target parameter.
11770 Change all callers.
11771 (Input_objects::add_object): Don't do anything with the target.
11772 (make_elf_sized_object): Add punconfigured parameter. Change all
11773 callers. Set or test parameter target.
11774 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
11775 Change all callers.
11776 * parameters.cc (Parameters::set_target): Change parameter type to
11777 be non-const.
11778 (Parameters::default_target): Remove.
11779 (set_parameters_target): Change parameter type to be non-const.
11780 (parameters_force_valid_target): New function.
11781 (parameters_clear_target): New function.
11782 * parameters.h (class Parameters): Update declarations. Remove
11783 default_target method. Add sized_target and clear_target
11784 methods. Change target_ to be non-const.
11785 (set_parameters_target): Update declaration.
11786 (parameters_force_valid_target): Declare.
11787 (parameters_clear_target): Declare.
11788 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
11789 as NULL if we aren't searching.
11790 (Add_symbols::run): Don't check for compatible target.
11791 * fileread.cc (Input_file::open_binary): Call
11792 parameters_force_valid_target.
11793 * gold.cc (queue_middle_tasks): Likewise.
11794 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
11795 set_target on object.
11796 * dynobj.h (class Sized_dynobj): Update declarations.
11797 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
11798 make_elf_object returns NULL.
11799 (Archive::include_member): Don't check whether object target is
11800 compatible.
11801 * output.cc (Output_section::add_input_section): Get target from
11802 parameters.
11803 (Output_section::relax_input_section): Likewise.
11804 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
11805 parameters.
11806 (Sized_relobj::do_scan_relocs): Likewise.
11807 (Sized_relobj::relocate_sections): Likewise.
11808 * resolve.cc (Symbol_table::resolve): Likewise.
11809 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
11810 parameter. Change all callers.
11811 (Symbol_table::add_from_object): Get target from parameters.
11812 (Symbol_table::add_from_relobj): Don't check object target.
11813 (Symbol_table::add_from_dynobj): Likewise.
11814 (Symbol_table::define_special_symbol): Get target from
11815 parameters.
11816 * symtab.h (class Symbol_table): Update declaration.
11817 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
11818 parameter. Change all callers. Clear parameter target.
11819 (Binary_test): Test target here.
11820 * testsuite/object_unittest.cc (gold_testsuite): Remove
11821 target_test_pointer parameter. Change all callers.
11822 (Object_test): Test target here.
11823
a6a22b83
ILT
118242009-09-26 Ian Lance Taylor <iant@google.com>
11825
11826 * testsuite/initpri1.c: Don't try to use constructor priorities if
11827 compiling with gcc before 4.3.
11828
6a8f49fe
ILT
118292009-09-22 Mikolaj Zalewski <mikolajz@google.com>
11830
11831 * testsuite/retain_symbols_file_test.sh (check_present): Change
11832 output file name to retain_symbols_file_test.stdout.
11833 (check_absent): Likewise.
11834
8c604651
CS
118352009-09-18 Craig Silverstein <csilvers@google.com>
11836
11837 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
11838 * options.cc: Include <cerrno> and <fstream>.
11839 (General_options::finalize): Parse -retain-symbols-file tag.
11840 * options.h: New flag.
11841 (General_options): New method should_retain_symbol, new
11842 variable symbols_to_retain.
11843 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
11844 should_retain_symbol map.
11845 * testsuite/Makefile.am (retain_symbols_file_test): New test.
11846 * testsuite/Makefile.in: Regenerate.
11847 * testsuite/retain_symbols_file_test.sh: New file.
11848
ca58b19f
NC
118492009-09-18 Nick Clifton <nickc@redhat.com>
11850
11851 * po/es.po: Updated Spanish translation.
11852
20e6d0d6
DK
118532009-09-17 Doug Kwan <dougkwan@google.com>
11854
11855 * debug.h (DEBUG_RELAXATION): New constant.
11856 (DEBUG_ALL): Add DEBUG_RELAXATION.
11857 (debug_string_to_enum): Add relaxation debug option.
11858 * layout.cc
11859 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
11860 Layout::Relaxation_debug_check::read_sections,
11861 Layout::Relaxation_debug_check::read_sections): New method definitions.
11862 (Layout::Layout): Initialize data members
11863 record_output_section_data_from_scrips_,
11864 script_output_section_data_list_ and relaxation_debug_check_.
11865 (Layout::save_segments, Layout::restore_segments,
11866 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11867 Layout::relaxation_loop_body): New method definitions.
11868 (Layout::finalize): Support relaxation. Move section layout code to
11869 Layout::relaxation_loop_body.
11870 (Layout::set_asection_address_from_script): Move code for orphan
11871 section placement out.
11872 (Layout::place_orphan_sections_in_script): New method definition.
11873 * layout.h (Output_segment_headers, Output_file_header):
11874 New forward class declarations.
11875 (Layout::~Layout): Define.
11876 (Layout::new_output_section_data_from_script): New method definition.
11877 (Layout::place_orphan_sections_in_script): New method declaration.
11878 (Layout::Segment_states): New type declaration.
11879 (Layout::save_segments, Layout::restore_segments,
11880 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11881 Layout::relaxation_loop_body): New method declarations.
11882 (Layout::Output_section_data_list): New type declaration.
11883 (Layout::Relaxation_debug_check): New class definition.
11884 (Layout::record_output_section_data_from_script_,
11885 Layout::script_output_section_data_list_, Layout::segment_states_,
11886 Layout::relaxation_debug_check_): New data members.
11887 * output.cc: (Output_section_headers::do_size): New method definition.
11888 (Output_section_headers::Output_section_headers): Move size
11889 computation to Output_section_headers::do_size.
11890 (Output_segment_headers::do_size): New method definition.
e1df38aa 11891 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
11892 Output_file_header::do_size and call it.
11893 (Output_file_header::do_size): New method definition.
11894 (Output_data_group::Output_data_group): Adjust call to
11895 Output_section_data.
11896 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
11897 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 11898 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
11899 RELAXED_INPUT_SECTION_CODE.
11900 (Output_section::Output_section): Initialize data member checkpoint_.
11901 (Output_section::~Output_section): Delete checkpoint object pointed
11902 by checkpoint_.
11903 (Output_section::add_input_section): Always add an Input_section if
11904 relaxing.
11905 (Output_section::add_merge_input_section): Add assert.
11906 (Output_section::relax_input_section): New method definition.
11907 (Output_section::set_final_data_size): Set load address to zero for
11908 an unallocated section.
11909 (Output_section::do_address_and_file_offset_have_reset_values):
11910 New method definition.
11911 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
11912 Handle relaxed input section.
11913 (Output_section::sort_attached_input_sections): Checkpoint input
11914 section list lazily.
11915 (Output_section::get_input_sections): Change type of input_sections to
11916 list of Simple_input_section pointers. Checkpoint input section list
11917 lazily. Also handle relaxed input sections.
11918 (Output_section::add_input_section_for_script): Take a reference to
11919 a Simple_input_section object instead of Relobj pointer and section
11920 index as parameter. Handle relaxed input sections.
11921 (Output_section::save_states, Output_section::restore_states): New
11922 method definitions.
11923 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
11924 (Output_data::is_data_size_fixed): New method definition.
11925 (Output_data::reset_addresss_and_file_offset): Do not reset data size
11926 if it is fixed.
11927 (Output_data::address_and_file_offset_have_reset_values): New method
11928 definition.
11929 (Output_data::do_address_and_file_offset_have_reset_values): New method
11930 definition.
11931 (Output_data::set_data_size): Check that data size is not fixed.
11932 (Output_data::fix_data_size): New method definition.
11933 (Output_data::is_data_size_fixed_): New data member.
11934 (Output_section_headers::set_final_data_size): New method definition.
11935 (Output_section_headers::do_size): New method declaration.
11936 (Output_segment_headers::set_final_data_size): New method definition.
11937 (Output_segment_headers::do_size): New method declaration.
11938 (Output_file_header::set_final_data_size)::New method definition.
11939 (Output_file_header::do_size)::New method declaration.
11940 (Output_section_data::Output_section_data): Add new parameter
11941 is_data_size_fixed and use it to fix data size.
11942 (Output_data_const::Output_data_const): Adjust call to base class
11943 constructor and fix data size.
11944 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
11945 base class constructor and fix data size.
11946 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
11947 base class constructor and fix data size.
11948 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
11949 class constructor and fix data size.
11950 (Output_data_group::set_final_data_size): New method definition.
11951 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
11952 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
11953 class constructor and fix data size.
11954 (Output_relaxed_input_section): New class definition.
11955 (Output_section::Simple_input_section): New class definition.
11956 (Output_section::get_input_sections): Adjust parameter list.
11957 (Output_section::add_input_section_for_script): Same.
11958 (Output_section::save_states, Output_section::restore_states,
11959 Output_section::do_address_and_file_offset_have_reset_values,
11960 (Output_section::Input_section::Input_section): Handle
11961 RELAXED_INPUT_SECTION_CODE. Add new overload for
11962 Output_relaxed_input_section.
11963 (Output_section::Input_section::is_input_section,
11964 Output_section::Input_section::set_output_section): Handle relaxed
11965 input section.
11966 (Output_section::Input_section::is_relaxed_input_section,
11967 Output_section::Input_section::output_section_data,
11968 Output_section::Input_section::relaxed_input_section): New method
11969 definitions.
11970 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
11971 value.
11972 (Output_section::Input_section::u1_): Update comments.
11973 (Output_section::Input_section::u2_): Add new union member poris.
11974 (Output_section::Checkpoint_output_section): New classs definition.
11975 (Output_section::relax_input_section): New method declaration.
11976 (Output_section::checkpoint_): New data member.
11977 (Output_segment): Update comments.
11978 (Output_segment::Output_segment): Un-privatize copy constructor.
11979 (Output_segment::operator=): Un-privatize.
11980 * script-sections.cc (Output_section_element::Input_section_list):
11981 Change element type to Output_section::Simple_input_section.
11982 (Output_section_element_dot_assignment::set_section_addresses):
11983 Register output section data for relaxation clean up.
11984 (Output_data_exression::Output_data_expression): Adjust call to base
11985 constructor to fix data size.
11986 (Output_section_element_data::set_section_addresses): Register
11987 Output_data_expression object for relaxation clean up.
11988 (struct Input_section_info): Replace Relobj pointer and section index
11989 pair with Output_section::Simple_input_section and Convert struct to a
11990 class.
11991 (Input_section_sorter::operator()): Adjust access to
e1df38aa 11992 Input_section_info data member to use accessors.
20e6d0d6
DK
11993 (Output_section_element_input::set_section_addresses): Use layout
11994 parameter. Adjust code to use Output_section::Simple_input_section
11995 and Input_secction_info classes. Register filler for relaxation
11996 clean up.
11997 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11998 and section index pair with Output_section::Simple_input_section
11999 class. Adjust code accordingly.
12000 (Phdrs_element::release_segment): New method definition.
12001 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12002 segment list.
12003 (Script_sections::release_segments): New method definition.
12004 * gold/script-sections.h (Script_sections::release_segments): New
12005 method declaration.
12006 * gold/target.h (Target::may_relax, Target::relax,
12007 Target::do_may_relax, Target::do_relax): New method definitions.
12008
5e445df6
ILT
120092009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12010
12011 * arm.cc (has_signed_unsigned_overflow): New function.
12012 (Arm_relocate_functions::abs8): New function.
12013 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12014 (Target_arm::Scan::global): Likewise.
12015 (Target_arm::relocate::relocate): Likewise.
12016 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12017 Likewise.
12018
8c604651 120192009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12020
12021 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12022 * testsuite/Makefile.in: Regenerate.
12023
1e9cc1c2
NC
120242009-09-11 Nick Clifton <nickc@redhat.com>
12025
12026 * po/gold.pot: Updated by the Translation project.
12027
6a89f575
CC
120282009-09-08 Cary Coutant <ccoutant@google.com>
12029
12030 * output.cc (Output_file::open): Add execute permission to empty file.
12031 * testsuite/Makefile.am (permission_test): New test.
12032 * testsuite/Makefile.in: Regenerate.
12033
fdcac5af
ILT
120342009-09-02 Ian Lance Taylor <iant@google.com>
12035
12036 * output.cc (Output_file::resize): Call map_no_anonymous rather
12037 than map.
12038
44453f85
ILT
120392009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12040
12041 * gold.cc: Include "incremental.h".
12042 (queue_initial_tasks): Call Incremental_checker methods.
12043 * incremental.cc: Include "output.h".
12044 (Incremental_checker::can_incrementally_link_output_file): New
12045 method.
12046 * incremental.h (Incremental_checker): New class.
12047
12048 * output.cc (Output_file::open_for_modification): New method.
12049 (Output_file::map_anonymous): Changed return type to bool. Record
12050 map in base_ field.
12051 (Output_file::map_no_anonymous): New method, broken out of map.
12052 (Output_file::map): Use map_no_anonymous and map_anonymous.
12053 * output.h (class Output_file): Update declarations.
12054
293c1386
CC
120552009-08-24 Cary Coutant <ccoutant@google.com>
12056
12057 * options.h (Command_line::Pre_options): New class.
12058 (Command_line::pre_options): New member.
12059 * options.cc (gold::options::ready_to_register): New variable.
12060 (One_option::register_option): Do nothing if not registering options.
12061 Assert if same short option registered twice.
12062 (General_options::General_options): Turn off option registration when
12063 done constructing.
12064 (Command_line::Pre_options::Pre_options): New constructor.
12065
f773f3d2
CC
120662009-08-24 Cary Coutant <ccoutant@google.com>
12067
06a73cfe
CC
12068 * options.h (General_options::no_keep_memory): Remove incorrect
12069 short option.
f773f3d2 12070
a15af8e2
RW
120712009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12072
12073 * Makefile.am (am__skiplex, am__skipyacc): New.
12074 * Makefile.in: Regenerate.
12075
c462b41b
RW
120762009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12077
14ec8efd
RW
12078 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12079 (INCLUDES): ... this.
12080 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12081 (AM_CPPFLAGS): Renamed from ...
12082 (INCLUDE): ... this.
12083 * Makefile.in, testsuite/Makefile.in: Regenerate.
12084
81ecdfbb
RW
12085 * Makefile.in: Regenerate.
12086 * aclocal.m4: Likewise.
12087 * config.in: Likewise.
12088 * configure: Likewise.
12089 * testsuite/Makefile.in: Likewise.
12090
c462b41b
RW
12091 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12092 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12093 * Makefile.in: Regenerate.
12094 * testsuite/Makefile.in: Regenerate.
12095
2da73f13
CC
120962009-08-19 Cary Coutant <ccoutant@google.com>
12097
12098 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12099 symbols in shared libraries overridden by hidden or internal symbols
12100 in the main program.
12101
2db70501
CD
121022009-08-19 Chris Demetriou <cgd@google.com>
12103
12104 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12105 checking source file names in error messages.
12106
f733487b
DK
121072009-08-18 Doug Kwan <dougkwan@google.com>
12108
12109 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12110 an elcpp::Ehdr as parameter. Adjust call to set_target.
12111 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12112 an elfcpp::Ehdr as parameter.
12113 * object.cc (Object::set_target): Remove the version that looks up
12114 a target and sets it.
12115 (Sized_relobj::setup): Take a Target object instead of
12116 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12117 (make_elf_sized_object): Find target and ask target to
12118 make an ELF object.
12119 * object.h: (Object::set_target): Remove the version that looks up
12120 a target and sets it.
12121 (Sized_relobj::setup): Take a Target object instead of
12122 an elfcpp:Ehdr as parameter.
12123 * target.cc: Include dynobj.h.
12124 (Target::do_make_elf_object_implementation): New.
2e702c99 12125 (Target::do_make_elf_object): New.
f733487b
DK
12126 * target.h (Target::make_elf_object): New template declaration.
12127 (Target::do_make_elf_object): New method declarations.
12128 (Target::do_make_elf_object_implementation): New template declaration.
12129
cc70f101
ILT
121302009-08-14 Ian Lance Taylor <iant@google.com>
12131
12132 * gold.h (FUNCTION_NAME): Define.
12133 (gold_unreachable): Use FUNCTION_NAME.
12134
ef5e0cb1
ST
121352009-08-12 Sriraman Tallam <tmsriram@google.com>
12136
12137 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12138 symbol in the --keep-unique list is not found.
12139
48c187ce
ST
121402009-08-12 Sriraman Tallam <tmsriram@google.com>
12141
12142 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12143 been maked as --keep-unique.
12144 (Icf::unfold_section): New function.
12145 * icf.h (Icf::unfold_section): New function.
12146 * options.h (General_options::keep_unique): New option.
12147 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12148 * testsuite/Makefile.in: Regenerate.
12149 * testsuite/icf_keep_unique_test.sh: New file.
12150 * testsuite/icf_keep_unique_test.cc: New file.
12151
645afe0c
CC
121522009-08-12 Cary Coutant <ccoutant@google.com>
12153
12154 PR 10471
12155 * resolve.cc (Symbol_table::resolve): Check for references from
12156 dynamic objects to hidden and internal symbols.
12157 * testsuite/Makefile.am (hidden_test.sh): New test.
12158 * testsuite/Makefile.in: Regenerate.
12159 * testsuite/hidden_test.sh: New script.
12160 * testsuite/hidden_test_1.c: New test source.
12161 * testsuite/hidden_test_main.c: New test source.
12162
11af873f
DK
121632009-08-11 Doug Kwan <dougkwan@google.com>
12164
12165 * arm.cc: Update comments.
12166 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12167 segment to locate the .ARM.exidx section if present.
12168
b9f7d72d
DK
121692009-08-09 Doug Kwan <dougkwan@google.com>
12170
12171 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12172 patch.
12173
ddd3c53c
ST
121742009-08-07 Sriraman Tallam <tmsriram@google.com>
12175 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12176 compiler warnings.
12177
27721062
ST
121782009-08-06 Sriraman Tallam <tmsriram@google.com>
12179
12180 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12181 valid tls_segment only for non-debug-section relocations.
12182 * testsuite/Makefile.am: Add gc_tls_test.
12183 * testsuite/Makefile.in: Regenerate.
12184 * testsuite/gc_tls_test.cc: New file.
12185 * testsuite/gc_tls_test.sh: New file.
12186
ef15dade 121872009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12188
ef15dade
ST
12189 * icf.cc: New file.
12190 * icf.h: New file.
12191 * Makefile.am (CCFILES): Add icf.cc.
12192 (HFILES): Add icf.h
12193 * Makefile.in: Regenerate.
12194 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12195 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12196 section, symbol and addend information for the relocs.
12197 * gold.cc (queue_middle_tasks): Call identical code folding.
12198 * gold.h: Add defines for multimap.
12199 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12200 to the call of finalize_local_symbols.
12201 * main.cc (main): Create object of class Icf.
12202 * object.cc (Sized_relobj::do_layout): Allow this function to be
12203 called twice during icf.
12204 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12205 to sections marked as identical by icf.
12206 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12207 when available.
12208 (Sized_relobj::do_section_entsize): New function.
12209 * object.h (Object::section_entsize): New function.
12210 (Object::do_section_entsize): New pure virtual function.
12211 (Relobj::finalize_local_symbols): Add new parameter.
12212 (Relobj::do_section_entsize): New function.
12213 * options.h (General_options::icf): New option.
12214 (General_options::icf_iterations): New option.
12215 (General_options::print_icf_sections): New option.
12216 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12217 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12218 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12219 icf.
12220 * symtab.cc (Symbol_table::is_section_folded): New function.
12221 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12222 to sections marked as identical by icf.
12223 * symtab.h (Symbol_table::set_icf): New function.
12224 (Symbol_table::icf): New function.
12225 (Symbol_table::is_section_folded): New function.
12226 (Symbol_table::icf_): New data member.
12227 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12228 * testsuite/Makefile.am: Add commands to build icf_test.
12229 * testsuite/Makefile.in: Regenerate.
12230 * testsuite/icf_test.sh: New file.
12231 * testsuite/icf_test.cc: New file.
12232
c3b65ac4
CD
122332009-07-24 Chris Demetriou <cgd@google.com>
12234
12235 * layout.cc (is_compressible_debug_section): Fix incorrect
12236 comment about compressed section names.
12237
1caf2c51
ILT
122382009-07-20 Ian Lance Taylor <ian@airs.com>
12239
12240 PR 10419
12241 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12242
1ef4d87f
ILT
122432009-07-16 Ian Lance Taylor <iant@google.com>
12244
12245 PR 10400
12246 * layout.h: #include <map>.
12247 (class Kept_section): Change from struct to class. Add accessors
12248 and setters. Add section size to Comdat_group mapping. Change
12249 Comdat_group to std::map. Add is_comdat_ field. Add
12250 linkonce_size field in union.
12251 (class Layout): Update declaration of find_or_add_kept_section.
12252 Don't declare find_kept_object.
12253 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12254 parameter. Add object, shndx, is_comdat, and is_group_name
12255 parameters. Change all callers. Adjust for new Kept_section.
12256 (Layout::find_kept_object): Remove.
12257 * object.cc (Sized_relobj::include_section_group): Update use of
12258 Kept_section. Rename secnum to shndx. Only record
12259 Kept_comdat_section if sections are the same size.
12260 (Sized_relobj::include_linkonce_section): Update use of
12261 Kept_section. Only record Kept_comdat_section if sections are the
12262 same size. Set size of linkonce section.
12263 (Sized_relobj::map_to_kept_section): Update call to
12264 get_kept_comdat_section.
12265 * object.h (class Sized_relobj): Rename fields in
12266 Kept_comdat_section to drop trailing underscores; change object
12267 field to Relobj*. Change Kept_comdat_section_table to store
12268 struct rather than pointer.
12269 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12270 Add kept_object and kept_shndx parameters. Change all callers.
12271 (Sized_relobj::get_kept_comdat_section): Change return type to
12272 bool. Add kept_object and kept_shndx parameters. Change all
12273 callers.
12274 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12275 Layout::find_or_add_kept_section.
12276
37c3b7b0
ILT
122772009-07-09 Ian Lance Taylor <iant@google.com>
12278
12279 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12280 Reserve space in the hash table.
12281
98fa85cb
ILT
122822009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12283
12284 * fileread.cc (File_read::get_mtime): New method.
12285 * fileread.h (Timespec): New structure.
12286 (File_read::get_mtime): New method.
12287 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12288 Renamed from timestamp_nsec.
12289 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12290 Elf_Xword.
e1df38aa 12291 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12292 timestamp_nsec.
e1df38aa 12293 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12294 (Incremental_inputs::report_obejct): Save mtime; style fix.
12295 (Incremental_inputs::report_script): Save mtime; style fix.
12296 (Incremental_inputs::finalize_inputs): Style fix.
12297 (Incremental_inputs::finalize): Style fix.
12298 (Incremental_inputs::create_input_section_data): Store inputs
12299 mtime.
12300 * incremental.h (Incremental_inputs::report_script): Add mtime
12301 argument.
12302 (Incremental_inputs::Input_info::Input_info): Intialize only one
12303 union member.
12304 (Incremental_inputs::Input_info::archive): Move to nameless
12305 union.
12306 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12307 (Incremental_inputs::Input_info::script): Move to nameless union.
12308 (Incremental_inputs::mtime): New field.
12309 * script.cc (read_input_script): Pass file mtime to
12310 Incremental_input.
12311 * script.h (Script_info::inputs): Style fix.
12312
c9d70757
ILT
123132009-07-01 Ian Lance Taylor <ian@airs.com>
12314
12315 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12316 instead of 32.
12317
9c547ec3
ILT
123182009-06-24 Ian Lance Taylor <iant@google.com>
12319
12320 PR 10156
12321 * layout.cc (Layout::choose_output_section): If we find an
12322 existing section, update the flags.
12323 (Layout::create_notes): New function, broken out of
12324 Layout::finalize.
12325 (Layout::finalize): Don't create note sections.
12326 (Layout::create_note): Don't crash if linker script discards
12327 section.
12328 (Layout::create_gold_note): Likewise.
12329 (Layout::create_build_id): Likewise. Don't set
12330 after_input_sections on the section.
12331 (Layout::create_executable_stack_info): Remove target parameter.
12332 Change caller.
12333 * layout.h (class Layout): Declare create_notes. Update
12334 declaration of create_executable_stack_info.
12335 * gold.cc (queue_middle_tasks): Call create_notes.
12336 * output.cc (Output_section::update_flags_for_input_section): Move
12337 here from output.h. If SHF_ALLOC flag is newly set, mark address
12338 invalid.
12339 * output.h (Output_data::mark_address_invalid): New function.
12340 (class Output_section): Only declare, not define,
12341 update_flags_for_input_section. Remove set_flags.
12342
55458500
ILT
123432009-06-24 Ian Lance Taylor <iant@google.com>
12344
12345 * script-sections.cc (Output_section_definition::
12346 set_section_addresses): Rename shadowing local load_address to
12347 laddr.
12348
1307d6cd
ILT
123492009-06-24 Ian Lance Taylor <iant@google.com>
12350
12351 PR 10244
12352 * reloc.cc (relocate_sections): Skip empty relocation sections.
12353
ec3f783e
ILT
123542009-06-23 Ian Lance Taylor <iant@google.com>
12355
12356 PR 10156
12357 * layout.cc (Layout::create_note): Use choose_output_section
12358 rather than make_output_section.
12359
459c9f1c
ILT
123602009-06-23 Ian Lance Taylor <iant@google.com>
12361
12362 PR 10237
12363 * options.cc (General_options::parse_V): Set printed_version_.
12364 (General_options::General_options): Initialize printed_version_.
12365 * options.h (class General_options): Add printed_version_ field.
12366 * gold.cc (queue_initial_tasks): If there are no input files,
12367 don't give a fatal error if we printed the version information.
12368 (queue_middle_tasks): If using -r with a shared object, give a
12369 fatal error rather than an ordinary error.
12370
1518dc8f
ILT
123712009-06-23 Ian Lance Taylor <iant@google.com>
12372
12373 PR 10219
12374 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12375 (Layout::make_output_section): Set have_stabstr_section_ if we see
12376 a .stab*str section.
12377 (Layout::finalize): Call link_stabs_sections.
12378 (Layout::link_stabs_sections): New file.
12379 * layout.h (class Layout): Add have_stabstr_section_ field.
12380 Declare link_stabs_sections.
12381
3d857b98
DK
123822009-06-23 Doug Kwan <dougkwan@google.com>
12383
12384 * Makefile.am (libgold_a_LIBADD): New.
12385 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12386 * Makefile.in: Regenerate.
3d857b98
DK
12387 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12388 * configure: Regenerate.
12389 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12390 * fileread.cc: Include sys/state.h
12391 * gold.h: Declare memmem and strndup if found missing.
12392 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12393
0639a6f6
ILT
123942009-06-23 Ian Lance Taylor <iant@google.com>
12395
12396 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12397 * configure: Rebuild.
12398
8d63875c
ILT
123992009-06-23 Ian Lance Taylor <iant@google.com>
12400
12401 PR 10147
12402 * object.cc (Object::section_contents): Don't try to get a view if
12403 the section has length zero.
12404 (Object::handle_gnu_warning_section): If the section is empty, use
12405 the name of the section as the warning.
12406
f7c8a183
ILT
124072009-06-23 Ian Lance Taylor <iant@google.com>
12408
12409 PR 10133
12410 * stringpool.h (class Stringpool_template): Add optimize_ field.
12411 (Stringpool_template::set_optimize): New function.
12412 * stringpool.cc (Stringpool_template::Stringpool_template):
12413 Initialize optimize_ field.
12414 (Stringpool_template::set_string_offsets): Test local optimize
12415 fild rather than parameter.
12416 * layout.cc (Layout::Layout): Call set_optimize on the section
12417 name stringpool.
12418
e6a307ba
ILT
124192009-06-22 Ian Lance Taylor <iant@google.com>
12420
12421 PR 10030
12422 * yyscript.y: Parse TARGET.
12423 * script.cc (script_set_target): New function.
12424 * script-c.h (script_set_target): Declare.
12425 * options.cc (General_options::string_to_object_format): Rename
12426 from string_to_object_format in anonymous namespace. Change
12427 callers.
12428 * options.h (class General_options): Declare
12429 string_to_object_format.
12430
3ee173de
ILT
124312009-06-22 Ian Lance Taylor <iant@google.com>
12432
12433 * script-sections.cc (Script_sections::create_segments): Don't put
12434 program headers in a PT_LOAD segment if -n or -N.
12435
124362009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12437
12438 PR 10141
12439 * options.h (class General_options): Add -z lazy and -z now. Sort
12440 -z options into alphabetical order.
12441 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12442
cd6739a1 124432009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12444
12445 * layout.cc (Layout::make_output_section): Call
12446 Target::new_output_section.
12447 (Layout::attach_allocated_section_to_segment): Put large section
12448 sections in a separate load segment with the large segment flag
12449 set.
12450 (Layout::segment_precedes): Sort large data segments after other
12451 load segments.
12452 (align_file_offset): New static function.
12453 (Layout::set_segment_offsets): Use align_file_offset.
12454 * output.h (class Output_section): Add is_small_section_ and
12455 is_large_section_ fields.
12456 (Output_section::is_small_section): New function.
12457 (Output_section::set_is_small_section): New function.
12458 (Output_section::is_large_section): New function.
12459 (Output_section::set_is_large_section): New function.
12460 (Output_section::is_large_data_section): New function.
12461 (class Output_segment): Add is_large_data_segment_ field.
12462 (Output_segment::is_large_data_segment): New function.
12463 (Output_segment::set_is_large_data_segment): New function.
12464 * output.cc (Output_section::Output_section): Initialize new
12465 fields.
12466 (Output_segment::Output_segment): Likewise.
12467 (Output_segment::add_output_section): Add assertion that large
12468 data sections always go in large data segments. Force small data
12469 sections to the end of the list of data sections. Force small BSS
12470 sections to the start of the list of BSS sections. For large BSS
12471 sections to the end of the list of BSS sections.
12472 * symtab.h (class Symbol): Declare is_common_shndx.
12473 (Symbol::is_defined): Check Symbol::is_common_shndx.
12474 (Symbol::is_common): Likewise.
12475 (class Symbol_table): Define enum Commons_section_type. Update
12476 declarations. Add small_commons_ and large_commons_ fields.
12477 * symtab.cc (Symbol::is_common_shndx): New function.
12478 (Symbol_table::Symbol_table): Initialize new fields.
12479 (Symbol_table::add_from_object): Put small and large common
12480 symbols in the right list.
12481 (Symbol_table::sized_finalized_symbol): Check
12482 Symbol::is_common_shndx.
12483 (Symbol_table::sized_write_globals): Likewise.
12484 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12485 common symbol lists. Don't call do_allocate_commons_list if the
12486 list is empty.
12487 (Symbol_table::do_allocate_commons_list): Remove is_tls
12488 parameter. Add comons_section_type parameter. Change all
12489 callers. Handle small and large common symbols.
12490 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12491 Symbol::is_common_shndx.
12492 * resolve.cc (symbol_to_bits): Likewise.
12493 * target.h (Target::small_common_shndx): New function.
12494 (Target::small_common_section_flags): New function.
12495 (Target::large_common_shndx): New function.
12496 (Target::large_common_section_flags): New function.
12497 (Target::new_output_section): New function.
12498 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12499 small_common_section_flags, and large_common_section_flags
12500 fields.
12501 (Target::do_new_output_section): New virtual function.
12502 * arm.cc (Target_arm::arm_info): Initialize new fields.
12503 * i386.cc (Target_i386::i386_info): Likewise.
12504 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12505 Likewise.
12506 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12507 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12508 (Target_x86_64::do_new_output_section): New function.
12509 * configure.ac: Define conditional MCMODEL_MEDIUM.
12510 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12511 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12512 (large_LDFLAGS): Define.
12513 * testsuite/large.c: New file.
12514 * testsuite/testfile.cc (Target_test::test_target_info):
12515 Initialize new fields.
12516 * configure, testsuite/Makefile.in: Rebuild.
12517
bb04269c
DK
125182009-06-05 Doug Kwan <dougkwan@google.com>
12519
12520 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 12521 * Makefile.in: Regenerate.
bb04269c
DK
12522 * i386.cc (class Target_i386): Define new virtual method to
12523 override do_is_local_label_name in parent.
12524 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12525 local symbols if --discard-locals or -X is given.
12526 * options.h (class General_options): Declare new options
12527 '--discard-locals' and '-X' for discarding locals.
12528 * target.h (class Target): Define new methods is_local_label_name.
12529 Declare new virtual method do_is_local_label_name.
12530 * target.cc: New file.
12531 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12532 (check_SCRIPTS): Add discard_locals_test.sh.
12533 (check_DATA): Add discard_local_tests.syms.
12534 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12535 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12536 * testsuite/Makefile.in: Regenerate.
12537 * testsuite/discard_locals_test.c: New file.
12538 * testsuite/discard_locals_test.sh: Same.
12539
805bb01c
DK
125402009-06-05 Doug Kwan <dougkwan@google.com>
12541
12542 * object.cc (Sized_relobj::Sized_relobj): Initialize
12543 discarded_eh_frame_shndx_ to -1U.
12544 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12545 section.
12546 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12547 a discarded .eh_frame section.
12548 (Sized_relobj::do_finalize_local_symbols): Ditto.
12549 * object.h (class Sized_relobj): Declare new member
12550 discarded_eh_frame_shndx_.
12551 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12552 (local_labels_test.o, local_labels_test): New rules.
12553 * testsuite/Makefile.in: Regenerate.
12554
1dcd334d
DK
125552009-06-04 Doug Kwan <dougkwan@google.com>
12556
12557 * layout.cc (Layout::section_name_mapping): Add mapping for
12558 special ARM sections.
12559
96d49306
DK
125602009-06-03 Doug Kwan <dougkwan@google.com>
12561
12562 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12563 (utils::has_overflow): Same.
12564
dff16297
ILT
125652009-06-03 Ian Lance Taylor <iant@google.com>
12566
12567 * layout.cc (Layout::section_name_mapping): New array, replacing
12568 Layout::linkonce_mapping.
12569 (Layout::section_name_mapping_count): New variable, replacing
12570 Layout::linkonce_mapping_count.
12571 (Layout::linkonce_output_name): Remove.
12572 (Layout::output_section_name): Rewrite.
12573 * layout.h (class Layout): Rename Linkonce_mapping to
12574 Section_name_mapping, linkonce_mapping to section_name_mapping,
12575 linkonce_mapping_count to section_name_mapping_count. Don't
12576 declare linkonce_output_name.
12577
c121c671
DK
125782009-06-03 Doug Kwan <dougkwan@google.com>
12579
12580 * gold/arm.cc (namespace utils): New.
12581 (Target_arm::reloc_is_non_pic): Define new method.
12582 (class Arm_relocate_functions): New.
12583 (Target_arm::Relocate::relocate): Handle relocation types used by
12584 Android.
12585
07800fab
ILT
125862009-06-03 Ian Lance Taylor <iant@google.com>
12587
12588 * arm.cc (Target_arm::scan::global): Use || instead of |.
12589
c121c671
DK
125902009-06-02 Doug Kwan <dougkwan@google.com>
12591
12592 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12593 issued_non_pic_error_.
12594 (class Target_arm::Scan): Declare new method check_non_pic.
12595 Define new method symbol_needs_plt_entry.
12596 Declare new data member issued_non_pic_error_.
12597 (class Target_arm::Relocate): Declare new method
12598 should_apply_static_reloc.
12599 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12600 (Target_arm::Scan::check_non_pic): Define new method.
12601 (Target_arm::Scan::local): Handle a small subset of reloc types used
12602 by Android.
12603 (Target_arm::Scan::local): Same.
12604 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12605
b19b0c6d
ILT
126062009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12607
12608 * incremental.cc (Incremental_inputs::report_command_line): Filter
12609 out --incremental-* options.
12610
94cdfcff
DK
126112009-05-29 Doug Kwan <dougkwan@google.com>
12612
12613 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12614 template class.
12615 (class Target_arm): Update comment.
12616 (Target_arm::Target_arm): Initialize new data members GOT_,
12617 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12618 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12619 and Target_arm::rel_dyn_section.
12620 Declare new_enum Target_arm::Got_type.
12621 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12622 and DYNBSS_.
12623 Update commments for member do_dynsym_value.
12624 (Target_arm::got_size, Target_arm::plt_section,
12625 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12626 new methods inside class defintion.
12627 (Target_arm::got_section): Define new method.
12628 (Target_arm::rel_dyn_section): Same.
12629 (Output_data_plt_arm): New template class.
12630 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12631 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12632 (Output_data_plt_arm::add_entry): Same.
12633 (Output_data_plt_arm::first_plt_entry): Define new
12634 static data member for PLT instruction template.
12635 (Output_data_plt_arm::plt_entry): Same.
12636 (Output_data_plt_arm::do_write): Define new method.
12637 (Target_arm::make_plt_entry): Same.
12638 (Target_arm::do_finalize_sections): Same.
12639 (Target_arm::do_dynsym_value): Same.
12640
4a657b0d
DK
126412009-05-28 Doug Kwan <dougkwan@google.com>
12642
12643 * Makefile.am (TARGETSOURCES): Add arm.cc.
12644 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12645 * Makefile.in: Regenerate.
12646 * arm.cc: New file.
12647 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12648
e7ae8c36
DK
126492009-05-26 Doug Kwan <dougkwan@google.com>
12650
12651 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12652 (General_options::check_excluded_libs): Strip off directories in
12653 archive name before matching like GNU ld does.
12654 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12655 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12656 (exclude_libs_test_LDFLAGS): Add linker option
12657 -Wl,--exclude-libs,libexclude_libs_test_3
12658 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12659 an explicit archive without using -l.
12660 (alt/libexclude_libs_test_3.a): New make rule.
12661 * testsuite/Makefile.in: Regenerate.
12662 * testsuite/exclude_libs_test.c : Declare lib3_default().
12663 (main): Call it.
12664 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12665 * exclude_libs_test_3.c: New file.
12666
f12e7348
NC
126672009-05-26 Nick Clifton <nickc@redhat.com>
12668
12669 * po/id.po: New Indonesian translation.
12670 * po/gold.pot: Updated template file.
12671
4daadc0d
ST
126722009-05-22 Sriraman Tallam <tmsriram@google.com>
12673
e1df38aa 12674 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
12675 gc_comdat_test files. Add -Wl,--gc-sections to build
12676 gc_comdat_test.
12677 * testsuite/Makefile.in: Regenerate.
12678 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12679
531813ad
ST
126802009-05-21 Sriraman Tallam <tmsriram@google.com>
12681
12682 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12683 kept comdat section was garbage collected.
12684 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12685 * testsuite/Makefile.in: Regenerate.
12686 * testsuite/gc_comdat_test.sh: New file.
12687 * testsuite/gc_comdat_test_1.cc: New file.
12688 * testsuite/gc_comdat_test_2.cc: New file.
12689
65514900
CC
126902009-05-19 Doug Kwan <dougkwan@google.com>
12691
12692 * archive.cc (Archive::Archive): Move constructor from archive.h
12693 to here. Initialize no_export_.
12694 (Archive::get_elf_object_for_member): Set no_export flag of object.
12695 * archive.h (Archive::Archive): Move constructor body to
12696 archive.cc.
12697 (Archive::no_export): New method.
12698 (Archive::no_export_): New field.
12699 * object.h (Object::Object): Initialize no_export_ to false.
12700 (Object::no_export, Object::set_no_export): New methods.
12701 (Object::no_export_): New field.
12702 * options.cc (General_options::parse_exclude_libs): New method.
12703 (General_options::check_excluded_libs) Same.
12704 * options.h (exclude_libs): New option.
12705 (General_options::check_excluded_libs): New method declaration.
12706 (General_options::excluded_libs_): New field.
12707 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12708 default or protected visibility if an object has no-export flag set.
12709 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12710 (check_SCRIPTS): Add exclude_libs_test.sh.
12711 (check_DATA): Add exclude_libs_test.syms.
12712 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12713 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12714 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12715 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12716 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12717 libexclude_libs_test_2.a): New rules.
12718 * testsuite/Makefile.in: Regenerate.
12719 * testsuite/exclude_libs_test.c: New file.
12720 * testsuite/exclude_libs_test.sh: Ditto.
12721 * testsuite/exclude_libs_test_1.c: Ditto.
12722 * testsuite/exclude_libs_test_2.c: Ditto.
12723
1b77ea50
ILT
127242009-05-15 Ian Lance Taylor <iant@google.com>
12725
12726 * configure.ac: Check for declarations for cases where libiberty.h
12727 checks HAVE_DECL_xxx.
12728 * configure, config.in: Rebuild.
12729
072fe7ce
ILT
127302009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12731
12732 * gold.h (Incremental_argument_list): Remove (invalid) forward
12733 declaration.
12734 * incremental.cc (Incremental_inputs::report_achive): New method.
12735 (Incremental_inputs::report_object): New method.
12736 (Incremental_inputs::report_script): New method.
12737 (Incremental_inputs::finalize_inputs): New method.
12738 (Incremental_inputs::finalize): Call finalize_inputs().
12739 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12740 Create inputs entries.
12741 * incremental.h (Incremental_input_type): New enum.
12742 (Incremental_inputs::Incremental_input): Initialize new fields.
12743 (Incremental_inputs::report_inputs): New method.
12744 (Incremental_inputs::report_achive): New method.
12745 (Incremental_inputs::report_object): New method.
12746 (Incremental_inputs::report_script): New method.
12747 (Incremental_inputs::finalize_inputs): New method.
12748 (Incremental_inputs::Input_info): New struct.
12749 (Incremental_inputs::Input_info_map): New typedef.
12750 (Incremental_inputs::lock_): New field.
12751 (Incremental_inputs::Inputs_): New field.
12752 (Incremental_inputs::Inputs_map): New field.
12753 * main.cc (main): Call Incremental_input::report_inputs.
12754 * options.h (Input_argument_list): Typedef moved from
12755 Input_arguments.
12756 (Input_file_group::Files): Remove, use ::Input_argument_list.
12757 (Input_file_group::Input_argument_list): Remove, use
12758 ::Input_argument_list.
12759 * plugin.cc (Plugin_manager::add_input_file): Add error in
12760 incremental build.
12761 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12762 functions.
12763 * script.cc (read_input_script): Call
12764 Incremental_input::report_script.
12765 * script.h (Script_info): New class.
12766
b0481b0b
ILT
127672009-04-27 Ian Lance Taylor <iant@google.com>
12768
12769 * x86_64.cc (do_adjust_output_section): Set entsize to
12770 plt_entry_size.
12771
b22a5a41 127722009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
12773
12774 * output.cc (Output_file::close): After short writes, continue
12775 writing from the correct offset in the buffer being written.
12776
40fde488
CD
127772009-04-23 Chris Demetriou <cgd@google.com>
12778
12779 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
12780 * configure: Regenerate.
12781 * config.in: Regenerate.
12782 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
12783 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
12784
3ce2c28e
ILT
127852009-04-21 Mikolaj Zalewski <mikolajz@google.com>
12786
12787 * incremental.cc (Incremental_inputs_header_data): Renamed from
12788 Incremental_input_header_data.
12789 (Incremental_inputs_header_data::data_size): New field.
12790 (Incremental_inputs_header_data::put_input_file_count): Renamed
12791 from input_file_count.
12792 (Incremental_inputs_header_data::put_command_line_offset): Renamed
12793 from command_line_offset.
12794 (Incremental_inputs_header_data::put_reserved): Renamed from
12795 put_reserved.
12796 (Incremental_inputs_entry_data): Renamed from
12797 Incremental_input_entry_data.
12798 (Incremental_inputs_entry_data::data_size): New field.
12799 (Incremental_inputs::report_command_line): New method.
12800 (Incremental_inputs::finalize): New method.
12801 (Incremental_inputs::create_incremental_inputs_data): New method.
12802 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
12803 * incremental.h: New file.
12804 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 12805 (Layout::finalize): Create incremental inputs section in
3ce2c28e 12806 incremental builds.
703d02da 12807 (Layout::create_incremental_info_sections): New method.
3ce2c28e 12808 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
12809 (Layout::create_incremental_info_sections): New method.
12810 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
12811 * main.cc (main): Notify Incremental_input of the command line.
12812
e55bde5e
ILT
128132009-04-01 Ian Lance Taylor <iant@google.com>
12814 Mikolaj Zalewski <mikolajz@google.com>
12815
12816 * gold.h (reserve_unordered_map): Define, three versions, one for
12817 each version of Unordered_map.
12818 * layout.cc (Layout::Layout): Remove options parameter. Add
12819 number_of_input_files parameter. Don't initialize options_.
12820 Initialize number_of_input_files_ and resized_signatures_. Move
12821 sections_are_attached_.
12822 (Layout::layout_group): Reserve space for group_signatures_.
12823 (Layout::find_or_add_kept_section): Change name parameter to be a
12824 reference. Resize signatures_ map when it gets large enough.
12825 (Layout::layout_eh_frame): Use parameters->options() instead of
12826 this->options_.
12827 (Layout::make_output_section): Likewise.
12828 (Layout::attach_allocated_section_to_segment): Likewise.
12829 (Layout::finalize, Layout::create_executable_stack): Likewise.
12830 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
12831 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
12832 * layout.h (class Layout): Update declarations. Remove options_
12833 field. Add number_of_input_files_ and resized_signatures_
12834 fields. Move sections_are_attached_ field.
12835 * main.cc (main): Pass number of input files to Layout
12836 constructor. Don't pass options.
12837
154b857c
ILT
128382009-03-30 Ian Lance Taylor <iant@google.com>
12839
12840 * ffsll.c (ffsll): Correct implementation.
12841
2f35ab9b
ILT
128422009-03-27 Ian Lance Taylor <iant@google.com>
12843
fd03461a
ILT
12844 * ffsll.c: New file.
12845 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
12846 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
12847 * ftruncate.c (ftruncate): Declare before definition.
12848 * mremap.c (mremap): Likewise.
12849 * pread.c (pread): Likewise.
12850 * configure, Makefile.in, config.in: Rebuild.
12851
2f35ab9b
ILT
12852 * mremap.c: New file.
12853 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
12854 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
12855 (mremap): Declare if HAVE_MREMAP is not defined.
12856 * configure, Makefile.in, config.in: Rebuild.
12857
33aea2fd
CC
128582009-03-27 Cary Coutant <ccoutant@google.com>
12859
12860 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
12861 position independent.
12862 * sparc.cc (Target_sparc::check_non_pic): Likewise.
12863 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
12864
6d479619
CC
128652009-03-24 Cary Coutant <ccoutant@google.com>
12866
12867 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
12868 an executable.
12869 (needs_dynamic_reloc): Likewise.
12870
afc06bb8
ILT
128712009-03-24 Ian Lance Taylor <iant@google.com>
12872
12873 * yyscript.y (file_cmd): Recognize EXTERN.
12874 (extern_name_list, extern_name_list_body): New nonterminals.
12875 * script.cc (script_add_extern): Define.
12876 * script-c.h (script_add_extern): Declare.
12877
f6060a4d
ILT
128782009-03-24 Rafael Avila de Espindola <espindola@google.com>
12879
12880 * object.cc (is_elf_object): Define.
12881 * object.h (is_elf_object): Declare.
12882 * archive.cc (Archive::get_elf_object_for_member): Call
12883 is_elf_object.
33aea2fd 12884 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 12885
26736d8e
ILT
128862009-03-24 Elliott Hughes <enh@google.com>
12887
12888 * output.cc (Output_file::map_anonymous): Define.
12889 (Output_file::map): Use map_anonymous. If the regular mmap fails,
12890 try an anonymous one. Report the size if the mmap fails.
12891 * output.h (class Output_file): Declare map_anonymous.
12892
22fd9730
ILT
128932009-03-24 Ian Lance Taylor <iant@google.com>
12894
12895 * target-select.cc (instantiate_target): Don't acquire the lock if
12896 the instantiated_target_ field has already been set.
12897
cb010894
ILT
128982009-03-23 Ian Lance Taylor <iant@google.com>
12899
7f055c20
ILT
12900 * gold-threads.h (class Initialize_lock): Define.
12901 * gold-threads.cc (class Initialize_lock_once): Define.
12902 (initialize_lock_control): New static variable.
12903 (initialize_lock_pointer): New static variable.
12904 (initialize_lock_once): New static function.
12905 (Initialize_lock::Initialize_lock): Define.
12906 (Initialize_lock::initialize): Define.
12907 * target-select.h: Include "gold-threads.h".
12908 (class Target_selector): Add lock_ and initialize_lock_ fields.
12909 Don't define instantiate_target, just declare it.
12910 * target-select.cc (Target_selector::Target_selector): Initialize
12911 new fields.
12912 (Target_selector::instantiate_target): Define.
12913 * descriptors.h: Include "gold-threads.h".
12914 (class Descriptors): Add initialize_lock_ field.
12915 * descriptors.cc (Descriptors::Descriptors): Initialize new
12916 field.
12917 (Descriptors::open): Use initialize_lock_ field
12918 * errors.h (class Errors): Add initialize_lock_ field.
12919 * errors.cc (Errors::Errors): Initialize new field.
12920 (Errors::initialize_lock): Use initialize_lock_ field.
12921 * powerpc.cc (class Target_selector_powerpc): Remove
12922 instantiated_target_ field. In do_recognize call
12923 instantiate_target rather than do_instantiate_target. In
12924 do_instantiate_target just allocate a new target.
12925 * sparc.cc (class Target_selector_sparc): Likewise.
12926
36959681
ILT
12927 * freebsd.h: New file.
12928 * i386.cc: Include "freebsd.h".
12929 (Target_i386): Derive from Target_freebsd rather than
12930 Sized_target.
12931 (Target_selector_i386): Derive from Target_selector_freebsd rather
12932 than Target_selector.
12933 * x86_64.cc: Include "freebsd.h".
12934 (Target_x86_64): Derive from Target_freebsd rather than
12935 Sized_target.
12936 (Target_selector_x86_64): Derive from Target_selector_freebsd
12937 rather than Target_selector.
12938 * target.h (class Target): Add adjust_elf_header and
12939 do_adjust_elf_header.
12940 * output.cc (Output_file_header:: do_sized_write): Call target
12941 adjust_elf_header routine.
12942 * configure.tgt: Set targ_osabi.
12943 * configure.ac: Define GOLD_DEFAULT_OSABI.
12944 * parameters.cc (Parameters::default_target): Pass
12945 GOLD_DEFAULT_OSABI to select_target.
12946 * target-select.h (class Target_selector): Make instantiate_target
12947 protected rather than private.
12948 * Makefile.am (HFILES): Add freebsd.h.
12949 * configure, Makefile.in, config.in: Rebuild.
12950
cb010894
ILT
12951 * merge.cc (do_add_input_section): Correct pend value. Change
12952 message about last entry not being null terminated from error to
12953 warning.
12954
0e879927
ILT
129552009-03-20 Mikolaj Zalewski <mikolajz@google.com>
12956
12957 * incremental.cc: New file.
12958 * Makefile.am (CCFILES): Add incremental.cc.
12959 * Makefile.in: Rebuild.
12960
41105937
PP
129612009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
12962
12963 * layout.cc (Layout::output_section_name): Preserve names
12964 of '.note.' sections.
e1df38aa 12965
60439920
ILT
129662009-03-19 Ian Lance Taylor <iant@google.com>
12967
12968 * descriptors.cc (Descriptors::open): Check that the options are
12969 valid before using them.
12970
0d371ad3
ILT
129712009-03-18 Ian Lance Taylor <iant@google.com>
12972
12973 * script-sections.h: Include <list>.
12974 (class Script_sections): Change Sections_elements from std::vector
12975 to std::list. Typedef public Elements_iterator. Add
12976 orphan_section_placement_, data_segment_align_start_, and
12977 saw_data_segment_align_ fields. Remove data_segment_align_index_
12978 field.
12979 * script-sections.cc (class Orphan_section_placement): New class.
12980 (class Sections_element): Add virtual functions is_relro and
12981 orphan_section_init. Remove virtual function place_orphan_here.
12982 (class Output_section_definition): Add is_relro and
12983 orphan_section_init. Remove place_orphan_here.
12984 (class Orphan_output_section): Likewise.
12985 (Script_sections::Script_sections): Update for field changes.
12986 (Script_sections::data_segment_align): Set saw_data_segment_align_
12987 and data_segment_align_start_, not data_segment_align_index.
12988 (Script_sections::data_segment_relro_end): Check
12989 saw_data_segment_align_. Use data_segment_align_start_ rather
12990 than data_segment_align_index_.
12991 (Script_sections::place_orphan): Rewrite to use
12992 Orphan_section_placement.
12993
9201d894
ILT
129942009-03-17 Ian Lance Taylor <iant@google.com>
12995
9c5b8369
ILT
12996 * archive.cc (Archive::add_symbols): Check for a version attached
12997 to the symbol name in the archive map.
12998 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12999 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13000 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13001 (ver_test_11.a): New target.
13002 * testsuite/Makefile.in: Rebuild.
13003
9201d894
ILT
13004 * configure.ac: Check for chsize and posix_fallocate. Replace
13005 ftruncate.
13006 * ftruncate.c: New file, from gnulib.
13007 * output.cc (posix_fallocate): Define dummy version if not
13008 HAVE_POSIX_FALLOCATE.
13009 (Output_file::map): Call posix_fallocate rather than lseek and
13010 write.
13011 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13012 * configure, Makefile.in, config.in: Rebuild.
13013
ef4ab7a8 130142009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13015
ef4ab7a8
PP
13016 * layout.h (Layout::create_note): Add section_name parameter.
13017 * layout.cc (Layout::create_note): Likewise.
13018 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13019
8c500701
ILT
130202009-03-17 Ian Lance Taylor <iant@google.com>
13021
e85b18e1
ILT
13022 * descriptors.cc: Include "options.h".
13023 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13024 (Descriptors::open): Always use O_CLOEXEC when opening a new
13025 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13026 then set FD_CLOEXEC.
13027
9efe6174
ILT
13028 * sparc.cc (class Target_sparc): Add has_got_section.
13029 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13030 make sure we have a GOT section.
13031
13032 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13033 (Target_sparc::Scan::local): Likewise.
13034 (Target_sparc::Scan::global): Likewise.
13035 (Target_sparc::Relocate::relocate): Likewise.
13036 (Target_sparc::Relocate::relocate_tls): Likewise.
13037
8c500701
ILT
13038 * symtab.cc (Symbol_table::define_default_version): New function,
13039 broken out of add_from_object.
13040 (Symbol_table::add_from_object): Call define_default_version.
13041 (Symbol_table::define_special_symbol): Add resolve_oldsym
13042 parameter. Change all callers. If the version for a symbol comes
13043 from a version script, resolve it with the symbol with the same
13044 name with no version. Also add the symbol without a version if
13045 appropriate.
13046 (do_define_in_output_data): If resolving with oldsym, don't delete
13047 sym.
13048 (do_define_in_output_segment): Likewise.
13049 (do_define_as_constant): Likewise.
13050 * symtab.h (class Symbol_table): Update declarations.
13051
f1ed28fb
ILT
130522009-03-13 Ian Lance Taylor <iant@google.com>
13053
15f8229b
ILT
13054 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13055 (Read_symbols::requeue): New function.
13056 (Read_symbols::do_read_symbols): If make_elf_object fails because
13057 the target type is not configured, and the file was searched for,
13058 issue a warning and retry with the next directory.
13059 (Add_symbols::run): If the file has an incompatible format, and
13060 it was searched for, requeue the Read_symbols task. On error,
13061 release the object.
13062 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13063 dirindex parameter to constructor. Change all callers. Declare
13064 incompatible_warning and requeue.
13065 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13066 input_argument_ and input_group_ fields. Add them to
13067 constructor. Change all callers.
13068 (class Read_script): Add dirindex_ field. Add it to constructor.
13069 Change all callers.
13070 * archive.cc (Archive::setup): Remove input_objects parameter.
13071 Change all callers.
13072 (Archive::get_file_and_offset): Likewise.
13073 (Archive::read_all_symbols): Likewise.
13074 (Archive::read_symbols): Likewise.
13075 (Archive::get_elf_object_for_member): Remove input_objects
13076 parameter. Add punconfigured parameter. Change all callers.
13077 (Archive::add_symbols): Change return type to bool. Check return
13078 value of include_member.
13079 (Archive::include_all_members): Likewise.
13080 (Archive::include_member): Change return type to bool. Return
13081 false if first included object has incompatible target. Set
13082 included_member_ field.
13083 (Add_archive_symbols::run): If add_symbols returns false, requeue
13084 Read_symbols task.
13085 * archive.h (class Archive): Add included_member_ field.
13086 Initialize it in constructor. Add input_file and searched_for
13087 methods. Update declarations.
13088 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13089 input_argument_ fields. Add them to constructor. Change all
13090 callers.
13091 * script.cc: Include "target-select.h".
13092 (class Parser_closure): Add skip_on_incompatible_target_ and
13093 found_incompatible_target_ fields. Add
13094 skip_on_incompatible_target parameter to constructor. Change all
13095 callers. Add methods skip_on_incompatible_target,
13096 clear_skip_on_incompatible_target, found_incompatible_target, and
13097 set_found_incompatible_target.
13098 (read_input_script): Add dirindex parameter. Change all callers.
13099 If parser finds an incompatible target, requeue Read_symbols
13100 task.
13101 (script_set_symbol): Clear skip_on_incompatible_target in
13102 closure.
13103 (script_add_assertion, script_parse_option): Likewise.
13104 (script_start_sections, script_add_phdr): Likewise.
13105 (script_check_output_format): New function.
13106 * script.h (read_input_script): Update declaration.
13107 * script-c.h (script_check_output_format): Declare.
13108 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13109 (ignore_cmd): Remove OUTPUT_FORMAT.
13110 * fileread.cc (Input_file::Input_file): Add explicit this.
13111 (Input_file::will_search_for): New function.
13112 (Input_file::open): Add pindex parameter. Change all callers.
13113 * fileread.h (class Input_file): Add input_file_argument method.
13114 Declare will_search_for. Update declarations.
13115 * object.cc (make_elf_object): Add punconfigured parameter.
13116 Change all callers.
13117 * object.h (class Object): Make input_file public. Add
13118 searched_for method.
13119 (make_elf_object): Update declaration.
13120 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13121 restart search.
13122 * dirsearch.h (class Dirsearch): Update declaration.
13123 * options.h (class General_options): Add --warn-search-mismatch.
13124 * parameters.cc (Parameters::is_compatible_target): New function.
13125 * parameters.h (class Parameters): Declare is_compatible_target.
13126 * workqueue.cc (Workqueue::add_blocker): New function.
13127 * workqueue.h (class Workqueue): Declare add_blocker.
13128
f1ed28fb
ILT
13129 * fileread.cc (Input_file::open): Remove options parameter.
13130 Change all callers.
13131 (Input_file::open_binary): Likewise.
13132 * script.cc (read_input_script): Likewise.
13133 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13134 options parameter from constructor. Change all callers.
13135 (class Read_script): Likewise.
13136 * fileread.h (class Input_file): Update declarations.
13137 * script.h (read_input_script): Update declaration.
13138
34dd024a
NC
131392009-03-10 Nick Clifton <nickc@redhat.com>
13140
13141 * po/es.po: New Spanish translation.
13142
6d71b17c
CC
131432009-03-06 Cary Coutant <ccoutant@google.com>
13144
13145 * options.cc (parse_short_option): Keep dash_z from registering itself.
13146
031cdbed
ILT
131472009-03-03 Ian Lance Taylor <iant@google.com>
13148
13149 PR 9918
13150 * target-reloc.h (relocate_section): Pass output_section to
13151 relocate.
13152 * i386.cc (Target_i386::should_apply_static_reloc): Add
13153 output_section parameter. Change all callers.
13154 (Target_i386::Relocate::relocate): Add output_section parameter.
13155 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13156 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13157 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13158 * testsuite/two_file_shared.sh: New script.
13159 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13160 (check_DATA): Add two_file_shared.dbg.
13161 (two_file_shared.dbg): New target.
13162 * testsuite/Makefile.in: Rebuild.
13163
15d5fa16
ILT
131642009-03-01 Ian Lance Taylor <iant@google.com>
13165
13166 * configure.ac: Check for byteswap.h.
13167 * configure: Rebuild.
13168 * config.in: Rebuild.
13169
8a4c0b0d
ILT
131702009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13171
13172 * layout.cc (Layout::find_or_add_kept_section): New function.
13173 (Layout::add_comdat): Removed.
13174 * layout.h (struct Kept_section): Move out of class Layout.
13175 Remove trailing underscores from field names. Add group_sections
13176 field. Rename group_ field to is_group. Change all uses.
13177 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13178 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13179 comdat_groups_ field.
13180 (Sized_relobj::include_section_group): Use
13181 find_or_add_kept_section and Kept_section::group_sections.
13182 (Sized_relobj::include_linkonce_section): Likewise.
13183 * object.cc (class Sized_relobj): Don't define Comdat_group or
13184 Comdat_group_table. Remove find_comdat_group and
13185 add_comdat_group. Remove comdat_groups_ field.
13186 * plugin.cc (include_comdat_group): Use
13187 Layout::find_or_add_kept_section.
13188
b4ecf66b
ILT
131892009-02-28 Ian Lance Taylor <iant@google.com>
13190
14359ca0
ILT
13191 * README: --gc-sections and map files are now supported. Document
13192 some build requirements.
13193
b4ecf66b
ILT
13194 PR 6992
13195 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13196 relocatable link set the value of the section symbol to zero.
13197 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13198 relocatable link don't include the section address in the local
13199 symbol value.
13200
0602e05a
ILT
132012009-02-27 Ian Lance Taylor <iant@google.com>
13202
fd9d194f
ILT
13203 PR 6811
13204 * options.h (class Search_directory): Add is_system_directory.
13205 (class General_options): Declare is_in_system_directory.
13206 * options.cc (get_relative_sysroot): Make static.
13207 (get_default_sysroot): Make static.
13208 (General_optoins::is_in_system_directory): New function.
13209 * fileread.cc (Input_file::is_in_system_directory): New function.
13210 * fileread.h (class Input_file): Declare is_in_system_directory.
13211 * object.h (class Object): Add is_in_system_directory.
13212 (class Input_objects): Remove system_library_directory_ field.
13213 * object.cc (Input_objects::add_object): Don't set
13214 system_library_directory_.
13215 (input_objects::found_in_system_library_directory): Remove.
13216 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13217 parameter. Change all callers.
13218 (Symbol_table::sized_write_globals): Likewise.
13219 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13220 Call Object::is_in_system_directory.
13221 * symtab.h (class Symbol_table): Update declarations.
13222
61edd21f
ILT
13223 PR 5990
13224 * descriptors.h (Open_descriptor): Add is_on_stack field.
13225 * descriptors.cc (Descriptors::open): If the descriptor is on the
13226 top of the stack, remove it. Initialize is_on_stack field.
13227 (Descriptors::release): Only add pod to stack if it is not on the
13228 stack already.
13229 (Descriptors::close_some_descriptor): Clear stack_next and
13230 is_on_stack fields.
13231
e29e076a
ILT
13232 PR 7091
13233 * output.cc (Output_section::find_starting_output_address): Rename
13234 from starting_output_address; add PADDR parameter; change return
13235 type.
13236 * output.h (class Output_section): Declare
13237 find_starting_output_address instead of starting_output_address.
13238 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13239 section symbol for which we can't find a merge section.
13240
0602e05a
ILT
13241 PR 9836
13242 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13243 hidden or internal, force the symbol to be local.
13244 * resolve.cc (Symbol::override_visibility): Define.
13245 (Symbol::override_base): Use override_visibility.
13246 (Symbol_table::resolve): Likewise.
13247 (Symbol::override_base_with_special): Likewise.
13248 (Symbol_table::override_with_special): If the visibility is hidden
13249 or internal, force the symbol to be local.
13250 * symtab.h (class Symbol): Add set_visibility and
13251 override_visibility.
13252 * testsuite/ver_test_1.sh: New file.
13253 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13254 (check_DATA): Add ver_test_1.syms.
13255 (ver_test_1.syms): New target.
13256 * testsuite/Makefile.in: Rebuild.
13257
401a9a73
CC
132582009-02-25 Cary Coutant <ccoutant@google.com>
13259
13260 * layout.cc (Layout::choose_output_section): Don't rename sections
13261 when using a linker script that has a SECTIONS clause.
13262 * Makefile.in: Regenerate.
13263
13264 * testsuite/Makefile.am (script_test_5.sh): New test case.
13265 * testsuite/Makefile.in: Regenerate.
13266 * testsuite/script_test_5.cc: New file.
13267 * testsuite/script_test_5.sh: New file.
13268 * testsuite/script_test_5.t: New file.
13269
f488e4b0
CC
132702009-02-13 Rafael Avila de Espindola <espindola@google.com>
13271
13272 * archive.cc (Archive::include_member): Update calls to add_symbols.
13273 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13274 the Layout argument.
13275 * dynobj.h (do_add_symbols): Add the Layout argument.
13276 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13277 Layout argument.
13278 * object.h (Object::add_symbols): Add the Layout argument.
13279 (Object::do_add_symbols): Add the Layout argument.
13280 (Sized_relobj::do_add_symbols): Add the Layout argument.
13281 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13282 Unify the two versions.
13283 (Add_plugin_symbols): Remove.
13284 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13285 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13286 (Add_plugin_symbols): Remove.
13287 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13288 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13289 (Add_symbols::run): Make it work with Pulginobj.
13290
89dd1680
ILT
132912009-02-06 Ian Lance Taylor <iant@google.com>
13292
13293 * object.cc (Sized_relobj::do_layout): Make info message start
13294 with lower case letter.
13295
266d0a74
ILT
132962009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13297
602b464e
ILT
13298 * binary.cc: Fix file comment.
13299
266d0a74
ILT
13300 * options.h (enum Incremental_disposition): Define.
13301 (class General_options): Add new options: --incremental,
13302 --incremental_changed, --incremental_unchanged,
13303 --incremental_unknown. Add incremental_disposition_ and
13304 implicit_incremental_ fields.
13305 (General_options::incremental_disposition): New function.
13306 (class Position_dependent_options): Add incremental_disposition
13307 option.
13308 (Position_dependent_options::copy_from_options): Set incremental
13309 dispositions.
13310 * options.cc (General_options::parse_incremental_changed): New
13311 function.
2e702c99
RM
13312 (General_options::parse_incremental_unchanged): New function.
13313 (General_options::parse_incremental_unknown): New function.
13314 (General_options::General_options): Initialize new fields
266d0a74 13315 incremental_disposition_ and implicit_incremental_.
2e702c99 13316 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13317 without --incremental.
13318
f073bbf7
CD
133192009-02-06 Chris Demetriou <cgd@google.com>
13320
13321 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13322 pointer and to report location as the file name associated with
13323 the symbol.
13324 (gold_undefined_symbol_at_location): New function to replace the
13325 old gold_undefined_symbol functionality.
13326 * target-reloc.h (relocate_section): Update to use
13327 gold_undefined_symbol_at_location.
13328 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13329 Call gold_undefined_symbol function rather than gold_error.
13330 * errors.h (Errors::undefined_symbol): Take location as a
13331 string, rather than calculating it from a relocation.
13332 * errors.cc (Errors::fatal): Print "fatal error:" before the
13333 formatted message.
13334 (Errors::error, Errors::error_at_location): Print "error: "
13335 before the formatted message.
13336 (Errors::undefined_symbol): Take location as a string, rather
13337 than calculating it from a relocation.
13338 (gold_undefined_symbol_at_location): New function akin to
13339 old gold_undefined_symbol, calculates location from relocation.
13340 (gold_undefined_symbol): Change to take only a Symbol pointer
13341 and to report location as the file name associated with the symbol.
13342 * testsuite/debug_msg.sh: Update for changed error messages.
13343 * testsuite/undef_symbol.sh: Likewise.
13344
8e94a90c
ILT
133452009-02-04 Duncan Sands <baldrick@free.fr>
13346
13347 PR 9812
13348 * reduced_debug_output.h
13349 (Output_reduced_debug_abbrev_section::failed): Use format for
13350 gold_warning.
13351 (Output_reduced_debug_info_section::faild): Likewise.
13352
88a0e15b
ILT
133532009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13354
13355 * script.cc (Lazy_demangler): New class.
2e702c99 13356 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13357 symbol only once.
13358
5efc7cd2
CC
133592009-01-29 Cary Coutant <ccoutant@google.com>
13360
13361 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13362 to __tls_get_addr.
13363 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13364
e0ebcf42
ILT
133652009-01-28 Ian Lance Taylor <iant@google.com>
13366
5efc7cd2 13367 * version.cc (version_string): Bump to 1.9.
75fe7426 13368
e0ebcf42
ILT
13369 * gold.h: Include <cstring> and <stdint.h>.
13370 * version.cc: Include <cstdio>.
13371 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13372 warning.
13373 * reduced_debug_output.cc (insert_into_vector): Rename from
13374 Insert_into_vector; change all callers. Use Swap_unaligned to
13375 avoid aliasing issue; remove union since it is unnecessary.
13376
8e2813be 133772009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13378
13379 * Makefile.am (CCFILES): Add gc.cc.
13380 (HFILES): Add gc.h.
13381 * Makefile.in: Regenerate.
13382 * gold.cc (Gc_runner): New class.
13383 (queue_initial_tasks): Call garbage collection related tasks
13384 when corresponding options are invoked.
13385 (queue_middle_gc_tasks): New function.
13386 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13387 processed early before laying out sections during garbage collection.
13388 * gold.h (queue_middle_gc_tasks): New function.
13389 (is_prefix_of): Move from "layout.cc".
13390 * i386.cc (Target_i386::gc_process_relocs): New function.
13391 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13392 * main.cc (main): Create object of class "Garbage_collection".
13393 * object.cc (Relobj::copy_symbols_data): New function.
13394 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13395 (Sized_relobj::do_layout): Allow this function to be called twice
13396 during garbage collection and defer layout of section during the
6d03d481
ST
13397 first call.
13398 * object.h (Relobj::get_symbols_data): New function.
13399 (Relobj::is_section_name_included): New function.
13400 (Relobj::copy_symbols_data): New function.
13401 (Relobj::set_symbols_data): New function.
13402 (Relobj::get_relocs_data): New function.
13403 (Relobj::set_relocs_data): New function.
13404 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13405 (Relobj::gc_process_relocs): New function.
13406 (Relobj::do_gc_process_relocs): New pure virtual function.
13407 (Relobj::sd_): New data member.
13408 (Sized_relobj::is_output_section_offset_invalid): New function.
13409 (Sized_relobj::do_gc_process_relocs): New function.
13410 * options.h (General_options::gc_sections): Modify to not be a no-op.
13411 (General_options::print_gc_sections): New option.
13412 * plugin.cc (Plugin_finish::run): Remove function call to
13413 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13414 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13415 * reloc.cc (Read_relocs::run): Add task to process relocs and
13416 determine unreferenced sections when doing garbage collection.
13417 (Gc_process_relocs): New class.
13418 (Sized_relobj::do_gc_process_relocs): New function.
13419 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13420 sections that are garbage collected.
13421 * reloc.h (Gc_process_relocs): New class.
13422 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13423 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13424 symbols whose corresponding sections are garbage collected.
13425 (Symbol_table::Symbol_table): Add new parameter for the garbage
13426 collection object.
13427 (Symbol_table::gc_mark_undef_symbols): New function.
13428 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13429 (Symbol_table::gc_mark_dyn_syms): New function.
13430 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13431 as garbage.
13432 (Symbol_table::add_from_object): Likewise.
13433 (Symbol_table::add_from_relobj): When building shared objects, do not
13434 treat externally visible symbols as garbage.
13435 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13436 table information for static and relocatable links.
13437 * symtab.h (Symbol_table::set_gc): New function.
13438 (Symbol_table::gc): New function.
13439 (Symbol_table::gc_mark_undef_symbols): New function.
13440 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13441 (Symbol_table::gc_mark_dyn_syms): New function.
13442 (Symbol_table::gc_): New data member.
e1df38aa 13443 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13444 function.
13445 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13446 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13447
3b293544
CF
134482009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13449
13450 * options.h (General_options::gc_sections): Define as a no-op for now.
13451 (General_options::no_keep_memory): Ditto.
13452 (General_options::Bshareable): Define.
13453 * options.cc (General_options::finalize): Honor -Bshareable.
13454
83d22aa8
AS
134552009-01-20 Andreas Schwab <schwab@suse.de>
13456
13457 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13458 read the value in the contents, since we don't use it. Use the
13459 template endianness when writing.
13460 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13461
cd536b21
AS
134622009-01-19 Andreas Schwab <schwab@suse.de>
13463
13464 * configure.tgt (powerpc64-*): Fix targ_obj.
13465
99e9a495
ILT
134662009-01-15 Ian Lance Taylor <iant@google.com>
13467
13468 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13469 local symbols when stripping all symbols.
13470
bbbfea06
CC
134712009-01-14 Cary Coutant <ccoutant@google.com>
13472
99e9a495 13473 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13474
0f7c0701
CC
134752009-01-14 Cary Coutant <ccoutant@google.com>
13476
13477 * archive.cc (Archive::get_elf_object_for_member): Remove call
13478 to File_read::claim_for_plugin.
13479 * descriptors.cc (Descriptors::open): Remove reference to
13480 is_claimed.
13481 (Descriptors::claim_for_plugin): Remove.
13482 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13483 (Descriptors::is_claimed): Remove.
13484 (claim_descriptor_for_plugin): Remove.
13485 * fileread.cc (File_read::claim_for_plugin): Remove.
13486 * fileread.h (File_read::claim_for_plugin): Remove.
13487 (File_read::descriptor): Reopen descriptor if necessary.
13488 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13489 (Plugin_manager::all_symbols_read): Add task parameter. Change
13490 all callers.
13491 (Plugin_manager::get_input_file): New function.
13492 (Plugin_manager::release_input_file): New function.
13493 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13494 corresponding data member.
13495 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13496 and pass to base constructor. Change all callers.
13497 (get_input_file, release_input_file): New functions.
13498 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13499 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13500 (Plugin_manager::all_symbols_read): Add task parameter.
13501 (Plugin_manager::get_input_file): New function.
13502 (Plugin_manager::release_input_file): New function.
13503 (Plugin_manager::task_): New data member.
13504 (Pluginobj::Pluginobj): Add filesize parameter.
13505 (Pluginobj::filename): New function.
13506 (Pluginobj::descriptor): New function.
13507 (Pluginobj::filesize): New function.
13508 (Pluginobj::filesize_): New data member.
13509 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13510 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13511 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13512
13513 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13514 with archive libraries.
13515 * testsuite/Makefile.in: Regenerate.
13516 * testsuite/plugin_test.c (struct sym_info): New type.
13517 (get_input_file, release_input_file): New static variables.
13518 (onload): Capture new transfer vector entries.
13519 (claim_file_hook): Stop reading at end of file according to filesize.
13520 Factor out parsing of readelf output into separate function.
13521 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13522 APIs and get the source file name from the symbol table. Convert
13523 source file name to corresponding object file name. Print info
13524 message when adding new input files.
13525 (parse_readelf_line): New function.
13526 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13527 * testsuite/plugin_test_2.sh: Likewise.
13528 * testsuite/plugin_test_3.sh: Likewise.
13529 * testsuite/plugin_test_4.sh: New test case.
13530
62a6d109
ILT
135312009-01-07 Ian Lance Taylor <iant@google.com>
13532
13533 * version.cc (version_string): Bump to 1.8.
13534
483620e8
CC
135352008-12-23 Cary Coutant <ccoutant@google.com>
13536
13537 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13538 * plugin.cc (Plugin_manager::finish): Rename as
13539 layout_deferred_objects. Move cleanup to separate function.
13540 (Plugin_manager::cleanup): New function.
13541 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13542 separately.
13543 * plugin.h (Plugin_manager::finish): Rename as
13544 layout_deferred_objects.
13545 (Plugin_manager::cleanup): New function.
13546 (Plugin_manager::cleanup_done): New field.
13547
d66a9eb3
CC
135482008-12-23 Cary Coutant <ccoutant@google.com>
13549
13550 * plugin.cc (is_visible_from_outside): New function.
13551 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13552 so we don't return "IR only" status for exported symbols or -r links.
13553
13554 * testsuite/Makefile.am (plugin_test_3): New test case.
13555 * testsuite/Makefile.in: Regenerate.
13556 * testsuite/plugin_test_3.sh: New file.
13557
5995b570
CC
135582008-12-22 Cary Coutant <ccoutant@google.com>
13559
13560 * object.cc (Sized_relobj::layout_section): New function.
13561 (Sized_relobj::do_layout): Defer layout of input sections until after
13562 plugin has provided replacement files.
13563 (Sized_relobj::do_layout_deferred_sections): New function.
13564 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13565 (Relobj::layout_deferred_sections): New function.
13566 (Relobj::do_layout_deferred_sections): New function.
13567 (Sized_relobj::do_layout_deferred_sections): New function.
13568 (Sized_relobj::layout_section): New function.
13569 (Sized_relobj::Deferred_layout): New structure.
13570 (Sized_relobj::deferred_layout_): New field.
13571 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13572 Change all callers. Layout deferred sections.
13573 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13574 references.
13575 (Plugin_hook::run): Move code from do_plugin_hook inline.
13576 (Plugin_hook::do_plugin_hook): Remove.
13577 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13578 (Plugin_manager::finish): Renamed, was cleanup.
13579 (Plugin_manager::should_defer_layout): New function.
13580 (Plugin_manager::add_deferred_layout_object): New function.
13581 (Plugin_manager::Deferred_layout_list): New type.
13582 (Plugin_manager::deferred_layout_objects_): New field.
13583 (Plugin_hook::do_plugin_hook): Remove.
13584
ee769c88
ILT
135852008-12-17 Ian Lance Taylor <iant@google.com>
13586
13587 * options.h (class General_options): Add --no case for
13588 --export-dynamic.
13589
abc8dcba
CC
135902008-12-16 Cary Coutant <ccoutant@google.com>
13591
13592 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13593 vector.
13594 (Plugin_manager::claim_file): Create plugin object even if
13595 plugin did not call the add_symbols callback.
13596 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13597 asking for more symbols than were added.
13598 * testsuite/Makefile.am (plugin_test_1): Add test case with
13599 no global symbols.
13600 (empty.syms): New target.
13601 * testsuite/Makefile.in: Regenerate.
13602 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13603 message. Don't call add_symbols if no globals.
13604 (all_symbols_read_hook): Don't provide replacement for empty
13605 claimed file.
13606
b0074644
ILT
136072008-12-12 Ian Lance Taylor <iant@google.com>
13608
68943102
ILT
13609 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13610 r_type == 0 for a local symbol with r_sym == 0.
13611 (scan_relocatable_relocs): Pass r_sym to
13612 local_non_section_strategy.
13613 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13614 r_sym parameter.
13615
b0074644
ILT
13616 * configure.ac: Update test for TLS descriptors: they are
13617 supported as of glibc 2.9.
13618 * configure: Rebuild.
13619
c2508178
ILT
136202008-12-11 Ian Lance Taylor <iant@google.com>
13621
13622 PR 7091
13623 * target-reloc.h (Default_scan_relocatable_relocs): For each
13624 function, map r_type == 0 to RELOC_DISCARD.
13625
2756a258
CC
136262008-12-10 Cary Coutant <ccoutant@google.com>
13627
13628 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13629 object to override a kept COMDAT group from a plugin object.
13630
bb6f53d3
ILT
136312008-12-09 Ian Lance Taylor <iant@google.com>
13632
fbc558e1
ILT
13633 PR 7088
13634 * yyscript.y (file_cmd): Handle INPUT.
13635
bb6f53d3
ILT
13636 * testsuite/initpri1.c: Change all declarations to be full
13637 prototypes by adding void, to avoid compiler warnings.
13638
4674ecfc
CC
136392008-12-05 Rafael Avila de Espindola <espindola@google.com>
13640
13641 * options.cc (General_options::parse_plugin_opt): New.
13642 (General_options::add_plugin): The argument now is just the filename.
13643 (General_options::add_plugin_option): New.
13644 * options.h (plugin_opt): New.
13645 (add_plugin): Change argument name.
13646 (add_plugin_option): New.
13647 * plugin.cc (Plugin::load): Don't parse the plugin option.
13648 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13649 (Plugin::add_option): New.
13650 (Plugin::args_): Change type.
13651 (Plugin::filename_): New.
13652 (Plugin_manager::add_plugin_option): New.
13653 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13654 * testsuite/Makefile.in: Regenerate.
13655
fd06b4aa
CC
136562008-12-05 Cary Coutant <ccoutant@google.com>
13657
13658 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13659 Handle --strip-lto-sections option.
13660 * options.h (strip_lto_sections): New option.
13661
6c52134c
CC
136622008-12-01 Cary Coutant <ccoutant@google.com>
13663
13664 * plugin.cc (ld_plugin_message): Change format parameter to const.
13665 Fix mismatch between new[] and delete.
13666
a45248e0
CC
136672008-11-14 Cary Coutant <ccoutant@google.com>
13668
13669 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13670 instead of -1U.
13671
c82fbeee
CS
136722008-11-05 Craig Silverstein <csilvers@google.com>
13673
13674 * options.cc (General_options::parse_dynamic_list): New function.
13675 * options.h (General_options): New flags dynamic_list,
13676 dynamic_list_data, dynamic_list_cpp_new, and
13677 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13678 (General_options::in_dynamic_list): New function.
13679 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13680 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13681 (Lex::can_continue_name): Likewise.
13682 (yylex): Likewise.
13683 (read_script_file): New parameter script_options.
13684 (read_dynamic_list): New function.
13685 (Script_options::define_dynamic_list): New function.
13686 (dynamic_list_keyword_parsecodes): New variable.
13687 (dynamic_list_keywords): New variable.
13688 * script.h (Script_options::define_dynamic_list): New function
13689 prototype.
13690 (read_dynamic_list): New function prototype.
13691 * symtab.cc (strprefix): New macro.
13692 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13693 dynamic_list_data, dynamic_list_cpp_new, and
13694 dynamic_list_cpp_typeinfo.
13695 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13696 (dynamic_list_expr): New rule.
13697 (dynamic_list_nodes): Likewise.
13698 (dynamic_list_node): Likewise.
13699 * testsuite/Makefile.am (dynamic_list): New test.
13700 * testsuite/Makefile.in: Regenerated.
13701 * testsuite/dynamic_list.t: New file.
13702 * testsuite/dynamic_list.sh: New file.
13703
e0bb29a5
CS
137042008-11-05 Craig Silverstein <csilvers@google.com>
13705
13706 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13707 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13708 (t11_last): Likewise.
13709 * testsuite/ver_test_6.c (main): Likewise.
13710
4e1e25e0
CC
137112008-10-07 Cary Coutant <ccoutant@google.com>
13712
13713 * options.c (General_options::finalize): Add check for -static and
13714 -shared.
13715 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13716 is not empty.
13717
92f03fcb
CC
137182008-10-02 Cary Coutant <ccoutant@google.com>
13719
13720 * plugin.cc (make_sized_plugin_object): Fix conditional
13721 compilation to work when not all targets are enabled.
13722
fbd8a257
CC
137232008-09-29 Cary Coutant <ccoutant@google.com>
13724
13725 * archive.cc (Archive::get_file_and_offset): Use filename instead
13726 of name to get library path.
13727 (Archive::include_member): Unlock external member of a thin archive.
13728
13729 * testsuite/Makefile.am (TEST_AR): New variable.
13730 (thin_archive_test_1): New test.
13731 (thin_archive_test_2): New test.
81636b3f
CC
13732 * testsuite/Makefile.in: Regenerate.
13733 * testsuite/thin_archive_main.cc: New file.
13734 * testsuite/thin_archive_test_1.cc: New file.
13735 * testsuite/thin_archive_test_2.cc: New file.
13736 * testsuite/thin_archive_test_3.cc: New file.
13737 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 13738
eff45813
CC
137392008-09-29 Cary Coutant <ccoutant@google.com>
13740
13741 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13742 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13743 instead of -1U.
13744 (Sized_relobj::do_finalize_local_symbols): Likewise.
13745 (Sized_relobj::map_to_kept_section): Likewise.
13746 * object.h (Sized_relobj::invalid_address): New constant.
13747 (Sized_relobj::do_output_section_offset): Check for invalid_address
13748 and return -1ULL.
13749 * output.cc (Output_reloc::local_section_offset): Use constant
13750 invalid_address instead of -1U.
13751 (Output_reloc::get_address): Likewise.
13752 (Output_section::output_address): Change -1U to -1ULL.
13753 * output.h (Output_reloc::invalid_address): New constant.
13754 * reloc.cc (Sized_relobj::write_sections): Use constant
13755 invalid_address instead of -1U.
13756 (Sized_relobj::relocate_sections): Likewise.
13757 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13758 values for merge sections.
13759 * target-reloc.h (relocate_for_relocatable): Use constant
13760 invalid_address instead of -1U.
13761
89fc3421
CC
137622008-09-19 Cary Coutant <ccoutant@google.com>
13763
13764 Add plugin functionality for link-time optimization (LTO).
13765 * configure.ac (plugins): Add --enable-plugins option.
13766 * configure: Regenerate.
13767 * config.in: Regenerate.
13768 * Makefile.am (LIBDL): New variable.
13769 (CCFILES): Add plugin.cc.
13770 (HFILES): Add plugin.h.
13771 (ldadd_var): Add LIBDL.
13772 * Makefile.in: Regenerate.
13773
13774 * archive.cc: Include "plugin.h".
13775 (Archive::setup): Don't preread archive symbols when using a plugin.
13776 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
13777 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
13778 files.
13779 (Archive::include_member): Add symbols from plugin objects.
13780 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
13781 * descriptors.cc (Descriptors::open): Check for file descriptors
13782 abandoned by plugins.
13783 (Descriptors::claim_for_plugin): New function.
13784 * descriptors.h (Descriptors::claim_for_plugin): New function.
13785 (Open_descriptor::is_claimed): New field.
13786 (claim_descriptor_for_plugin): New function.
13787 * fileread.cc (File_read::claim_for_plugin): New function.
13788 * fileread.h (File_read::claim_for_plugin): New function.
13789 (File_read::descriptor): New function.
13790 * gold.cc: Include "plugin.h".
13791 (queue_initial_tasks): Add task to call plugin hooks for generating
13792 new object files.
13793 * main.cc: Include "plugin.h".
13794 (main): Load plugin libraries.
13795 * object.h (Pluginobj): Declare.
13796 (Object::pluginobj): New function.
13797 (Object::do_pluginobj): New function.
13798 (Object::set_target): New function.
13799 * options.cc: Include "plugin.h".
13800 (General_options::parse_plugin): New function.
13801 (General_options::General_options): Initialize plugins_ field.
13802 (General_options::add_plugin): New function.
13803 * options.h (Plugin_manager): Declare.
13804 (General_options): Add --plugin option.
13805 (General_options::has_plugins): New function.
13806 (General_options::plugins): New function.
13807 (General_options::add_plugin): New function.
13808 (General_options::plugins_): New field.
13809 * plugin.cc: New file.
13810 * plugin.h: New file.
13811 * readsyms.cc: Include "plugin.h".
13812 (Read_symbols::do_read_symbols): Check for archive before checking
13813 for ELF file. Call plugin hooks to claim files.
13814 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
13815 from a real object file; force override when processing replacement
13816 files.
13817 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
13818 (Symbol::init_base_object): Likewise.
13819 (Symbol::init_base_output_data): Likewise.
13820 (Symbol::init_base_output_segment): Likewise.
13821 (Symbol::init_base_constant): Likewise.
13822 (Symbol::init_base_undefined): Likewise.
13823 (Symbol::output_section): Assert that object is not a plugin.
13824 (Symbol_table::add_from_pluginobj): New function.
13825 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
13826 undefined.
13827 (Symbol_table::sized_write_globals): Likewise.
13828 (Symbol_table::add_from_pluginobj): Instantiate template.
13829 * symtab.h (Sized_pluginobj): Declare.
13830 (Symbol::in_real_elf): New function.
13831 (Symbol::set_in_real_elf): New function.
13832 (Symbol::in_real_elf_): New field.
13833 (Symbol_table::add_from_pluginobj): New function.
13834
13835 * testsuite/Makefile.am (AM_CFLAGS): New variable.
13836 (LIBDL): New variable.
13837 (LDADD): Add LIBDL.
13838 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
13839 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
13840 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
13841 (MOSTLYCLEANFILES): Likewise.
13842 * testsuite/Makefile.in: Regenerate.
13843 * testsuite/plugin_test.c: New file.
13844 * testsuite/plugin_test_1.sh: New file.
13845 * testsuite/plugin_test_2.sh: New file.
13846
de31bda5
ILT
138472008-09-16 Ian Lance Taylor <iant@google.com>
13848
9c2d0ef9
ILT
13849 * target-reloc.h (relocate_section): Check whether a symbol is
13850 defined by the ABI before reporting an undefined symbol error.
13851 * target.h (Target::is_defined_by_abi): Make parameter const.
13852 (Target::do_is_defined_by_abi): Likewise.
13853 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
13854 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
13855 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
13856 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
13857 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
13858 * testsuite/Makefile.in: Rebuild.
13859
de31bda5
ILT
13860 * fileread.cc (make_view): Add casts to avoid warning.
13861
9fa33bee
AO
138622008-09-16 Alexandre Oliva <aoliva@redhat.com>
13863
13864 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
13865 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13866
183fd0e3
AO
138672008-09-16 Alexandre Oliva <aoliva@redhat.com>
13868
13869 * options.h (General_options::output_is_executable): New.
13870 (General_options::output_is_pie): New.
13871 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
13872 for shared libraries.
13873 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13874
7be8330a
CD
138752008-09-11 Chris Demetriou <cgd@google.com>
13876
13877 * options.h (origin): New -z option.
13878 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
13879 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
13880 in DT_FLAGS_1.
13881
a9caad02
CC
138822008-09-05 Cary Coutant <ccoutant@google.com>
13883
13884 * fileread.cc (File_read::make_view): Add check for attempt to map
13885 beyond end of file.
13886
ae6dce4d
CC
138872008-09-05 Cary Coutant <ccoutant@google.com>
13888
13889 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
13890 explicit instantiations.
13891
d7ab2a47
KVH
138922008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
13893
13894 PR gold/6858
13895 * options.cc (General_options::finalize): Allow undefined symbols
13896 in shlibs if linking -shared.
13897
13898 PR gold/6859
13899 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
13900 symbols as not needing a dynsym entry.
13901
1e52a9c1
CS
139022008-08-20 Craig Silverstein <csilvers@google.com>
13903
13904 * fileread.cc (File_read::open): Do not lock the file unless it
13905 was successfully opened.
13906
d85c80a3
CC
139072008-08-14 Cary Coutant <ccoutant@google.com>
13908
13909 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
13910 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
13911 * testsuite/tls_test.cc (struct int128): 128-bit struct
13912 for testing TLS relocs with non-zero addend.
13913 (v12): New TLS variable.
13914 (t12): New test.
13915 (t_last): Add check for v12.
13916 * testsuite/tls_test.h (t12): New function.
13917 * testsuite/tls_test_main.cc (thread_routine): Call new test.
13918
2d924fd9
ILT
139192008-08-13 Ian Lance Taylor <iant@google.com>
13920
13921 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
13922 set tls_segment_ or relro_segment_.
13923 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
13924 when appropriate.
13925 * output.h (Output_section::clear_is_relro): New function.
13926 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
13927 sections specially even when output_data_ is empty.
13928 (Output_segment::maximum_alignment): When first section is relro,
13929 only force alignment for PT_LOAD segments.
13930 * script.cc (script_data_segment_align): New function.
13931 (script_data_segment_relro_end): New function.
13932 * script-c.h (script_data_segment_align): Declare.
13933 (script_data_segment_relro_end): Declare.
13934 * script-sections.h (class Script_sections): Declare
13935 data_segment_align and data_segment_relro_end. Add fields
13936 segment_align_index_ and saw_relro_end_.
13937 * script-sections.cc (class Sections_element): Add set_is_relro
13938 virtual function. Add new bool* parameter to place_orphan_here.
13939 Add get_output_section virtual function.
13940 (class Output_section_definition): Add set_is_relro. Add new
13941 bool* parameter to place_orphan_here. Add get_output_section.
13942 Add is_relro_ field.
13943 (Output_section_definition::Output_section_definition): Initialize
13944 evaluated_address_, evaluated_load_address, evaluated_addralign_,
13945 and is_relro_ fields.
13946 (Output_section_definition::place_orphan_here): Add is_relro
13947 parameter.
13948 (Output_section_definition::set_section_addresses): Set relro for
13949 output section.
13950 (Output_section_definition::alternate_constraint): Likewise.
13951 (class Orphan_output_section): Add new bool* parameter to
13952 place_orphan_here. Add get_output_section.
13953 (Orphan_output_section::place_orphan_here): Add is_relro
13954 parameter.
13955 (Script_sections::Script_sections): Initialize
13956 data_segment_align_index_ and saw_relro_end_.
13957 (Script_sections::data_segment_align): New function.
13958 (Script_sections::data_segment_relro_end): New function.
13959 (Script_sections::place_orphan): Set or clear is_relro.
13960 (Script_sections::set_section_addresses): Force alignment of first
13961 TLS section.
13962 * yyscript.y (exp): Call script_data_segment_align and
13963 script_data_segment_relro_end.
13964 * testsuite/relro_script_test.t: New file.
13965 * testsuite/relro_test.cc (using_script): Declare.
13966 (t1, t2): Test using_script.
13967 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
13968 (relro_script_test_SOURCES): Define.
13969 (relro_script_test_DEPENDENCIES): Define.
13970 (relro_script_test_LDFLAGS): Define.
13971 (relro_script_test_LDADD): Define.
13972 (relro_script_test.so): New target.
13973 * testsuite/Makefile.in: Rebuild.
13974
f827c9a9
CC
139752008-08-06 Cary Coutant <ccoutant@google.com>
13976
13977 * archive.cc (Archive::total_archives, Archive::total_members)
13978 (Archive::total_members_loaded): New variables.
13979 (Archive::setup): Add parameter. Add option to preread
13980 archive symbols.
13981 (Archive::read_armap): Add counter.
13982 (Archive::get_file_and_offset): New function.
13983 (Archive::get_elf_object_for_member): New function.
13984 (Archive::read_all_symbols): New function.
13985 (Archive::read_symbols): New function.
13986 (Archive::add_symbols): Add counters.
13987 (Archive::include_all_members): Use armap to find members if it's
13988 already built.
13989 (Archive::include_member): Skip reading symbols if already read.
13990 Factored code into Archive::get_file_and_offset and
13991 Archive::get_elf_object_for_member. Changed call to
13992 Mapfile::report_include_archive_member.
13993 (Archive::print_stats): New function.
13994 * archive.h: Declare Object and Read_symbols_data classes.
13995 (Archive::Archive): Add initializers for new members.
13996 (Archive::setup): Add parameter.
13997 (Archive::print_stats): New function.
13998 (Archive::total_archives, Archive::total_members)
13999 (Archive::total_members_loaded): New variables.
14000 (Archive::get_file_and_offset): New function.
14001 (Archive::get_elf_object_for_member): New function.
14002 (Archive::read_all_symbols): New function.
14003 (Archive::read_symbols): New function.
14004 (Archive::Archive_member): New class.
14005 (Archive::members_): New member.
14006 (Archive::num_members_): New member.
14007 * main.cc: Include archive.h.
14008 (main): Call Archive::print_stats.
14009 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14010 archive parameter; member_name is now the fully-decorated name.
14011 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14012 * options.h: (General_options): Add --preread-archive-symbols option.
14013 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14014 Archive::setup.
14015
de4c45bd
ILT
140162008-08-04 Ian Lance Taylor <iant@google.com>
14017
14018 * symtab.h (Symbol::use_plt_offset): New function.
14019 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14020 * powerpc.cc (Relocate::relocate): Likewise.
14021 * sparc.cc (Relocate::relocate): Likewise.
14022 * x86_64.cc (Relocate::relocate): Likewise.
14023 * testsuite/weak_plt.sh: New test.
14024 * testsuite/weak_plt_main.cc: New test.
14025 * testsuite/weak_plt_shared.cc: New test.
14026 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14027 (check_PROGRAMS): Add weak_plt.
14028 (check_DATA): Add weak_plt_shared.so.
14029 (weak_plt_main_pic.o, weak_plt): New targets.
14030 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14031 * testsuite/Makefile.in: Rebuild.
14032
14033 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14034 gcctestdir/ld.
14035 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14036 * testsuite/Makefile.in: Rebuild.
14037
323ee3f4
AM
140382008-08-04 Alan Modra <amodra@bigpond.net.au>
14039
14040 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14041 * Makefile.in: Regenerate.
14042 * po/POTFILES.in: Regenerate.
14043
7c07ecec
ILT
140442008-07-29 Ian Lance Taylor <iant@google.com>
14045
14046 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14047 symbols before other symbols.
14048 * testsuite/script_test_2.cc (test_addr): Declare.
14049 (test_addr_alias): Declare.
14050 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14051 values.
7c07ecec
ILT
14052 * testsuite/script_test_2.t: Define test_addr_alias and
14053 test_addr.
14054
5778530e
ILT
140552008-07-24 Ian Lance Taylor <iant@google.com>
14056
2a00e4fb
ILT
14057 PR 5990
14058 * descriptors.cc: New file.
14059 * descriptors.h: New file.
14060 * gold-threads.h (class Hold_optional_lock): New class.
14061 * fileread.cc: Include "descriptors.h".
14062 (File_read::~File_read): Release descriptor rather than closing
14063 it.
14064 (File_read::open) [file]: Call open_descriptor rather than open.
14065 Set is_descriptor_opened_.
14066 (File_read::open) [memory]: Assert that descriptor is not open.
14067 (File_read::reopen_descriptor): New function.
14068 (File_read::release): Release descriptor.
14069 (File_read::do_read): Make non-const. Reopen descriptor.
14070 (File_read::read): Make non-const.
14071 (File_read::make_view): Reopen descriptor.
14072 (File_read::do_readv): Likewise.
14073 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14074 Update declarations.
14075 * layout.cc: Include "descriptors.h".
14076 (Layout::create_build_id): Use open_descriptor rather than open.
14077 * output.cc: Include "descriptors.h".
14078 (Output_file::open): Use open_descriptor rather than open.
14079 * archive.cc (Archive::const_iterator): Change Archive to be
14080 non-const.
14081 (Archive::begin, Archive::end): Make non-const.
14082 (Archive::count_members): Likewise.
14083 * archive.h (class Archive): Update declarations.
14084 * object.h (Object::read): Make non-const.
14085 * Makefile.am (CCFILES): Add descriptors.cc.
14086 (HFILES): Add descriptors.h.
14087 * Makefile.in: Rebuild.
14088
801647d1
ILT
14089 PR 6716
14090 * gold.h: Always include <clocale>. Add Solaris workarounds
14091 following code in binutils/sysdep.h.
14092
5edd166e
ILT
14093 PR 6048
14094 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14095 this->eh_frame_hdr_ is NULL before using it.
14096
c89ad728
ILT
14097 * dynobj.cc (Versions::Versions): Update comment.
14098
aa86f06b
ILT
14099 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14100 the base version name.
14101
5778530e
ILT
14102 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14103 array size plus one.
14104 (Stringpool_template::set_string_offsets): Subtract one from key
14105 before using it as an array index.
14106 (Stringpool_template::get_offset_with_length): Likewise.
14107 (Stringpool_template::write_to_buffer): Likewise.
14108 * stringpool.h (Stringpool_template::get_offset_from_key):
14109 Likewise.
14110
057ead22
ILT
141112008-07-23 Ian Lance Taylor <iant@google.com>
14112
7f649c59
ILT
14113 PR 6658
14114 * object.h (Merged_symbol_value::value): Do our best to handle a
14115 negative addend.
14116
057ead22
ILT
14117 PR 6647
14118 * script.cc (Version_script_info::get_versions): Don't add empty
14119 version tag to return value.
14120 (Version_script_info::get_symbol_version_helper): Change return
14121 type to bool. Add pversion parameter. Change all callers.
14122 (script_register_vers_node): Don't require a non-NULL tag.
14123 * script.h (class Version_script_info): Update declarations.
14124 (Version_script_info::get_symbol_version): Change return type to
14125 bool. Add version parameter. Change all callers.
14126 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14127 handling. Handle an empty version from a version script.
14128 (Symbol_table::define_special_symbol): Likewise.
14129 * testsuite/ver_test_10.script: New file.
14130 * testsuite/ver_test_10.sh: New file.
14131 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14132 (check_DATA): Add ver_test_10.syms.
14133 (ver_test_10.syms, ver_test_10.so): New target.
14134 * testsuite/Makefile.in: Rebuild.
14135
58e54ac2
CD
141362008-07-23 Simon Baldwin <simonb@google.com>
14137
14138 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14139 to zero for undefined symbols from dynamic libraries.
14140
95d14cd3
ILT
141412008-07-23 Ian Lance Taylor <iant@google.com>
14142
14143 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14144 Change all callers.
14145 * symtab.h (class Symbol_table): Update declaration.
14146 * testsuite/ver_test_9.cc: New file.
14147 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14148 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14149 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14150 (ver_test_9.so, ver_test_9.o): New targets.
14151 * testsuite/Makefile.in: Rebuild.
14152
92de84a6
ILT
141532008-07-22 Ian Lance Taylor <iant@google.com>
14154
34810851
ILT
14155 * options.h (class General_options): Define --check-sections.
14156 * layout.cc (Layout::set_segment_offsets): Handle
14157 --check-sections.
14158
af6156ef
ILT
14159 * options.h (class General_options): Define -n/--nmagic and
14160 -N/--omagic.
14161 * options.cc (General_options::finalize): For -n/--nmagic or
14162 -N/--omagic, set -static.
14163 * layout.cc (Layout::attach_allocated_section_to_segment): If
14164 -N/--omagic, don't put read-only and read-write sections in
14165 different segments.
14166 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14167 finding a read-only segment.
14168 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14169 don't set the minimum segment alignment to the common page size,
14170 and don't set the file offset to the address modulo the page size.
14171 * script-sections.cc (Script_sections::create_segments): If
14172 -n/--omagic, don't put read-only and read-write sections in
14173 different segments.
14174
92de84a6
ILT
14175 * cref.cc: New file.
14176 * cref.h: New file.
14177 * options.h (class General_options): Add --print-symbol-counts.
14178 * main.cc (main): Issue defined symbol report if requested.
14179 * archive.cc (Archive::interpret_header): Make into a const member
14180 function.
14181 (Archive::add_symbols): Call Input_objects::archive_start and
14182 archive_stop.
14183 (Archive::const_iterator): Define new class.
14184 (Archive::begin, Archive::end): New functions.
14185 (Archive::include_all_members): Rewrite to use iterator.
14186 (Archive::count_members): New function.
14187 * archive.h (class Archive): Update declarations.
14188 (Archive::filename): New function.
14189 * object.cc: Include "cref.h".
14190 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14191 (Sized_relobj::do_get_global_symbol_counts): New function.
14192 (Input_objects::add_object): Add object to cross-referencer.
14193 (Input_objects::archive_start): New function.
14194 (Input_objects::archive_stop): New function.
14195 (Input_objects::print_symbol_counts): New function.
14196 * object.h: Declare Cref and Archive.
14197 (Object::get_global_symbol_counts): New function.
14198 (Object::do_get_global_symbol_counts): New pure virtual function.
14199 (class Sized_relobj): Add defined_count_ field. Update
14200 declarations.
14201 (class Input_objects): Add cref_ field. Update constructor.
14202 Update declarations.
14203 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14204 defined_count_.
14205 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14206 symbol counts.
14207 (Sized_dynobj::do_get_global_symbol_counts): New function.
14208 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14209 defined_count_. Update declarations. Define Symbols typedef.
14210 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14211 parameter. Change all callers.
14212 (Symbol_table::add_from_dynobj): Add sympointers and defined
14213 parameters. Change all callers.
14214 * symtab.h (class Symbol_table): Update declarations.
14215 * Makefile.am (CCFILES): Add cref.cc.
14216 (HFILES): Add cref.h.
14217 * Makefile.in: Rebuild.
14218
3f7c5e1d
CD
142192008-07-22 Simon Baldwin <simonb@google.com>
14220
14221 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14222 to zero when writing undefined symbols.
14223
e0b64032
ILT
142242008-07-22 Ian Lance Taylor <iant@google.com>
14225
14226 * output.cc (Output_section::add_input_section): Don't try to
14227 merge empty merge sections.
14228
096b02cf
CS
142292008-07-21 Craig Silverstein <csilvers@google.com>
14230
14231 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14232 Include symbol version in error message.
cd536b21 14233
1d1f116d
CD
142342008-07-20 Chris Demetriou <cgd@google.com>
14235
cd536b21 14236 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14237 (RANDOM_SEED_CFLAGS): New substituted variable.
14238 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14239 * configure: Rebuild.
14240 * Makefile.in: Likewise.
14241 * testsuite/Makefile.in: Likewise.
14242
a18f591e
ILT
142432008-07-18 Ian Lance Taylor <iant@google.com>
14244
14245 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14246 where we see NAME/NULL and NAME/VERSION as separate symbols.
14247 * testsuite/ver_test_main.cc (main): Call t4.
14248 (t4, t4_2a): Define.
14249 * testsuite/ver_test_2.cc (t4_2): Define.
14250 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14251 * testsuite/ver_test_4.cc (t4_2a): Define.
14252 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14253 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14254
c6e3f6ed
ILT
142552008-07-17 Ian Lance Taylor <iant@google.com>
14256
14257 * dynobj.cc (Versions::add_def): If we give an error about a
14258 missing version, go ahead and create the version anyhow.
14259
ef9beddf
ILT
142602008-07-10 Ian Lance Taylor <iant@google.com>
14261
14262 Handle output sections with more than 0x7fffffff bytes.
14263 * object.h (class Relobj): Change map_to_output_ to
14264 output_sections_, and just keep a section pointer. Change all
14265 uses. Move comdat group support to Sized_relobj.
14266 (Relobj::is_section_specially_mapped): Remove.
14267 (Relobj::output_section): Remove poff parameter. Change all
14268 callers.
14269 (Relobj::output_section_offset): New function.
14270 (Relobj::set_section_offset): Rewrite.
14271 (Relobj::map_to_output): Remove.
14272 (Relobj::output_sections): New function.
14273 (Relobj::do_output_section_offset): New pure virtual function.
14274 (Relobj::do_set_section_offset): Likewise.
14275 (class Sized_relobj): Add section_offsets_ field. Add comdat
14276 group support from Relobj. Update declarations.
14277 (Sized_relobj::get_output_section_offset): New function.
14278 (Sized_relobj::do_output_section_offset): New function.
14279 (Sized_relobj::do_set_section_offset): New function.
14280 * object.cc (Relobj::output_section_address): Remove.
14281 (Sized_relobj::Sized_relobj): Initialize new fields.
14282 (Sized_relobj::include_section_group): Cast find_kept_object to
14283 Sized_relobj.
14284 (Sized_relobj::include_linkonce_section): Likewise.
14285 (Sized_relobj::do_layout): Use separate arrays for output section
14286 and output offset.
14287 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14288 output_sections.
14289 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14290 output_sections and section_offsets.
14291 (Sized_relobj::write_local_symbols): Likewise.
14292 (map_to_kept_section): Compute output address directly.
14293 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14294 output_sections and section_offsets.
14295 (Sized_relobj::write_sections): Likewise.
14296 (Sized_relobj::relocate_sections): Likewise.
14297 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14298 * output.h (class Output_reloc): Update declarations. Change
14299 u2_.relobj to Sized_relobj*.
14300 (class Output_data_reloc): Change add functions to use
14301 Sized_relobj*.
14302 * output.cc (Output_reloc::Output_reloc): Change relobj to
14303 Sized_relobj*.
14304 (Output_reloc::local_section_offset): Change return type to
14305 Elf_Addr. Use get_output_section_offset.
14306 (Output_reloc::get_address): Likewise.
14307 (Output_section::is_input_address_mapped): Don't call
14308 is_section_specially_mapped.
14309 (Output_section::output_offset): Likewise.
14310 (Output_section::output_address): Likewise.
14311 (Output_section::starting_output_address): Likewise.
14312 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14313 parameter to Sized_relobj*.
14314 (Copy_relocs::need_copy_reloc): Likewise.
14315 (Copy_relocs::save): Likewise.
14316 * copy-relocs.h (class Copy_relocs): Update declarations.
14317 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14318 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14319 * target-reloc.h (relocate_for_relocatable): Change
14320 offset_in_output_section type to Elf_Addr. Change code that uses
14321 it as well.
14322 * layout.cc (Layout::layout): Always set *off.
14323 * mapfile.cc (Mapfile::print_input_section): Use
14324 output_section_offset.
14325 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14326 Sized_relobj*.
14327 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14328 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14329 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14330
5cb66f97
ILT
143312008-07-03 Ian Lance Taylor <iant@google.com>
14332
14333 * layout.cc (Layout::include_section): Do not discard unrecognized
14334 SHT_STRTAB sections.
14335
afe47622
CS
143362008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14337
14338 * script.cc (Lex::can_continue_name): Make '?' allowable in
14339 version-script names.
14340 * testsuite/version_script.map: Change glob pattern to use '?'
14341
5adf9721
ILT
143422008-06-30 Manish Singh <yosh@gimp.org>
14343
14344 PR 6585
14345 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14346 Correct typo.
14347
e6fde208
ILT
143482008-06-30 Ian Lance Taylor <iant@google.com>
14349
14350 PR 6660
14351 PR 6682
14352 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14353 versions]: Don't try to read the value in the contents, since we
14354 don't use it. Use the template endianness when writing.
14355
3f2e6a2d
CC
143562008-06-25 Cary Coutant <ccoutant@google.com>
14357
14358 * fileread.cc (File_read::make_view): Assert on zero-length view.
14359 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14360 symbol table when there are no symbols to read.
14361
c43d3a48
CS
143622008-06-23 Craig Silverstein <csilvers@google.com>
14363
14364 * version.cc (version_string): Bump to 1.7
14365
5f494ea0
CS
143662008-06-18 Craig Silverstein <csilvers@google.com>
14367
14368 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14369 constant 0xFFFF to type Valtype.
14370 (Powerpc_relocate_functions::rel16_ha): Likewise.
14371
c42e122e
ILT
143722008-06-17 Ian Lance Taylor <iant@google.com>
14373
f34787f8
ILT
14374 * output.h (Output_section::Input_section): Initialize p2align_ to
14375 zero for Output_section_data constructors.
14376 (Output_section::Input_section::addralign): If not an input
14377 section, return the alignment of the Output_section_data.
14378 * testsuite/copy_test.cc: New file.
14379 * testsuite/copy_test_1.cc: New file.
14380 * testsuite/copy_test_2.cc: New file.
14381 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14382 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14383 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14384 (copy_test_1_pic.o, copy_test_1.so): New targets.
14385 (copy_test_2_pic.o, copy_test_2.so): New targets.
14386 * testsuite/Makefile.in: Rebuild.
14387
c42e122e
ILT
14388 * script-sections.cc (Script_sections::place_orphan): Initialize
14389 local variable exact.
14390
ce3ac18a
DE
143912008-06-13 David Edelsohn <edelsohn@gnu.org>
14392
14393 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14394
42cacb20
DE
143952008-06-12 David Edelsohn <edelsohn@gnu.org>
14396 David S. Miller <davem@davemloft.net>
14397
14398 * powerpc.cc: New file.
14399 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14400 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14401 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14402 * Makefile.in: Rebuild.
14403
7b308235
ILT
144042008-06-09 Ian Lance Taylor <iant@google.com>
14405
14406 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14407 <exception>.
14408 (throwing, orig_terminate): New static variables.
14409 (terminate_handler): New static function.
14410 (t2): Set terminate handler.
14411
f0b886e3
ILT
144122008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14413
14414 PR 6584
cd536b21 14415 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14416 alignment.
14417
3e90f135
CC
144182008-05-30 Cary Coutant <ccoutant@google.com>
14419
14420 * archive.cc (Archive::include_all_members) Correct to step
14421 over symbol table and extended name table in thin archives.
14422
e09ad04a
ILT
144232008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14424
14425 PR 6407
14426 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14427 calculation.
14428
62b01cb5
ILT
144292008-05-28 Caleb Howe <cshowe@google.com>
14430
14431 * reduced_debug_output.cc: New file.
14432 * reduced_debug_output.h: New file.
92de84a6 14433 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14434 * options.cc (General_options::finalize): Add strip_debug_non_line
14435 to the strip heirarchy.
14436 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14437 fields.
14438 * layout.cc: Include "reduced_debug_output.h".
14439 (Layout::Layout): Initialize new fields.
14440 (line_only_debug_sections): New static array.
14441 (is_lines_only_debug_sections): New static inline function.
14442 (Layout::include_section): Handle --strip-debug-non-line.
14443 (Layout::make_output_section): If --strip-debug-non-line, build
14444 new output sections for .debug_abbrev and .debug_info.
14445 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14446 gold. Warn about possible overflow.
14447 (read_signed_LEB_128): Likewise.
14448 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14449 (read_signed_LEB_128): Declare.
14450 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14451 (HFILES): Add reduced_debug_output.h.
14452 * Makefile.in: Rebuild.
14453
7d9e3d98
ILT
144542008-05-21 Ian Lance Taylor <iant@google.com>
14455
14456 * mapfile.cc: New file.
14457 * mapfile.h: New file.
14458 * options.h (class General_options): Add -M/--print-map and -Map.
14459 * options.cc (General_options::finalize): Make -M equivalent to
14460 -Map -.
14461 * main.cc: Include <cstdio> and "mapfile.h".
14462 (main): Open mapfile if requested.
14463 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14464 constructor. Change caller.
14465 (queue_initial_tasks): Add mapfile parameter. Change caller.
14466 (queue_middle_tasks): Likewise.
14467 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14468 declarations.
14469 * archive.cc: Include "mapfile.h".
14470 (Archive::add_symbols): Add mapfile parameter. Change all
14471 callers. Pass mapfile, symbol, and reason to include_member.
14472 (Archive::include_all_members): Add mapfile parameter. Change all
14473 callers.
14474 (Archive::include_member): Add mapfile, sym, and why parameters.
14475 Change all callers. Report inclusion to map file.
14476 * archive.h: Include "fileread.h".
14477 (class Archive): Update declarations.
14478 (Archive::file): New const method.
14479 (class Add_archive_symbols): Add mapfile_ field. Update
14480 constructor. Change all callers.
14481 * readsyms.h (class Read_symbols): Likewise.
14482 (class Finish_group): Likewise.
14483 (class Read_script): Likewise.
14484 * common.cc: Include "mapfile.h".
14485 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14486 all callers.
14487 (Symbol_table::do_allocate_commons): Likewise.
14488 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14489 symbol allocation to mapfile.
14490 * common.h (class Allocate_commons_task): Add mapfile_ field.
14491 Update constructor. Change all callers.
14492 * symtab.h (class Symbol_table): Update declarations.
14493 * layout.cc: Include "mapfile.h".
14494 (Layout_task_runner::run): Print information to mapfile.
14495 (Layout::create_gold_note): Change Output_data_fixed_space to
14496 Output_data_zero_fill.
14497 (Layout::create_build_id): Likewise.
14498 (Layout::print_to_mapfile): New function.
14499 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14500 constructor. Change caller.
14501 (class Layout): Declare print_to_mapfile.
14502 * output.cc (Output_section::Input_section::print_to_mapfile): New
14503 function.
14504 (Output_section::add_input_section): If producing a map, always
14505 add to input_sections_ list.
14506 (Output_section::do_print_to_mapfile): New function.
14507 (Output_segment::print_sections_to_mapfile): New function.
14508 (Output_segment::print_section_list_to_mapfile): New function.
14509 * output.h: Include "mapfile.h".
14510 (Output_data::print_to_mapfile): New function.
14511 (Output_data::do_print_to_mapfile): New virtual function.
14512 (Output_segment_headers::do_print_to_mapfile): New function.
14513 (Output_file_header::do_print_to_mapfile): New function.
14514 (Output_data_const::do_print_to_mapfile): New function.
14515 (class Output_data_const_buffer): Add map_name_ field. Update
14516 constructor. Change all callers. Add do_print_to_mapfile
14517 function.
14518 (class Output_data_fixed_space): Likewise.
14519 (class Output_data_space): Likewise.
14520 (class Output_data_zero_fill): New class.
14521 (Output_data_strtab::do_print_to_mapfile): New function.
14522 (Output_data_reloc_base::do_print_to_mapfile): New function.
14523 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14524 (Output_data_group::do_print_to_mapfile): New function.
14525 (Output_data_got::do_print_to_mapfile): New function.
14526 (Output_data_dynamic::do_print_to_mapfile): New function.
14527 (Output_symtab_xindex::do_print_to_mapfile): New function.
14528 (class Output_section): Declare do_print_to_mapflie. Declare
14529 print_to_mapfile in Input_section.
14530 (class Output_segment): Declare new functions.
14531 * object.h (Sized_relobj::symbol_count): New function.
14532 * script-sections.cc
14533 (Output_section_element_dot_assignment::set_section_addresses):
14534 Change Output_data_fixed_space to Output_data_zero_fill.
14535 (Output_data_expression::do_print_to_mapfile): New function.
14536 * script.cc (read_input_script): Add mapfile parameter. Change
14537 all callers.
14538 * script.h (read_input_script): Update declaration.
14539 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14540 (Eh_frame::do_print_to_mapfile): New function.
14541 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14542 (Output_merge_string::do_print_to_mapfile): New function.
14543 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14544 function.
14545 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14546 function.
14547 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14548 function.
14549 * Makefile.am (CCFILES): Add mapfile.cc.
14550 (HFILES): Add mapfile.h.
14551 * Makefile.in: Rebuild.
14552
9f1d377b
ILT
145532008-05-19 Ian Lance Taylor <iant@google.com>
14554
14555 * options.h (class General_options): Add -z relro.
14556 * layout.cc (Layout::Layout): Initialize relro_segment_.
14557 (Layout::add_output_section_data): Return the output section.
14558 (Layout::make_output_section): Rcognize relro sections and mark
14559 them appropriately.
14560 (Layout::attach_allocated_section_to_segment): Put relro sections
14561 in a PT_GNU_RELRO segment.
14562 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14563 section as relro.
14564 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14565 PT_TLS segments.
14566 (Layout::linkonce_mapping): Map d.rel.ro.local to
14567 .data.rel.ro.local.
14568 (Layout::output_section_name): Us .data.rel.ro.local for any
14569 section which begins with that.
14570 * layout.h (class Layout): Update add_output_section_data
14571 declaration. Add relro_segment_ field.
14572 * output.cc (Output_section::Output_section): Initialize is_relro_
14573 and is_relro_local_ fields.
14574 (Output_segment::add_output_section): Group relro sections.
14575 (Output_segment::is_first_section_relro): New function.
14576 (Output_segment::maximum_alignment): If there is a relro section,
14577 align the segment to the common page size.
14578 (Output_segment::set_section_addresses): Track whether we are
14579 looking at relro sections. If the last section is a relro
14580 section, align to the common page size.
14581 (Output_segment::set_section_list_addresses): Add in_relro
14582 parameter. Change all callers. Align to the page size when
14583 moving from relro to non-relro section.
14584 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14585 segment.
14586 * output.h (class Output_section): Add is_relro_ and
14587 is_relro_local_ fields.
14588 (Output_section::is_relro): New function.
14589 (Output_section::set_is_relro): New function.
14590 (Output_section::is_relro_local): New function.
14591 (Output_section::set_is_relro_local): New function.
14592 (class Output_segment): Update declarations.
14593 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14594 * sparc.cc (Target_sparc::got_section): Likewise.
14595 * x86_64.cc (Target_x86_64::got_section): Likewise.
14596 * testsuite/relro_test_main.cc: New file.
14597 * testsuite/relro_test.cc: New file.
14598 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14599 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14600 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14601 (relro_test.so, relro_test_pic.o): New targets.
14602 * testsuite/Makefile.in: Rebuild.
14603
a984ee1d
ILT
146042008-05-16 Ian Lance Taylor <iant@google.com>
14605
01676dcd
ILT
14606 * output.cc (Output_segment::add_output_section): Remove front
14607 parameter.
14608 * output.h (class Output_segment): Remove
14609 add_initial_output_section and overloaded add_output_section.
14610 Update declaration of remaining add_output_section.
14611 * layout.cc (Layout::create_interp): Call add_output_section
14612 rather than add_initial_output_section.
14613 (Layout::finish_dynamic_section): Likewise.
14614
497897f9
ILT
14615 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14616 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14617 know the dynamic type.
14618 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14619 field. Initialize it in constructor.
14620 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14621 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14622 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14623 reloc.
14624
a984ee1d
ILT
14625 * output.cc (Output_reloc::get_address): Change return type to
14626 Elf_Addr.
14627 * output.h (class Output_reloc): Update get_address declaration.
14628 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14629 for section addresses.
14630
55ba0940
ILT
146312008-05-09 Ian Lance Taylor <iant@google.com>
14632
14633 PR 6493
14634 * gold.cc (gold_nomem): Use return value of write.
14635
75517b77
ILT
146362008-05-08 Ian Lance Taylor <iant@google.com>
14637
14638 * symtab.c (Symbol::init_base_output_data): Add version
14639 parameter. Change all callers.
14640 (Symbol::init_base_output_segment): Likewise.
14641 (Symbol::init_base_constant): Likewise.
14642 (Symbol::init_base_undefined): Likewise.
14643 (Sized_symbol::init_output_data): Likewise.
14644 (Sized_symbol::init_output_segment): Likewise.
14645 (Sized_symbol::init_constant): Likewise.
14646 (Sized_symbol::init_undefined): Likewise.
14647 (Symbol_table::do_define_in_output_data): If the new symbol has a
14648 version, mark it as the default.
14649 (Symbol_table::do_define_in_output_segment): Likewise.
14650 (Symbol_table::do_define_as_constant): Likewise.
14651 * symtab.h (class Symbol): Update declarations.
14652 (class Sized_symbol): Likewise.
14653 * resolve.cc (Symbol::override_version): New function.
c42e122e 14654 (Symbol::override_base): Call override_version.
75517b77
ILT
14655 (Symbol::override_base_with_special): Likewise.
14656 * testsuite/ver_script_8.script: New file.
14657 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14658 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14659 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14660 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14661
f1f70eae
ILT
146622008-05-06 Ian Lance Taylor <iant@google.com>
14663
f3e9c5c5
ILT
14664 PR 6049
14665 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14666 functions.
14667 (class General_options): Remove existing --undefined, and add
14668 --no-undefined instead. Add new --undefined as synonym for -u.
14669 * archive.cc (Archive::add_symbols): Check whether symbol was
14670 named with -u.
14671 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14672 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14673 all uses. Add IS_UNDEFINED. Update declarations to split
14674 different versions of init_base. Declare init_base_undefined.
14675 (Symbol::is_defined): Handle IS_UNDEFINED.
14676 (Symbol::is_undefined): Likewise.
14677 (Symbol::is_weak_undefined): Call is_undefined.
14678 (Symbol::is_absolute): Handle IS_CONSTANT.
14679 (class Sized_symbol): Update declarations to split different
14680 versions of init. Declare init_undefined.
14681 (class Symbol_table): Declare new functions.
14682 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14683 Change all callers.
14684 (Symbol::init_base_output_data): Likewise.
14685 (Symbol::init_base_output_segment): Likewise.
14686 (Symbol::init_base_constant): Likewise.
14687 (Symbol::init_base_undefined): New function.
14688 (Sized_symbol::init_object): Rename from init. Change all
14689 callers.
14690 (Sized_symbol::init_output_data): Likewise.
14691 (Sized_symbol::init_output_segment): Likewise.
14692 (Sized_symbol::init_constant): Likewise.
14693 (Sized_symbol::init_undefined): New function.
14694 (Symbol_table::add_undefined_symbols_from_command_line): New
14695 function.
14696 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14697 function.
14698 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14699 (Symbol::output_section): Likewise.
14700 (Symbol::set_output_section): Likewise.
14701 (Symbol_table::sized_finalize_symbol): Likewise.
14702 (Symbol_table::sized_write_globals): Likewise.
14703 * resolve.cc (Symbol_table::should_override): Likewise.
14704 (Symbol::override_base_with_special): Likewise.
14705
8bdcdf2c
ILT
14706 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14707 symbol, change it to have default visibility.
14708 * testsuite/protected_1.cc: New file.
14709 * testsuite/protected_2.cc: New file.
14710 * testsuite/protected_3.cc: New file.
14711 * testsuite/protected_main_1.cc: New file.
14712 * testsuite/protected_main_2.cc: New file.
14713 * testsuite/protected_main_3.cc: New file.
14714 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14715 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14716 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14717 (protected_1.so): New target.
14718 (protected_1_pic.o, protected_2_pic.o): New targets.
14719 (protected_3_pic.o): New target.
14720 (check_PROGRAMS): Add protected_2.
14721 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14722 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14723 * testsuite/Makefile.in: Rebuild.
14724
2b706932
ILT
14725 * options.h (DEFINE_var): Add set_user_set_##varname__.
14726 (DEFINE_bool_alias): New macro.
14727 (class General_options): Define -Bstatic using DEFINE_bool_alias
14728 rather than DEFINE_special. Add --undefined as an alias for -z
14729 defs.
14730 * options.cc (General_options::parse_Bstatic): Remove.
14731
d82a5bcc
ILT
14732 * options.h (class General_options): Add --fatal-warnings.
14733 * main.cc (main): Implement --fatal-warnings.
14734 * errors.h (Errors::warning_count): New function.
14735
f1f70eae
ILT
14736 * options.h (class General_options): Add -Bsymbolic-functions.
14737 * symtab.h (Symbol::is_preemptible): Check for
14738 -Bsymbolic-functions.
14739
8825ac63
ILT
147402008-05-05 Ian Lance Taylor <iant@google.com>
14741
d98bc257
ILT
14742 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14743 as noVARNAME rather than no-VARNAME.
14744 (class General_options): Add option -z combreloc.
14745 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14746 get_address.
14747 (Output_reloc::sort_before) [SHT_REL]: New function.
14748 (Output_reloc::sort_before) [SHT_RELA]: New function.
14749 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14750 Sort_relocs_comparison.
14751 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14752 parameter. Change all callers.
14753 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14754 sort_relocs parameter. Change all callers.
14755 * output.cc (Output_reloc::get_address): New function, broken out
14756 of write_rel.
14757 (Output_reloc::write_rel): Call it.
14758 (Output_reloc::compare): New function.
14759 (Output_data_reloc_base::do_write): Optionally sort relocs.
14760
60b2b4e7
ILT
14761 * configure.ac: If targ_extra_obj is set, link it in.
14762 * configure.tgt: Initialize all variables.
14763 (x86_64*): Set targ_extra_obj and targ_extra_size.
14764 * configure: Rebuild.
14765
8825ac63
ILT
14766 * object.cc (Sized_relobj::include_section_group): Adjust section
14767 indexes read from group data. Build vector to pass to
14768 layout_group.
14769 * layout.cc (Layout::layout_group): Add flags and shndxes
14770 parameters. Remove contents parameter. Change caller. Update
14771 explicit instantiations.
14772 * layout.h (class Layout): Update layout_group declaration.
14773 * output.cc (Output_data_group::Output_data_group): Add flags and
14774 input_shndxes parameters. Remove contents parameter. Change
14775 caller.
14776 (Output_data_group::do_write): Change input_sections_ to
14777 input_shndxes_.
14778 * output.h (class Output_data_group): Update constructor
14779 declaration. Rename input_sections_ to input_shndxes_.
14780 * testsuite/many_sections_test.cc: Add template.
14781
e94cf127
CC
147822008-04-30 Cary Coutant <ccoutant@google.com>
14783
4418b2d5
CC
14784 * target-reloc.h (relocate_section): Fix dead-pointer bug.
14785
e94cf127
CC
14786 * layout.cc (Layout::include_section): Refactored check for debug
14787 info section.
14788 (Layout::add_comdat): Add new parameters. Change type
14789 of signature parameter. Add object and shndx to signatures table.
14790 (Layout::find_kept_object): New function.
14791 * layout.h: Include <cstring>.
14792 (Layout::is_debug_info_section): New function.
14793 (Layout::add_comdat): Add new parameters.
14794 (Layout::find_kept_object): New function.
14795 (Layout::Kept_section): New struct.
14796 (Layout::Signatures): Change type of map range.
14797 * object.cc (Relobj::output_section_address): New function.
14798 (Sized_relobj::include_section_group): Add new parameters. Change
14799 calls to Layout::add_comdat. Change to build table of kept comdat
14800 groups and table mapping discarded sections to kept sections.
14801 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
14802 (Sized_relobj::do_layout): Change calls to include_section_group and
14803 include_linkonce_section.
14804 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
14805 value to zero when section is discarded.
14806 (Sized_relobj::map_to_kept_section): New function.
14807 * object.h (Relobj::output_section_address): New function.
14808 (Relobj::Comdat_group): New type.
14809 (Relobj::find_comdat_group): New function.
14810 (Relobj::Comdat_group_table): New type.
14811 (Relobj::Kept_comdat_section): New type.
14812 (Relobj::Kept_comdat_section_table): New type.
14813 (Relobj::add_comdat_group): New function.
14814 (Relobj::set_kept_comdat_section): New function.
14815 (Relobj::get_kept_comdat_section): New function.
14816 (Relobj::comdat_groups_): New field.
14817 (Relobj::kept_comdat_sections_): New field.
14818 (Symbol_value::input_value): Update comment.
14819 (Sized_relobj::map_to_kept_section) New function.
14820 (Sized_relobj::include_linkonce_section): Add new parameter.
14821 * target-reloc.h (Comdat_behavior): New type.
14822 (get_comdat_behavior): New function.
14823 (relocate_section): Add code to map a discarded section to the
14824 corresponding kept section when applying a relocation.
14825
e4e5049b
CS
148262008-04-30 Craig Silverstein <csilvers@google.com>
14827
14828 * dwarf_reader.cc (next_generation_count): New static var.
14829 (Addr2line_cache_entry): New struct.
14830 (addr2line_cache): New static var.
14831 (Dwarf_line_info::one_addr2line): Added caching.
14832 (Dwarf_line_info::clear_addr2line_cache): New function.
14833 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
14834 cache-size parameter.
14835 (Dwarf_line_info::one_addr2line_cache): New function.
14836 * symtab.cc (Symbol_table::detect_odr_violations): Pass
14837 new cache-size argument to one_addr2line(), and clear cache.
14838
d09e9154
CC
148392008-04-28 Cary Coutant <ccoutant@google.com>
14840
14841 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
14842 R_386_PC8 relocations.
14843
7ef73768
ILT
148442008-04-23 Ian Lance Taylor <iant@google.com>
14845
55438702
ILT
14846 * object.cc (Sized_relobj::include_section_group): Check for
14847 invalid section group.
14848
c165fb93
ILT
14849 * object.cc (make_elf_object): Correct test for 64-bit ELF file
14850 header size.
14851
7ef73768
ILT
14852 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
14853 than read for file header.
14854 * archive.cc (Archive::include_member): Likewise.
14855
6194aaab
L
148562008-04-23 Paolo Bonzini <bonzini@gnu.org>
14857
14858 * aclocal.m4: Regenerate.
14859 * configure: Regenerate.
14860
d491d34e
ILT
148612008-04-19 Ian Lance Taylor <iant@google.com>
14862
5ea2bac6
ILT
14863 * version.cc (version_string): Bump to 1.6.
14864
7bc3e21a
ILT
14865 * testsuite/Makefile.am (many_sections_r_test): New target.
14866 (many_sections_r_test_SOURCES): Remove.
14867 (many_sections_r_test_DEPENDENCIES): Remove.
14868 (many_sections_r_test_LDFLAGS): Remove.
14869 (many_sections_r_test_LDADD): Remove.
14870
7fcd3aa9
ILT
14871 * object.cc (Sized_relobj::do_add_symbols): Always pass
14872 local_symbol_count_ to add_from_relobj.
14873
4c94d6ae
ILT
14874 * testsuite/Makefile.am (many_sections_check.h): Only check one in
14875 every thousand variables.
14876 * testsuite/Makefile.in: Rebuild.
14877
d491d34e
ILT
14878 * object.cc (Xindex::initialize_symtab_xindex): New function.
14879 (Xindex::read_symtab_xindex): New function.
14880 (Xindex::sym_xindex_to_shndx): New function.
14881 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
14882 available.
14883 (Sized_relobj::do_initialize_xindex): New function.
14884 (Sized_relobj::do_read_symbols): Adjust section links.
14885 (Sized_relobj::symbol_section_and_value): Add is_ordinary
14886 parameter. Change all callers.
14887 (Sized_relobj::include_section_group): Adjust section links and
14888 symbol section indexes.
14889 (Sized_relobj::do_layout): Adjust section links.
14890 (Sized_relobj::do_count_local_symbols): Adjust section links and
14891 symbol section indexes.
14892 (Sized_relobj::do_finalize_local_symbols): Distinguish between
14893 ordinary and special symbols.
14894 (Sized_relobj::write_local_symbols): Add symtab_xindex and
14895 dynsym_xindex parameters. Change all callers. Adjust section
14896 links. Use SHN_XINDEX when needed.
14897 (Sized_relobj::get_symbol_location_info): Adjust section links.
14898 Don't get fooled by special symbols.
14899 * object.h (class Xindex): Define.
14900 (class Object): Add xindex_ parameter. Declare virtual functoin
14901 do_initialize_xindex.
14902 (Object::adjust_sym_shndx): New function.
14903 (Object::set_xindex): New protected function.
14904 (class Symbol_value): Add is_ordinary_shndx_ field.
14905 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
14906 (Symbol_value::value): Assert ordinary section.
14907 (Symbol_value::initialize_input_to_output_map): Likewise.
14908 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
14909 Change all callers.
14910 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
14911 all callers.
14912 (class Sized_relobj): Update declarations.
14913 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
14914 parameter. Change all callers.
14915 (Sized_relobj::adjust_shndx): New function.
14916 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
14917 field.
14918 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
14919 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
14920 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
14921 (Sized_dynobj::read_dynsym_section): Adjust section links.
14922 (Sized_dynobj::read_dynamic): Likewise.
14923 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
14924 section links.
14925 (Sized_dynobj::do_initialize_xindex): New function.
14926 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
14927 do_initialize_xindex.
14928 (Sized_dynobj::adjust_shndx): New function.
14929 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
14930 dynsym_xindex_ fields.
14931 (Layout::finalize): Add a call to set_section_indexes before
14932 creating the symtab sections.
14933 (Layout::set_section_indexes): Don't do anything if the section
14934 already has a section index.
14935 (Layout::create_symtab_sections): Add shnum parameter. Change
14936 caller. Create .symtab_shndx section if needed.
14937 (Layout::create_shdrs): Add shstrtab_section parameter. Change
14938 caller.
14939 (Layout::allocated_output_section_count): New function.
14940 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
14941 needed.
14942 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
14943 fields. Update declarations.
14944 (Layout::symtab_xindex): New function.
14945 (Layout::dynsym_xindex): New function.
14946 (class Write_symbols_task): Add layout_ field.
14947 (Write_symbols_task::Write_symbols_task): Add layout parameter.
14948 Change caller.
14949 * output.cc (Output_section_headers::Output_section_headers): Add
14950 shstrtab_section parameter. Change all callers.
14951 (Output_section_headers::do_sized_write): Store overflow values
14952 for section count and section string table section index in
14953 section header zero.
14954 (Output_file_header::do_sized_write): Check for overflow of
14955 section count and section string table section index.
14956 (Output_symtab_xindex::do_write): New function.
14957 (Output_symtab_xindex::endian_do_write): New function.
14958 * output.h (class Output_section_headers): Add shstrtab_section_.
14959 Update declarations.
14960 (class Output_symtab_xindex): Define.
14961 (Output_section::has_out_shndx): New function.
14962 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
14963 field.
14964 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
14965 Change all callers.
14966 (Sized_symbol::init): Likewise.
14967 (Symbol::output_section): Check for ordinary symbol.
14968 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
14969 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
14970 callers.
14971 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
14972 Change all callers. Simplify handling of symbols from sections
14973 not included in the link.
14974 (Symbol_table::add_from_dynobj): Handle ordinary symbol
14975 distinction.
14976 (Weak_alias_sorter::operator()): Assert that symbols are
14977 ordinary.
14978 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14979 distinction.
14980 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14981 parameters. Change all callers.
14982 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14983 symbol distinction. Use SHN_XINDEX when needed.
14984 (Symbol_table::write_section_symbol): Add symtab_xindex
14985 parameter. Change all callers.
14986 (Symbol_table::sized_write_section_symbol): Likewise. Use
14987 SHN_XINDEX when needed.
14988 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14989 declarations.
14990 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14991 (Symbol::is_defined): Check is_ordinary.
14992 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14993 (Symbol::is_absolute, Symbol::is_common): Likewise.
14994 (class Sized_symbol): Update declarations.
14995 (class Symbol_table): Update declarations.
14996 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14997 parameters. Change all callers.
14998 (Sized_symbol::override): Likewise.
14999 (Symbol_table::override): Likewise.
15000 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15001 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15002 is_ordinary, and orig_st_shndx parameters. Change all callers.
15003 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15004 to be in an ordinary section.
15005 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15006 object and is_ordinary parameters. Change all callers.
15007 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15008 Change all callers. Don't add undefined or non-ordinary symbols
15009 to reloc_map_.
15010 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15011 Change all callers.
15012 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15013 declarations.
15014 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15015 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15016 (Sized_relobj::relocate_sections): Likewise.
15017 * target-reloc.h (scan_relocs): Adjust section symbol index.
15018 (scan_relocatable_relocs): Likewise.
15019 * i386.cc (Scan::local): Check for ordinary symbols.
15020 * sparc.cc (Scan::local): Likewise.
15021 * x86_64.cc (Scan::local): Likewise.
15022 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15023 to symbol_section_and_value.
15024 * testsuite/many_sections_test.cc: New file.
15025 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15026 (check_PROGRAMS): Add many_sections_test.
15027 (many_sections_test_SOURCES): Define.
15028 (many_sections_test_DEPENDENCIES): Define.
15029 (many_sections_test_LDFLAGS): Define.
15030 (BUILT_SOURCES): Add many_sections_define.h.
15031 (many_sections_define.h): New target.
15032 (BUILT_SOURCES): Add many_sections_check.h.
15033 (many_sections_check.h): New target.
15034 (check_PROGRAMS): Add many_sections_r_test.
15035 (many_sections_r_test_SOURCES): Define.
15036 (many_sections_r_test_DEPENDENCIES): Define.
15037 (many_sections_r_test_LDFLAGS): Define.
15038 (many_sections_r_test_LDADD): Define.
15039 (many_sections_r_test.o): New target.
15040 * testsuite/Makefile.in: Rebuild.
15041
c5818ff1
CC
150422008-04-17 Cary Coutant <ccoutant@google.com>
15043
15044 * errors.cc (Errors::info): New function.
15045 (gold_info): New function.
15046 * errors.h (Errors::info): New function.
15047 * gold.h (gold_info): New function.
15048 * object.cc (Input_objects::add_object): Print trace output.
15049 * options.cc (options::parse_set): New function.
15050 (General_options::parse_wrap): Deleted.
15051 (General_options::General_options): Deleted initializer.
15052 * options.h (options::String_set): New typedef.
15053 (options::parse_set): New function.
15054 (DEFINE_set): New macro.
15055 (General_options::wrap): Changed to use DEFINE_set. Changed
15056 callers of any_wrap_symbols and is_wrap_symbol.
15057 (General_options::trace, General_options::trace_symbol):
15058 New options.
15059 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15060 (General_options::wrap_symbols_): Deleted.
15061 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15062
b5be4a7c
DM
150632008-04-17 David S. Miller <davem@davemloft.net>
15064
15065 * options.cc (General_options::parse_V): New function.
15066 * options.h: Add entries for -V and -Qy.
15067
155a0dd7
ILT
150682008-04-17 Ian Lance Taylor <iant@google.com>
15069
15070 * common.cc (Symbol_table::allocate_commons): Remove options
15071 parameter. Change caller.
15072 (Symbol_table::do_allocate_commons): Remove options parameter.
15073 Change caller. Just call do_allocate_commons_list twice.
15074 (Symbol_table::do_allocate_commons_list): New function, broken out
15075 of do_allocate_commons.
15076 * common.h (class Allocate_commons_task): Remove options_ field.
15077 Update constructor.
15078 * symtab.cc (Symbol_table::Symbol_table): Initialize
15079 tls_commons_.
15080 (Symbol_table::add_from_object): Put TLS common symbols on
15081 tls_commons_ list.
15082 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15083 which are IN_OUTPUT_DATA.
15084 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15085 allocate_commons and do_allocate_commons declarations. Declare
15086 do_allocate_commons_list.
15087 * gold.cc (queue_middle_tasks): Update creation of
15088 Allocate_commons_task to not pass options.
15089 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15090 (TLS_TEST_C_FLAGS): New variable.
15091 (tls_test_c_pic.o): New target.
15092 (tls_test_shared.so): Link in tls_test_c_pic.o.
15093 (tls_test_c_pic_ie.o): New target.
15094 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15095 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15096 (tls_test_c.o): New target.
15097 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15098 (tls_pic_test_LDADD): Likewise.
15099 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15100 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15101 (tls_test_c_gnu2.o): New target.
15102 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15103 tls_test_c_gnu2.o.
15104 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15105 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15106 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15107 * testsuite/tls_test.cc: Include "config.h".
15108 (t_last): Call t11_last.
15109 * testsuite/tls_test.h (t11, t11_last): Declare.
15110 * testsuite/tls_test_c.c: New file.
15111 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15112 * configure.ac: Check for OpenMP support.
15113 * configure, config.in, Makefile.in: Rebuild.
15114 * testsuite/Makefile.in: Rebuild.
15115
edfbb029
CC
151162008-04-16 Cary Coutant <ccoutant@google.com>
15117
15118 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15119 (Target_i386::tls_base_symbol_defined_): New field.
15120 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15121 (Target_i386::Scan::global): Likewise.
15122 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15123 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15124 (Target_x86_64::tls_base_symbol_defined_): New field.
15125 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15126 (Target_x86_64::Scan::global): Likewise.
15127
f3c69fca
CC
151282008-04-16 Cary Coutant <ccoutant@google.com>
15129
15130 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15131 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15132 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15133 building shared libraries.
15134 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15135 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15136 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15137 * testsuite/Makefile.in: Rebuild.
15138 * testsuite/weak_undef.h: New file.
15139 * testsuite/weak_undef_file1.cc: Add extra test cases.
15140 * testsuite/weak_undef_file2.cc: Likewise.
15141 * testsuite/weak_undef_test.cc: Likewise.
15142
7c414435
DM
151432008-04-16 David S. Miller <davem@davemloft.net>
15144
32b769e1
DM
15145 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15146 Add issued_non_pic_error_ field. Declare check_non_pic.
15147 (Target_sparc::Scan::check_non_pic): New function.
15148 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15149 (Target_sparc::Scan::global): Likewise.
15150
11936fb1
DM
15151 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15152 * configure: Rebuild.
15153
7c414435
DM
15154 * options.h (DEFINE_enable): New macro.
15155 (new_dtags): New enable option.
15156 (initfirst, interpose, loadfltr, nodefaultlib,
15157 nodelete, nodlopen, nodump): New -z options.
15158 * layout.cc (Layout:finish_dynamic_section): If new
15159 dtags enabled, emit DT_RUNPATH. Also, emit a
15160 DT_FLAGS_1 containing any specified -z flags.
15161
85c7bf8b
ILT
151622008-04-16 Ian Lance Taylor <iant@google.com>
15163
12c0daef
ILT
15164 * copy-relocs.cc: New file.
15165 * copy-relocs.h: New file.
15166 * reloc.cc: Remove Copy_relocs code.
15167 * reloc.h: Likewise.
15168 * reloc-types.h (struct Reloc_types) [both versions]: Add
15169 get_reloc_addend_noerror.
15170 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15171 variants of add_global which take an addend which must be zero.
15172 * i386.cc: Include "copy-relocs.h".
15173 (class Target_i386): Change type of copy_relocs_ to variable,
15174 update initializer.
15175 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15176 Change all callers.
15177 (Target_i386::do_finalize_sections): Change handling of
15178 copy_relocs_.
15179 * sparc.cc: Include "copy-relocs.h".
15180 (class Target_sparc): Change type of copy_relocs_ to variable,
15181 update initializer.
15182 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15183 Change all callers.
15184 (Target_sparc::do_finalize_sections): Change handling of
15185 copy_relocs_.
15186 * x86_64.cc: Include "copy-relocs.h".
15187 (class Target_x86_64): Change type of copy_relocs_ to variable,
15188 update initializer.
15189 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15190 class. Change all callers.
15191 (Target_x86_64::do_finalize_sections): Change handling of
15192 copy_relocs_.
15193 * Makefile.am (CCFILES): Add copy-relocs.cc.
15194 (HFILES): Add copy-relocs.h.
15195
4f4995b6
ILT
15196 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15197
85c7bf8b
ILT
15198 * testsuite/script_test_4.sh: Permit leading zeroes.
15199
4f2a9edd
ILT
152002008-04-15 Ian Lance Taylor <iant@google.com>
15201
e6188289
ILT
15202 * script-sections.cc (Script_sections::create_segments): Use
15203 header_size_adjustment even when there is enough room for the
15204 headers.
15205 * testsuite/script_test_4.sh: New file.
15206 * testsuite/script_test_4.t: New file.
15207 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15208 (check_DATA): Add script_test_4.stdout.
15209 (MOSTLYCLEANFILES): Likewise.
15210 (script_test_4): New target.
15211 (script_test_4.stdout): New target.
15212 * testsuite/Makefile.in: Rebuild.
15213
4f2a9edd
ILT
15214 * sparc.cc: Add definitions for Output_data_plt_sparc class
15215 constants.
15216
f5314dd5
DM
152172008-04-14 David S. Miller <davem@davemloft.net>
15218
15219 * sparc.cc: New file.
15220 * Makefile.am (TARGETSOURCES): Add sparc.cc
15221 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15222 * configure.tgt: Document targ_extra_size and
15223 targ_extra_big_endian. Add entries for sparc-* and
15224 sparc64-*.
15225 * configure.ac: Handle targ_extra_size and
15226 targ_extra_big_endian.
15227 * Makefile.in: Rebuild.
15228 * configure: Likewise.
15229 * po/POTFILES.in: Likewise.
15230 * po/gold.pot: Likewise.
15231
154e0e9a
ILT
152322008-04-14 Ian Lance Taylor <iant@google.com>
15233
15234 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15235 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15236 in the name/type/flags to section mapping. Don't call
15237 allocate_output_section.
15238 (Layout::choose_output_section): Change parameter from adjust_name
15239 to is_input_section. Don't permit input sections after sections
15240 are attached to segments. Don't call allocate_output_section.
15241 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15242 not write_enable_output_section.
15243 (Layout::make_output_section): Don't push to
15244 unattached_section_list_ nor call attach_to_segment. Call
15245 attach_section_to_segment if sections are attached.
15246 (Layout::attach_sections_to_segments): New function.
15247 (Layout::attach_section_to_segment): New function.
15248 (Layout::attach_allocated_section_to_segment): Rename from
15249 attach_to_segment. Remove flags parameter.
15250 (Layout::allocate_output_section): Remove function.
15251 (Layout::write_enable_output_section): Remove function.
15252 * layout.h (class Layout): Update for above changes. Add new
15253 field sections_are_attached_.
15254 * output.h (Output_section::update_flags_for_input_section): New
15255 function.
15256 * output.cc (Output_section::add_input_section): Call
15257 update_flags_for_input_section.
15258 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15259
009a67a2
CC
152602008-04-11 Cary Coutant <ccoutant@google.com>
15261
15262 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15263 thought unnecessary.
15264 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15265
759b1a24
ILT
152662008-04-11 Ian Lance Taylor <iant@google.com>
15267
15268 * output.h (class Output_section_data): Remove inline definition
15269 of set_addralign.
15270 * output.cc (Output_section_data::set_addralign): New function.
15271
c2b45e22
CC
152722008-04-11 Cary Coutant <ccoutant@google.com>
15273
15274 Add support for TLS descriptors for i386 and x86_64.
15275 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15276 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15277 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15278 GOT_TYPE_TLS_DESC.
15279 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15280 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15281 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15282 relocations.
15283 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15284 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15285 Fix problem with initial-exec relocations.
15286 (Target_i386::Relocate::relocate_tls): Likewise.
15287 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15288 relaxation.
15289 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15290 support for section-plus-offset dynamic table entries.
15291 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15292 (Output_data_dynamic::Dynamic_entry): Add support for
15293 section-plus-offset dynamic table entries.
15294 (Output_data_dynamic::Classification): Likewise.
15295 (Output_data_dynamic::classification_): Renamed offset_.
15296 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15297 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15298 (Target_x86_64::make_plt_section): New function.
15299 (Target_x86_64::reserve_tlsdesc_entries): New function.
15300 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15301 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15302 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15303 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15304 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15305 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15306 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15307 add extra PLT entry for TLS descriptors.
15308 (Output_data_plt_x86_64::got_): New field.
15309 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15310 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15311 fields.
15312 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15313 descriptors.
15314 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15315 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15316 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15317 R_386_TLS_DESC_CALL relocations.
15318 (Target_x86_64::Scan::global): Likewise.
15319 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15320 for TLS descriptors.
15321 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15322 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15323 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15324 GD-to-IE relaxation.
15325 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15326 and TLS_DESCRIPTORS.
15327 * Makefile.in: Rebuild.
15328 * configure: Rebuild.
15329 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15330 (tls_test_shared2.so): New target.
15331 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15332 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15333 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15334 (tls_shared_gd_to_ie_test_LDADD): New variable.
15335 (tls_shared_gnu2_gd_to_ie_test): New target.
15336 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15337 New targets.
15338 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15339 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15340 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15341 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15342 (tls_shared_gnu2_test): New target.
15343 (tls_test_gnu2_shared.so): New target.
15344 (tls_shared_gnu2_test_SOURCES): New variable.
15345 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15346 (tls_shared_gnu2_test_LDFLAGS): New variable.
15347 (tls_shared_gnu2_test_LDADD): New variable.
15348 * testsuite/Makefile.in: Rebuild.
15349 * testsuite/Makefile.
15350
83bfb6b7
ILT
153512008-04-11 Ian Lance Taylor <iant@google.com>
15352
15353 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15354 justsyms.t.
15355 * testsuite/Makefile.in: Rebuild.
15356
15357 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15358 long.
15359 * testsuite/script_test_2.cc (main): Adjust test.
15360
706e1f5e
ILT
153612008-04-11 David S. Miller <davem@davemloft.net>
15362 Ian Lance Taylor <iant@google.com>
15363
15364 * options.h (General_options): Add entries for '-Y' and
15365 '-relax'.
15366 * options.cc (General_options:finalize): If -Y was used, add those
15367 entries to the library path instead of the default "/lib" and
15368 "/usr/lib".
15369
7c98e6bb
DM
153702008-04-11 David S. Miller <davem@davemloft.net>
15371
15372 * testsuite/justsyms.t: Start at 0x100.
15373 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15374 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15375 long.
15376 * testsuite/script_test_2.cc: Adjust string and section length
15377 checks.
7c98e6bb 15378
99a37bfd
ILT
153792008-04-09 Ian Lance Taylor <iant@google.com>
15380
2cefc357
ILT
15381 PR gold/5996
15382 * script-sections.cc (Sections_element::allocate_to_segment): Add
15383 orphan parameter.
15384 (Output_section_definition::allocate_to_segment): Likewise.
15385 (Orphan_output_section::allocate_to_segment): Likewise.
15386 (Script_sections::attach_sections_using_phdrs_clause): Don't
15387 propagate non-PT_LOAD segments to orphan sections.
15388 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15389 readelf rather than objdump.
15390 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15391 .interp section and PT_INTERP segment are the same size.
15392 * testsuite/Makefile.in: Rebuild.
15393
99a37bfd
ILT
15394 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15395 aliases for symbols defined in the same object.
15396 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15397 (weak_alias_test_SOURCES): New variable.
15398 (weak_alias_test_DEPENDENCIES): New variable.
15399 (weak_alias_test_LDFLAGS): New variable.
15400 (weak_alias_test_LDADD): New variable.
15401 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15402 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15403 (weak_alias_test_3.o): New target.
15404 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15405 * testsuite/weak_alias_test_main.cc: New file.
15406 * testsuite/weak_alias_test_1.cc: New file.
15407 * testsuite/weak_alias_test_2.cc: New file.
15408 * testsuite/weak_alias_test_3.cc: New file.
15409
780e49c5
ILT
154102008-04-08 Ian Lance Taylor <iant@google.com>
15411
cdb0b8f5
ILT
15412 * options.h (class General_options): Add --noinhibit-exec option.
15413 * main.cc (main): Check --noinhibit-exec.
15414
0864d551
ILT
15415 * options.h (class General_options): Define --wrap as a special
15416 option. Add wrap_symbols_ field.
15417 (General_options::any_wrap_symbols): New function.
15418 (General_options::is_wrap_symbol): New function.
15419 * options.cc (General_options::parse_wrap): New function.
15420 (General_options::General_options): Initialize wrap_symbols_.
15421 * symtab.cc (Symbol_table::wrap_symbol): New function.
15422 (Symbol_table::add_from_object): Handle --wrap.
15423 * symtab.h (class Symbol_table): Declare wrap_symbol.
15424 * target.h (Target::wrap_char): New function.
15425 (Target::Target_info): Add wrap_char field.
15426 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15427 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15428 * testsuite/testfile.cc (Target_test::test_target_info):
15429 Likewise.
15430
789aa6de
ILT
15431 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15432 there is one.
15433
2c38906f
ILT
15434 * layout.h (class Layout): Add added_eh_frame_data_ field.
15435 * layout.cc (Layout::Layout): Initialize new field.
15436 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15437 output section until we find a section we merged successfully.
15438 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15439 that the size be non-zero.
15440
780e49c5
ILT
15441 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15442 qualifier.
15443
7fcd0256
ILT
154442008-04-08 Craig Silverstein <csilvers@google.com>
15445
15446 * configure.ac: Export new conditional variable HAVE_ZLIB.
15447 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15448 on HAVE_ZLIB.
15449 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15450 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15451
6835af53
ILT
154522008-04-07 Ian Lance Taylor <iant@google.com>
15453
e24f324c
ILT
15454 * version.cc (version_string): Set to "1.5".
15455
a036edd8
ILT
15456 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15457 Add issued_non_pic_error_ field. Declare check_non_pic.
15458 (Target_x86_64::Scan::check_non_pic): New function.
15459 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15460 (Target_x86_64::Scan::global): Likewise.
15461
624f8810
ILT
15462 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15463 addend parameter. Change caller. Handle merge sections.
15464 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15465 Address to Addend. Don't add in the result of
15466 local_section_offset, pass down the addend and use the returned
15467 value.
15468 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15469 Update declarations of local_section_offset and symbol_value.
15470 * testsuite/two_file_test_1.cc (t18): New function.
15471 * testsuite/two_file_test_2.cc (f18): New function.
15472 * testsuite/two_file_test_main.cc (main): Call t18.
15473 * testsuite/two_file_test.h (t18, f18): Declare.
15474
6835af53
ILT
15475 * configure.ac: Don't test for objdump, c++filt, or readelf.
15476 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15477 conditionals.
15478 (TEST_READELF): New variable.
15479 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15480 (check_PROGRAMS): Add two_file_strip_test.
15481 (two_file_strip_test): New target.
15482 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15483 (two_file_same_shared_strip_test_SOURCES): New variable.
15484 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15485 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15486 (two_file_same_shared_strip_test_LDADD): New variable.
15487 (two_file_shared_strip.so): New target.
15488 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15489 (ver_test_5.syms, ver_test_7.syms): Likewise.
15490 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15491 (strip_test_3.stdout): Use TEST_OBJDUMP.
15492 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15493
86925eef
CC
154942008-04-04 Cary Coutant <ccoutant@google.com>
15495
15496 * symtab.h (Symbol::is_weak_undefined): New function.
15497 (Symbol::is_strong_undefined): New function.
15498 (Symbol::is_absolute): New function.
15499 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15500 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15501 absolute symbols.
15502 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15503 (weak_undef_test): New target.
15504 * testsuite/Makefile.in: Rebuild.
15505 * testsuite/weak_undef_file1.cc: New file.
15506 * testsuite/weak_undef_file2.cc: New file.
15507 * testsuite/weak_undef_test.cc: New file.
15508
126f3ece
ILT
155092008-04-03 Craig Silverstein <csilvers@google.com>
15510
15511 * compressed_output.h (class Output_compressed_section): Use
15512 unsigned buffer.
15513 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15514 add zlib header.
15515 (zlib_compressed_suffix): Removed.
15516 (Output_compressed_section::set_final_data_size): Use unsigned
15517 buffers.
15518 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15519 Fix linker invocation.
15520 (flagstest_o_specialfile_and_compress_debug_sections):
15521 Likewise.
15522 * testsuite/Makefile.in: Regenerated.
15523
deae2a14
DM
155242008-04-02 David S. Miller <davem@davemloft.net>
15525
15526 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15527 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15528
70752818
ILT
155292008-04-02 Craig Silverstein <csilvers@google.com>
15530
15531 * TODO: New file.
15532
39d0cb0e
ILT
155332008-04-02 Ian Lance Taylor <iant@google.com>
15534
15535 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15536 parameters. Update for new key type to views_. Change all
15537 callers.
15538 (File_read::read): Adjust for byteshift in returned view.
15539 (File_read::add_view): New function, broken out of
15540 find_and_make_view.
15541 (File_read::make_view): New function, broken out of
15542 find_and_make_view.
15543 (File_read::find_or_make_view): Add offset and aligned
15544 parameters. Rewrite accordingly. Change all callers.
15545 (File_read::get_view): Add offset and aligned parameters. Adjust
15546 for byteshift in return value.
15547 (File_read::get_lasting_view): Likewise.
15548 * fileread.h (class File_read): Update declarations.
15549 (class File_read::View): Add byteshift_ field. Add byteshift to
15550 constructor. Add byteshift method.
15551 * archive.h (Archive::clear_uncached_views): New function.
15552 (Archive::get_view): Add aligned parameter. Change all callers.
15553 * object.h (Object::get_view): Add aligned parameter. Change all
15554 callers.
15555 (Object::get_lasting_view): Likewise.
15556
15557 * fileread.cc (File_read::release): Don't call clear_views if
15558 there are multiple objects.
15559 * fileread.h (File_read::clear_uncached_views): New function.
15560 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15561 on the archive.
15562
a1207466
CC
155632008-03-31 Cary Coutant <ccoutant@google.com>
15564
15565 Add thin archive support.
15566 * archive.cc (Archive::armagt): New const.
15567 (Archive::setup): Remove task parameter and calls to unlock.
15568 (Archive::unlock_nested_archives): New function.
15569 (Archive::read_header): Add nested_off parameter. Change
15570 all callers.
15571 (Archive::interpret_header): Likewise.
15572 (Archive::include_all_members): Change to handle thin
15573 archives.
15574 (Archive::include_member): Likewise.
15575 * archive.h (Archive::Archive): Add new parameters and
15576 initializers.
15577 (Archive::armagt): New const.
15578 (Archive::setup): Remove task parameter.
15579 (Archive::unlock_nested_archives): New function.
15580 (Archive::read_header): Add nested_off parameter.
15581 (Archive::interpret_header): Likewise.
15582 (Archive::Nested_archive_table): New typedef.
15583 (Archive::is_thin_archive_): New field.
15584 (Archive::nested_archives_): New field.
15585 (Archive::options_): New field.
15586 (Archive::dirpath_): New field.
15587 (Archive::task_): New field.
15588 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15589 for thin archives. Pass additional parameters to
15590 Archive::Archive. Unlock the archive file after calling
15591 Archive::setup.
cd536b21 15592
479f6503
ILT
155932008-03-29 Ian Lance Taylor <iant@google.com>
15594
686c8caf
ILT
15595 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15596 version symbol to be local.
15597 * testsuite/ver_test_4.sh: New file.
15598 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15599 (check_DATA): Add ver_test_4.syms.
15600 (ver_test_4.syms): New target.
15601 * testsuite/Makefile.in: Rebuild.
15602
ab794b6b
ILT
15603 * output.cc
15604 (Output_section::Input_section_sort_entry::has_priority): New
15605 function.
15606 (Output_section::Input_section_sort_entry::match_file_name): New
15607 function.
15608 (Output_section::Input_section_sort_entry::match_section_name):
15609 Remove.
15610 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15611 Remove.
15612 (Output_section::Input_section_sort_entry::match_section_file):
15613 Remove.
15614 (Output_section::Input_section_sort_compare::operator()): Rewrite
15615 using new Input_section_sort_entry functions. Sort crtbegin and
15616 crtend first. Sort sections with no priority before sections with
15617 a priority.
15618 * testsuite/initpri1.c (d3): Check j != 4.
15619 (cd5): New constructor/destructor function.
15620 (main): Check j != 2.
15621
479f6503
ILT
15622 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15623 new symbol when resolving, don't call set_is_default.
15624 * testsuite/ver_test_7.cc: New file.
15625 * testsuite/ver_test_7.sh: New file.
15626 * testsuite/Makefile.am (ver_test_7.so): New target.
15627 (ver_test_7.o): New target.
15628 (check_SCRIPTS): Add ver_test_7.sh.
15629 (check_DATA): Add ver_test_7.syms.
15630 (ver_test_7.syms): New target.
15631
2fd32231
ILT
156322008-03-28 Ian Lance Taylor <iant@google.com>
15633
15634 * layout.cc (Layout::layout): If we see an input section with a
15635 name that needs sorting, set the must_sort flag for the output
15636 section.
15637 (Layout::make_output_section): If the name of the output section
15638 indicates that it might require sorting, set the may_sort flag.
15639 * output.h (Output_section::may_sort_attached_input_sections): New
15640 function.
15641 (Output_section::set_may_sort_attached_input_sections): New
15642 function.
15643 (Output_section::must_sort_attached_input_sections): New
15644 function.
15645 (Output_section::set_must_sort_attached_input_sections): New
15646 function.
15647 (class Output_section): Declare Input_section_sort_entry. Define
15648 Input_section_sort_compare. Declare
15649 sort_attached_input_sections. Add new fields:
15650 may_sort_attached_input_sections_,
15651 must_sort_attached_input_sections_,
15652 attached_input_sections_are_sorted_.
15653 * output.cc (Output_section::Output_section): Initialize new
15654 fields.
15655 (Output_section::add_input_section): Add an entry to
15656 input_sections_ if may_sort or must_sort are true.
15657 (Output_section::set_final_data_size): Call
15658 sort_attached_input_sections if necessary.
15659 (Output_section::Input_section_sort_entry): Define new class.
15660 (Output_section::Input_section_sort_compare::operator()): New
15661 function.
15662 (Output_section::sort_attached_input_sections): New function.
15663 * configure.ac: Check whether the compiler supports constructor
15664 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15665 * testsuite/initpri1.c: New file.
15666 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15667 CONSTRUCTOR_PRIORITY.
15668 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15669 (initpri1_LDFLAGS): New variable.
15670 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15671
18e6b24e
ILT
156722008-03-27 Ian Lance Taylor <iant@google.com>
15673
49bdd526
ILT
15674 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15675 * testsuite/common_test_1.c: New file.
15676 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15677 (common_test_1_SOURCES): New variable.
15678 (common_test_1_DEPENDENCIES): New variable.
15679 (common_test_1_LDFLAGS): New variable.
15680
18e6b24e
ILT
15681 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15682 and commons_ correctly when NAME/VERSION does not override
15683 NAME/NULL.
15684 * testsuite/ver_test_6.c: New file.
15685 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15686 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15687 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15688
04bf7072
ILT
156892008-03-26 Ian Lance Taylor <iant@google.com>
15690
5871526f
ILT
15691 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15692 of an undefined symbol from a version script.
15693 * testsuite/Makefile.am (ver_test_5.so): New target.
15694 (ver_test_5.o): New target.
15695 (check_SCRIPTS): Add ver_test_5.sh.
15696 (check_DATA): Add ver_test_5.syms.
15697 (ver_test_5.syms): New target.
15698 * testsuite/ver_test_5.cc: New file.
15699 * testsuite/ver_test_5.script: New file.
15700 * testsuite/ver_test_5.sh: New file.
15701 * Makefile.in, testsuite/Makefile.in: Rebuild.
15702
04bf7072
ILT
15703 PR gold/5986
15704 Fix problems building gold with gcc 4.3.0.
15705 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15706 (gold_error_at_location, gold_warning_at_location): Use it.
15707 * configure.ac: Check whether we can compile and use a template
15708 function with a printf attribute.
15709 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15710 when jumping over bytes.
15711 * object.cc: Instantiate Object::read_section_data.
15712 * debug.h: Include <cstring>
15713 * dwarf_reader.cc: Include <algorithm>
15714 * main.cc: Include <cstring>.
15715 * options.cc: Include <cstring>.
15716 * output.cc: Include <cstring>.
15717 * script.cc: Include <cstring>.
15718 * script.h: Include <string>.
15719 * symtab.cc: Include <cstring> and <algorithm>.
15720 * target-select.cc: Include <cstring>.
15721 * version.cc: Include <string>.
15722 * testsuite/testmain.cc: Include <cstdlib>.
15723 * configure, config.in: Rebuild.
15724
874c5b28
ILT
157252008-03-25 Ian Lance Taylor <iant@google.com>
15726
819d6c3a
ILT
15727 * options.cc: Include "../bfd/bfdver.h".
15728 (options::help): Print bug reporting address.
15729
f4b2c6f5
ILT
15730 * version.cc (print_version): Adjust output for current value of
15731 BFD_VERSION_STRING.
15732
15733 * NEWS: New file.
15734
e96caa79
ILT
15735 * options.cc (options::help): Print list of supported targets.
15736 * target-select.h: Include <vector>.
15737 (class Target_selector): Make machine_, size_, and is_big_endian_
15738 fields const. Add bfd_name_ and instantiated_target_ fields.
15739 (Target_selector::Target_selector): Add bfd_name parameter.
15740 (Target_selector::recognize): Make non-virtual, call
15741 do_recognize.
15742 (Target_selector::recognize_by_name): Make non-virtual, call
15743 do_recognize_by_name.
15744 (Target_selector::supported_names): New function.
15745 (Target_selector::bfd_name): New function.
15746 (Target_selector::do_instantiate_target): New pure virtual
15747 function.
15748 (Target_selector::do_recognize): New virtual function.
15749 (Target_selector::do_recognize_by_name): New virtual function.
15750 (Target_selector::instantiate_target): New private function.
15751 (supported_target_names): Declare.
15752 * target-select.cc (Target_selector::Target_selector): Update for
15753 new parameter and fields.
15754 (select_target_by_name): Check that the name matches before
15755 calling recognize_by_name.
15756 (supported_target_names): New function.
15757 * i386.cc (class Target_selector_i386): Update Target_selector
15758 constructor call. Remove recognize and recognize_by_name. Add
15759 do_instantiate_target.
15760 * x86_64.cc (class Target_selector_x86_64): Likewise.
15761 * testsuite/testfile.cc (class Target_selector_test): Update for
15762 changes to Target_selector.
15763
874c5b28
ILT
15764 * README: Rewrite, with some notes on unsupported features.
15765
0a65a3a7
CC
157662008-03-24 Cary Coutant <ccoutant@google.com>
15767
15768 * i386.cc (Target_i386::Got_type): New enum declaration.
15769 (Target_i386::Scan::local): Updated callers of Output_data_got
15770 member functions.
15771 (Target_i386::Scan::global): Likewise.
15772 (Target_i386::Relocate::relocate): Likewise.
15773 (Target_i386::Relocate::relocate_tls): Likewise.
15774 * object.h (Got_offset_list): New class.
15775 (Sized_relobj::local_has_got_offset): Added got_type parameter.
15776 (Sized_relobj::local_got_offset): Likewise.
15777 (Sized_relobj::set_local_got_offset): Likewise.
15778 (Sized_relobj::local_has_tls_got_offset): Removed.
15779 (Sized_relobj::local_tls_got_offset): Removed.
15780 (Sized_relobj::set_local_tls_got_offset): Removed.
15781 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
15782 * output.cc (Output_data_got::add_global): Added got_type parameter.
15783 (Output_data_got::add_global_with_rel): Likewise.
15784 (Output_data_got::add_global_with_rela): Likewise.
15785 (Output_data_got::add_global_pair_with_rel): New function.
15786 (Output_data_got::add_global_pair_with_rela): New function.
15787 (Output_data_got::add_local): Added got_type parameter.
15788 (Output_data_got::add_local_with_rel): Likewise.
15789 (Output_data_got::add_local_with_rela): Likewise.
15790 (Output_data_got::add_local_pair_with_rel): New function.
15791 (Output_data_got::add_local_pair_with_rela): New function.
15792 (Output_data_got::add_global_tls): Removed.
15793 (Output_data_got::add_global_tls_with_rel): Removed.
15794 (Output_data_got::add_global_tls_with_rela): Removed.
15795 (Output_data_got::add_local_tls): Removed.
15796 (Output_data_got::add_local_tls_with_rel): Removed.
15797 (Output_data_got::add_local_tls_with_rela): Removed.
15798 * output.h (Output_data_got::add_global): Added got_type parameter.
15799 (Output_data_got::add_global_with_rel): Likewise.
15800 (Output_data_got::add_global_with_rela): Likewise.
15801 (Output_data_got::add_global_pair_with_rel): New function.
15802 (Output_data_got::add_global_pair_with_rela): New function.
15803 (Output_data_got::add_local): Added got_type parameter.
15804 (Output_data_got::add_local_with_rel): Likewise.
15805 (Output_data_got::add_local_with_rela): Likewise.
15806 (Output_data_got::add_local_pair_with_rel): New function.
15807 (Output_data_got::add_local_pair_with_rela): New function.
15808 (Output_data_got::add_global_tls): Removed.
15809 (Output_data_got::add_global_tls_with_rel): Removed.
15810 (Output_data_got::add_global_tls_with_rela): Removed.
15811 (Output_data_got::add_local_tls): Removed.
15812 (Output_data_got::add_local_tls_with_rel): Removed.
15813 (Output_data_got::add_local_tls_with_rela): Removed.
15814 * resolve.cc (Symbol::override_base_with_special): Removed
15815 reference to has_got_offset_ field.
15816 * symtab.cc (Symbol::init_fields): Replaced initialization
15817 of got_offset_ with got_offsets_. Removed initialization
15818 of has_got_offset_
53fcba31 15819 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
15820 (Symbol::got_offset): Likewise.
15821 (Symbol::set_got_offset): Likewise.
15822 (Symbol::has_tls_got_offset): Removed.
15823 (Symbol::tls_got_offset): Removed.
15824 (Symbol::set_tls_got_offset): Removed.
15825 (Symbol::got_offset_): Removed.
15826 (Symbol::tls_mod_got_offset_): Removed.
15827 (Symbol::tls_pair_got_offset_): Removed.
15828 (Symbol::got_offsets_): New field.
15829 (Symbol::has_got_offset): Removed.
15830 (Symbol::has_tls_mod_got_offset): Removed.
15831 (Symbol::has_tls_pair_got_offset): Removed.
15832 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
15833 (Target_x86_64::Scan::local): Updated callers of Output_data_got
15834 member functions.
15835 (Target_x86_64::Scan::global): Likewise.
15836 (Target_x86_64::Relocate::relocate): Likewise.
15837 (Target_x86_64::Relocate::relocate_tls): Likewise.
15838
bd52eafb
BE
158392008-03-25 Ben Elliston <bje@au.ibm.com>
15840
15841 * yyscript.y: Fix spelling error in comment.
15842
8b105e34
ILT
158432008-03-24 Ian Lance Taylor <iant@google.com>
15844
8ed814a9
ILT
15845 * options.h (class General_options): Define build_id option.
15846 * layout.h (class Layout): Declare write_build_id, create_note,
15847 create_build_id. Add build_id_note_ member.
15848 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
15849 "libiberty.h", "md5.h", "sha1.h".
15850 (Layout::Layout): Initialize eh_frame_data_,
15851 eh_frame_hdr_section_, and build_id_note_.
15852 (Layout::finalize): Call create_build_id.
15853 (Layout::create_note): New function, broken out of
15854 Layout::create_gold_note.
15855 (Layout::create_gold_note): Call create_note.
15856 (Layout::create_build_id): New function.
15857 (Layout::write_build_id): New function.
15858 (Close_task_runner::run): Call write_build_id.
15859
8b105e34
ILT
15860 * x86_64.cc: Correct license to GPLv3.
15861
086a1841
ILT
158622008-03-23 Ian Lance Taylor <iant@google.com>
15863
15864 * options.cc: Include "demangle.h".
15865 (parse_optional_string): New function.
15866 (parse_long_option): Handle takes_optional_argument.
15867 (parse_short_option): Update dash_z initializer. Handle
15868 takes_optional_argument.
15869 (General_options::General_options): Initialize do_demangle_.
15870 (General_options::finalize): Set do_demangle_. Handle demangling
15871 style.
15872 * options.h (parse_optional_string): Declare.
15873 (struct One_option): Add optional_arg field. Update constructor.
15874 Update call constructor calls. Add takes_optional_argument
15875 function.
15876 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
15877 (DEFINE_optional_string): Define.
15878 (General_options::demangle): Change from DEFINE_bool to
15879 DEFINE_optional_string.
15880 (General_options::no_demangle): New function.
15881 (General_options::do_demangle): New function.
15882 (General_options::set_do_demangle): New function.
15883 (General_options::execstack_status_): Move definition to end of
15884 class definition.
15885 (General_options::static_): Likewise.
15886 (General_options::do_demangle_): New field.
15887 * object.cc (big_endian>::get_symbol_location_info): Call
15888 Options::do_demangle, not Options::demangle.
15889 * symtab.cc (demangle): Likewise.
15890
cbb93e63
ILT
158912008-03-22 Ian Lance Taylor <iant@google.com>
15892
15893 * gold.h: Include <cstddef> and <sys/types.h>
15894 * options.h: Include <cstring>.
15895
ec531623
ILT
158962008-03-21 Ian Lance Taylor <iant@google.com>
15897
15898 * Added source code to GNU binutils.
752937aa 15899\f
4b95cf5c 15900Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
15901
15902Copying and distribution of this file, with or without modification,
15903are permitted in any medium without royalty provided the copyright
15904notice and this notice are preserved.
15905
15906Local Variables:
15907mode: change-log
15908left-margin: 8
15909fill-column: 74
15910version-control: never
15911End:
This page took 1.10752 seconds and 4 git commands to generate.