Sync toplevel configure with GCC
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
fb8b9dbc
L
12015-07-12 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR gold/18322
4 * compressed_output.cc (zlib_compress): Add argument for
5 compression header size. Set header size to compression header
6 size if it isn't 0. Don't write out the zlib header here.
7 (Output_compressed_section::set_final_data_size): Support
8 zlib-gnu and zlib-gabi compressions. Pass compression header
9 size to zlib_compress and write out compression header. Set
10 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
11 clear the SHF_COMPRESSED bit
12 * options.h (compress_debug_sections): Add zlib-gnu and
13 zlib-gabi.
14 * output.h (Output_section::set_flags): New.
15 * testsuite/Makefile.am (check_PROGRAMS): Add
16 flagstest_compress_debug_sections_none,
17 flagstest_compress_debug_sections_gnu and
18 flagstest_compress_debug_sections_gabi.
19 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
20 flagstest_compress_debug_sections.stdout,
21 flagstest_compress_debug_sections.cmp,
22 flagstest_compress_debug_sections.check,
23 flagstest_compress_debug_sections_gnu.stdout,
24 flagstest_compress_debug_sections_gnu.cmp,
25 flagstest_compress_debug_sections_gnu.check,
26 flagstest_compress_debug_sections_gabi.stdout,
27 flagstest_compress_debug_sections_gabi.cmp and
28 flagstest_compress_debug_sections_gabi.check.
29 (flagstest_compress_debug_sections_none): New.
30 (flagstest_compress_debug_sections_none.stdout): Likewise.
31 (flagstest_compress_debug_sections.stdout): Likewise.
32 (flagstest_compress_debug_sections.check): Likewise.
33 (flagstest_compress_debug_sections.cmp): Likewise.
34 (flagstest_compress_debug_sections_gnu): Likewise.
35 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
36 (flagstest_compress_debug_sections_gnu.check): Likewise.
37 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
38 (flagstest_compress_debug_sections_gabi): Likewise.
39 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
40 (flagstest_compress_debug_sections_gnu.check): Likewise.
41 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
42 * testsuite/Makefile.in: Regenerated.
43
48058663
L
442015-07-12 H.J. Lu <hongjiu.lu@intel.com>
45
46 PR gold/18321
47 * compressed_output.h (decompress_input_section): Add arguments
48 for ELF class, big endian and sh_flags.
49 * compressed_output.cc (decompress_input_section): Likewise.
50 Support the SHF_COMPRESSED section.
51 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
52 functions.
53 * plugin.h (Pluginobj): Likewise.
54 * layout.cc (Layout::get_output_section_flags): Also clear the
55 SHF_COMPRESSED bit.
56 * object.h (Compressed_section_info): Add flag to store sh_flags.
57 (Object): Add pure virtual elfsize and is_big_endian member
58 functions.
59 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
60 prefix here.
61 (build_compressed_section_map): Check SHF_COMPRESSED for
62 uncompressed size. Store sh_flags in Compressed_section_info.
63 Pass size, big_endian and sh_flags to decompress_input_section.
64 Skip the ".debug"/".zdebug" prefix when passing section name to
65 need_decompressed_section.
66 (Sized_relobj_file<size, big_endian>::do_find_special_section):
67 Don't check ".zdebug_*" sections.
68 (Object::decompressed_section_contents): Pass ELF class, big
69 endian and sh_flags to decompress_input_section.
70 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
71 Likewise.
72 * testsuite/Makefile.am (check_DATA): Add
73 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
74 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
75 gdb_index_test_2_gabi.stdout.
76 (debug_msg_cdebug_gabi.o): New.
77 (odr_violation1_cdebug_gabi.o): Likewise.
78 (odr_violation2_cdebug_gabi.o): Likewise.
79 (debug_msg_cdebug_gabi.err): Likewise.
80 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
81 (gdb_index_test_cdebug_gabi.o): Likewise.
82 (gdb_index_test_2_gabi): Likewise.
83 (gdb_index_test_2_gabi.stdout): Likewise.
84 * testsuite/gdb_index_test_2_gabi.sh: New file.
85 * testsuite/Makefile.in: Regenerated.
86
73854cdd
HS
872015-07-09 Han Shen <shenhan@google.com>
88
89 Use "gold_info" instead of "gold_warning" for erratum fix.
90
91 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
92 'gold_info'.
93 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
94
61163dfa
HS
952015-07-09 Han Shen <shenhan@google.com>
96
97 Drop missing symbol warning for arm/aarch64.
98
99 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
100 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
101 symbol warning.
102
b91deca9
HS
1032015-07-07 Han Shen <shenhan@google.com>
104
105 Make gold aarch64 accept long form of mapping symbols.
106
107 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
108 of mapping symbols.
109
15162bef
DK
1102015-06-29 Doug Kwan <dougkwan@google.com>
111
112 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
113 at address expected by test.
114 * testsuite/arm_cortex_a8_b.s: Ditto.
115 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
116 * testsuite/arm_cortex_a8_bl.s: Ditto.
117 * testsuite/arm_cortex_a8_blx.s: Ditto.
118 * testsuite/arm_cortex_a8_local.s: Ditto.
119 * testsuite/arm_fix_v4bx.s: Ditto.
120 * testsuite/arm_unaligned_reloc.s: Ditto.
121 * testsuite/thumb_bl_out_of_range.s: Ditto.
122 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
123 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 124
56b06706
HS
1252015-06-29 Han Shen <shenhan@google.com>
126
127 Patch for erratum 843419 internal error.
128
b91deca9 129 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
56b06706
HS
130 (Erratum_stub::update_erratum_insn): New method.
131 (Stub_table::relocate_stubs): Modified to place relocated insn.
132 (AArch64_relobj::fix_errata): Modified gold_assert.
133
2f0c79aa
HS
1342015-06-12 Han Shen <shenhan@google.com>
135
136 Fix erratum 835769.
137
138 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
139 defintion outside class definition.
140 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
141 (AArch64_insn_utilities::aarch64_op31): New member.
142 (AArch64_insn_utilities::aarch64_ra): New member.
143 (AArch64_insn_utilities::aarch64_mac): New member.
144 (AArch64_insn_utilities::aarch64_mlxl): New member.
145 (ST_E_835769): New global enum member.
146 (Stub_table::relocate_stubs): Add 835769 handler.
147 (Stub_template_repertoire::Stub_template_repertoire): Install new
148 stub type.
149 (AArch64_relobj::scan_errata): This func is renamed from
150 scan_erratum_843419.
151 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
152 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
153 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
154 (Target_aarch64::scan_erratum_835769_span): New method.
155 (Target_aarch64::create_erratum_stub): New method.
156 (Target_aarch64::is_erratum_835769_sequence): New method.
157 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
158 code into create_erratum_stub.
159 * options.h (fix_cortex_a53_835769): New option.
160
5d7908e0
CC
1612015-06-11 Cary Coutant <ccoutant@gmail.com>
162
163 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
164 outside class body.
165 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
166
dd68f8fa
CC
1672015-06-11 Cary Coutant <ccoutant@gmail.com>
168
169 PR gold/17731
170 * layout.cc (corresponding_uncompressed_section_name): New function.
171 (Layout::choose_output_section): Call it.
172 * layout.h (corresponding_uncompressed_section_name): New function.
173 * script-sections.cc (Input_section_info::set_section_name): Check
174 for compressed debug section (.zdebug style).
175
a3a0c391
JY
1762015-06-11 Jing Yu <jingyu@google.com>
177
178 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
179 * testsuite/Makefile.in: Regenerate.
180
970cdef2
DI
1812015-06-11 Davide Italiano <dccitaliano@gmail.com>
182
183 * gold.h (is_cident): Correct typo.
184
a48d0c12
HS
1852015-06-10 Han Shen <shenhan@google.com>
186 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
187
188 Now fixing for 843419 is fully functional.
189
190 The first part of the erratum fix CL is here -
191 https://sourceware.org/ml/binutils/2015-04/msg00229.html
192
193 * aarch64.cc(global enum): New constants representing stub types.
194 (Stub_template): New POD struct.
195 (Stub_template_repertoire): New class.
196 (Stub_base): New class.
197 (Erratum_stub): New class.
198 (Reloc_stub): Refactored to be a subclass of Stub_base.
199 (Reloc_stub::Stub_type): Removed.
200 (Reloc_stub::offset): Moved to Stub_base.
201 (Reloc_stub::set_offset): Moved to Stub_base.
202 (Reloc_stub::destination_address): Moved to Stub_base.
203 (Reloc_stub::set_destination_address): Moved to Stub_base.
204 (Reloc_stub::reset_destination_address): Moved to Stub_base.
205 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
206 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
207 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
208 (Reloc_stub::write): Moved to Stub_base.
209 (Reloc_stub::invalid_offset): Moved to Stub_base.
210 (Reloc_stub::invalid_address): Moved to Stub_base.
211 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
212 (Reloc_stub::stub_insns_): Moved to Stub_base.
213 (Reloc_stub::offset_): Moved to Stub_base.
214 (Reloc_stub::destination_address_): Moved to Stub_base.
215 (Stub_table::The_aarch64_relobj): New typedef.
216 (Stub_table::The_erratum_stub): New typedef.
217 (Stub_table::The_erratum_stub_less): New typedef.
218 (Stub_table::The_erratum_stub_set): New typedef.
219 (Stub_table::The_erratum_stub_set_iter): New typedef.
220 (Stub_table::empty): Added emptiness testing for erratum stubs.
221 (Stub_table::add_erratum_stub): New method to add an erratum stub.
222 (Stub_table::find_erratum_stub): New method.
223 (Stub_table::find_erratum_stubs_for_input_section): New method.
224 (Stub_table::erratum_stub_address): New method.
225 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
226 (Stub_table::do_addralign): Modified to handle erratum stubs.
227 (Stub_table::erratum_stubs_): New member.
228 (Stub_table::erratum_stub_size_): New member.
229 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
230 (Stub_table::do_write): Modified to handle erratum stubs.
231 (AArch64_relobj::The_erratum_stub): New typedef.
232 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
233 (AArch64_relobj::fix_errata): New method.
234 (Target_aarch64::The_reloc_stub_type): Removed.
235 (Target_aarch64::The_erratum_stub): New typede.
236 (AArch64_relocate_functions::construct_b): New method.
237
1e1b2efc
NC
2382015-06-08 Nick Clifton <nickc@redhat.com>
239
240 * po/fr.po: New French Translation.
241
b8cf5075
CC
2422015-06-07 Cary Coutant <ccoutant@gmail.com>
243
244 PR gold/18288
245 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
246 callers. Don't use STT_COMMON to check for common symbols.
247 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
248 symbol that's not in a common section.
249 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
250 common symbols.
251
bdd2d2b7
CC
2522015-06-04 Cary Coutant <ccoutant@gmail.com>
253
254 PR gold/18200
255 * Makefile.am (diststuff): Add target.
256 * Makefile.in: Regenerate.
257
cd3c333f
CC
2582015-06-04 Cary Coutant <ccoutant@gmail.com>
259
260 PR gold/17498
261 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
262 temporary locals in merge sections.
263 * options.cc (General_options::parse_discard_all): New method.
264 (General_options::parse_discard_locals): New method.
265 (General_options::parse_discard_none): New method.
266 (General_options::General_options): Initialize discard_locals_.
267 * options.h (--discard-all): Convert to special option.
268 (--discard-locals): Likewise.
269 (--discard-none): New option.
270 (General_options::discard_all): New method.
271 (General_options::discard_locals): New method.
272 (General_options::discard_sec_merge): New method.
273 (General_options::Discard_locals): New enum.
274 (General_options::discard_locals_): New data member.
275
8086551f
CC
2762015-06-03 Cary Coutant <cary@google.com>
277
278 * script-sections.cc (Script_sections::Script_sections): Initialize
279 segments_created_.
280 (Script_sections::create_note_and_tls_segments): Set flag when
281 segments are created.
282 (Script_sections::expected_segment_count): Count PT_INTERP.
283 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
284 segments are created.
285 * script-sections.h (Script_sections::segments_created_): New data
286 member.
287
374082df
CC
2882015-06-03 Cary Coutant <ccoutant@gmail.com>
289
290 PR gold/15370
291 * script-sections.cc
292 (Output_section_element_input::set_section_addresses): When there
293 are several patterns with no sort spec, put all sections in the same
294 bin.
295 * testsuite/Makefile.am (script_test_12): New testcase.
296 (script_test_12i): New testcase.
297 * testsuite/Makefile.in: Regenerate.
298 * testsuite/script_test_12.t: New test linker script.
299 * testsuite/script_test_12i.t: New test linker script.
300 * testsuite/script_test_12a.c: New test source file.
301 * testsuite/script_test_12b.c: New test source file.
302
775ed62e
CC
3032015-06-02 Cary Coutant <ccoutant@gmail.com>
304
305 * nacl.h (Sniff_file): Switch parameters to get_view to get an
306 aligned view.
307
9c7fe3c5
CC
3082015-06-03 Cary Coutant <ccoutant@gmail.com>
309
310 PR gold/17819
311 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
312 separate task to schedule the build id computation.
313 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
314 add Output_file and offset.
315 (Hash_task::run): Get and release the input views.
316 (Hash_task::is_runnable): Always return NULL (always runnable).
317 (Layout::queue_build_id_tasks): Remove.
318 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
319 parameters; use them instead of class members.
320 (Build_id_task_runner::run): New function.
321 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
322 to write_build_id.
323 * layout.h (Layout::queue_build_id_tasks): Remove.
324 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
325 parameters.
326 (Layout::array_of_hashes_): Remove.
327 (Layout::size_of_array_of_hashes_): Remove.
328 (Layout::input_view_): Remove.
329 (Build_id_task_runner): New class.
330 (Close_task_runner::Close_task_runner): Add array_of_hashes and
331 size_of_hashes parameters.
332 (Close_task_runner::array_of_hashes_): New data member.
333 (Close_task_runner::size_of_hashes_): New data member.
334 * testsuite/Makefile.am
335 (flagstest_compress_debug_sections_and_build_id_tree): New test.
336 * testsuite/Makefile.in: Regenerate.
337
400f8944
RÁE
3382015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
339
340 * merge.cc (get_input_merge_map): Update for data structure change.
341 (get_or_make_input_merge_map): Update for data structure change.
342 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
343 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
344
bbec1a5d
AM
3452015-05-16 Alan Modra <amodra@gmail.com>
346
347 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
348 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
349 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
350 (lis_0): Rename from lis_0_0.
351
efc6fa12
CC
3522015-04-29 Cary Coutant <cary@google.com>
353 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
354
355 * gc.h (Garbage_collection::is_section_garbage): Change Object*
356 to Relobj*.
357 (Garbage_collection::add_reference): Likewise.
358 (Garbage_collection::gc_process_relocs): Likewise. Don't push
359 object/shndx pair onto *secvec for dynamic objects. Don't follow
360 relocations pointing to dynamic objects for GC.
361 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
362 (Icf::unfold_section): Likewise.
363 (Icf::is_section_folded): Likewise.
364 (Icf::get_folded_section): Likewise.
365 * icf.h: (Icf::get_folded_section): Likewise.
366 (Icf::unfold_section): Likewise.
367 (Icf::is_section_folded): Likewise.
368 (Icf::section_has_function_pointers): Likewise.
369 (Icf::set_section_has_function_pointers): Likewise.
370 * object.h (Section_id): Likewise.
371 (Const_section_id): Likewise.
372 * output.cc (Output_section::update_section_layout): Likewise.
373 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
374 Likewise.
375 * plugin.cc (update_section_order): Likewise.
376 (unique_segment_for_sections): Likewise.
377 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
378 (Target_powerpc::do_gc_add_reference): Likewise.
379 (Target_powerpc::gc_process_relocs): Likewise.
380 (Target_powerpc::do_gc_add_reference): Likewise.
381 * symtab.cc (Symbol_table::is_section_folded): Likewise.
382 (Symbol_table::gc_mark_symbol): Likewise.
383 * symtab.h: (Symbol_table::is_section_folded): Likewise.
384 * target.h: (Sized_target::gc_add_reference): Likewise.
385 (Sized_target::do_gc_add_reference): Likewise.
386
f9d3ecaa
NC
3872015-04-29 Nick Clifton <nickc@redhat.com>
388
389 * po/fi.po: Updated Finnish translation.
390
faa2211d
AM
3912015-04-28 Alan Modra <amodra@gmail.com>
392
393 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
394 than unsigned int for find_global_entry result temp. Compare
395 against invalid_address.
396 (Target_powerpc::do_plt_address_for_global): Likewise.
397 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
398 on plt call stub existence for debug info. Do assert for plt
399 and global entry stub existence if an alloc section.
400
6ec65f28
AM
4012015-04-28 Alan Modra <amodra@gmail.com>
402
403 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
404 on missing global entry stub due to bogus debug info.
405
7a2a1c79
HS
4062015-04-27 Han Shen <shenhan@google.com>
407
408 * options.h (--fix-cortex-a53-843419): Rename option.
409 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
410 option.
411 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
412
cfbf0e3c
RÁE
4132015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
414
415 PR gold/18327
416 * output.cc (Output_section::is_input_address_mapped): Assume a missing
417 entry is mapped.
418 * testsuite/Makefile.am: Add the eh_test test.
419 * testsuite/Makefile.in: Regenerate.
420 * testsuite/eh_test_a.cc: New test.
421 * testsuite/eh_test_b.cc: New test.
422
6ec65f28
AM
4232015-04-23 Sriraman Tallam <tmsriram@google.com>
424
a100d66f
ST
425 * options.h (--weak-unresolved-symbols): New option.
426 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
427 binding to weak with new option.
428 * symtab.h (is_weak_undefined): Check for new option.
429 (is_strong_undefined): Check for new option.
430 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
431 * testsuite/Makefile.in: Regenerate.
432 * testsuite/weak_unresolved_symbols_test.cc: New file.
433
4b889c30
IC
4342015-04-20 Ian Coolidge <icoolidge@google.com>
435
436 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
437 GNU_UNIQUE.
438
4277535c
RÁE
4392015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
440
441 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
442 push_back.
443 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
444 * object.cc (Sized_relobj_file::do_layout): Use push_back.
445 * powerpc.cc (process_gc_mark): Use push_back.
446 (Target_powerpc::do_gc_mark_symbol): Use push_back.
447 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
448
7a2a1c79 4492015-04-16 Han Shen <shenhan@google.com>
5019d64a 450
6ec65f28
AM
451 * aarch64.cc (AArch64_insn_utilities): New utility class.
452 (AArch64_relobj::Mapping_symbol_position): New struct.
453 (AArch64_relobj::Mapping_symbol_info): New typedef.
454 (AArch64_relobj::do_count_local_symbols): New function overriding
455 parent's implementation.
456 (AArch64_relobj::mapping_symbol_info_): New member
457 (AArch64_relobj::scan_erratum_843419): New method.
458 (Target_aarch64::scan_erratum_843419_span): New method.
459 (Target_aarch64::is_erratum_843419_sequence): New method.
460 * options.h (fix_cortex_a53): New option.
5019d64a 461
a6a17750
CC
4622015-04-09 Cary Coutant <ccoutant@google.com>
463
464 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
465 in a PIE link.
466 * testsuite/Makefile.am (tls_pie_test.sh): New test.
467 * testsuite/Makefile.in: Regenerate.
468 * testsuite/tls_pie_test.sh: New.
469
437ddf0c
CC
4702015-04-09 Cary Coutant <ccoutant@google.com>
471
472 * debug.h (DEBUG_LOCATION): New.
473 (DEBUG_ALL): Include DEBUG_LOCATION.
474 (debug_string_to_enum): Add DEBUG_LOCATION.
475 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
476 output to print correct context.
477 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
478 up to 4 more locations at the beginning of the function.
479 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
480 result before sorting list of line numbers.
481 * testsuite/debug_msg.sh: Allow range of line numbers for
482 canonical results on optimized code.
483
24491327
HS
4842015-04-07 HC Yen <hc.yen@mediatek.com>
485
486 Add AArch32 support for gold linker.
487 gold/
488 * arm.cc: Add V8 arch combine table.
489
7fa5525f
RÁE
4902015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
491
492 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
493
5368dcf2
RÁE
4942015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
495
496 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
497 to find by using the return value of insert.
498
9dbb4b02
RÁE
4992015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
500
501 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
502 constructor call.
503
1fa29f10
IT
5042015-04-06 Ilya Tocar <ilya.tocar@intel.com>
505
506 PR gold/17641
507 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
508 (Target_x86_64::Scan::local): Don't create GOT entry, when we
509 can convert mov to lea.
510 (Target_x86_64::Scan::global): Ditto.
511 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
512 %reg to lea foo(%rip), %reg if possible.
513 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
514 * testsuite/x86_64_mov_to_lea1.s: New.
515 * testsuite/x86_64_mov_to_lea2.s: Ditto.
516 * testsuite/x86_64_mov_to_lea3.s: Ditto.
517 * testsuite/x86_64_mov_to_lea4.s: Ditto.
518 * testsuite/x86_64_mov_to_lea.sh: Ditto.
519
39f3de7c
L
5202015-04-02 H.J. Lu <hongjiu.lu@intel.com>
521
522 * configure: Regenerated.
523
c4fc4724
IT
5242015-04-01 Ilya Tocar <ilya.tocar@intel.com>
525
526 PR gold/17640
527 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
528 (Target_i386::Scan::local): Don't create GOT entry, when we
529 can convert GOT to GOTOFF.
530 (Target_i386::Scan::global): Ditto.
531 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
532 lea foo@GOTOFF(%reg), %reg if possible.
533 * testsuite/Makefile.am (i386_mov_to_lea): New test.
534 * testsuite/i386_mov_to_lea1.s: New.
535 * testsuite/i386_mov_to_lea2.s: Ditto.
536 * testsuite/i386_mov_to_lea3.s: Ditto.
537 * testsuite/i386_mov_to_lea4.s: Ditto.
538 * testsuite/i386_mov_to_lea5.s: Ditto.
539 * testsuite/i386_mov_to_lea.sh: Ditto.
540
918357b9
L
5412015-04-01 H.J. Lu <hongjiu.lu@intel.com>
542
543 * Makefile.am (ZLIB): New.
544 (ZLIBINC): Likewise.
545 (AM_CFLAGS): Add $(ZLIBINC).
546 (AM_CXXFLAGS): Likewise.
547 (ldadd_varldadd_var): Add $(ZLIB).
548 (incremental_dump_LDADD): Likewise.
549 (dwp_LDADD): Likewise.
550 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
551 <zlib.h>.
552 (zlib_compress): Don't check HAVE_ZLIB_H.
553 (zlib_decompress): Likewise.
554 * options.h (compress_debug_sections): Likewise.
555 * configure.ac (AM_CONDITIONAL): Removed.
556 * testsuite/Makefile.am (ZLIB): New.
557 (LDADD): Add $(ZLIB).
558 Don't check HAVE_ZLIB.
559 * Makefile.in: Regenerated.
560 * config.in: Likewise.
561 * configure: Likewise.
562 * testsuite/Makefile.in: Likewise.
563
6b0ad2eb
JY
5642015-03-30 Jing Yu <jingyu@google.com>
565
566 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
567 TLSLD_ADD_DTPREL_LO12_NC.
568 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
569 _TLS_MODULE_BASE_ point to the start of tls segment.
570 (Target_aarch64::optimize_tls_reloc): Add cases for
571 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
572 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
573 (Target_aarch64::Scan::local): Likewise.
574 (Target_aarch64::Scan::global): Likewise.
575 (Target_aarch64::Relocate::relocate): Likewise.
576 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
577 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
578 relocations.
579
0916f9e7
RÁE
5802015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
581
582 * merge.cc (Object_merge_map::add_mapping): call
583 Object_merge_map::Input_merge_map::add_mapping.
584 (Object_merge_map::Input_merge_map::add_mapping): New.
585 (Output_merge_data::do_add_input_section): Call
586 get_or_make_input_merge_map before a loop.
587 (Output_merge_string<Char_type>::finalize_merged_data): Call
588 get_or_make_input_merge_map before a loop.
589 * merge.h (Object_merge_map): Make Input_merge_map public.
590 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
591 (Relobj::get_or_create_merge_map): New.
592 * object.h (Relobj::get_or_create_merge_map): New.
593
282c9750
AM
5942015-03-24 Alan Modra <amodra@gmail.com>
595
596 PR 18147
597 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
598 relocation errors for branches to strong undefined symbols.
599
67f95b96
RÁE
6002015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
601
602 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
603 (Object_merge_map::is_merge_section_for): Remove.
604 (Object_merge_map::find_merge_section): New.
605 * merge.h (Object_merge_map::is_merge_section_for): Remove.
606 (Object_merge_map::find_merge_section): New.
607 (Object_merge_map::get_input_merge_map): Add a const version.
608 * object.cc (Relobj::is_merge_section_for): Remove.
609 (Relobj::find_merge_section): New.
610 * object.h (Relobj::is_merge_section_for): Remove.
611 (Relobj::find_merge_section): New.
612 * output.cc
613 (Output_section::Input_section::is_merge_section_for): Remove.
614 (Output_section::add_merge_input_section): Don't call
615 add_merge_input_section.
616 (Output_section::find_merge_section): Return const. Use
617 object->find_merge_section.
618 (Output_section::build_lookup_maps): Don't build a map for
619 merge sections.
620 (Output_section::is_input_address_mapped): Return false if
621 section is not found.
622 (Output_section::find_starting_output_address): Use
623 find_merge_section instead of is_merge_section_for.
624 (Output_section::add_script_input_section): Don't build a map for
625 merge sections.
626 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
627 (Output_section_lookup_maps::find_merge_section): Remove.
628 (Output_section_lookup_maps::add_merge_input_section) Remove.
629 (Output_section::find_merge_section): Return const.
630
152f7024
CC
6312015-03-22 Cary Coutant <cary@google.com>
632
633 PR gold/18106
634 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
635 non-SIB form of lea, with nop after the call.
636
bccffdfd
CC
6372015-03-21 Cary Coutant <cary@google.com>
638
639 PR gold/14217
640 * output.cc (Output_segment::is_first_section_relro): Don't ignore
641 .tdata section.
642 (Output_segment::set_section_addresses): Don't align size of relro
643 segment for .tbss.
644
1c582fe7
CC
6452015-03-21 Cary Coutant <cary@google.com>
646
647 PR gold/18010
648 * stringpool.cc (Stringpool_template): Don't optimize if section
649 alignment is greater than sizeof(char).
650
410da591
CC
6512015-03-21 Cary Coutant <cary@google.com>
652
653 PR gold/18048
654 * script-c.h (script_include_directive): Add first_token parameter.
655 * script.cc (script_include_directive): Add first_token parameter, and
656 pass it to read_script_file.
657 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
658 (PARSING_MEMORY_DEF): New tokens.
659 (top): Add new productions for INCLUDE files.
660 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
661 Pass PARSING_LINKER_SCRIPT to script_include_directive.
662 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
663 (section_cmd): Pass PARSING_SECTION_CMDS.
664 (file_or_sections_cmd): Remove.
665 (memory_def): Pass PARSING_MEMORY_DEF.
666 * testsuite/Makefile.am (memory_test_2): New test.
667 * testsuite/Makefile.in: Regenerate.
668 * testsuite/memory_test_inc.t: New script file.
669 * testsuite/memory_test_inc_1.t.src: New script file.
670 * testsuite/memory_test_inc_2.t.src: New script file.
671 * testsuite/memory_test_inc_3.t.src: New script file.
672
0d5bbdb0
CC
6732015-03-21 Cary Coutant <cary@google.com>
674
675 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
676 (Sized_relobj_dwo::setup): Build compressed section map.
677 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
678 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
679 section map.
680 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
681 compressed_sections_ field.
682 (build_compressed_section_map): Take Object instead of
683 Sized_relobj_file parameter; add decompress_if_needed parameter.
684 (Sized_relobj_file::do_find_special_sections): Store compressed
685 section map in parent Object.
686 (Sized_relobj_file::do_decompressed_section_contents): Move
687 implementation to Object::decompressed_section_contents.
688 (Sized_relobj_file::do_discard_decompressed_sections): Move
689 implementation to Object::discard_decompressed_sections.
690 * object.h (build_compressed_section_map): Declare.
691 (Object::Object): Add compressed_sections_ field.
692 (Object::section_is_compressed): Move implementation here.
693 (Object::decompressed_section_contents): De-virtualize.
694 (Object::discard_decompressed_sections): De-virtualize.
695 (Object::do_section_is_compressed): Delete.
696 (Object::do_decompressed_section_contents): Delete.
697 (Object::set_compressed_sections): New method.
698 (Object::compressed_sections): New method.
699 (Object::compressed_sections_): New data member.
700 (Compressed_section_info, Compressed_section_map): Move to top of file.
701 (Sized_relobj_file::do_section_is_compressed): Delete.
702 (Sized_relobj_file::do_decompressed_section_contents): Delete.
703 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
704 (Sized_relobj_file::compressed_sections_): Move to Object class.
705
bd9e0d46
CC
7062015-03-21 Cary Coutant <ccoutant@google.com>
707
708 PR gold/18152
709 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
710 deferred objects.
711
943c8b43
CC
7122015-03-11 Cary Coutant <ccoutant@google.com>
713
714 * options.cc (General_options::finalize): Don't allow -z relro
715 with incremental linking.
716 * testsuite/Makefile.am (incremental_test): Add -z norelro.
717 (incremental_test_2): Likewise.
718 (incremental_test_3): Likewise.
719 (incremental_test_4): Likewise.
720 (incremental_test_5): Likewise.
721 (incremental_test_6): Likewise.
722 (incremental_copy_test): Likewise.
723 (incremental_common_test_1): Likewise.
724 (incremental_comdat_test_1): Likewise.
725 * testsuite/Makefile.in: Regenerate.
726
e1663197
CC
7272015-03-09 Cary Coutant <ccoutant@google.com>
728
729 PR gold/14675
730 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
731 return enum indicating whether .eh_frame section is empty, optimizable,
732 unrecognized, or an end marker. Adjust explicit instantiations.
733 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
734 (Eh_frame::add_ehframe_input_section): Change return type.
735 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
736 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
737 to the .eh_frame output section until we see the end marker.
738 (Layout::finalize_eh_frame_section): New.
739 * layout.h: (Layout::finalize_eh_frame_section): New.
740
beb8418f
L
7412015-03-05 H.J. Lu <hongjiu.lu@intel.com>
742
743 * output.cc (Relobj::initialize_input_to_output_map<size>):
744 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
745
48c73428
CC
7462015-03-04 Cary Coutant <ccoutant@google.com>
747
748 * parameters.cc (Parameters::set_target_once): Call
749 Target::select_as_default_target just once from here...
750 (set_parameters_target): ...instead of from here.
751
7522015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
753
754 * ehframe.cc (Cie::set_output_offset): Pass in and use a
755 Output_section_data instead of a Merge_map.
756 (Eh_frame::Eh_frame): Don't initialize merge_map_.
757 (Eh_frame::read_cie): Use add_merge_mapping instead of
758 Merge_map::add_mapping.
759 (Eh_frame::read_fde): Ditto.
760 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
761 (Eh_frame::do_output_offset): Use merge_output_offset istead of
762 merge_map_->get_output_offset.
763 (Eh_frame::do_is_merge_section_for): Delete.
764 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
765 instead of a Merge_map.
766 (Cie::set_output_offset): Pass in a Output_section_data instead of a
767 Merge_map.
768 (Eh_frame::do_is_merge_section_for): Delete.
769 (Eh_frame::merge_map_): Delete.
770 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
771 and use a Output_section_data instead of a Merge_map.
772 (Object_merge_map::add_mapping): Ditto.
773 (Object_merge_map::get_output_offset): Remove the merge_map argument.
774 (Object_merge_map::is_merge_section_for): Pass in and use a
775 Output_section_data instead of a Merge_map.
776 (Merge_map): Delete.
777 (Output_merge_base::do_output_offset): Use merge_output_offset instead
778 of merge_map_.get_output_offset.
779 (Output_merge_base::do_is_merge_section_for): Delete.
780 (Output_merge_data::do_add_input_section): Use
781 object->add_merge_mapping instead of add_mapping.
782 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
783 * merge.h (Merge_map): Delete forward declaration.
784 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
785 instead of a Merge_map.
786 (Object_merge_map::get_output_offset): Remove the merge_map argument.
787 (Object_merge_map::is_merge_section_for): Pass in and use a
788 Output_section_data instead of a Merge_map.
789 (Input_merge_map::Object_merge_map::merge_map): Replace with
790 output_data.
791 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
792 Output_section_data instead of a Merge_map.
793 (Merge_map): Delete.
794 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
795 (Output_merge_base::do_is_merge_section_for): Delete.
796 (Output_merge_base::add_mapping): Delete.
797 (Output_merge_base::merge_map_): Delete.
798 * object.cc (Relobj::initialize_input_to_output_map): New.
799 (Relobj::initialize_input_to_output_map): New.
800 (Relobj::merge_output_offset): New.
801 (Relobj::is_merge_section_for): New.
802 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
803 bits.
804 * object.h (Relobj::merge_map): Delete.
805 (initialize_input_to_output_map): New.
806 (set_merge_map): Delete.
807 (add_merge_mapping): New.
808 (merge_output_offset): New.
809 (is_merge_section_for): New.
810 * output.cc (Output_section::Input_section::is_merge_section_for):
811 Use object->is_merge_section_for.
812 * output.h (Output_section_data::is_merge_section_for): Delete.
813 (Output_section_data::do_is_merge_section_for): Delete.
814 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
815 Use object->initialize_input_to_output_map.
816 (Merged_symbol_value<size>::value_from_output_section): Use
817 object->merge_output_offset.
818
48c73428 8192015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
820 Cary Coutant <ccoutant@google.com>
821
822 * output.cc (Output_section::add_merge_input_section): Do not
823 attempt to merge sections with an entsize of 0.
824
48c73428 8252015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
826
827 * attributes.h (class Output_attributes_section_data ): Add
828 do_print_to_mapfile function.
829
ec86f434
AM
8302015-02-24 Alan Modra <amodra@gmail.com>
831
832 PR 18010
833 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
834 complain if value is not a multiple of four.
835 (Target_powerpc::Relocate::relocate): Correct handling of
836 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
837
be66981e
L
8382015-02-21 H.J. Lu <hongjiu.lu@intel.com>
839
840 * configure.ac (default_size): Set to 32 for x32.
841 * configure: Regenerated.
842
e3ee8ed4
AM
8432015-02-18 Alan Modra <amodra@gmail.com>
844
845 PR 17954
846 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
847 visibility.
848
3a935c6c
RÁE
8492015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
850
851 * gc.h (Garbage_collection::add_reference): Don't use find.
852
e0a1e121
RÁE
8532015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
854
855 * object.cc (write_local_symbols): avoid std::vector copy.
856
45a4fb1a
RÁE
8572015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
858
859 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
860
2d9afefe
MW
8612015-02-09 Mark Wielaard <mjw@redhat.com>
862
863 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
864 DW_LANG_Fortran03 and DW_LANG_Fortran08.
865
e9c1bdad
CC
8662015-02-16 Cary Coutant <ccoutant@google.com>
867
868 PR gold/13577
869 PR gold/16992
870 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
871 DF_SYMBOLIC if --dynamic-list option is used.
872 * options.cc (General_options::finalize): --dynamic-list is not
873 mutually exclusive with -Bsymbolic.
874 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
875 listed in --dynamic-list.
876 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
877 -Bsymbolic-functions.
878 * testsuite/Makefile.in: Regenerate.
879
0ed4b0bf
CC
8802015-02-16 Cary Coutant <ccoutant@google.com>
881
882 PR gold/17971
883 * incremental.cc: Remove redundant include of "output.h".
884
1a920511
JY
8852015-02-12 Jing Yu <jingyu@google.com>
886
887 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
888 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
889 New relocation.
890 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
891 TLSLE_MOVW_* relocations.
892 (Target_aarch64::Scan::global): Likewise.
893 (Target_aarch64::Relocate::relocate): Likewise.
894 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
895 for new TLSLE_MOVW_* relocations.
896
07f107f3
WN
8972015-02-11 Will Newton <will.newton@linaro.org>
898
899 PR gold/13321
900 * arm.cc (Target_arm::make_plt_section): Create an ARM
901 state mapping symbol at the start of the PLT.
902
e051a5b5
L
9032015-02-09 H.J. Lu <hongjiu.lu@intel.com>
904
905 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
906 Replace two_file_shared_2.so with two_file_shared_1.so.
907 * testsuite/Makefile.in: Regenerated.
908
dddcc5b9
AM
9092015-02-09 Alan Modra <amodra@gmail.com>
910
911 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
912 plugin_test_thin.a and defsym_test.
913 * testsuite/Makefile.in: Regenerate.
914
b39b8b9d
RÁE
9152015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
916
917 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
918 body.
919
b66d1c52
CC
9202015-02-04 Peter Collingbourne <pcc@google.com>
921
922 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
923 forwarding symbols when computing symbol resolution info for plugins.
924 * plugin.h (Plugin_manager::symtab): New method.
925 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
926
23081de0
CC
9272015-02-03 Cary Coutant <ccoutant@google.com>
928 Peter Collingbourne <pcc@google.com>
929
930 PR gold/15660
931 * archive.cc (Thin_archive_object_unlocker): New class.
932 (Archive::include_member): Unlock external members of thin archives.
933 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
934 (plugin_test_2): Likewise.
935 (plugin_test_3): Likewise.
936 (plugin_test_4): Likewise.
937 (plugin_test_5): Likewise.
938 (plugin_test_6): Likewise.
939 (plugin_test_7): Likewise.
940 (plugin_test_8): Likewise.
941 (plugin_test_9): Likewise.
942 (plugin_test_10): Likewise.
943 (plugin_test_11): New test case.
944 * testsuite/Makefile.in: Regenerate.
945 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
946 file to decide whether to claim file.
947 (all_symbols_read_hook): Likewise.
948 * testsuite/plugin_test_1.sh: Adjust expected output.
949 * testsuite/plugin_test_2.sh: Likewise.
950 * testsuite/plugin_test_3.sh: Likewise.
951 * testsuite/plugin_test_6.sh: Likewise.
952 * testsuite/plugin_test_tls.sh: Likewise.
953 * testsuite/plugin_test_11.sh: New testcase.
954
9552015-02-03 Cary Coutant <ccoutant@google.com>
956
957 * descriptors.cc (Descriptors::open): Set artificially-low limit for
958 file descriptors when debugging enabled. Add debug output.
959 (Descriptors::release): Add debug output.
960 (Descriptors::close_some_descriptor): Likewise.
961 (Descriptors::close_all): Likewise.
962 * fileread.cc (File_read::lock): Likewise.
963 (File_read::unlock): Likewise.
964
24dd5808
CC
9652015-02-02 Cary Coutant <ccoutant@google.com>
966
967 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
968 executable output file.
969
fa89cc82
HS
9702015-01-22 Han Shen <shenhan@google.com>
971
972 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
973 (Target_arm::do_plt_address_for_global): New method.
974 (Target_arm::do_plt_address_for_local): New method.
975 (Target_arm::rel_irelative_section): New method.
976 (Target_arm::make_data_plt): Add more parameters for plt ctor.
977 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
978 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
979 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
980 (Target_arm::Scan::check_non_pic): Add ifunc support.
981 (Target_arm::Scan::local): Add ifunc support.
982 (Target_arm::Scan::global): Add ifunc support.
983 (Target_arm::make_plt_section): New method.
984 (Target_arm::make_plt_entry): Change to call to make_plt_section.
985 (Target_arm::make_local_ifunc_plt_entry): New method.
986 (Target_arm::got_irelative_): New member.
987 (Target_arm::rel_irelative_): New member.
988 (Target_arm::got_section): Add creation for got_irelative_.
989 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
990 (Target_arm::Relocate::relocate): Properly set local ifunc address.
991 (Target_arm::do_dynsym_value): Properly set global ifunc address.
992 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
993 (Output_data_plt_arm::IRelative_data): New type.
994 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
995 (Output_data_plt_arm::add_entry): Add more parameters.
996 (Output_data_plt_arm::add_relocation): New method.
997 (Output_data_plt_arm::add_local_ifunc_entry): New method.
998 (Output_data_plt_arm::rel_irelative): New method.
999 (Output_data_plt_arm::entry_count): Modified.
1000 (Output_data_plt_arm::address_for_global): New method.
1001 (Output_data_plt_arm::address_for_local): New method.
23081de0 1002gold/
fa89cc82
HS
1003 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1004 (Output_data_plt_arm::insert_irelative_data): New method.
1005 (Output_data_plt_arm::irelative_rel_): New member.
1006 (Output_data_plt_arm::got_): New member.
1007 (Output_data_plt_arm::got_irelative_): New member.
1008 (Output_data_plt_arm::irelative_count_): New member.
1009 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1010 (Output_data_plt_arm::irelative_data_vec_): New member.
1011 (Output_data_plt_arm::do_write): Write out irelative entries.
1012 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1013 more parameters to ctor.
1014 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1015 more parameters to ctor.
1016 * output.h (Output_data_reloc::add_local_relative): New method.
1017 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1018
0f81d3f0
AM
10192015-01-29 Alan Modra <amodra@gmail.com>
1020
1021 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1022 and GOT_TLSGD to LE optimization.
1023
65d92137
CC
10242015-01-28 Cary Coutant <ccoutant@google.com>
1025
1026 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1027 for undef TLS symbols.
1028 (Target_x86_64::Relocate::relocate_tls): Likewise.
1029 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1030
5485698a
CC
10312015-01-25 Cary Coutant <ccoutant@google.com>
1032
1033 * output.cc (Output_segment::set_section_addresses): Fix calculation
1034 of size of relro segment.
1035
b01a4b04
AM
10362015-01-22 Alan Modra <amodra@gmail.com>
1037
1038 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1039 condition for need of ifunc plt entry.
1040 (Target_powerpc::Scan::global <got relocs>): Likewise.
1041
3d0064a9
CC
10422015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1043
1044 * mips.cc (reloc_high): Add r_sym.
1045 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1046 reloc_high constructor.
1047 (Mips_relocate_functions::relgot16_local): Likewise.
1048 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1049 r_type to decide whether LO16 matches HI16.
1050 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1051 rello16 and relgot16_local.
1052
a5cd8f05
CC
10532015-01-09 Cary Coutant <ccoutant@google.com>
1054
1055 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1056 unless alignment is larger than page size.
1057
4fc1b9d4
L
10582015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1059 Cary Coutant <ccoutant@google.com>
1060
1061 PR gold/17729
1062 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1063 (DEFAULT_TARGET_X32): Set for x32.
1064 * x86_64.cc (cmp_insn_32): New.
1065 (lea_r10_insn_32): Likewise.
1066 (lea_r11_insn_32): Likewise.
1067 (cmp_insn_64): Likewise.
1068 (lea_r10_insn_64): Likewise.
1069 (lea_r11_insn_64): Likewise.
1070 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1071 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1072 (check_DATA): Add split_x32 files.
1073 (split_x32_[1234n].o): New targets.
1074 (split_x32_[124]): New targets.
1075 (split_x32_[1234r].stdout): New targets.
1076 * testsuite/split_x32.sh: New file.
1077 * testsuite/split_x32_1.s: Likewise.
1078 * testsuite/split_x32_2.s: Likewise.
1079 * testsuite/split_x32_3.s: Likewise.
1080 * testsuite/split_x32_4.s: Likewise.
1081 * testsuite/split_x32_n.s: Likewise.
1082 * configure: Regenerated.
1083 * testsuite/Makefile.in: Likewise.
1084
e749cab8
L
10852015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1086
1087 PR gold/17809
1088 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1089 x32.
1090
af759df0
AM
10912015-01-02 Alan Modra <amodra@gmail.com>
1092
1093 * version.cc (print_version): Just print current year.
1094 * dwp.cc (print_version): Likewise.
1095
b90efa5b
AM
10962015-01-01 Alan Modra <amodra@gmail.com>
1097
1098 Update year range in copyright notice of all files.
1099
f12d1e8a
AM
11002014-12-25 Alan Modra <amodra@gmail.com>
1101
1102 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1103 new enums.
1104 (Target_arm::merge_object_attributes, ): Likewise.
1105
5c294fee
TG
11062014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1107
1108 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1109 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1110 AEABI_VFP_args_vfp to check that.
1111 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1112 value and replace hardcoded values by enum values.
1113
e30880c2
CC
11142014-12-22 Cary Coutant <ccoutant@google.com>
1115
1116 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1117
bd040da1
L
11182014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1119
1120 PR gold/14608
1121 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1122 to "return i * i * 3;".
1123
e02a4046
CC
11242014-12-16 Cary Coutant <ccoutant@google.com>
1125
1126 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1127 (Mapfile::print_output_data): Use current_data_size() to avoid
1128 assert for sections requiring postprocessing; if address is not valid,
1129 print 0.
1130 (Mapfile::print_output_section): Use current_data_size(); print note
1131 that addresses and sizes are before compression.
1132
add6016b
L
11332014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1134
1135 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1136 Cast current_group_size to unsigned long when reporting error.
1137
0bf32ea9
JY
11382014-12-10 Jing Yu <jingyu@google.com>
1139
1140 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1141 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1142 Update error message.
1143 (Target_aarch64::do_relax): Use absolute value of option
1144 stub_group_size. Replace local variable with class member
1145 stub_group_size_.
1146
cbcb23fa
AM
11472014-12-04 Alan Modra <amodra@gmail.com>
1148
1149 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1150 addend of PLTREL24 reloc when not generating a plt stub. Make
1151 max_branch_offset an "Address".
fbad6518 1152 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1153 (Target_powerpc::Relocate::relocate): Likewise.
1154
1611bc4a
AM
11552014-12-04 Alan Modra <amodra@gmail.com>
1156
1157 PR 17670
1158 * symtab.cc (Symbol::set_undefined): Remove assertion.
1159 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1160 on symbols defined in discarded sections, instead return false.
1161 Rearrange params, update all callers.
1162 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1163 branches to syms in discarded sections.
1164 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1165 undefined and flag as discarded.
1166 (Target_powerpc::Relocate::relocate): Localize variable.
1167
4759c34e
L
11682014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1169
1170 PR gold/17675
1171 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1172 * testsuite/Makefile.in: Regenerated.
1173
1f98a074
AM
11742014-12-03 Alan Modra <amodra@gmail.com>
1175
1176 PR 17566
1177 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1178 when adding dynamic relocations against section symbols.
1179
fb257835
DI
11802014-12-01 Dimitry Ivanov <dimitry@google.com>
1181
1182 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1183 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1184 * options.h (General_options): New -z option (global).
1185
d8e60314
CC
11862014-12-01 Cary Coutant <ccoutant@google.com>
1187
1188 PR gold/17578
1189 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1190 is given.
1191 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1192 given but some inputs require executable stack.
1193
982bbd97
CC
11942014-11-26 Cary Coutant <ccoutant@google.com>
1195
1196 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1197 .debug_str_offsets; strip .debug_gnu_pubnames and
1198 .debug_gnu_pubtypes.
1199 (lines_only_debug_sections): Strip all four new sections.
1200
bb779192
HS
12012014-11-26 Jing Yu <jingyu@google.com>
1202
1203 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1204 register to be x0 when to relax TLSDESC_LD64_LO12.
1205
a3e60ddb
AM
12062014-11-26 Alan Modra <amodra@gmail.com>
1207
1208 * powerpc.cc (struct Stub_table_owner): New.
1209 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1210 unsigned int vector. Update all references.
1211 (powerpc_relobj::set_stub_table): Take an unsigned int param
1212 rather than a Stub_table. Update callers.
1213 (Powerpc_relobj::clear_stub_table): New function.
1214 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1215 stub_group_size_ vars.
1216 (Target_powerpc::new_stub_table): Delete.
1217 (max_branch_delta): New function, extracted from..
1218 (Target_powerpc::Relocate::relocate): ..here..
1219 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1220 status on whether stub created successfully.
1221 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1222 default sizing to..
1223 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1224 reduce on relax failure.
1225 (Target_powerpc::group_sections): Add "no_size_errors" param.
1226 Use stub_group_size_. Set up group info in a temp vector,
1227 before building Stub_table vector. Account for input sections
1228 possibly already converted to relaxed sections.
1229 (Stub_table::init): Delete. Merge into..
1230 (Stub_table::Stub_table): ..here.
1231 (Stub_table::can_reach_stub): New function.
1232 (Stub_table::add_plt_call_entry): Add "from" parameter and
1233 return true iff stub could be reached.
1234 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1235 param too.
1236 (Stub_table::clear_stubs): Add "all" param.
1237
a20605cf
AM
12382014-11-26 Alan Modra <amodra@gmail.com>
1239
1240 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1241 (Target_powerpc::group_sections): Use it.
1242
43b64deb
CC
12432014-11-25 Cary Coutant <ccoutant@google.com>
1244
1245 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1246 (Binary_to_elf::write_symbol): Add st_size parameter.
1247 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1248
c924eb67
CC
12492014-11-25 Cary Coutant <ccoutant@google.com>
1250
1251 PR gold/17639
1252 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1253 (Sized_relobj_file::do_layout): Handle deferred sections properly
1254 during GC pass 1. Don't add reloc sections to deferred list twice.
1255 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1256 (Sized_relobj_file::is_deferred_layout_): New data member.
1257
9d585188
L
12582014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1259
1260 PR gold/17619
1261 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1262 Check PC-relative offset overflow in PLT entry.
1263
3ffaac20
AM
12642014-11-21 Alan Modra <amodra@gmail.com>
1265
1266 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1267 for undefined weaks.
1268
0cfb0717
AM
12692014-11-20 Alan Modra <amodra@gmail.com>
1270
1271 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1272 from --stub-group-size parameter divided by 1024.
1273 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1274 template parameter. Update all uses.
1275 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1276 has_stub_value. Set for long branches. Don't report overflow for
1277 branch to undefined weak symbols. Print info message on
1278 overflowing branch to stub.
1279
f9dffbf0
AM
12802014-11-20 Alan Modra <amodra@gmail.com>
1281
1282 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1283
e88ba8d5
L
12842014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1285
1286 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1287 entry for R_X86_64_GOTPLT64.
1288 (Target_x86_64<size>::Relocate::relocate): Update comments for
1289 R_X86_64_GOTPLT64.
1290
d37ffe25
ED
12912014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1292
1293 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1294 * plugin.h: add lock definition
1295
9726c3c1
HS
12962014-10-29 Han Shen <shenhan@google.com>
1297 Jing Yu <jingyu@google.com>
1298
1299 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1300 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1301 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1302 Symbol::TLS_REF.
1303 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1304 method.
1305 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1306 (Target_aarch64::tls_ld_to_le): New method.
1307 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1308 for 64bit targets.
1309 (Output_data_plt_aarch64::irelative_rel_): New data member.
1310 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1311 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1312 (Output_data_plt_aarch64::add_relocation): New method.
1313 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1314 offset. Add got_irelative size to got size.
1315 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1316 type string with the new typename.
1317 (AArch64_relocate_functions::update_adr): Replace parameter x with
1318 immed.
1319 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1320 (AArch64_relocate_functions::reloc_common): New method.
1321 (AArch64_relocate_funcsions::rela_general): Extract common part out
1322 into reloc_common method.
1323 (AArch64_relocate_functions::rela_general): Likewise.
1324 (AArch64_relocate_functions::pcrela_general): Likewise.
1325 (AArch64_relocate_functions::adr): New method.
1326 (AArch64_relocate_functions::adrp): Calculate immed before calling
1327 update_adr.
1328 (AArch64_relocate_functions::adrp): Likewise.
1329 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1330 comparing x to 0. Calculate immed from ~x when x < 0.
1331 (Target_aarch64::optimize_tls_reloc): Add new cases for
1332 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1333 TLSLD_MOVW_DTPREL_G0_NC.
1334 (Target_aarch64::possible_function_pointer_reloc): Implement this
1335 method.
1336 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1337 comment.
1338 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1339 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1340 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1341 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1342 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1343 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1344 (Target_aarch64::make_plt_entry): Call add_entry with two more
1345 parameters.
1346 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1347 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1348 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1349 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1350 (Target_aarch64::Relocate::relocate_tls): Add cases for
1351 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1352 TLSLD_MOVW_DTPREL_G0_NC.
1353 * testsuite/icf_safe_so_test.cc: Correct test comment.
1354 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1355
80272b8c
AM
13562014-10-22 Alan Modra <amodra@gmail.com>
1357
1358 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1359 thread_starter.
1360
998a69f4
AS
13612014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1362
1363 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1364
aed56ec5
CC
13652014-10-17 Cary Coutant <ccoutant@google.com>
1366
1367 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1368 Add "typename" keyword.
1369
bb779192 13702014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
1371 Jing Yu <jingyu@google.com>
1372
1373 Patch for gold aarch64 backend to support relaxation.
1374 * aarch64-reloc.def: Change format.
1375 * aarch64.cc (class Reloc_stub): New class.
1376 (class Stub_table): New class.
1377 (class AArch64_relobj): New class.
1378 (class AArch64_input_section): New class.
1379 (class AArch64_output_section): New class.
1380 (Target_aarch64::new_stub_table): New method.
1381 (Target_aarch64::new_aarch64_input_section): New method.
1382 (Target_aarch64::find_aarch64_input_section): New method.
1383 (Target_aarch64::scan_section_for_stubs): New method.
1384 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1385 (Target_aarch64::relocate_stub): New method.
1386 (Target_aarch64::current_target): New method.
1387 (Target_aarch64::do_make_elf_object): New method.
1388 (Target_aarch64::do_may_relax): New method.
1389 (Target_aarch64::do_relax): New method.
1390 (Target_aarch64::group_sections): New method.
1391 (Target_aarch64::scan_reloc_for_stub): New method.
1392 (Target_aarch64::do_make_output_section): New method.
1393 (Target_aarch64::stub_tables_): New data member.
1394 (Target_aarch64::aarch64_input_section_map_): New data member.
1395 (AArch64_relocate_functions::maybe_apply_stub): New method.
1396
db4c9594
CC
13972014-09-30 Cary Coutant <ccoutant@google.com>
1398
1399 PR gold/17432
1400 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1401
cd6da036
KC
14022014-09-30 Kito Cheng <kito@0xlab.org>
1403
1404 PR gold/13597
1405 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1406 hash table before sysv-style hash table.
1407
5f772412
ST
14082014-09-29 Sriraman Tallam <tmsriram@google.com>
1409
1410 * options.h (--pic-executable): Add negative to alias to -no-pie.
1411
5efeedf6
CC
14122014-09-26 Cary Coutant <ccoutant@google.com>
1413
1414 PR gold/16773
1415 * object.cc (Sized_relobj_file): Compute value of section symbols
1416 for TLS sections the same as TLS symbols.
1417
1707f183
CC
14182014-09-25 Cary Coutant <ccoutant@google.com>
1419
1420 PR gold/17432
1421 * resolve.cc (Symbol_table::resolve): Override common placeholder
1422 symbols, but adjust sizes.
1423 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1424 symbols to common lists.
1425
00cac886
AM
14262014-09-24 Alan Modra <amodra@gmail.com>
1427
1428 * po/POTFILES.in: Regenerate.
1429
635aa30e
CC
14302014-09-23 Taiju Tsuiki <tzik@google.com>
1431 Cary Coutant <ccoutant@google.com>
1432
71b9b91b 1433 PR gold/14860
635aa30e
CC
1434 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1435 on input_sections_blocker.
1436 * layout.cc (Write_sections_task::locks): Unblock
1437 input_sections_blocker_.
1438 * layout.h (Write_sections_task::Write_sections_task): Add
1439 input_sections_blocker.
1440 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1441 to DEPENDENCIES.
1442 * testsuite/Makefile.in: Regenerate.
1443
c0c71592
RÁE
14442014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1445
1446 * testsuite/Makefile.am (plugin_test_10): New test.
1447 * testsuite/Makefile.in: Regenerate
1448 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1449 * testsuite/plugin_test_10.sh: New file.
1450
6168c2a1
RÁE
14512014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1452
1453 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1454 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1455 during the replacement phase.
1456
3a531937
JY
14572014-09-17 Han Shen <shenhan@google.com>
1458 Jing Yu <jingyu@google.com>
1459
1460 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1461 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1462 * aarch64.cc (Target_aarch64): Add data members
1463 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1464 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1465 constructor.
1466 (Target_aarch64::do_reloc_symbol_index): New method.
1467 (Target_aarch64::do_reloc_addend): New method.
1468 (Target_aarch64::add_tlsdesc_info): New method.
1469 (Target_aarch64::do_dynsym_value): New method.
1470 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1471 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1472 (Target_aarch64::make_data_plt): Add new parameters: got,
1473 got_irelative. Pass them to do_make_data_plt.
1474 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1475 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1476 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1477 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1478 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1479 (Target_aarch64::got_tlsdesc_section): New method.
1480 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1481 (Target_aarch64::define_tls_base_symbol): New method.
1482 (Target_aarch64::reserve_tlsdesc_entries): New method.
1483 (Target_aarch64::got_mod_index_entry): New method.
1484 (Target_aarch64::rela_tlsdesc_section): New method.
1485 (Target_aarch64::rela_irelative_section): New method.
1486 (Target_aarch64::Tlsdesc_info): New struct.
1487 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1488 relocations and tlsdesc relocations.
1489 (Target_aarch64::optimize_tls_reloc): Implement method.
1490 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1491 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1492 in constructor.
1493 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1494 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1495 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1496 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1497 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1498 (Output_data_plt_aarch64::rela_irelative): New method.
1499 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1500 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1501 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1502 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1503 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1504 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1505 (Output_data_plt_aarch64_standard): New member variables:
1506 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1507 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1508 New parameter: got, got_irelative.
1509 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1510 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1511 (Output_data_plt_aarch64::do_write): Replace got_address with
1512 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1513 (AArch64_relocate_functions::update_movnz): New method.
1514 (AArch64_relocate_functions): Correct format.
1515 (AArch64_relocate_functions::movnz): New method.
1516 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1517 before the switch. Add new cases to switch.
00cac886 1518 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1519 tlsgd tlsdesc cases.
1520 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1521 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1522 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1523 Call reloc_name_in_error_message to print unsupported reloc.
1524 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1525 make_data_plt.
1526 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1527 relocs. Fill in some more dynamic tags.
1528 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1529 Skip call tls_get_addr when tlsgd is relaxed.
1530 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1531 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1532 tlsdesc->ie relaxation.
1533
62661c93
SS
15342014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1535
1536 * mips.cc (Target_mips_nacl): New class.
1537 (Target_selector_mips_nacl): New class.
1538 (target_selector_mips32): Rename from target_selector_mips32be and use
1539 Target_selector_mips_nacl instead of Target_selector_mips.
1540 (target_selector_mips32el): Rename from target_selector_mips32 and use
1541 Target_selector_mips_nacl instead of Target_selector_mips.
1542 (target_selector_mips64): Rename from target_selector_mips64be and use
1543 Target_selector_mips_nacl instead of Target_selector_mips.
1544 (target_selector_mips64el): Rename from target_selector_mips64 and use
1545 Target_selector_mips_nacl instead of Target_selector_mips.
1546 (Target_mips::mips_info): Add const attribute.
1547
54674d38
CC
15482014-09-02 Cary Coutant <ccoutant@google.com>
1549
1550 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1551 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1552 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1553 (Sized_incr_dynobj::do_section_name): Likewise.
1554 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1555 (Sized_incr_dynobj::do_section_name): Likewise.
1556 * object.h (Object::section_name): Likewise.
1557 (Object::do_section_name): Likewise.
1558 (Sized_relobj_file::do_section_name): Likewise.
1559 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1560 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1561
9860cbcf
CC
15622014-09-02 Cary Coutant <ccoutant@google.com>
1563
1564 PR gold/17005
1565 * ehframe.cc (Fde::write): Add output_offset parameter.
1566 (Cie::write): Likewise.
1567 (Eh_frame::set_final_data_size): Account for offset within output
1568 section.
1569 (Eh_frame::do_sized_write): Likewise.
1570 * ehframe.h (Fde::write): Add output_offset parameter.
1571 (Cie::write): Likewise.
1572 * output.cc (Output_section::Input_section_sort_entry): Remove
1573 section_has_name_; add output_section_name parameter. Use
1574 output section name for non-input sections.
1575 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1576 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1577 (Output_section::Input_section_sort_compare): Remove logic for
1578 sections without names.
1579 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1580 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1581 Likewise.
1582 (Output_section::Input_section_sort_section_name_compare): Likewise.
1583
8e33481e
HS
15842014-08-29 Han Shen <shenhan@google.com>
1585 Jing Yu <jingyu@google.com>
1586
1587 * aarch64-reloc-property.cc
1588 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1589 reference reloc property in the table.
1590 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1591 3 other entries.
1592 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1593 2 new overloaded methods.
1594 (Output_data_got_aarch64::do_write): Add code to write out
1595 static relocs.
1596 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1597 static relocs.
1598 (Output_data_got_aarch64::static_relocs): New vector to
1599 hold static relocs.
1600 (Target_aarch64::TCB_SIZE): New const static memeber.
1601 (Target_aarch64::tcb_size): New method.
1602 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1603 (Target_aarch64::Relocate::relocate_tls): New method.
1604 (Target_aarch64::Scan::local): Add code handling new reloc types.
1605 (Target_aarch64::Scan::global): Add code handling new reloc types.
1606
81233653
ST
16072014-08-13 Sriraman Tallam <tmsriram@google.com>
1608
1609 * options.h (-no-pie): Add option.
1610
9363c7c3
JY
16112014-08-08 Jing Yu <jingyu@google.com>
1612 Han Shen <shenhan@google.com>
1613
1614 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1615 (DEFFILES): add aarch64-reloc.def.
1616 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1617 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1618 * Makefile.in: Regenerate.
1619 * aarch64-reloc-property.cc: New file.
1620 * aarch64-reloc-property.h: New file.
1621 * aarch64-reloc.def: New file.
1622 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1623 with tab to make the format consistent.
1624 (Output_data_got_aarch64::symbol_table_): New method.
1625 (Target_aarch64::do_plt_address_for_global): New method.
1626 (Target_aarch64::do_plt_address_for_local): New method.
1627 (Target_aarch64::do_select_as_default_target): New method.
1628 (Target_aarch64::do_make_data_plt): New method.
1629 (Target_aarch64::make_data_plt): New method.
1630 (Output_data_plt_aarch64::has_irelative_section): New method.
1631 (Output_data_plt_aarch64::address_for_global): New method.
1632 (Output_data_plt_aarch64::address_for_local): New method.
1633 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1634 (Output_data_plt_aarch64::add_entry): Implement contents.
1635 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1636 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1637 the got_pov entry to plt0.
1638 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1639 Implement contents.
1640 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1641 (AArch64_howto): New struct.
1642 (aarch64_howto[]): New static const array.
1643 (AArch64_relocate_functions): New class.
1644 (Target_aarch64::Scan::get_reference_flags): Remove method.
1645 (Target_aarch64::Scan::local): Implement to support a few relocations.
1646 (Target_aarch64::Scan::global): Implement to support a few relocations.
1647 (Target_aarch64::make_plt_section): Implement contents.
1648 (Target_aarch64::make_plt_entry): Implement contents.
1649 (Target_aarch64::do_finalize_sections): Implement contents.
1650 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1651 (Target_aarch64::relocate_section): Implement contents.
1652
ad9fe6c1
AM
16532014-08-06 Alan Modra <amodra@gmail.com>
1654
1655 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1656
7cd4e5b7
AM
16572014-08-06 Alan Modra <amodra@gmail.com>
1658
1659 PR 13227
1660 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1661
5ad9b0a7
ST
16622014-07-21 Sriraman Tallam <tmsriram@google.com>
1663
1664 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1665 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1666
e051745c
CC
16672014-07-08 Cary Coutant <ccoutant@google.com>
1668
1669 * expression.cc (struct Expression::Expression_eval_info): Add
1670 new fields type_pointer, vis_pointer, and nonvis_pointer.
1671 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1672 nonvis_pointer parameters. Adjust all calls.
1673 (Symbol_expression::value): Update type, visibility, and nonvis bits
1674 in caller.
1675 * script.cc (Symbol_assignment::sized_finalize): Update type,
1676 visibility, and remaining st_other bits for new symbol.
1677 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1678 vis_pointer, and nonvis_pointer parameters.
1679 * symtab.h (Symbol::set_type): New method.
1680
1681 * testsuite/Makefile.am (defsym_test): New test.
1682 * testsuite/Makefile.in: Regenerate.
1683 * testsuite/defsym_test.c: New file.
1684 * testsuite/defsym_test.sh: New file.
1685
f35c4853
CC
16862014-07-08 Cary Coutant <ccoutant@google.com>
1687
1688 PR gold/15639
1689 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1690 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1691 (Sized_dynobj::base_read_symbols): ...new method.
1692 * object.h (Sized_relobj_file::base_read_symbols): New method.
1693 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1694 (Sized_relobj_file::base_read_symbols): ...new method.
1695 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1696 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1697 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1698
2900af2d
AM
16992014-07-04 Alan Modra <amodra@gmail.com>
1700
1701 * po/POTFILES.in: Regenerate.
1702
053a4d68
JY
17032014-07-02 Jing Yu <jingyu@google.com>
1704
1705 * aarch64.cc: New file
1706 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1707 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1708 * Makefile.in: Regenerate.
1709 * configure.tgt: Add entries for aarch64*.
1710 * configure.ac: Likewise.
1711 * configure: Likewise.
1712
7b549045
AM
17132014-06-27 Alan Modra <amodra@gmail.com>
1714
1715 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1716
cb818dbf
CC
17172014-06-24 Cary Coutant <ccoutant@google.com>
1718
1719 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1720 sections.
1721 (Dwo_file::sized_read_unit_index): Likewise.
1722
9810d34d
SS
17232014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1724
1725 * mips.cc: New file.
1726 * Makefile.am (TARGETSOURCES): Add mips.cc
1727 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1728 * configure.tgt: Add entries for mips*.
1729 * configure.ac: Likewise.
1730 * Makefile.in: Regenerate.
1731 * configure: Likewise.
1732
9baa787b
CC
17332014-06-09 Cary Coutant <ccoutant@google.com>
1734
1735 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1736 unit_length is within section bounds.
1737
8f89af0a
CC
17382014-06-09 Cary Coutant <ccoutant@google.com>
1739
1740 PR gold/16980
1741 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1742 map.
1743
a47622ac
AM
17442014-06-07 Alan Modra <amodra@gmail.com>
1745
1746 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1747
4320c691
CC
17482014-06-06 Cary Coutant <ccoutant@google.com>
1749
1750 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1751 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1752 (Dwarf_pubnames_table::read_header): Likewise.
1753 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1754 .debug_gnu_pubtypes.
1755
270c9937
JB
17562014-06-05 Joel Brobecker <brobecker@adacore.com>
1757
1758 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1759 * Makefile.in, configure: Regenerate.
1760
397998fc
AM
17612014-06-03 Alan Modra <amodra@gmail.com>
1762
1763 * powerpc.cc (addis_12_2): Define.
1764 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1765
61f5c66f
AM
17662014-06-03 Alan Modra <amodra@gmail.com>
1767
1768 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1769 st_other output.
1770
f6971787
AM
17712014-06-02 Alan Modra <amodra@gmail.com>
1772
1773 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1774 Only ignore relocs on ELFv1.
1775 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1776
f6fb8322
CC
17772014-05-30 Cary Coutant <ccoutant@google.com>
1778
1779 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1780 * testsuite/Makefile.in: Regenerate.
1781 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1782
c23dd342
L
17832014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1784
1785 PR gold/16945
1786 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1787 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1788
5fe7ffdc
AM
17892014-05-15 Alan Modra <amodra@gmail.com>
1790
1791 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1792 Compare FDE contents with DW_CFA_nop rather than 0.
1793
a82bef93
ST
17942014-05-13 Sriraman Tallam <tmsriram@google.com>
1795
1796 * symtab.h (may_need_copy_reloc): Remove check for position independent
1797 code.
1798 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1799 position independence before pc absolute may_need_copy_reloc call.
1800 Add check for executable output befor pc relative may_need_copy_reloc
1801 call.
1802 * i386.cc: Ditto.
1803 * arm.cc: Ditto.
1804 * sparc.cc: Ditto.
1805 * tilegx.cc: Ditto.
1806 * powerpc.cc: Add check for no position independence before
1807 may_need_copy_reloc calls.
1808 * testsuite/pie_copyrelocs_test.cc: New file.
1809 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1810 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1811 * Makefile.in: Regenerate.
a82bef93 1812
53c66605
ML
18132014-05-08 Martin Liška <mliska@suse.cz>
1814
1815 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1816
57b2284c
CC
18172014-05-06 Cary Coutant <ccoutant@google.com>
1818
1819 PR gold/16900
1820 * i386.cc (Output_data_got_plt_i386): New class.
1821 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1822 parameter. Change all callers.
1823 (Output_data_plt_i386::layout_): Remove.
1824 (Output_data_plt_i386::got_plt_): Change type.
1825 (Target_i386::got_plt_): Change type. Change all references.
1826 (Target_i386::got_section): Create instance of new class.
1827 (Output_data_got_plt_i386::do_write): New function.
1828 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1829 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1830 parameter. Change all callers.
1831 (Output_data_plt_x86_64::layout_): Remove.
1832 (Output_data_plt_x86_64::got_plt_): Change type.
1833 (Target_x86_64::got_plt_): Change type. Change all references.
1834 (Target_x86_64::got_section): Create instance of new class.
1835 (Output_data_got_plt_x86_64::do_write): New function.
1836 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1837 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1838 class.
1839
6b97515d 18402014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1841
6b97515d
CC
1842 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1843 if we have pubnames/pubtypes.
1844
d1bddd3c
CC
18452014-05-02 Cary Coutant <ccoutant@google.com>
1846
5fe7ffdc
AM
1847 * defstd.cc (in_segment): Define __ehdr_start here...
1848 * layout.cc (Layout::finalize): ...Instead of here. Set the
1849 output segment when known.
1850 * resolve.cc (Symbol::override_base_with_special): Remember
1851 the original binding.
1852 * symtab.cc (Symbol::set_output_segment): New function.
1853 (Symbol::set_undefined): New function.
1854 * symtab.h (Symbol::is_weak_undefined): Check original undef
1855 binding.
1856 (Symbol::is_strong_undefined): New function.
1857 (Symbol::set_output_segment): New function.
1858 (Symbol::set_undefined): New function.
1859 * target-reloc.h (is_strong_undefined): Remove.
1860 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1861 Check for hidden undefs.
1862 (relocate_section): Call Symbol::is_strong_undefined.
1863
1864 * testsuite/Makefile.am (ehdr_start_test_1)
1865 (ehdr_start_test_2, ehdr_start_test_3)
1866 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1867 * testsuite/Makefile.in: Regenerate.
1868 * testsuite/ehdr_start_def.cc: New source file.
1869 * testsuite/ehdr_start_test.cc: New source file.
1870 * testsuite/ehdr_start_test.t: New linker script.
1871 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1872
7849f6d8
CC
18732014-04-23 Cary Coutant <ccoutant@google.com>
1874
bf2cc635 1875 PR gold/16870
7849f6d8
CC
1876 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1877
99fd8cff
CC
18782014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1879
1880 * layout.cc (Layout::include_section): Allow a target to decide
1881 whether to include a section.
1882 * target.h (Target::should_include_section): New function.
1883 (Target::do_should_include_section): New function.
1884
91f43acd
CC
18852014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1886
1887 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1888 inline into ...
1889 (Copy_relocs::emit): ... here.
1890 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1891 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1892 (Copy_reloc_entry::entries_): Change from private to protected.
1893
c4eb27e1
ST
18942014-04-02 Sriraman Tallam <tmsriram@google.com>
1895
1896 * icf.cc (get_section_contents): Replace copies of reloc
1897 vectors with const references.
1898
ae447ddd
CC
18992014-04-02 Cary Coutant <ccoutant@google.com>
1900
1901 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1902 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1903 * configure: Regenerate.
1904 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1905 -fno-use-linker-plugin.
1906 (LINK1, CXXLINK1): Add it to the link command.
1907 * testsuite/Makefile.in: Regenerate.
1908
fa47fa92
AM
19092014-03-12 Alan Modra <amodra@gmail.com>
1910
1911 * Makefile.in: Regenerate.
1912
9b12c500
CC
19132014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1914
1915 * symtab.h (Symbol::set_nonvis): New function.
1916
beacaa96
CC
19172014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1918
1919 * symtab.cc (Sized_symbol<32>::init_output_data):
1920 Instantiate the template.
1921 (Sized_symbol<64>::init_output_data): Likewise.
1922
800d9823
CC
19232014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1924
1925 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1926 adjust dynamic symbol value.
1927 * target.h (Target::adjust_dyn_symbol): New function.
1928 (Target::do_adjust_dyn_symbol): New function.
1929
918fc1f8 19302014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1931
918fc1f8
CC
1932 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1933 Get the value of DYNAMIC_CUSTOM dynamic entry.
1934 * output.h (Output_data_dynamic::add_custom): New function.
1935 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1936 dynamic entry.
1937 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1938 * target.h (Target::dynamic_tag_custom_value): New function.
1939 (Target::do_dynamic_tag_custom_value): New function.
1940
98ff9231
CC
19412014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1942
1943 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1944 dynsym indexes.
1945 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1946 (Target::do_has_custom_set_dynsym_indexes): New function.
1947 (Target::set_dynsym_indexes): New function.
1948 (Target::do_set_dynsym_indexes): New function.
1949
b80eed39
AM
19502014-03-07 Alan Modra <amodra@gmail.com>
1951
1952 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1953 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1954 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1955 (Powerpc_relocate_functions::has_overflow_bitfield,
1956 overflowed): Use the above.
1957 (Target_powerpc::Relocate::relocate): Correct overflow checking
1958 for a number of relocations. Modify overflow test for 16-bit
1959 fields in instructions to signed/unsigned according to whether
1960 the field takes a signed or unsigned value.
1961
4b95cf5c
AM
19622014-03-05 Alan Modra <amodra@gmail.com>
1963
1964 Update copyright years.
1965
45965137
AM
19662014-03-05 Alan Modra <amodra@gmail.com>
1967
1968 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1969 R_PPC64_ADDR64_LOCAL.
1970 (Target_powerpc::Relocate::relocate): Likewise.
1971
2c80b753
AM
19722014-03-03 Alan Modra <amodra@gmail.com>
1973
1974 * dwp.cc (print_version): Update copyright year to current.
1975
c1c69e83
AM
19762014-02-10 Alan Modra <amodra@gmail.com>
1977
1978 * po/gold.pot: Regenerate.
1979
dd0c4e70
CC
19802014-02-06 Cary Coutant <ccoutant@google.com>
1981
1982 Fix problem where -u is ignored when a weak undef is seen.
1983
1984 * archive.cc (Library_base::should_include_member): Reorder
1985 code to check for -u option if a weak undef has already been seen.
1986 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1987 * testsuite/Makefile.in: Regenerate.
1988 * testsuite/weak_undef_file3.cc: New file.
1989 * testsuite/weak_undef_file4.cc: New file.
1990 * testsuite/weak_undef_test_2.cc: New file.
1991
1a221d3d
CC
19922014-02-05 Cary Coutant <ccoutant@google.com>
1993
1994 Fix issues with gold undefined symbol diagnostics.
1995
1996 PR binutils/15435
1997 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1998 check to here.
1999 * target-reloc.h (is_strong_undefined): New function.
2000 (relocate_section): Move undef vtable symbol check from here.
2001 Check for is_strong_undefined.
2002
e889f0a4 20032014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2004
e889f0a4
CC
2005 Fix problems with the --dynamic-list option.
2006
2007 PR gold/13577
2008 * options.cc (General_options::parse_dynamic_list):
2009 Set have_dynamic_list_.
2010 (General_options::General_options): Initialize have_dynamic_list_.
2011 (General_options::finalize): Turn off -Bsymbolic and
2012 -Bsymbolic-functions if --dynamic-list provided.
2013 * options.h (General_options::have_dynamic_list): New function.
2014 (General_options::have_dynamic_list_): New data member.
2015 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2016 correctly.
5fe7ffdc 2017
e889f0a4
CC
2018 PR gold/16530
2019 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2020 in --dynamic-list, mark it.
5fe7ffdc 2021
e889f0a4
CC
2022 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2023 (dynamic_list_2): New test case.
2024 * testsuite/Makefile.in: Regenerate.
2025 * testsuite/dynamic_list_2.cc: New file.
2026 * testsuite/dynamic_list_2.t: New file.
2027 * testsuite/dynamic_list_lib1.cc: New file.
2028 * testsuite/dynamic_list_lib2.cc: New file.
2029 * testsuite/gc_dynamic_list_test.c: New file.
2030 * testsuite/gc_dynamic_list_test.sh: New file.
2031 * testsuite/gc_dynamic_list_test.t: New file.
2032
ec673e64
CC
20332014-01-28 Cary Coutant <ccoutant@google.com>
2034
2035 Add .gdb_index version 7 support.
2036
2037 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2038 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2039 debug sections.
2040 (Dwarf_ranges_table::read_ranges_table): Likewise.
2041 (Dwarf_pubnames_table::read_section): Check for GNU-style
2042 sections, and for compressed debug sections.
2043 (Dwarf_pubnames_table::read_header): Compute end address of table.
2044 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2045 for end of list by offset, not by offset == 0.
2046 (Dwarf_info_reader::do_read_string_table): Check for compressed
2047 debug sections.
2048 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2049 Initialize new data members.
2050 (Dwarf_pubnames_table::next_name): return flag_byte.
2051 (Dwarf_pubnames_table::end_of_table_): New data member.
2052 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2053 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2054 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2055 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2056 read skeleton type unit DIEs.
2057 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2058 (Gdb_index::do_write): Write flag_byte.
2059 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2060 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2061 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2062 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2063
221fd5d5
L
20642014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2065
2066 * version.cc (print_version): Update copyright year to 2014.
2067
6c09fb0b
ILT
20682013-12-19 Dimitry Andric <dimitry@andric.com>
2069
2070 * stringpool.cc (Stringpool_template::reserve): Add
2071 HAVE_UNORDERED_MAP case.
2072 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2073
8356f2d0
CC
20742013-12-18 Cary Coutant <ccoutant@google.com>
2075
2076 * configure.ac: Check for <unordered_set> and <unordered_map>.
2077 * config.in: Regenerate.
2078 * configure: Regenerate.
2079 * system.h: Use <unordered_set> and <unordered_map> if available.
2080
f2c7d7ee
RM
20812013-12-10 Roland McGrath <mcgrathr@google.com>
2082
2083 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2084 with $(INSTALL_PROGRAM_ENV).
2085 * Makefile.in: Regenerate.
2086
6632e8cc
CC
20872013-11-22 Cary Coutant <ccoutant@google.com>
2088
2089 * configure.ac: Add check for which library is needed for
2090 dlopen.
2091 * configure: Regenerate.
2092
0c075858
CC
20932013-11-22 Cary Coutant <ccoutant@google.com>
2094
2095 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2096 assembler.
2097 * testsuite/Makefile.in: Regenerate.
2098
f49fe902
L
20992013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2100
2101 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2102 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2103 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2104 (Target_x86_64<size>::Scan::local): Likewise.
2105 (Target_x86_64<size>::Scan::global): Likewise.
2106 (Target_x86_64<size>::Relocate::relocate): Likewise.
2107 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2108 Likewise.
2109 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2110 R_X86_64_PC32_BND.
2111
2112 * testsuite/Makefile.am (check_PROGRAMS): Add
2113 exception_x86_64_bnd_test.
2114 (exception_x86_64_bnd_test_SOURCES): New macro.
2115 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2116 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2117 (exception_x86_64_bnd_test_LDADD): Likewise.
2118 (exception_x86_64_bnd_1.o): New rule.
2119 (exception_x86_64_bnd_2.o): Likewise.
2120 * testsuite/Makefile.in: Regenerated.
2121
9055360d
AM
21222013-11-15 Alan Modra <amodra@gmail.com>
2123
2124 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2125 accessor.
2126 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2127 Only call ppc64_local_entry_offset for 64-bit. Restrict
2128 symval_for_branch lookup to ELFv1.
2129 (Stub_table::add_plt_call_entry): Use unsigned int off.
2130 (Output_data_glink::Address, invalid_address): New.
2131 (Output_data_glink::add_eh_frame): Move out of line. Add
2132 support for ELFv2.
2133 (Output_data_glink::add_global_entry, find_global_entry,
2134 global_entry_address): New functions.
2135 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2136 ge_size): New variables.
2137 (Output_data_glink::set_final_data_size): Add global entry
2138 stub sizing.
2139 (Output_data_glink::do_write): Write global entry stubs.
2140 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2141 parameter. Return true for ELFv2. Adjust callers.
2142 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2143 ELFv1. Similarly for ifunc and dynamic relocation processing
2144 specific to ELFv1. Recognize that symbols are defined on
2145 their plt entries for ELFv2.
2146 (Target_powerpc::symval_for_branch): Assert if called for
2147 ELFv2 or ppc32.
2148 (Target_powerpc::Relocate::relocate): Use global entry plt
2149 stub for symbol value if such exists on ELFv2.
2150 (Target_powerpc::Relocate::relocate): Don't call
2151 symval_for_branch when ELFv2. Do adjust for local entry
2152 offset when ELFv2.
2153 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2154 plt stub for ELFv2.
2155 (Target_powerpc::do_plt_address_for_global): Similarly.
2156
cafdd569
CC
21572013-11-14 Cary Coutant <ccoutant@google.com>
2158
2159 Revert patch -- this did not fix the problem, and there is
2160 no race there.
2161
2162 2013-11-14 Cary Coutant <ccoutant@google.com>
2163
2164 PR gold/14860
2165 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2166 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2167 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2168 updating fde_offsets_.
2169 (Eh_frame_hdr::lock_): New data member.
2170
94e49e16
CC
21712013-11-14 Cary Coutant <ccoutant@google.com>
2172
2173 * dwp.cc (Dwo_file_entry): New type.
2174 (File_list): Use Dwo_file_entry.
2175 (Dwo_file::verify): New function.
2176 (Dwo_file::verify_dwo_list): New function.
2177 (Dwo_file::sized_verify_dwo_list): New function.
2178 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2179 list.
2180 (Dwp_options): New enum type.
2181 (dwp_options): Add --verify-only.
2182 (usage): Likewise.
2183 (main): Likewise.
2184 * dwp.h (gold_info): Add declaration.
2185
7cdd7d57
CC
21862013-11-14 Cary Coutant <ccoutant@google.com>
2187
2188 PR gold/14860
2189 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2190 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2191 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2192 updating fde_offsets_.
2193 (Eh_frame_hdr::lock_): New data member.
2194
1d946cb3
CC
21952013-11-06 Cary Coutant <ccoutant@google.com>
2196
2197 PR gold/15758
2198 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2199 before reloc sections.
2200
4f65b40e
AM
22012013-11-04 Alan Modra <amodra@gmail.com>
2202
2203 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2204 (Symbol::needs_dynamic_reloc): Test new flag.
2205 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2206 (Target_powerpc::Scan::get_reference_flags): Add target param.
2207 Return FUNC_DESC_ABI for 64-bit ELFv1.
2208 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2209 call.
2210 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2211 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2212
908794a9
CC
22132013-10-31 Cary Coutant <ccoutant@google.com>
2214
2215 Restore support for dwp v2 DWARF package file format.
2216
2217 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2218 tu_length parameter. Adjust all callers.
2219 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2220 * dwp.cc: Include dwarf.h.
2221 (Section_bounds): New struct type.
2222 (Unit_set): New struct type.
2223 (Dwo_file::Dwo_file): Initialize new data member.
2224 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2225 Combine and rename to...
2226 (Dwo_file::read_unit_index): ...this.
2227 (Dwo_file::sized_read_compunit_index)
2228 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2229 (Dwo_file::sized_read_unit_index): ...this.
2230 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2231 parameters; add section_id parameter.
2232 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2233 (Dwo_file::add_unit_set): ...this.
2234 (Dwo_file::shndx_map_): Remove.
2235 (Dwo_file::sect_offsets_): New data member.
2236 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2237 (Dwp_output_file::add_section): Rename to...
2238 (Dwp_output_file::add_contribution): ...this.
2239 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2240 (Dwp_output_file::add_tu_set): Likewise.
2241 (Dwp_output_file::Contribution): New type.
2242 (Dwp_output_file::Section::contributions): New data member.
2243 (Dwp_output_file::Cu_or_tu_set): Remove.
2244 (Dwp_output_file::Section::Section): New ctor.
2245 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2246 (Dwp_output_file::Dwp_index::Section_table): New type.
2247 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2248 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2249 parameter.
2250 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2251 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2252 (Dwp_output_file::Dwp_index::section_table): New member function.
2253 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2254 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2255 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2256 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2257 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2258 (Dwp_output_file::Dwp_index::section_table_): New data member.
2259 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2260 (Dwp_output_file::add_output_section): New member function.
2261 (Dwp_output_file::write_new_section): New member function.
2262 (Dwp_output_file::write_contributions): New member function.
2263 (Dwp_output_file::section_id_map_): New data member.
2264 (class Dwo_id_info_reader): Remove.
2265 (class Unit_reader): New class.
2266 (get_dwarf_section_name): New function.
2267 (Dwo_file::read_executable): Adjust initializations of class data.
2268 (Dwo_file::read): Add support for v2 package file format.
2269 (Dwo_file::read_unit_index): Likewise.
2270 (Dwo_file::sized_read_unit_index): Likewise.
2271 (Dwo_file::copy_section): Likewise.
2272 (Dwo_file::add_unit_set): Likewise.
2273 (Dwp_output_file::add_output_section): Likewise.
2274 (Dwp_output_file::add_contribution): Likewise.
2275 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2276 for empty slot.
2277 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2278 file format.
2279 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2280 slot.
2281 (Dwp_output_file::initialize): Remove unused function.
2282 (Dwp_output_file::finalize): Add support for v2 package file format.
2283 (Dwp_output_file::write_index): Likewise.
2284 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2285 function prototype.
2286
2500c017
CC
22872013-10-31 Cary Coutant <ccoutant@google.com>
2288
2289 * configure.ac: Fix check for -fmerge-constants.
2290 * configure.ac: Regenerate.
2291
dd0845d7
RM
22922013-10-30 Roland McGrath <mcgrathr@google.com>
2293
2294 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2295 Correct 9-byte nop sequence to match what the assembler generates.
2296
b4f7960d
AM
22972013-10-30 Alan Modra <amodra@gmail.com>
2298
2299 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2300 ppc64_local_entry_offset, ppc64_local_entry_offset,
2301 do_read_symbols): New functions.
2302 (Powerpc_relobj::e_flags_, st_other_): New vars.
2303 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2304 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2305 (Powerpc_relobj::e_flags_): New var.
2306 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2307 and adjust for ELFv2.
2308 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2309 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2310 (Powerpc_dynobj::do_find_special_sections): Likewise.
2311 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2312 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2313 to ELFv2 local entry.
2314 (Target_powerpc::do_relax): No thread safe barriers needed for
2315 ELFv2.
2316 (Output_data_plt_powerpc::initial_plt_entry_size_,
2317 plt_entry_size): Delete. Replace all uses with
2318 first_plt_entry_offset() and plt_entry_size().
2319 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2320 reserved_size parm. Update callers.
2321 (Output_data_plt_powerpc::entry_count): Update.
2322 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2323 and use Target_powerpc::first_plt_entry_offset().
2324 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2325 rename to plt_entry_size.
2326 (Output_data_plt_powerpc::add_ifunc_entry,
2327 add_local_ifunc_entry): Adjust reloc for ELFv2.
2328 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2329 (glink_eh_frame_fde_64v2): New.
2330 (Stub_table::plt_call_size): Support ELFv2 sizing.
2331 (Output_data_glink::add_eh_frame): Use the new FDE.
2332 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2333 (Stub_table::do_write): Write ELFv2 stubs and glink.
2334 (Target_powerpc::Relocate::relocate): Replaces nop after call
2335 with ld 2,24(1) and adjust local offset destination for ELFv2.
2336
f9c6b907
AM
23372013-10-30 Alan Modra <amodra@gmail.com>
2338
2339 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2340 (Target_powerpc::Scan::global, local): Likewise.
2341 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2342 on all ppc64 @h and @ha relocs.
2343
e84fe78f
AM
23442013-10-14 Alan Modra <amodra@gmail.com>
2345
2346 * output.h (Output_data_got::add_constant): Tidy.
2347 (Output_data_got::add_constant_pair): New function.
2348 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2349 methods used so as to first call reserve_ent().
2350
679e4abf
RM
23512013-10-11 Roland McGrath <mcgrathr@google.com>
2352
44dcb735
RM
2353 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2354 add_got_entry and add_got_entry_pair.
2355
13323c49
RM
2356 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2357 (HAVE_PUBNAMES): Likewise.
2358 * configure: Regenerate.
2359
1496b446
RM
2360 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2361 * testsuite/Makefile.in: Regenerate.
2362
cc84c10b
RM
2363 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2364 Remove const from declaration.
2365 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2366 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2367 * output.h (Output_file_header): Remove const from member target_
2368 and corresponding constructor argument.
2369 * output.cc (Output_file_header::Output_file_header): Update prototype.
2370 (Output_file_header::do_sized_write): Use this->target_ in place
2371 of parameters()->target().
2372
52f66a2c
RM
2373 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2374
2b64b551
RM
2375 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2376 * configure: Regenerate.
2377 * Makefile.in: Regenerate.
2378 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2379 * testsuite/merge_string_literals_2.c: Likewise.
2380 * testsuite/Makefile.am
2381 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2382 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2383 literal -fmerge-constants.
2384 * testsuite/Makefile.in: Regenerate.
2385
43819297
RM
2386 * i386.cc (Target_i386): Remove unused member dynbss_.
2387 * arm.cc (Target_arm): Likewise.
2388 * powerpc.cc (Target_powerpc): Likewise.
2389 * sparc.cc (Target_sparc): Likewise.
2390 * tilegx.cc (Target_tilegx): Likewise.
2391 * x86_64.cc (Target_x86_64): Likewise.
2392 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2393 type_signature_, type_offset_.
2394 * plugin.h (Plugin_hook): Remove unused member layout_.
2395 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2396 mapfile_.
2397 (Read_member): Remove unused members input_objects_, symtab_,
2398 mapfile_, layout_.
2399 (Check_library): Remove unused member symtab_.
2400 * archive.h (Lib_group): Remove unused member lib_.
2401 * archive.cc (Lib_group::Lib_group): Update initializer.
2402 * incremental.h (Incremental_binary): Remove unused member target_.
2403 (Incremental_script_entry): Removed unused member script_.
2404 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2405 * icf.h (Icf): Remove unused member num_tracked_relocs.
2406
39d9ead7
RM
2407 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2408 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2409 its only use.
2410 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2411
679e4abf
RM
2412 * archive.h: Use struct rather than class for forward declaration
2413 of Read_symbols_data.
2414
54de2ea6
CC
24152013-10-07 Cary Coutant <ccoutant@google.com>
2416
2417 PR gold/16010
2418 * testsuite/Makefile.am (icf_test): Fix dependencies.
2419 (icf_safe_test): Likewise.
2420 (icf_safe_so_test): Likewise.
2421 (large_symbol_alignment): Add empty _LDADD rule.
2422 * testsuite/Makefile.in: Regenerate.
2423
b14016f0
L
24242013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2425
2426 PR gold/15927
2427 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2428 relocation for R_X86_64_32 on x32.
2429
eb426534
RM
24302013-08-27 Roland McGrath <mcgrathr@google.com>
2431
2432 * output.cc (Output_segment::set_section_addresses): Take new
2433 Target* argument. If target->isolate_execinstr() and the segment
2434 is executable and starts at a target->abi_pagesize() boundary,
2435 pad its end out to a target->abi_pagesize() boundary with code fill.
2436 * output.h (Output_segment::set_section_addresses): Update decl.
2437 * layout.h (Layout::check_output_data_for_reset_values): Take new
2438 argument RELAX_OUTPUTS.
2439 (Layout): New member relax_output_list_.
2440 (Layout::add_relax_output): New method.
2441 * layout.cc (Layout::Layout): Update constructor.
2442 (Layout::reset_relax_output): New method.
2443 (Layout::clean_up_after_relaxation): Call it.
2444 (Layout::prepare_for_relaxation): Update caller.
2445 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2446 Call reset_relax_output before re-processing segments for
2447 isolate_execinstr case.
2448 (Layout::write_data): Handle relax_output_list_.
2449 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2450 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2451
9aff4b7a
NC
24522013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2453
2454 PR binutils/15834
2455 * object.h: Fix typos.
2456
93f8221c
RM
24572013-08-16 Roland McGrath <mcgrathr@google.com>
2458
2459 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2460 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2461
e44c3715
CC
24622013-08-07 Cary Coutant <ccoutant@google.com>
2463
2464 Revert support for v2 DWP files:
2465
2466 2013-03-01 Cary Coutant <ccoutant@google.com>
2467
2468 Add dwp support for v2 DWARF package file format.
2469 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2470 tu_length parameter. Adjust all callers.
2471 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2472 * dwp.cc: Include dwarf.h.
2473 (Section_bounds): New struct type.
2474 (Unit_set): New struct type.
2475 (Dwo_file::Dwo_file): Initialize new data member.
2476 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2477 Combine and rename to...
2478 (Dwo_file::read_unit_index): ...this.
2479 (Dwo_file::sized_read_compunit_index)
2480 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2481 (Dwo_file::sized_read_unit_index): ...this.
2482 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2483 parameters; add section_id parameter.
2484 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2485 (Dwo_file::add_unit_set): ...this.
2486 (Dwo_file::shndx_map_): Remove.
2487 (Dwo_file::sect_offsets_): New data member.
2488 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2489 (Dwp_output_file::add_section): Rename to...
2490 (Dwp_output_file::add_contribution): ...this.
2491 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2492 (Dwp_output_file::add_tu_set): Likewise.
2493 (Dwp_output_file::Contribution): New type.
2494 (Dwp_output_file::Section::contributions): New data member.
2495 (Dwp_output_file::Cu_or_tu_set): Remove.
2496 (Dwp_output_file::Section::Section): New ctor.
2497 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2498 (Dwp_output_file::Dwp_index::Section_table): New type.
2499 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2500 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2501 parameter.
2502 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2503 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2504 (Dwp_output_file::Dwp_index::section_table): New member function.
2505 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2506 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2507 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2508 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2509 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2510 (Dwp_output_file::Dwp_index::section_table_): New data member.
2511 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2512 (Dwp_output_file::add_output_section): New member function.
2513 (Dwp_output_file::write_new_section): New member function.
2514 (Dwp_output_file::write_contributions): New member function.
2515 (Dwp_output_file::section_id_map_): New data member.
2516 (class Dwo_id_info_reader): Remove.
2517 (class Unit_reader): New class.
2518 (get_dwarf_section_name): New function.
2519 (Dwo_file::read_executable): Adjust initializations of class data.
2520 (Dwo_file::read): Add support for v2 package file format.
2521 (Dwo_file::read_unit_index): Likewise.
2522 (Dwo_file::sized_read_unit_index): Likewise.
2523 (Dwo_file::copy_section): Likewise.
2524 (Dwo_file::add_unit_set): Likewise.
2525 (Dwp_output_file::add_output_section): Likewise.
2526 (Dwp_output_file::add_contribution): Likewise.
2527 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2528 for empty slot.
2529 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2530 file format.
2531 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2532 slot.
2533 (Dwp_output_file::initialize): Remove unused function.
2534 (Dwp_output_file::finalize): Add support for v2 package file format.
2535 (Dwp_output_file::write_index): Likewise.
2536 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2537 function prototype.
2538
c6905c28
CC
25392013-07-31 Cary Coutant <ccoutant@google.com>
2540
2541 * object.cc (Sized_relobj::do_output_section_address): New function.
2542 (Sized_relobj): Instantiate explicitly.
2543 * object.h (Object::output_section_address): New function.
2544 (Object::do_output_section_address): New function.
2545 (Sized_relobj::do_output_section_address): New function.
2546 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2547
25482013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2549 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2550
2551 * parameters.cc (Parameters::entry): Return target-specific entry
2552 symbol name.
2553 * target.h (Target::entry_symbol_name): New function.
2554 (Target_info::entry_symbol_name): New data member.
2555
2556 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2557 * i386.cc (Target_i386::i386_info): Likewise.
2558 (Target_i386_nacl::i386_nacl_info): Likewise.
2559 * sparc.cc (Target_sparc::sparc_info): Likewise.
2560 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2561 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2562 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2563 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2564
234d4ab8
SA
25652013-07-22 Sterling Augustine <saugustine@google.com>
2566
2567 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2568 Convert parameter shndx to local variable. Add parameters symtab
2569 and symtab_size. Scan over section names. Find relocation
2570 section corresponding to current section. Create and initialize
2571 reloc_mapper_ and reloc_type_.
2572 (Dwarf_pubnames_table::read_header): Add assertion. Change
2573 unit_length to off_t. Initialize member unit_length_. Fill in field
2574 cu_offset_.
2575 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2576 Initialize new fields unit_length_ and cu_offset_.
2577 (Dwarf_pubnames_table::read_section): Update prototype.
2578 (Dwarf_pubnames_table::cu_offset): New member function.
2579 (Dwarf_pubnames_table::subsection_size): Likewise.
2580 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2581 New fields.
2582 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2583 member functions public.
2584 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2585 Update comment. Rework logic. Move repeated parts to...
2586 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2587 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2588 pubtypes_table_, and stmt_list_offset.
2589 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2590 Gdb_index::find_pubtype_offset,
2591 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2592 (Gdb_index::pubnames_read): Update prototype and rework logic.
2593 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2594 Forward declare.
2595 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2596 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2597 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2598 Gdb_index::map_pubtable_to_dies):
2599 Declare functions.
2600 (Gdb_index::pubnames_read): Update declaration.
2601 (Gdb_index::Pubname_offset_map): New type.
2602 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2603 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2604 Gdb_index::stmt_list_offset): Declare.
2605 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2606 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2607 Gdb_index::pubtypes_offset_): Remove.
2608
a3ed37d8
RM
26092013-07-19 Roland McGrath <mcgrathr@google.com>
2610
2611 * options.h (General_options): Add -Trodata-segment option.
2612 * parameters.cc (Parameters::check_rodata_segment): New function.
2613 (Parameters::set_target_once): Call it.
2614 * parameters.h (Parameters): Declare it (private member function).
2615 * layout.cc (load_seg_unusable_for_headers): New function, broken
2616 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2617 then validate rodata segment rather than text segment.
2618 (relaxation_loop_body): Call that.
2619 (is_text_segment): New function. Don't admit a non-executable
2620 segment if TARGET->isolate_execinstr().
2621 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2622
eb5b4ded
CC
26232013-07-15 Shawn Landden <shawnlandden@gmail.com>
2624
2625 PR gold/15070
2626 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2627 * nacl.h (Sniff_file::View::View): Request aligned view.
2628
4d5effb9
CC
26292013-07-11 Cary Coutant <ccoutant@google.com>
2630
2631 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2632 correct BRLT entry size.
2633
ba8ca3e7
AM
26342013-07-03 Alan Modra <amodra@gmail.com>
2635
2636 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2637 comment.
2638
267257d2
CC
26392013-07-01 Cary Coutant <ccoutant@google.com>
2640
2641 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2642 reloc_type_.
2643 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2644 (Dwarf_ranges_table::lookup_reloc): New function.
2645 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2646 reloc_type_.
2647 (Dwarf_ranges_table::lookup_reloc): New function.
2648 (Dwarf_ranges_table::reloc_type_): New data member.
2649
06f30c9d
CC
26502013-06-27 Jing Yu <jingyu@google.com>
2651
2652 PR gold/15662
2653 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2654 function.
2655 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2656 (Target_powerpc::do_relax): Call the above.
2657
a2d7bf59
AM
26582013-06-27 Cary Coutant <ccoutant@google.com>
2659
2660 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2661 on garbage collected .opd section.
2662
26632013-06-27 Alan Modra <amodra@gmail.com>
2664
2665 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2666 is non-zero.
2667 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2668 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2669
32364e50
CC
26702013-06-14 Cary Coutant <ccoutant@google.com>
2671
2672 * resolve.cc (Symbol::override_base): Don't override st_type
2673 from plugin placeholder symbols.
2674 (Symbol_table::resolve): Likewise.
2675 (Symbol_table::should_override): Don't complain about TLS mismatch
2676 if the TO symbol is a plugin placeholder.
2677 * testsuite/Makefile.am (plugin_test_tls): New test.
2678 * testsuite/Makefile.in: Regenerate.
2679 * testsuite/plugin_test_tls.sh: New test script.
2680 * testsuite/two_file_test_2_tls.cc: New test source.
2681 * testsuite/two_file_test_tls.cc: New test source.
2682
7fb47cc9
CC
26832013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2684
2685 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2686 the maximum segment alignment is larger than the page size.
2687 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2688 correctly aligns the symbols with large alignemnt.
2689 * testsuite/Makefile.in: Regenerate.
2690 * testsuite/large_symbol_alignment.cc: New file.
2691
6934001a
CC
26922013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2693 Sriraman Tallam <tmsriram@google.com>
2694
2695 * options.h (sort_section): New option.
2696 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2697 Rename from Input_section_sort_section_name_special_ordering_compare.
2698 (Input_section_sort_section_name_compare): New struct.
2699 * output.cc (Output_section::Input_section_sort_section_name_compare::
2700 operator()): New function.
2701 (Output_section::sort_attached_input_sections): Use new sort function
2702 for .text if --sort-section=name is specified.
2703 * layout.cc (Layout::make_output_section):
2704 Add sorting by name when --sort-section=name is specified.
2705 * testsuite/Makefile.am (text_section_grouping): Test option
2706 --sort-section=name.
2707 * testsuite/Makefile.in: Regenerate.
2708 * testsuite/section_sorting_name.cc: New file.
2709 * testsuite/section_sorting_name.sh: New file.
2710
93acabad
CC
27112013-05-21 Cary Coutant <ccoutant@google.com>
2712
2713 * symtab.h (Symbol::is_cxx_vtable): New function.
2714 * target-reloc.h (relocate_section): Check for vtable symbol.
2715 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2716 * testsuite/Makefile.in: Regenerate.
2717 * testsuite/missing_key_func.cc: New test source.
2718 * testsuite/missing_key_func.sh: New test script.
2719
60e8b3fc
CC
27202013-05-21 Cary Coutant <ccoutant@google.com>
2721
2b64b551
RM
2722 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2723 type of enclosing symbol.
2724 (Relocate_info::location): Check symbol type when describing symbol.
2725 * object.h (Symbol_location_info): Remove unused line_number;
2726 add enclosing_symbol_type.
2727 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2728
9df9de2c
CC
27292013-05-13 Cary Coutant <ccoutant@google.com>
2730
2b64b551
RM
2731 * configure.ac: Export DEFAULT_TARGET.
2732 * configure: Regenerate.
2733 * Makefile.in: Regenerate.
2734 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2735 * testsuite/Makefile.in: Regenerate.
2736 * testsuite/debug_msg.sh: Delete duplicate tests.
2737 Don't check undef_int error message match for powerpc where the
2738 source file and line number aren't available.
9df9de2c 2739
bbc5ae17
RM
27402013-05-10 Roland McGrath <mcgrathr@google.com>
2741
2742 * options.h (General_options): Add --rosegment-gap option.
2743 * options.cc (finalize): --rosegment-gap implies --rosegment.
2744 * layout.cc (set_segment_offsets): Let user option override
2745 target->rosegment_gap().
2746
0c6e6c39
RM
27472013-05-10 Roland McGrath <mcgrathr@google.com>
2748
2749 * options.h (General_options): Remove leading space from help
2750 messages for -nostdlib and --rosegment.
2751
cde7cb01
MR
27522013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2753
2754 PR ld/15365
2755 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2756
f31ae5b8
AM
27572013-05-03 Alan Modra <amodra@gmail.com>
2758
2759 * merge.cc (Output_merge_string::do_add_input_section): Correct
2760 scan for number of strings. Rename vars to avoid shadowing.
2761 Include missing terminator in input_size_.
2762
d3a7cd45
L
27632013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2764
2765 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2766 Restore empty string handling.
2767
6ad3daba
CC
27682013-05-01 Cary Coutant <ccoutant@google.com>
2769
2770 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2771 uninitialized warning.
2772
e31908b6
CC
27732013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2774
2775 * output.cc (Output_section::add_merge_input_section): Allow
2776 to merge sections if the alignment is more than character size.
2777 * merge.h (Output_merge_string::Output_merge_string): Remove
2778 assert.
2779 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2780 only not-null strings. Check the alignment of strings.
2781 * stringpool.h
2782 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2783 alignment as the argument.
2784 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2785 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2786 Align non-zero length strings according to the addralign_.
2787 (Stringpool_template<Stringpool_char>::set_string_offsets):
2788 Updating offsets according to the given alignment.
2789 * testsuite/Makefile.am (text_section_grouping): Test if string
2790 literals are getting merged.
2791 * testsuite/Makefile.in: Regenerate.
2792 * testsuite/merge_string_literals_1.c: New file.
2793 * testsuite/merge_string_literals_2.c: Ditto.
2794 * testsuite/merge_string_literals.sh: Ditto.
2795
0e804863
ILT
27962013-04-26 Ian Lance Taylor <iant@google.com>
2797
2798 * target-reloc.h (relocate_section): If the reloc offset is out of
2799 range, pass VIEW as NULL to relocate.relocate.
2800 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2801 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2802 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2803 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2804 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2805 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2806
e7c5ea40
CC
28072013-04-26 Geoff Pike <gpike@chromium.org>
2808
2809 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2810 * layout.cc (Hash_task): New class.
2811 (Layout::queue_build_id_tasks): New function.
2812 (Layout::write_build_id): Handle single-thread portion of build ID
2813 computation. (In some cases, all of it is single-threaded.) Replace
2814 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2815 functionality in fewer lines of code.
2816 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2817 * options.h (General_options): make "--build-id" default to tree
2818 rather than sha1. Add two new options related to --build-id=tree:
2819 --build-id-chunk-size-for-treehash and
2820 --build-id-min-file-size-for-treehash.
2821 * Makefile.am: add testing of --build-id=tree and related new options
2822 (these tests will be invoked by "make check").
2823 * Makefile.in: Regenerate.
2824
49926cd0
AM
28252013-04-25 Alan Modra <amodra@gmail.com>
2826
2827 * configure.tgt: Add powerpcle and powerpc64le.
2828
a4034750
AM
28292013-04-22 Alan Modra <amodra@gmail.com>
2830
2831 PR gold/15355
2832 * layout.cc (Layout::segment_precedes): Allow more than one
2833 segment with the same type and flags.
2834
e79c84aa
CC
28352013-04-15 Cary Coutant <ccoutant@google.com>
2836
2837 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2838 allocate space in file for BSS sections.
2839
2199fbe7
CC
28402013-04-15 Cary Coutant <ccoutant@google.com>
2841
2842 * script-sections.cc (Orphan_output_section): Reset address
2843 to zero after each orphaned section for relocatable links.
2844
502e8a84
CC
28452013-04-15 Cary Coutant <ccoutant@google.com>
2846
a4034750
AM
2847 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2848 section starting address for relocatable link.
2849 * testsuite/Makefile.am (script_test_11): New test.
2850 * testsuite/Makefile.in: Regenerate.
2851 * testsuite/script_test_11.c: New source file.
2852 * testsuite/script_test_11.t: New linker script.
502e8a84 2853
0cfdc767
AM
28542013-04-13 Alan Modra <amodra@gmail.com>
2855
2856 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2857 owner when sections are not adjacent and exceed group size.
2858 (Target_powerpc::group_sections): Handle corner case.
2859 (Target_powerpc::Branch_info::make_stub): Handle case where
2860 stub table doesn't exist due to branches in non-exec sections.
2861 (Target_powerpc::Relocate::relocate): Likewise.
2862
6830ee24
AM
28632013-04-11 Alan Modra <amodra@gmail.com>
2864
2865 PR gold/15354
2866 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2867 .branch_lt to match bfd ld. Adjust comments throughout file.
2868
54a3d865
ILT
28692013-04-04 Ian Lance Taylor <iant@google.com>
2870
2871 GCC PR c++/56840
2872 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2873 sections before checking whether they are included in the link.
2874
9993ba11
ST
28752013-03-29 Sriraman Tallam <tmsriram@google.com>
2876
2877 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2878 object before calling the plugin claim_file handler. Pass the elf
2879 object of the archive to the plugin. Delete the elf object if the
2880 plugin claims the file.
2881
ebacd51e
AM
28822013-03-21 Alan Modra <amodra@gmail.com>
2883
2884 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2885 segment when omagic.
2886
117be58f
AM
28872013-03-21 Alan Modra <amodra@gmail.com>
2888
2889 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2890 comparison warning.
2891 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2892 uninitialized" warning.
2893
32e2b61d
AM
28942013-03-20 Alan Modra <amodra@gmail.com>
2895
2896 * symtab.h (Symbol::clear_version): New function.
2897 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2898 is_needed by weak references. Clear version for symbols defined
2899 in as-needed objects that are not needed.
2900
b3ccdeb5
AM
29012013-03-15 Alan Modra <amodra@gmail.com>
2902
2903 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2904 static and public. Add report_err param. Return false for data refs.
2905 (Target_powerpc::rela_dyn_section): New overloaded function.
2906 (Target_powerpc::plt_, iplt_): Elucidate.
2907 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2908 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2909 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2910 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2911 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2912 push_branch and make_plt_entry for ifunc syms when
2913 reloc_needs_plt_for_ifunc.
2914 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2915 for ifunc unless reloc_needs_plt_for_ifunc.
2916
ad3d8a2f
AM
29172013-03-15 Alan Modra <amodra@gmail.com>
2918
2919 * gc.h (gc_process_relocs): Don't look through function descriptors.
2920 * icf.cc (get_section_contents): Do so here instead.
2921
4d9aa155
AM
29222013-03-13 Alan Modra <amodra@gmail.com>
2923
2924 * powerpc.cc (is_branch_reloc): Forward declare.
2925 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2926 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2927 false for 64-bit, true for 32-bit non-branch relocs.
2928 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2929 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2930 nm output.
2931 (icf_safe_test): Generate linker map file as well as nm output.
2932 (icf_safe_so_test): Likewise.
2933 * testsuite/Makefile.in: Regenerate.
2934 * testsuite/icf_test.sh: Parse linker map file to determine
2935 section folding.
2936 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2937 * testsuite/icf_safe_so_test.sh: Likewise.
2938 (X86_32_or_ARM_specific_safe_fold): Merge into..
2939 (arch_specific_safe_fold): ..this.
2940 (X86_64_specific_safe_fold): Delete unused function.
2941
57420c20
AM
29422013-03-12 Alan Modra <amodra@gmail.com>
2943
2944 * gc.h (gc_process_relocs): Look through function descriptors
2945 to determine shndx, symvalue and addend used by ICF. Tidy
2946 variable duplication.
2947
dc3714f3
AM
29482013-03-11 Alan Modra <amodra@gmail.com>
2949
2950 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2951 * layout.cc (Layout_task_runner::run): ..to here.
2952 * symtab.h (struct Symbol_location): Extract from..
2953 (class Symbol_table): ..here.
2954 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2955 * target.h (class Target): Add function_location and
2956 do_function_location functions.
2957 (class Sized_target): Add do_function_location.
2958 * object.h (class Sized_relobj_file): Move find_shdr..
2959 (class Object): ..to here.
2960 * object.cc: Likewise. Update to suit. Instantiate.
2961 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2962 * powerpc.cc (class Powerpc_dynobj): New.
2963 (Target_powerpc::do_function_location): New function.
2964 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2965 (Powerpc_dynobj::do_read_symbols): New function.
2966 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2967
956b03bb
ILT
29682013-03-08 Ian Lance Taylor <iant@google.com>
2969
2970 * options.cc (General_options::string_to_object_format): Accept
2971 "default".
2972
4bead2d5
AM
29732013-03-08 Alan Modra <amodra@gmail.com>
2974
2975 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2976 pointer to Post_fde.
2977 (struct Post_fde): Move definition to here..
2978 * ehframe.cc (struct Post_fde): ..from here.
2979 (Cie::write): Don't alloc Post_fde.
2980 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2981
02e60bf7
AM
29822013-03-07 Alan Modra <amodra@gmail.com>
2983
2984 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2985 relocation referencing .LC0.
2986 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2987
8343f03a
AM
29882013-03-07 Alan Modra <amodra@gmail.com>
2989
2990 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2991 always_inline. Add assembly for powerpc to avoid GOT.
2992
3366d57c
AM
29932013-03-07 Alan Modra <amodra@gmail.com>
2994
2995 * testsuite/script_test_10.sh: Don't test .bss section
2996 header number.
2997
6c77229c
AM
29982013-03-06 Alan Modra <amodra@gmail.com>
2999
3000 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3001 (Target_powerpc::symval_for_branch): Add symtab param. Update
3002 all callers. Handle folded sections.
3003 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3004 to Powerpc_relobj.
3005 (Global_symbol_visitor_opd::operator()): Likewise.
3006
a39e4af6
AM
30072013-03-04 Alan Modra <amodra@gmail.com>
3008
3009 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3010 * testsuite/Makefile.in: Regenerate.
3011
d5834edb
CC
30122013-03-01 Cary Coutant <ccoutant@google.com>
3013
3014 Add dwp support for v2 DWARF package file format.
3015 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3016 tu_length parameter. Adjust all callers.
3017 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3018 * dwp.cc: Include dwarf.h.
3019 (Section_bounds): New struct type.
3020 (Unit_set): New struct type.
3021 (Dwo_file::Dwo_file): Initialize new data member.
3022 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3023 Combine and rename to...
3024 (Dwo_file::read_unit_index): ...this.
3025 (Dwo_file::sized_read_compunit_index)
3026 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3027 (Dwo_file::sized_read_unit_index): ...this.
3028 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3029 parameters; add section_id parameter.
3030 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3031 (Dwo_file::add_unit_set): ...this.
3032 (Dwo_file::shndx_map_): Remove.
3033 (Dwo_file::sect_offsets_): New data member.
3034 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3035 (Dwp_output_file::add_section): Rename to...
3036 (Dwp_output_file::add_contribution): ...this.
3037 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3038 (Dwp_output_file::add_tu_set): Likewise.
3039 (Dwp_output_file::Contribution): New type.
3040 (Dwp_output_file::Section::contributions): New data member.
3041 (Dwp_output_file::Cu_or_tu_set): Remove.
3042 (Dwp_output_file::Section::Section): New ctor.
3043 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3044 (Dwp_output_file::Dwp_index::Section_table): New type.
3045 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3046 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3047 parameter.
3048 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3049 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3050 (Dwp_output_file::Dwp_index::section_table): New member function.
3051 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3052 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3053 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3054 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3055 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3056 (Dwp_output_file::Dwp_index::section_table_): New data member.
3057 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3058 (Dwp_output_file::add_output_section): New member function.
3059 (Dwp_output_file::write_new_section): New member function.
3060 (Dwp_output_file::write_contributions): New member function.
3061 (Dwp_output_file::section_id_map_): New data member.
3062 (class Dwo_id_info_reader): Remove.
3063 (class Unit_reader): New class.
3064 (get_dwarf_section_name): New function.
3065 (Dwo_file::read_executable): Adjust initializations of class data.
3066 (Dwo_file::read): Add support for v2 package file format.
3067 (Dwo_file::read_unit_index): Likewise.
3068 (Dwo_file::sized_read_unit_index): Likewise.
3069 (Dwo_file::copy_section): Likewise.
3070 (Dwo_file::add_unit_set): Likewise.
3071 (Dwp_output_file::add_output_section): Likewise.
3072 (Dwp_output_file::add_contribution): Likewise.
3073 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3074 for empty slot.
3075 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3076 file format.
3077 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3078 slot.
3079 (Dwp_output_file::initialize): Remove unused function.
3080 (Dwp_output_file::finalize): Add support for v2 package file format.
3081 (Dwp_output_file::write_index): Likewise.
3082 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3083 function prototype.
3084
a68a081d
CC
30852013-03-01 Cary Coutant <ccoutant@google.com>
3086
3087 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3088 function into class definition in header file.
3089 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3090 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3091 New function.
3092 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3093
9d5781f8
AM
30942013-02-28 Alan Modra <amodra@gmail.com>
3095
3096 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3097 * target.cc (Target::do_plt_fde_location): New function.
3098 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3099 accessor function, and constructor param.
3100 (struct Post_fde, Post_fdes): Declare.
3101 (Cie::write): Add post_fdes param.
3102 * ehframe.cc (Fde::write): Use plt_fde_location.
3103 (struct Post_fde): Define.
3104 (Cie::write): Stash FDEs added post merge mapping.
3105 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3106 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3107 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3108 other FDEs.
3109 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3110 (Target_powerpc::has_glink): New function.
3111 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3112 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3113 glink_eh_frame_fde_32, default_fde): New data.
3114 (Stub_table::eh_frame_added_): New var.
3115 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3116 Make const.
3117 (Stub_table::add_eh_frame): New function.
3118 (Output_data_glink::add_eh_frame): New function.
3119 (Target_powerpc::make_glink_section): Call add_eh_frame.
3120
214383dd
ILT
31212013-02-15 Ian Lance Taylor <iant@google.com>
3122
3123 * options.h (DEFINE_uint64_alias): Define.
3124 (class General_options): Add -Ttext-segment as an alias for
3125 -Ttext.
3126
91c2b899
AM
31272013-02-15 Alan Modra <amodra@gmail.com>
3128
3129 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3130 (Stub_table::do_write): ..here, two places.
3131 (Stub_table::plt_call_size): Use it here too.
3132
20e2a8aa
ILT
31332013-02-11 Ian Lance Taylor <iant@google.com>
3134
3135 * descriptors.cc (Descriptors::close_all): New function.
3136 * descriptors.h (class Descriptors): Declare close_all.
3137 (close_all_descriptors): New inline function.
3138 * plugin.cc: Include "descriptors.h".
3139 (Plugin_manager::cleanup): Call close_all_descriptors.
3140
8952bc69
AM
31412013-02-06 Alan Modra <amodra@gmail.com>
3142
3143 * README: Update coding style link.
3144
29bd8b6b
CC
31452013-01-28 Cary Coutant <ccoutant@google.com>
3146
a4034750
AM
3147 * dwp.cc (File_list): New typedef.
3148 (Dwo_name_info_reader): New class.
3149 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3150 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3151 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3152 (Dwo_file::read_executable): New function.
3153 (Dwo_file::read): Move common setup code to ...
3154 (Dwo_file::make_object): ... here.
3155 (dwp_options): Add --exec/-e.
3156 (usage): Likewise.
3157 (main): Likewise.
29bd8b6b 3158
c6ac678d
ST
31592013-01-24 Sriraman Tallam <tmsriram@google.com>
3160
3161 * layout.cc (Layout::layout): Check for option text_reorder.
3162 (Layout::make_output_section): Ditto.
3163 * options.h (text_reorder): New option.
3164 * output.cc (Input_section_sort_compare): Remove special ordering
3165 of section names.
3166 (Output_section::
3167 Input_section_sort_section_name_special_ordering_compare::
3168 operator()): New function.
3169 (Output_section::sort_attached_input_sections): Use new sort function
3170 for .text.
3171 * output.h (Input_section_sort_section_name_special_ordering_compare):
3172 New struct.
3173 * testsuite/Makefile.am (text_section_grouping): Test option
3174 --no-text-reorder
3175 * testsuite/Makefile.in: Regenerate.
3176 * testsuite/text_section_grouping.sh: Check order of functions without
3177 default text reordering.
3178
50701cc1
MF
31792013-01-18 Mike Frysinger <vapier@gentoo.org>
3180
3181 * options.h (General_options): Change default to true for new_dtags.
3182
b1b00fcc
MF
31832013-01-18 Mike Frysinger <vapier@gentoo.org>
3184
3185 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3186 when enable_new_dtags is false. Only add DT_RUNPATH when
3187 enable_new_dtags is true.
3188
ec5b8187
AM
31892013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3190
3191 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3192 used in declaration and definition consistent.
3193 (Target_powerpc::symval_for_branch): Ditto.
3194
a880d4c4
ST
31952013-01-16 Sriraman Tallam <tmsriram@google.com>
3196
3197 * testsuite/plugin_final_layout.cc: Fix comment.
3198
7c381248
ST
31992013-01-16 Sriraman Tallam <tmsriram@google.com>
3200
3201 * layout.cc (Layout::layout): Do not do default sorting for
3202 text sections when section ordering is specified.
3203 (make_output_section): Ditto.
3204 * testsuite/plugin_final_layout.cc: Name the function sections
3205 to catch reordering issues.
3206
e2458743
AM
32072013-01-15 Alan Modra <amodra@gmail.com>
3208
3209 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3210 plt-thread-safe.
3211
431ed302
AM
32122013-01-15 Alan Modra <amodra@gmail.com>
3213
3214 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3215 * testsuite/Makefile.in: Regenerate.
3216
0ec6429b
AM
32172013-01-14 Alan Modra <amodra@gmail.com>
3218
3219 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3220 * testsuite/Makefile.in: Regenerate.
3221
0bf402d5
ILT
32222013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3223
36af3926 3224 PR bfd/14430
0bf402d5
ILT
3225 Fix mingw gold build with plugins enabled
3226 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3227 * configure.ac: Export DLOPEN_LIBS and add headers check.
3228 * plugin.cc: Handle non-dlfcn case.
3229 * Makefile.in: Regenerate.
3230 * config.in: Regenerate.
3231 * configure: Regenerate.
3232 * testsuite/Makefile.in: Regenerate.
3233
9e9143bc
ST
32342013-01-09 Sriraman Tallam <tmsriram@google.com>
3235
3236 * output.h (sort_attached_input_sections): Change to be public.
3237 * script-sections.cc
3238 (Output_section_definition::set_section_addresses): Sort
3239 attached input sections according to section order before linker
3240 script assigns section addresses.
3241 (Orphan_output_section::set_section_addresses): Sort
3242 attached input sections according to section order before linker
3243 script assigns section addresses.
3244 * Makefile.am (final_layout.sh): Use a simple linker script to
3245 check if section ordering still works.
3246 * Makefile.in: Regenerate.
3247
679af368
ILT
32482013-01-09 Ben Cheng <bccheng@google.com>
3249
3250 * arm.cc (Target_arm::attributes_accept_div): New function.
3251 (Target_arm::attributes_forbid_div): New function.
3252 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3253 attribute using the same new functions as what bfd/elf32_arm.c
3254 does.
3255
3136a00e
CC
32562013-01-07 Cary Coutant <ccoutant@google.com>
3257
3258 PR gold/14993
3259 * output.cc (Output_section::add_input_section): For incremental
3260 updates, don't track input sections that are allocated from patch
3261 space.
3262
f2a6224b
L
32632013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3264 Ian Lance Taylor <iant@google.com>
3265
3266 PR gold/14897
3267 * configure.ac (--enable-ld): Removed.
3268 (install_as_default): Set to yes only for --enable-gold=default
3269 or --disable-ld.
3270 * configure: Regenerated.
3271
4f46f626
L
32722013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3273
3274 * options.h (General_options): Add -fuse-ld= for GCC linker
3275 option compatibility.
3276
26e4ef59
CC
32772013-01-04 Cary Coutant <ccoutant@google.com>
3278
3279 * configure.ac: Fix typo restoring CXXFLAGS.
3280 * configure: Regenerate.
3281
3d587466
CC
32822013-01-04 Cary Coutant <ccoutant@google.com>
3283
4f46f626
L
3284 * testsuite/Makefile.am (CXXLINK_S): New macro.
3285 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3286 * testsuite/Makefile.in: Regenerate.
3d587466 3287
44db6695
L
32882013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3289
3290 * version.cc (print_version): Update copyright year to 2013.
3291
edcac0c1
ILT
32922012-12-20 Ian Lance Taylor <iant@google.com>
3293
3294 * layout.cc (Layout::special_ordering_of_input_section): New
3295 function.
3296 (Layout::layout): If input section requires special ordering, must
3297 sort input sections.
3298 (Layout::make_output_section): May sort .text input sections.
3299 (Layout::is_section_name_prefix_grouped): Remove.
3300 * layout.h (class Layout): Declare
3301 special_ordering_of_input_section. Don't declare
3302 is_section_name_prefix_grouped.
3303 * output.cc (Output_section::add_input_section): Revert last
3304 change.
3305 (Output_section::Input_section_sort::match_file_name): Don't crash
3306 if called on output section data.
3307 (Output_section::Input_section_sort_compare): Sort based on
3308 special ordering.
3309 (Output_section::Input_section_sort_section_order_index_compare):
3310 Revert last patch.
3311 (Output_section::sort_attached_input_sections): Likewise.
3312
28f2a4ac
ST
33132012-12-18 Sriraman Tallam <tmsriram@google.com>
3314
edcac0c1 3315 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3316 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3317 * output.cc (Output_section::add_input_section): Check if section
3318 name contains special prefix. Keep input sections to sort such
3319 sections.
3320 (Output_section::Input_section_sort_section_order_index_compare
3321 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3322 (Output_section::sort_attached_input_sections): Add condition to
3323 Input_section_entry constructor call.
28f2a4ac
ST
3324 * testsuite/Makefile.am (text_section_grouping): New test.
3325 * testsuite/Makefile.in: Regenerate.
3326 * testsuite/text_section_grouping.cc: New file.
3327 * testsuite/text_section_grouping.sh: New file.
3328
5bf135a7
NC
33292012-12-17 Nick Clifton <nickc@redhat.com>
3330
3331 * Makefile.am: Add copyright notice.
3332 * NEWS: Likewise.
3333 * README: Likewise.
3334 * configure.ac: Likewise.
3335 * ftruncate.c: Likewise.
3336 * Makefile.in: Regenerate.
3337
59965708
CC
33382012-12-14 Cary Coutant <ccoutant@google.com>
3339
a4034750
AM
3340 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3341 --no-as-needed flag.
3342 (exception_separate_shared_12_test): Likewise.
3343 (incremental_copy_test): Likewise.
3344 * testsuite/Makefile.in: Regenerate.
59965708 3345
2a77e2ab
CC
33462012-12-14 Cary Coutant <ccoutant@google.com>
3347
3348 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3349 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3350
e3deeb9c
AM
33512012-12-12 Alan Modra <amodra@gmail.com>
3352
3353 * powerpc.cc (class Track_tls): New.
3354 (class Relocate, class Scan): Inherit Track_tls.
3355 (Target_powerpc::Scan::local, global): Track tls optimization
3356 and avoid creating plt entry for __tls_get_addr if all uses
3357 are optimized away.
3358 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3359
d8f5a274
AM
33602012-12-12 Alan Modra <amodra@gmail.com>
3361
3362 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3363 Replace no_toc_optimize with toc_optimize.
3364 * output.h (Output_section::input_sections): Provide non-const variant.
3365 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3366 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3367 accessors.
3368 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3369 (class Sort_toc_sections): New.
3370 (Target_powerpc::do_finalize_sections): Sort toc sections.
3371 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3372
4c8a1de1
RM
33732012-12-10 Roland McGrath <mcgrathr@google.com>
3374
3375 * testsuite/binary_unittest.cc (read_all): New function.
3376 (Sized_binary_test): Use it instead of ::read.
3377 * fileread.cc (do_read): Don't assume pread always reads the whole
3378 amount in a single call.
3379
edc27beb
AM
33802012-12-10 Alan Modra <amodra@gmail.com>
3381
3382 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3383 Set EM_PPC64 or EM_PPC here.
3384 (Target_selector_powerpc::do_recognize): Delete.
3385
906b9150
AM
33862012-12-10 Alan Modra <amodra@gmail.com>
3387
3388 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3389 stub_table_.
3390 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3391
418c15ae
RM
33922012-12-07 Roland McGrath <mcgrathr@google.com>
3393
3394 * testsuite/binary_unittest.cc (Sized_binary_test):
3395 Use open_descriptor rather than ::open.
3396
decdd3bc
AM
33972012-12-07 Alan Modra <amodra@gmail.com>
3398
3399 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3400 typedef and invalid_address constant.
3401 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3402 instantiate constants.
3403
db399005
ILT
34042012-12-06 Roland McGrath <mcgrathr@google.com>
3405
3406 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3407 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3408 * aclocal.m4: Regenerate.
3409 * configure: Regenerate.
3410 * Makefile.in: Regenerate.
3411 * testsuite/Makefile.in: Regenerate.
3412
aba6bc71
AM
34132012-12-07 Alan Modra <amodra@gmail.com>
3414
3415 * options.h (General_options): Add no_toc_optimize.
3416 * powerpc.cc (ok_lo_toc_insn): New function.
3417 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3418
9e69ed50
AM
34192012-12-06 Alan Modra <amodra@gmail.com>
3420
3421 * options.h (General_options): Add plt_align, plt_static_chain,
3422 plt_thread_safe. Update stub_group_size help text.
3423 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3424 for new plt_thread_safe_ var.
3425 (use_plt_offset): Correct comments.
3426 (Target_powerpc::do_relax): Look for thread creation symbols to
3427 determine default plt_thread_safe value. Clear plt call stubs
3428 as well as branch stubs each iteration.
3429 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3430 insn constants.
3431 (l, hi, ha, write_insn): Move earlier.
3432 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3433 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3434 plt stubs too.
3435 (Stub_table::update_size): Adjust.
3436 (Stub_table::prev_size, set_prev_size): Delete.
3437 (Stub_table::stub_align): Let --plt-align affect result.
3438 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3439 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3440 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3441 (Stub_table::do_write): Support more stub variants.
3442
f43ba157
AM
34432012-12-04 Alan Modra <amodra@gmail.com>
3444
3445 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3446 (Target_powerpc::do_define_standard_symbols): New function.
3447
34171bc5
AM
34482012-12-03 Alan Modra <amodra@gmail.com>
3449
3450 * output.h: Formatting, whitespace.
3451
dc9589e9 34522012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3453
3454 * layout.h (Layout::get_executable_sections): Declare.
3455 * layout.cc (Layout::get_executable_sections): New function.
3456 * arm.cc (Target_arm::group_sections): Use it.
3457 (Arm_output_section::group_sections): Delete now redundant test.
3458 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3459 param to handle relative relocs.
3460 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3461 (Output_data_reloc::add_absolute): Adjust.
3462 (Output_data_reloc::add_relative): New function.
3463 (Output_data::reset_data_size): New function.
3464 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3465 (Output_section::set_addralign): New function.
3466 (Output_section::checkpoint_set_addralign): New function.
3467 (Output_section::clear_section_offsets_need_adjustment): New function.
3468 (Output_section::input_sections): Make public.
3469 * powerpc.cc (class Output_data_brlt_powerpc): New.
3470 (class Stub_table, class Stub_control): New.
3471 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3472 stub_table_, set_stub_table, stub_table): New vectors and accessor
3473 functions.
3474 (Target_powerpc::do_may_relax, do_relax, push_branch,
3475 new_stub_table, stub_tables, brlt_section, group_sections,
3476 add_branch_lookup_table, find_branch_lookup_table,
3477 write_branch_lookup_table, make_brlt_section): New functions.
3478 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3479 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3480 branch_info_): New vars.
3481 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3482 make call stubs here.
3483 (Output_data_glink): Remove all call stub handling from this class.
3484 (Target_powerpc::Scan::local, global): Save interesting branch
3485 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3486 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3487 functions on final link.
3488 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3489 Handle long branch destinations too.
3490 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3491 do_plt_address_for_local): Adjust lookup of plt call stubs.
3492
627b30b7
AM
34932012-11-30 Alan Modra <amodra@gmail.com>
3494
3495 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3496 relocs against protected symbols when building 32-bit shared libs.
3497
40b469d7
AM
34982012-11-30 Alan Modra <amodra@gmail.com>
3499
3500 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3501 param. Call got_section() to make .got. Update all callers
3502 and their callers and so on.
3503
bb66a627
AM
35042012-11-30 Alan Modra <amodra@gmail.com>
3505
3506 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3507 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3508 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3509 value if it already exists.
3510
d2cf1c6c
L
35112012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3512
3513 PR gold/14858
3514 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3515
edccdf7c
RM
35162012-11-14 Roland McGrath <mcgrathr@google.com>
3517
3518 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3519 than bfc instruction for data sandboxing.
3520
6febeb74
AM
35212012-11-08 Alan Modra <amodra@gmail.com>
3522
3523 * po/POTFILES.in: Regenerate.
3524
0a6f1bf2
AM
35252012-11-05 Alan Modra <amodra@gmail.com>
3526
3527 * configure.ac: Apply 2012-09-10 change to config.in here.
3528 * configure: Regenerate.
3529
26a4e9cb
AM
35302012-11-05 Alan Modra <amodra@gmail.com>
3531
3532 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3533 (struct Opd_ent): Use "Address" rather than "Offset".
3534 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3535 (Target_powerpc::got_section): Make public.
3536 (Target_powerpc::scan_relocs): Move code setting symbols..
3537 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3538 Create _SDA_BASE_ only when referenced.
3539
cc928013
RM
35402012-11-02 Roland McGrath <mcgrathr@google.com>
3541
3542 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3543 from last change.
3544
50ed5eb1
RM
35452012-11-01 Roland McGrath <mcgrathr@google.com>
3546
62fe925a
RM
3547 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3548 for offset_in_output_section parameter.
3549 (Sized_target::relocate_special_relocatable): Likewise.
3550 * arm.cc (Target_arm::relocate_relocs): Likewise.
3551 (Target_arm::relocate_special_relocatable): Likewise.
3552 * i386.cc (Target_i386::relocate_relocs): Likewise.
3553 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3554 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3555 * target-reloc.h (relocate_relocs): Likewise.
3556 * testsuite/testfile.cc (Target_test): Likewise.
3557 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3558 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3559
3560 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3561 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3562
3563 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3564 parameter, which is unused in the [!F_SETFD] case.
3565
50ed5eb1
RM
3566 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3567 SYMNDX to off_t before comparing it to this->data_size().
3568 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3569 * incremental.cc (Output_section_incremental_inputs::do_write):
3570 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3571
2cadc0bf
RM
3572 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3573
3bfcb652
NC
35742012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3575
3576 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3577 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3578 in EABI_VER5.
3579
c1a8d56e
CC
35802012-10-29 Cary Coutant <ccoutant@google.com>
3581
3582 * dwp.cc (usage): Add file and exit status parameters;
3583 add --help and --version options.
3584 (print_version): New function.
3585 (main): Add --help and --version options.
3586
b2490a7b
L
35872012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3588
3589 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3590 final_layout_sequence.txt.
3591 * testsuite/Makefile.in: Regenerated.
3592
aa543512
L
35932012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3594
3595 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3596 COMPILE generated by automake.
3597 (LINK1): Likewise.
3598 (CXXCOMPILE1): Likewise.
3599 (CXXLINK1): Likewise.
3600 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3601 (LINK): Likewise.
3602 (CXXCOMPILE): Likewise.
3603 (CXXLINK): Likewise.
3604 * testsuite/Makefile.in: Regenerated.
3605
d361fafb
L
36062012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3607
3608 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3609 on bad fwrite return.
3610
598c7410
L
36112012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3612
3613 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3614 on val.
3615
35c813e2
CC
36162012-10-23 Cary Coutant <ccoutant@google.com>
3617
3618 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3619 * testsuite/Makefile.in: Regenerate.
3620 * testsuite/dwp_test.h: New source file.
3621 * testsuite/dwp_test_1.cc: New source file.
3622 * testsuite/dwp_test_1.s: New source file.
3623 * testsuite/dwp_test_1.sh: New source file.
3624 * testsuite/dwp_test_1b.cc: New source file.
3625 * testsuite/dwp_test_1b.s: New source file.
3626 * testsuite/dwp_test_2.cc: New source file.
3627 * testsuite/dwp_test_2.s: New source file.
3628 * testsuite/dwp_test_2.sh: New source file.
3629 * testsuite/dwp_test_main.cc: New source file.
3630 * testsuite/dwp_test_main.s: New source file.
3631
77429909
CC
36322012-10-23 Cary Coutant <ccoutant@google.com>
3633
3634 * dwp.h: New header file.
3635 * dwp.cc: New source file.
3636 * gold.h: Move shared declarations to system.h.
3637 * system.h: New header file.
3638 * Makefile.am: Add dwp.
3639 * Makefile.in: Regenerate.
3640
ed5d6712
CC
36412012-10-23 Cary Coutant <ccoutant@google.com>
3642
3643 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3644 Dwarf_info_reader::read_from_pointer.
3645 (Dwarf_pubnames_table::read_header): Likewise.
3646 (Dwarf_pubnames_table::next_name): Likewise.
3647 (Dwarf_die::read_attributes): Likewise.
3648 (Dwarf_die::skip_attributes): Likewise.
3649 (Dwarf_info_reader::read_from_pointer): New function template.
3650 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3651 (Dwarf_pubnames_table): Likewise.
3652 (Dwarf_info_reader::read_from_pointer): New function template.
3653 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3654 Dwarf_pubnames_table ctor.
3655
8787852d
CC
36562012-10-23 Cary Coutant <ccoutant@google.com>
3657
3658 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3659 abbrev_shndx.
3660 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3661 abbrev_shndx_.
3662 (Dwarf_info_reader::set_abbrev_shndx): New method.
3663 (Dwarf_info_reader::abbrev_shndx_): New data member.
3664
9fc236f3
CC
36652012-10-23 Cary Coutant <ccoutant@google.com>
3666
3667 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3668 from object, not parameters.
3669 (Dwarf_info_reader::parse): Likewise.
3670 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3671 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3672 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3673 methods.
3674
effe8365
CC
36752012-10-23 Cary Coutant <ccoutant@google.com>
3676
3677 * fileread.cc (Input_file::Input_file): New constructor.
3678 * fileread.h (class Input_file): Add new constructor.
3679
1698990d
AM
36802012-10-18 Alan Modra <amodra@gmail.com>
3681
3682 PR gold/14727
3683 * object.cc (Relobj::is_section_name_included): Also match
3684 .sdata personality section.
3685
168a4726
AM
36862012-10-18 Alan Modra <amodra@gmail.com>
3687
3688 * target-reloc.h (class Default_comdat_behavior): New, package up..
3689 (get_comdat_behaviour): ..this.
3690 (relocate_section): Add Relocate_comdat_behavior template arg,
3691 adjust code to suit.
3692 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3693 (Target_arm::scan_reloc_section): Likewise.
3694 * i386.cc (Target_i386::relocate_section): Likewise.
3695 * sparc.cc (Target_sparc::relocate_section): Likewise.
3696 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3697 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3698 * powerpc.cc (class Relocate_comdat_behavior): New.
3699 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3700 gold::relocate_section with new template arg.
3701
acc276d8
AM
37022012-10-18 Alan Modra <amodra@gmail.com>
3703
3704 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3705 dynamic relocs for GOT_TPREL got entries, without symbol if
3706 resolving locally.
3707 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3708 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3709 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3710
e10f9870
AM
37112012-10-17 Alan Modra <amodra@gmail.com>
3712
3713 PR gold/14726
3714 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3715
ae034989
ST
37162012-10-16 Sriraman Tallam <tmsriram@google.com>
3717
3718 * layout.cc (Layout::include_section): Keep sections marked
3719 SHF_EXCLUDE when doing relocatable links.
3720
f3a0ed29
AM
37212012-10-16 Alan Modra <amodra@gmail.com>
3722
3723 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3724 (Target_powerpc::do_finalize_sections): Call it.
3725 (Output_data_save_res): New class and supporting functions.
3726 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3727 normal symbols defined in object files.
3728
c6de8ed4
AM
37292012-10-12 Alan Modra <amodra@gmail.com>
3730
3731 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3732 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3733 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3734 section if scan_opd_relocs not yet called.
3735 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3736
03e25981
AM
37372012-10-12 Alan Modra <amodra@gmail.com>
3738
3739 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3740 add_local_ifunc_entry): Revert last change.
3741 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3742
c9824451
AM
37432012-10-05 Alan Modra <amodra@gmail.com>
3744
3745 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3746 do_plt_address_for_global): New functions.
3747 (Output_data_got_powerpc::do_write): Don't segfault when linking
3748 statically.
3749 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3750 add_local_ifunc_entry): Return true on adding entry..
3751 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3752 glink->add_entry call. Remove unused symtab param. Adjust calls.
3753 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3754 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3755 set up symbols here.
3756 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3757 syms here. Do so even when no .iplt. Don't segfault when linking
3758 statically.
3759 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3760 new variants without reloc param.
3761 (Glink_sym_ent::Glink_sym_ent): Likewise.
3762 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3763 reloc when refs will resolve to plt call stub.
3764 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3765 R_PPC_PLTREL24 to resolve locally.
3766 (Target_powerpc::Scan::global): Correct ifunc handling.
3767 (Target_powerpc::Relocate::relocate): Correct local sym glink
3768 lookup. Don't destroy "value" when we have a plt call stub,
3769 and when checking plt call validity.
3770 (Target_powerpc::do_dynsym_value): Simplify.
3771
19fec8c1
AM
37722012-10-05 Alan Modra <amodra@gmail.com>
3773
3774 * i386.cc (Output_data_plt_i386::address_for_global,
3775 address_for_local): Add plt offset to returned value. Adjust uses.
3776 * sparc.cc (Output_data_plt_sparc::address_for_global,
3777 address_for_local): Likewise.
3778 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3779 address_for_local): Likewise.
3780 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3781 address_for_local): Likewise.
3782 * target.h (Target::plt_address_for_global, plt_address_for_local):
3783 Update comment.
3784 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3785 (Output_data_got::Got_entry::write): Nor here.
3786 * output.h: Comment fix.
3787
e867b647
WL
37882012-10-02 Jiong Wang <jiwang@tilera.com>
3789
3790 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3791 global_offset_table_ value for larget got.
3792 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3793
e5d5f5ed
AM
37942012-09-29 Alan Modra <amodra@gmail.com>
3795
3796 * powerpc.cc (Target_powerpc::iplt_): New output section.
3797 (Target_powerpc::iplt_section, make_iplt_section,
3798 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3799 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3800 Target_powerpc::plt_entry_count): Count iplt entries too.
3801 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3802 reloc section in constructor. New params.
3803 (Target_powerpc::make_plt_section): Create reloc section here instead.
3804 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3805 functions.
3806 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3807 (Output_data_glink::add_entry, find_entry): New functions to
3808 deal with local syms.
3809 (Glink_sym_ent): Add support for local syms.
3810 (Output_data_glink::do_write): Handle ifunc plt entries.
3811 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3812 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3813 (Target_powerpc::Relocate::relocate): Likewise.
3814 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3815
ec4dbad3
AM
38162012-09-25 Alan Modra <amodra@gmail.com>
3817
3818 * object.h (Sized_relobj_file::adjust_local_symbol,
3819 do_adjust_local_symbol): New functions.
3820 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3821 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3822 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3823 and irregular opd entry spacing.
3824 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3825 (Global_symbol_visitor_opd): New functor.
3826 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3827 on deleted opd entries.
3828
5c0b3823
WL
38292012-09-15 Jiong Wang <jiwang@tilera.com>
3830
3831 * tilegx.cc: New file.
3832 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3833 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3834 * configure.tgt: Add entries for tilegx*.
3835 * configure.ac: Likewise.
3836 * Makefile.in: Rebuild.
3837 * configure: Likewise.
3838 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3839 tilegx.
3840
bfdfa4cd
AM
38412012-09-13 Alan Modra <amodra@gmail.com>
3842
3843 * target-reloc.h (scan_relocs): Call scan.local for relocs
3844 against symbols in discarded sections. Pass is_discarded
3845 param.
3846 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3847 Add is_discarded param.
3848 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3849 is_discarded to flag opd entry as discarded. Don't emit dyn
3850 relocs on such entries.
3851 (Target_powerpc::Scan::global): Similarly detect and handle
3852 such opd entries.
3853 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3854 opd_ent_. Update all uses.
3855 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3856 (Target_powerpc::relocate_section): Zero out discarded opd
3857 entry relocs.
3858
d77a0555
ILT
38592012-09-12 Ian Lance Taylor <iant@google.com>
3860
3861 PR gold/14570
3862 * output.cc: Rename Output_data_got template parameter from size
3863 to got_size for all functions. Compile all variants of
3864 Output_data_got.
3865 (Output_data_got::Got_entry::write): Correct use of size for
3866 symbol value. Use local_is_tls rather than casting to
3867 Sized_relobj_file.
3868 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3869 (class Sized_relobj_file): Add do_local_is_tls.
3870 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3871
815a1205
AM
38722012-09-11 Alan Modra <amodra@gmail.com>
3873
3874 PR gold/14566
3875 * layout.cc (Layout::set_segment_offsets): When using
3876 common-page-size alignment, ensure we are on a new max-page-size
3877 page.
3878 * output.cc (Output_segment::set_section_addresses): Use
3879 abi_pagesize, not common_pagesize for relro boundary.
3880 (Output_segment::set_offset): Likewise.
3881
bd73a62d
AM
38822012-09-11 Alan Modra <amodra@gmail.com>
3883
3884 * output.h (Output_data_got::add_global_tls, add_local_tls,
3885 add_local_tls_pair): New functions.
3886 (Output_data_got::add_local_pair_with_rel): Remove second
3887 reloc param. Expand comment.
3888 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3889 use_plt_or_tls_offset_, similarly for constructor param.
3890 (Output_data_got::Got_entry::write): Add got_index param.
3891 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3892 add_local_tls_pair): New functions.
3893 (Output_data_got::Got_entry::write): Handle tls symbols
3894 with use_plt_or_tls_offset_ set specially.
3895 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3896 (Output_data_got::do_write): Replace iterator with index, pass
3897 index to entry write function.
3898 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3899 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3900 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3901 call.
3902 * i386.cc (Target_i386::Scan::local): Likewise.
3903 * sparc.cc (Target_sparc::Scan::local): Likewise.
3904 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3905 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3906 do_tls_offset_for_global): New functions.
3907 (Target_powerpc::Scan::local): Correct TLS relocations and got
3908 entry values.
3909 (Target_powerpc::Scan::global): Don't emit unnecessary
3910 dynamic relocations on TLS GOT entries.
3911
00716ab1
AM
39122012-09-10 Matthias Klose <doko@ubuntu.com>
3913
3914 * config.in: Disable sanity check for kfreebsd.
3915
c891b3f9
SA
39162012-09-10 Sterling Augustine <saugustine@google.com>
3917
3918 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3919 (Gdb_index::pubtypes_read): New parameter.
3920 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3921 to calls.
3922 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3923 pubtypes_object_.
3924
e81fea4d
AM
39252012-09-09 Alan Modra <amodra@gmail.com>
3926
3927 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3928 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3929 * gc.h (gc_process_relocs): Call target gc_add_reference.
3930 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3931 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3932 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3933 unnecessary cast.
3934 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3935 to cater for when we don't need code offset. Update use.
3936 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3937 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3938 set_opd_valid): New functions.
3939 (Target_powerpc::do_gc_add_reference): New function.
3940 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3941 stashed refs.
3942 (Target_powerpc::do_gc_mark_symbol): New function.
3943
d2d60eef
CC
39442012-09-06 Cary Coutant <ccoutant@google.com>
3945
3946 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3947 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3948 (Dwarf_die::skip_attributes): Likewise.
3949 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3950 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3951 (main): Call it.
3952 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3953
32ed4573
L
39542012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3955
3956 * testsuite/script_test_3.t: Add .got.plt output section
3957 statement.
3958 * testsuite/script_test_4.t: Likewise.
3959
f4baf0d4
AM
39602012-09-05 Alan Modra <amodra@gmail.com>
3961
3962 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3963 update all uses and lose "enum" when using type.
3964
864a1b56
AM
39652012-09-05 Alan Modra <amodra@gmail.com>
3966
3967 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3968 * configure: Regenerate.
3969 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3970 (plugin_final_layout.stdout): Likewise.
3971 (memory_test): Set page sizes to 0x1000.
3972 * testsuite/Makefile.in: Regenerate.
3973 * testsuite/discard_locals_test.sh: Add FIXME comment.
3974 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3975 * testsuite/pr14265.t: Add .got output section statement.
3976 * testsuite/script_test_2.t: Likewise.
3977 * testsuite/script_test_3.t: Likewise.
3978 * testsuite/script_test_4.t: Likewise.
3979 * testsuite/script_test_5.t: Likewise.
3980 * testsuite/script_test_6.t: Likewise.
3981 * testsuite/script_test_7.t: Likewise.
3982 * testsuite/script_test_9.t: Likewise.
3983
3ea0a085
AM
39842012-09-05 Alan Modra <amodra@gmail.com>
3985
3986 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3987 (Powerpc_relocate_functions::Status): New typedef.
3988 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3989 (Target_powerpc::Scan::local): Handle REL64.
3990 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3991 for REL32 and REL64.
3992 (Target_powerpc::symval_for_branch): New function, extracted from..
3993 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3994 checks. Report overflow errors.
3995
7404fe1b
AM
39962012-09-05 Alan Modra <amodra@gmail.com>
3997
3998 * object.h (Sized_relobj_file::emit_relocs): Delete.
3999 (Sized_relobj_file::emit_relocs_reltype): Delete.
4000 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4001 relocate_relocs for --emit-relocs.
4002 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4003 * output.h: Update comment.
4004 (Output_segment::first_section): New function.
4005 (Output_segment::first_section_load_address): Use first_section.
4006 * output.cc (Output_segment::first_section): New function extracted..
4007 (Output_segment::first_section_load_address): ..from here. Delete.
4008 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4009 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4010 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4011 adjust call to target.h function.
4012 * i386.cc (Target_i386): Likewise.
4013 * sparc.cc (Target_sparc): Likewise.
4014 * x86_64.cc (Target_x86_64): Likewise.
4015 * powerpc.cc (Target_powerpc): Likewise.
4016 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4017 first tls section has section symbol for optimised local dynamic
4018 output relocs.
4019 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4020 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4021 optimised tls code.
4022 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4023 Rename to relocate_relocs. Update error message.
4024
957564c9
AS
40252012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4026
4027 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4028 --just-symbols.
4029
dd93cd0a
AM
40302012-08-31 Alan Modra <amodra@gmail.com>
4031
4032 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4033 (Powerpc_relobj::toc_base_offset): New stub function.
4034 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4035 got_mod_index_offset to tlsld_got_offset. Update all refs.
4036 (Target_powerpc::Relocate::enum skip_tls): New.
4037 (Target_powerpc::call_tls_get_addr_): New var.
4038 (Target_powerpc::is_branch_reloc): Move to file scope.
4039 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4040 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4041 New functions.
4042 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4043 (powerpc_info): Correct common_pagesize for ppc64.
4044 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4045 (Powerpc_relocate_functions): Add overflow check enums and functions.
4046 Add non-shift version of rela, rela_ua. Delete all rel public
4047 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4048 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4049 addr16_ha3, addr14 functions.
4050 (Output_data_got_powerpc::add_constant_pair): New function.
4051 (Output_data_got_powerpc::got_base_offset): Likewise.
4052 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4053 (instruction constants): Sort, add some more.
4054 (Output_data_glink::do_write): Add and use Address typedef. Use
4055 object->toc_base_offset() stub for 64-bit.
4056 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4057 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4058 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4059 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4060 Always treat .opd relocs as against locally defined symbol.
4061 Correct condition for RELATIVE relocs.
4062 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4063 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4064 for 32-bit syms with a plt entry. Correct ppc64 toc base
4065 calculations. Handle TLS relocs, and more. Add overflow
4066 checking and adjust for Powerpc_relocate_functions changes.
4067 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4068 Reinstate --emit-relocs code with FIXME.
4069
a1373b60
AM
40702012-08-30 Alan Modra <amodra@gmail.com>
4071
4072 * layout.cc (Layout::set_segment_offsets): Set p_align to
4073 abi_pagesize, not common_pagesize.
4074 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4075 to determine whether file header can go in segment.
4076
703d02da
AM
40772012-08-30 Alan Modra <amodra@gmail.com>
4078
4079 * output.h (Output_reloc::Output_reloc <output section>): Add
4080 is_relative param. Adjust calls.
4081 (Output_reloc::add_output_section_relative): New functions.
4082 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4083 is_relative.
4084 (Output_reloc::symbol_value): Handle SECTION_CODE.
4085
16164a6b
ST
40862012-08-24 Sriraman Tallam <tmsriram@google.com>
4087
4088 * gold.cc (queue_middle_tasks): Call layout again when unique
4089 segments for sections is desired.
4090 * layout.cc (Layout::Layout): Initialize new members.
4091 (Layout::get_output_section_flags): New function.
4092 (Layout::choose_output_section): Call get_output_section_flags.
4093 (Layout::layout): Make output section for mapping to a unique segment.
4094 (Layout::insert_section_segment_map): New function.
4095 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4096 output sections marked so.
16164a6b
ST
4097 (Layout::segment_precedes): Check for unique segments when sorting.
4098 * layout.h (Layout::Unique_segment_info): New struct.
4099 (Layout::Section_segment_map): New typedef.
4100 (Layout::insert_section_segment_map): New function.
4101 (Layout::get_output_section_flags): New function.
4102 (Layout::is_unique_segment_for_sections_specified): New function.
4103 (Layout::set_unique_segment_for_sections_specified): New function.
4104 (Layout::unique_segment_for_sections_specified_): New member.
4105 (Layout::section_segment_map_): New member.
4106 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4107 Rename is_gc_pass_one to is_pass_one.
4108 Rename is_gc_pass_two to is_pass_two.
4109 Rename is_gc_or_icf to is_two_pass.
4110 Check for which pass based on whether symbols data is present.
4111 Make it two pass when unique segments for sections is desired.
4112 * output.cc (Output_section::Output_section): Initialize new
4113 members.
4114 * output.h (Output_section::is_unique_segment): New function.
4115 (Output_section::set_is_unique_segment): New function.
4116 (Output_section::is_unique_segment_): New member.
4117 (Output_section::extra_segment_flags): New function.
4118 (Output_section::set_extra_segment_flags): New function.
4119 (Output_section::extra_segment_flags_): New member.
4120 (Output_section::segment_alignment): New function.
4121 (Output_section::set_segment_alignment): New function.
4122 (Output_section::segment_alignment_): New member.
4123 (Output_segment::Output_segment): Initialize is_unique_segment_.
4124 (Output_segment::is_unique_segment): New function.
4125 (Output_segment::set_is_unique_segment): New function.
4126 (Output_segment::is_unique_segment_): New member.
4127 * plugin.cc (allow_unique_segment_for_sections): New function.
4128 (unique_segment_for_sections): New function.
4129 (Plugin::load): Add new functions to transfer vector.
4130 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4131 * Makefile.in: Regenerate.
4132 * testsuite/plugin_final_layout.sh: Check if unique segment
4133 functionality works.
4134 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4135 are available.
4136 (allow_unique_segment_for_sections): New global.
4137 (unique_segment_for_sections): New global.
4138 (claim_file_hook): Call allow_unique_segment_for_sections.
4139 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4140
1e2bee4f
CC
41412012-08-22 Cary Coutant <ccoutant@google.com>
4142
4143 * layout.cc (Layout::include_section): Don't assert on GROUP
4144 sections with --emit-relocs.
4145
1d5dfe78
CC
41462012-08-21 Cary Coutant <ccoutant@google.com>
4147
4148 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4149 if --export-dynamic-symbol names an undef symbol.
4150
c9269dff
AM
41512012-08-18 Alan Modra <amodra@gmail.com>
4152
4153 * powerpc.cc: Formatting and white space.
4154 (Powerpc_relobj): Rename got2_section_ to special_.
4155 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4156 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4157 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4158 (Target_powerpc): Add Address typedef and invalid_address. Use
4159 throughout.
4160 (Target_powerpc::is_branch_reloc): New function.
4161 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4162 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4163 for dst_mask, value and addend.
4164 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4165 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4166 (Output_data_glink::do_write): Correct toc base. Don't try to use
4167 uint16_t for 24-bit offset. Use get_output_section_offset and
4168 check return.
4169 (Target_powerpc::Scan::local): Handle more relocs.
4170 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4171 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4172 Plug in toc restoring insn after plt calls. Translate branches
4173 to function descriptor symbols to corresponding entry point.
4174 (Target_powerpc::relocate_for_relocatable): Check return from
4175 get_output_section_offset.
4176 * symtab.h: Comment typo.
4177
b1759dce
ILT
41782012-08-14 Ian Lance Taylor <iant@google.com>
4179
4180 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4181 unsupported_relocal_local to call unsupported_reloc_global.
4182
b9b2ae8b
NC
41832012-08-14 Nick Clifton <nickc@redhat.com>
4184
4185 PR ld/14265
4186 * script-sections.cc (Sections_element::output_section_name): Add
4187 keep return parameter.
4188 (Output_section_element::match_name): Add keep return parameter.
4189 Return the value of the keep_ member.
4190 * script-sections.h (class Output_section): Update
4191 output_section_name prototype.
4192 * layout.cc (Layout::keep_input_section): New public member
4193 function.
4194 (Layout::choose_output_section): Pass keep parameter to
4195 output_section_name.
4196 * layout.h (class Layout): Add keep_input_section.
4197 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4198 sections.
4199 * testsuite/Makefile.am: Add a test.
4200 * testsuite/Makefile.in: Regenerate.
4201 * testsuite/pr14265.c: Source file for the test.
4202 * testsuite/pr14265.t: Linker script for the test.
4203 * testsuite/pr14265.sh: Shell script for the test.
4204
921b5322
AM
42052012-08-14 Alan Modra <amodra@gmail.com>
4206
4207 * target.h (Target::output_section_name): New function.
4208 (Target::do_output_section_name): New function.
4209 * layout.cc (Layout::choose_output_section): Call the above.
4210 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4211
6ce78956
AM
42122012-08-14 Alan Modra <amodra@gmail.com>
4213
4214 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4215 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4216 for replace_constant call.
4217 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4218 (Output_data_glink::do_print_to_mapfile): New function.
4219 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4220 (Target_powerpc::Relocate::relocate): Likewise.
4221
d1a8cabd
AM
42222012-08-14 Alan Modra <amodra@gmail.com>
4223
4224 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4225 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4226 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4227 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4228 all references to shndx_. Handle special case for R_PPC_PLTREL24
4229 here.
4230 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4231 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4232 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4233 here.
4234 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4235 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4236
d83ce4e3
AM
42372012-08-12 Alan Modra <amodra@gmail.com>
4238
4239 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4240 (glink insn constants): Use uint32_t.
4241 (Output_data_glink::add_entry): Use insert, not [] operator.
4242
cf43a2fe
AM
42432012-08-11 Alan Modra <amodra@gmail.com>
4244
4245 * object.h (Sized_relobj_file::find_shdr): New function.
4246 (Sized_relobj_file::find_special_sections): New function.
4247 * object.cc (Sized_relobj_file::find_shdr): New function.
4248 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4249 (Sized_relobj_file::find_special_sections): New function, split out..
4250 (Sized_relobj_file::do_read_symbols): ..from here.
4251 * output.h (Output_data_got::replace_constant): New function.
4252 (Output_data_got::num_entries): New function.
4253 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4254 (Output_data_got::got_offset): Protected rather than private.
4255 (Output_data_got::replace_got_entry): New function.
4256 * output.cc (Output_data_got::replace_got_entry): New function.
4257 * powerpc.cc (class Powerpc_relobj): New.
4258 (class Powerpc_relocate_functions): Delete all psymval variants or
4259 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4260 Implement _ha functions using corresponding _hi function.
4261 (Powerpc_relobj::find_special_sections): New function.
4262 (Target_powerpc::do_make_elf_object): New function.
4263 (class Output_data_got_powerpc): New.
4264 (class Output_data_glink): New.
4265 (class Powerpc_scan_relocatable_reloc): New.
4266 Many more changes througout file.
4267
3c892704
NC
42682012-08-09 Nick Clifton <nickc@redhat.com>
4269
4270 * po/vi.po: Updated Vietnamese translation.
4271
82435b3b
ILT
42722012-08-07 Ian Lance Taylor <iant@google.com>
4273
4274 * layout.cc (Layout::add_target_dynamic_tags): If
4275 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4276 plt_rel.
4277
a6dc81d2
NC
42782012-07-30 Nick Clifton <nickc@redhat.com>
4279
4280 * po/gold.pot: Updated template.
4281 * po/es.po: Updated Spanish translation.
4282
f1415016
CC
42832012-07-18 Cary Coutant <ccoutant@google.com>
4284
4285 PR gold/14344
4286 * configure.ac: Add check for -gpubnames support.
4287 * configure: Regenerate.
4288 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4289 support; force -gno-pubnames.
4290 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4291 support.
4292 (gdb_index_test_4): New test.
4293 * testsuite/Makefile.in: Regenerate.
4294 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4295 * testsuite/gdb_index_test_2.sh: Likewise.
4296 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4297 * testsuite/gdb_index_test_4.sh: New script.
4298 * testsuite/gdb_index_test_comm.sh: New script with common code;
4299 don't look for space after colon.
4300
b7fd7c37
ST
43012012-07-16 Sriraman Tallam <tmsriram@google.com>
4302
4303 * gold.cc (queue_middle_tasks): Update function order only after
4304 deferred objects due to plugins are processed.
4305
1f3212db
ILT
43062012-07-11 Ian Lance Taylor <iant@google.com>
4307
4308 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4309 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4310 (Target_arm::scan_reloc_for_stub): Likewise.
4311 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4312 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4313 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4314 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4315 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4316
81c82a68
ILT
43172012-07-10 Dodji Seketeli <dodji@redhat.com>
4318 Ian Lance Taylor <iant@google.com>
4319
4320 PR gold/14309
4321 * configure.ac: Test whether std::tr1::hash<off_t> works.
4322 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4323 needed.
4324 * output.h (class Output_fill): Add virtual destructor.
4325 * configure, config.in: Rebuild.
4326
eabc84f4
RM
43272012-06-22 Roland McGrath <mcgrathr@google.com>
4328
4329 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4330
370e30b6
RÁE
43312012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4332
4333 * plugin.cc (Plugin::load): Handle position independent executables.
4334
fb1b895d
CC
43352012-06-06 Cary Coutant <ccoutant@google.com>
4336
4337 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4338 add .debug_macro.
4339 (lines_only_debug_sections): Likewise.
4340 (gdb_fast_lookup_sections): New static array.
4341 (is_gdb_debug_section): Rename formal parameter.
4342 (is_lines_only_debug_section): Likewise.
4343 (is_gdb_fast_lookup_section): New function.
4344 (Layout::include_section): Check for ".zdebug_" prefix; pass
4345 section name suffix to is_gdb_debug_section, et al.; check for
4346 fast-lookup sections when building .gdb_index.
4347 * options.h (--strip-debug-gdb): Update GDB version number.
4348
7c0640fa
CC
43492012-06-06 Cary Coutant <ccoutant@google.com>
4350
4351 * configure.ac: Add check for fallocate.
4352 * configure: Regenerate.
4353 * config.in: Regenerate.
4354
4355 * options.h (class General_options): Add --mmap-output-file and
4356 --posix-fallocate options.
4357 * output.cc: (posix_fallocate): Remove; replace with...
4358 (gold_fallocate): New function.
4359 (Output_file::map_no_anonymous): Call gold_fallocate.
4360 (Output_file::map): Check --mmap-output-file option.
4361
2a49eb69
DK
43622012-06-05 Jing Yu <jingyu@google.com>
4363
4364 * gold.h (textdomain): Add do {} to empty while(0).
4365 (bindtextdomain): Likewise.
4366
fad072ac
CC
43672012-06-04 Cary Coutant <ccoutant@google.com>
4368
4369 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4370 has_dynsym_index.
4371
8cc69fb6
ST
43722012-05-25 Sriraman Tallam <tmsriram@google.com>
4373
4374 * symtab.cc (Symbol_table::define_special_symbol):
4375 Initialize *poldsym to prevent uninitialized variable errors.
4376
1be75daa
CC
43772012-05-23 Cary Coutant <ccoutant@google.com>
4378
4379 * layout.cc (Layout::section_name_mapping): Add rules to handle
4380 exact match on .data.rel.ro.local or .data.rel.ro.
4381 (Layout::output_section_name): Check for exact matches.
4382
9b689de0
CC
43832012-05-23 Cary Coutant <ccoutant@google.com>
4384
4385 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4386 more carefully.
4387
b24fdbf5
CC
43882012-05-22 Cary Coutant <ccoutant@google.com>
4389
4390 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4391 object before exporting symbol.
4392
e550e1a2
L
43932012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4394
4395 * testsuite/tls_test.cc: Include "config.h" first.
4396 * testsuite/tls_test_c.c: Likewise.
4397
df7b86aa
NC
43982012-05-17 Daniel Richard G. <skunk@iskunk.org>
4399 Nick Clifton <nickc@redhat.com>
4400
4401 PR 14072
4402 * configure.in: Add check that sysdep.h has been included before
4403 any system header files.
4404 * configure: Regenerate.
4405 * config.in: Regenerate.
4406
1007b503
CC
44072012-05-14 Cary Coutant <ccoutant@google.com>
4408
4409 * layout.cc (Layout::make_output_section): Mark .tdata section
4410 as RELRO.
4411 * testsuite/relro_test.cc: Add a TLS variable.
4412
fd885f3a
L
44132012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4414
4415 PR gold/14091
4416 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4417 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4418 R_X86_64_64.
4419
80f5885c
CC
44202012-05-08 Cary Coutant <ccoutant@google.com>
4421
4422 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4423 (lines_only_debug_sections): Likewise.
4424
2e702c99
RM
44252012-05-02 Roland McGrath <mcgrathr@google.com>
4426
4427 * nacl.cc: New file.
4428 * nacl.h: New file.
4429 * Makefile.am (CCFILES, HFILES): Add them.
4430 * Makefile.in: Regenerate.
4431 * i386.cc (Output_data_plt_i386_nacl): New class.
4432 (Output_data_plt_i386_nacl_exec): New class.
4433 (Output_data_plt_i386_nacl_dyn): New class.
4434 (Target_i386_nacl): New class.
4435 (Target_selector_i386_nacl): New class.
4436 (target_selector_i386): Use it instead of Target_selector_i386.
4437 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4438 (Target_x86_64_nacl): New class.
4439 (Target_selector_x86_64_nacl): New class.
4440 (target_selector_x86_64, target_selector_x32): Use it instead of
4441 Target_selector_x86_64.
4442 * arm.cc (Output_data_plt_arm_nacl): New class.
4443 (Target_arm_nacl): New class.
4444 (Target_selector_arm_nacl): New class.
4445 (target_selector_arm, target_selector_armbe): Use it instead of
4446 Target_selector_arm.
4447
4448 * target-select.cc (select_target): Take new Input_file* and off_t
4449 arguments, pass them on to recognize method of selector.
4450 * object.cc (make_elf_sized_object): Update caller.
4451 * parameters.cc (parameters_force_valid_target): Likewise.
4452 * incremental.cc (make_sized_incremental_binary): Likewise.
4453 * target-select.h: Update decl.
4454 (Target_selector::recognize): Take new Input_file* argument,
4455 pass it on to do_recognize.
4456 (Target_selector::do_recognize): Take new Input_file* argument.
4457 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4458 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4459 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4460 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4461
4462 * target.h (Target::Target_info): New members isolate_execinstr
4463 and rosegment_gap.
4464 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4465 * arm.cc (Target_arm::arm_info): Update initializer.
4466 * i386.cc (Target_i386::i386_info): Likewise.
4467 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4468 * sparc.cc (Target_sparc::sparc_info): Likewise.
4469 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4470 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4471 * layout.cc (Layout::attach_allocated_section_to_segment):
4472 Take new const Target* argument. If target->isolate_execinstr(), act
4473 like --rosegment.
4474 (Layout::find_first_load_seg): Take new const Target* argument;
4475 if target->isolate_execinstr(), reject PF_X segments.
4476 (Layout::relaxation_loop_body): Update caller.
4477 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4478 reset file offset to zero when we hit LOAD_SEG, and then do a second
4479 loop over the segments before LOAD_SEG to reassign offsets after
4480 addresses have been determined. Handle target->rosegment_gap().
4481 (Layout::attach_section_to_segment): Take new const Target* argument;
4482 pass it to attach_allocated_section_to_segment.
4483 (Layout::make_output_section): Update caller.
4484 (Layout::attach_sections_to_segments): Take new const Target* argument;
4485 pass it to attach_section_to_segment.
4486 * gold.cc (queue_middle_tasks): Update caller.
4487 * layout.h (Layout): Update method decls with new arguments.
4488
4489 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4490 Target_info pointer to use.
4491 (Target_arm::do_make_data_plt): New virtual method.
4492 (Target_arm::make_data_plt): New method that calls it.
4493 (Target_arm::make_plt_entry): Use it.
4494 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4495 for the section alignment.
4496 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4497 method.
4498 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4499 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4500 method.
4501 (Output_data_plt_arm::get_plt_entry_size): Call it.
4502 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4503 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4504 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4505 method.
4506 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4507 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4508 method instead of sizeof(plt_entry).
4509 (Output_data_plt_arm::add_entry): Likewise.
4510 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4511 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4512 than static method.
4513 (Target_arm::plt_entry_size): Likewise.
4514 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4515 Move to ...
4516 (Output_data_plt_arm_standard): ... here, new class.
4517 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4518 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4519 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4520
4521 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4522 Take additional argument for the PLT entry size.
4523 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4524 Use get_plt_entry_size method rather than plt_entry_size variable.
4525 (Output_data_plt_x86_64::reserve_slot): Likewise.
4526 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4527 (Output_data_plt_x86_64::add_entry): Likewise.
4528 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4529 (Output_data_plt_x86_64::address_for_global): Likewise.
4530 (Output_data_plt_x86_64::address_for_local): Likewise.
4531 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4532 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4533 Make method non-static.
4534 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4535 method.
4536 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4537 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4538 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4539 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4540 virtual method.
4541 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4542 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4543 virtual method.
4544 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4545 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4546 virtual method.
4547 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4548 (Output_data_plt_x86_64::plt_entry_size)
4549 (Output_data_plt_x86_64::first_plt_entry)
4550 (Output_data_plt_x86_64::plt_entry)
4551 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4552 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4553 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4554 (Output_data_plt_x86_64_standard): ... here, new class.
4555 (Target_x86_64::Target_x86_64): Take optional argument for the
4556 Target_info pointer to use.
4557 (Target_x86_64::do_make_data_plt): New virtual method.
4558 (Target_x86_64::make_data_plt): New method to call it.
4559 (Target_x86_64::init_got_plt_for_update): Use that.
4560 Call this->plt_->add_eh_frame method here.
4561 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4562 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4563 rather than static method.
4564 (Target_x86_64::plt_entry_size): Likewise.
4565 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4566 rather than plt_entry_size variable. Move guts of PLT filling to...
4567 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4568 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4569 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4570
4571 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4572 additional argument for the section alignment.
4573 Don't do add_eh_frame_for_plt here.
4574 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4575 non-static. Use get_plt_entry_size method rather than plt_entry_size
4576 variable.
4577 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4578 method.
4579 (Output_data_plt_i386::get_plt_entry_size): Call it.
4580 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4581 (Output_data_plt_i386::add_eh_frame): New method to call it.
4582 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4583 method.
4584 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4585 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4586 method.
4587 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4588 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4589 method instead of plt_entry_size.
4590 (Output_data_plt_i386::plt_entry_size)
4591 (Output_data_plt_i386::plt_eh_frame_fde_size)
4592 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4593 (Output_data_plt_i386_standard): ... here, new class.
4594 (Output_data_plt_i386_exec): New class.
4595 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4596 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4597 (Output_data_plt_i386::exec_plt_entry): Move to ...
4598 (Output_data_plt_i386_exec::plt_entry): ... here.
4599 (Output_data_plt_i386_dyn): New class.
4600 (Output_data_plt_i386::first_plt_entry): Move to ...
4601 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4602 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4603 (Output_data_plt_i386_dyn::plt_entry): ... here.
4604 (Target_i386::Target_i386): Take optional argument for the Target_info
4605 pointer to use.
4606 (Target_i386::do_make_data_plt): New virtual method.
4607 (Target_i386::make_data_plt): New method to call it.
4608 (Target_i386::make_plt_section): Use that.
4609 Call this->plt_->add_eh_frame method here.
4610 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4611 rather than plt_entry_size variable.
4612 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4613 (Output_data_plt_i386::address_for_local): Likewise.
4614 (Output_data_plt_i386::do_write): Likewise.
4615 Move guts of PLT filling to...
4616 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4617 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4618 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4619 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4620
b9b9f2ee
CC
46212012-05-01 Cary Coutant <ccoutant@google.com>
4622
4623 * dwarf_reader.cc (Dwarf_die::read_attributes)
4624 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4625 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4626 * reduced_debug_output.cc
4627 (Output_reduced_debug_info_section::get_die_end): Remove
4628 DW_FORM_GNU_ref_index. Add default case.
4629
57923f48
MW
46302012-04-26 Mark Wielaard <mjw@redhat.com>
4631
4632 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4633 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4634 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4635 DW_AT_high_pc as offset from DW_AT_low_pc.
4636
4637 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4638 * testsuite/Makefile.in: Regenerate.
4639 * testsuite/gdb_index_test_3.c: New test source file.
4640 * testsuite/gdb_index_test_3.sh: New test source file.
4641
2c54b4f4
ILT
46422012-04-25 Ian Lance Taylor <iant@google.com>
4643
4644 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4645 pointer.
4646 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4647 as a class, not a struct.
4648 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4649 (Target_arm::apply_cortex_a8_workaround): Likewise.
4650 * gc.h: Declare Reloc_types as a struct, not a class.
4651 * object.h: Declare Symbols_data as a struct.
4652 * reloc.h: Declare Read_relocs_data as a struct.
4653 * target.h: Declare Relocate_info as a struct.
4654
a5a5f7a3
DM
46552012-04-24 David S. Miller <davem@davemloft.net>
4656
4657 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4658 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4659 and R_SPARC_WPLT30.
4660
f038d496
CC
46612012-04-24 Cary Coutant <ccoutant@google.com>
4662
4663 * incremental-dump.cc (find_input_containing_global): Replace
4664 magic number with symbolic constant.
4665 (dump_incremental_inputs): Update version number.
4666 * incremental.cc (Output_section_incremental_inputs): Update version
4667 number; import symbolic constants from Incremental_inputs_reader.
4668 (Incremental_inputs::create_data_sections): Align relocations
4669 section correctly for 64-bit targets.
4670 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4671 constants; add padding.
4672 (Output_section_incremental_inputs::write_header): Add assert for
4673 header_size.
4674 (Output_section_incremental_inputs::write_input_files): Add assert
4675 for input_entry_size.
4676 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4677 add assert for object_info_size, input_section_entry_size,
4678 global_sym_entry_size.
4679 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4680 for data structure sizes; use them.
4681 (Incremental_input_entry_reader): Import symbolic constants from
4682 Incremental_inputs_reader; use them.
4683
a4d85145
DM
46842012-04-23 David S. Miller <davem@davemloft.net>
4685
4686 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4687 and elf_flags_set_.
4688 (Target_sparc::Target_sparc): Initialize new fields.
4689 (Target_sparc::do_make_elf_object): New function.
4690 (Target_sparc::do_adjust_elf_header): New function.
4691
1d509098
CC
46922012-04-23 Cary Coutant <ccoutant@google.com>
4693
4694 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4695 CU range table of gdb index.
4696
7ebeff7f
DM
46972012-04-20 David S. Miller <davem@davemloft.net>
4698
4699 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4700 instead of false.
4701
13cf9988
DM
47022012-04-16 David S. Miller <davem@davemloft.net>
4703
2a1079e8
DM
4704 * sparc.cc (Target_sparc::got_address): New function.
4705 (Sparc_relocate_functions::gdop_hix22): New function.
4706 (Sparc_relocate_functions::gdop_lox10): New function.
4707 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4708 relocs.
4709 (Target_sparc::Scan::local): Likewise if the global symbol is not
4710 preemptible and is not IFUNC.
4711 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4712 transformations for local and non-preemptible non-IFUNC global
4713 symbols.
4714
0bc964fc
DM
4715 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4716 writing out 64-bit part of ranges.
4717
661d7a80
DM
4718 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4719 -fpic and -fpie respectively.
4720 * Makefile.in: Regenerate.
4721
8c2bf391
DM
4722 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4723 (Target_sparc::Target_sparc): Initialize new field.
4724 (Target_sparc::do_plt_section_for_global): New function.
4725 (Target_sparc::do_plt_section_for_local): New function.
4726 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4727 (Target_sparc::make_plt_section): New function, broken out of
4728 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4729 (Target_sparc::make_plt_entry): Call make_plt_section.
4730 (Target_sparc::make_local_ifunc_plt_entry): New function.
4731 (Target_sparc::rela_ifunc_section): New function.
4732 (Target_sparc::plt_section): Remove const.
4733 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4734 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4735 and ifunc_count_ fields.
4736 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4737 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4738 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4739 (Output_data_plt_sparc::rela_ifunc): New function.
4740 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4741 (Output_data_plt_sparc::has_ifunc_section): New function.
4742 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4743 (Output_data_plt_sparc::address_for_global): New function.
4744 (Output_data_plt_sparc::address_for_local): New function.
4745 (Output_data_plt_sparc::plt_index_to_offset): New function.
4746 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4747 and entry_count.
4748 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4749 entry_count.
4750 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4751 R_SPARC_JMP_IREL to switch.
4752 (Target_sparc::Scan::check_non_pic): Likewise.
4753 (Target_sparc::Scan::local): Handle IFUNC symbols.
4754 (Target_sparc::Scan::local): Likewise.
4755 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4756 and plt_address_for_local.
4757 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4758 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4759
13cf9988
DM
4760 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4761 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4762 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4763 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4764 global relocs too.
4765 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4766 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4767 calls.
4768 * sparc.cc (Target_sparc::Scan::global): Likewise.
4769 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4770
31821be0
CC
47712012-04-16 Cary Coutant <ccoutant@google.com>
4772
4773 * archive.cc (Library_base::should_include_member): Check for
4774 --export-dynamic-symbol.
4775 * options.h (class General_options): Add --export-dynamic-symbol.
4776 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4777 --export-dynamic-symbol.
4778 (Symbol_table::gc_mark_undef_symbols): Likewise.
4779 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4780
2615994e
DM
47812012-04-12 David S. Miller <davem@davemloft.net>
4782
4783 * sparc.cc (Reloc::wdisp10): New relocation method.
4784 (Reloc::h34): Likewise.
4785 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4786 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4787 R_SPARC_WDISP10.
4788 (Target_sparc::Scan::local): Likewise.
4789 (Target_sparc::Scan::global): Likewise.
4790 (Target_sparc::Relocate::relocate): Likewise.
4791
6782735d
CC
47922012-04-09 Cary Coutant <ccoutant@google.com>
4793
4794 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4795 low_pc == 0.
4796
8c7a0b00
ILT
47972012-04-06 Ian Lance Taylor <iant@google.com>
4798
4799 * timer.cc: #include <unistd.h>.
4800
58797674
RM
48012012-04-06 Roland McGrath <mcgrathr@google.com>
4802
4803 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4804 * config.in: Regenerate.
4805 * configure: Regenerate.
4806
44350750
NC
48072012-04-05 Nick Clifton <nickc@redhat.com>
4808
4809 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4810 (AM_LC_MESSAGES): Add.
4811 * aclocal.m4: Regenerate.
4812 * config.in: Regenerate.
4813 * configure: Regenerate.
4814
c1027032
CC
48152012-03-21 Cary Coutant <ccoutant@google.com>
4816
4817 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4818 * Makefile.in: Regenerate.
4819 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4820 (Sized_elf_reloc_mapper::symbol_section): New function.
4821 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4822 (make_elf_reloc_mapper): New function.
4823 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4824 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4825 (Dwarf_abbrev_table::do_get_abbrev): New function.
4826 (Dwarf_ranges_table::read_ranges_table): New function.
4827 (Dwarf_ranges_table::read_range_list): New function.
4828 (Dwarf_pubnames_table::read_section): New function.
4829 (Dwarf_pubnames_table::read_header): New function.
4830 (Dwarf_pubnames_table::next_name): New function.
4831 (Dwarf_die::Dwarf_die): New function.
4832 (Dwarf_die::read_attributes): New function.
4833 (Dwarf_die::skip_attributes): New function.
4834 (Dwarf_die::set_name): New function.
4835 (Dwarf_die::set_linkage_name): New function.
4836 (Dwarf_die::attribute): New function.
4837 (Dwarf_die::string_attribute): New function.
4838 (Dwarf_die::int_attribute): New function.
4839 (Dwarf_die::uint_attribute): New function.
4840 (Dwarf_die::ref_attribute): New function.
4841 (Dwarf_die::child_offset): New function.
4842 (Dwarf_die::sibling_offset): New function.
4843 (Dwarf_info_reader::check_buffer): New function.
4844 (Dwarf_info_reader::parse): New function.
4845 (Dwarf_info_reader::do_parse): New function.
4846 (Dwarf_info_reader::do_read_string_table): New function.
4847 (Dwarf_info_reader::lookup_reloc): New function.
4848 (Dwarf_info_reader::get_string): New function.
4849 (Dwarf_info_reader::visit_compilation_unit): New function.
4850 (Dwarf_info_reader::visit_type_unit): New function.
4851 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4852 Sized_elf_reloc_mapper.
4853 (Sized_dwarf_line_info::symbol_section): Remove function.
4854 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4855 (Sized_dwarf_line_info::read_line_mappings): Remove object
4856 parameter, adjust callers.
4857 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4858 * dwarf_reader.h: Include <sys/types.h>.
4859 (class Track_relocs): Remove forward declaration.
4860 (class Elf_reloc_mapper): New class.
4861 (class Sized_elf_reloc_mapper): New class.
4862 (class Dwarf_abbrev_table): New class.
4863 (class Dwarf_range_list): New class.
4864 (class Dwarf_ranges_table): New class.
4865 (class Dwarf_pubnames_table): New class.
4866 (class Dwarf_die): New class.
4867 (class Dwarf_info_reader): New class.
4868 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4869 (Sized_dwarf_line_info::symbol_section): Remove member function.
4870 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4871 base class.
4872 * gdb-index.cc: New source file.
4873 * gdb-index.h: New source file.
4874 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4875 and .debug_types sections, call Layout::add_to_gdb_index.
4876 (Sized_relobj_incr::do_section_name): Implement.
4877 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4878 return type; Implement.
4879 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4880 return type.
4881 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4882 parameter list and return type.
4883 (Sized_incr_dynobj::do_section_contents): Likewise.
4884 * layout.cc: Include gdb-index.h.
4885 (Layout::Layout): Initialize gdb_index_data_.
4886 (Layout::init_fixed_output_section): Check for .gdb_index section.
4887 (Layout::add_to_gdb_index): New function. Instantiate.
4888 * layout.h: Add forward declaration for class Gdb_index.
4889 (Layout::add_to_gdb_index): New member function.
4890 (Layout::gdb_index_data_): New data member.
4891 * main.cc: Include gdb-index.h.
4892 (main): Print statistics for gdb index.
4893 * object.cc (Object::section_contents): Move code into
4894 do_section_contents.
4895 (need_decompressed_section): Check for sections needed when building
4896 gdb index.
4897 (build_compressed_section_map): Likewise.
4898 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4899 gdb index.
4900 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4901 sections; call Layout::add_to_gdb_index.
4902 (Sized_relobj_file::do_decompressed_section_contents): Call
4903 do_section_contents directly.
4904 * object.h (Object::do_section_contents): Adjust parameter list and
4905 return type.
4906 (Object::do_decompressed_section_contents): Call do_section_contents
4907 directly.
4908 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4909 return type.
4910 * options.h (class General_options): Add --gdb-index option.
4911 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4912 list and return type.
4913 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4914 * reloc.h (Track_relocs::checkpoint): New function.
4915 (Track_relocs::reset): New function.
4916
4917 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4918 New test cases.
4919 * testsuite/Makefile.in: Regenerate.
4920 * testsuite/gdb_index_test.cc: New test source file.
4921 * testsuite/gdb_index_test_1.sh: New test source file.
4922 * testsuite/gdb_index_test_2.sh: New test source file.
4923
647f1574
DK
49242012-03-19 Doug Kwan <dougkwan@google.com>
4925
4926 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4927 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4928 __exidx_start and __exidx_end. Make symbol table parameter
4929 anonymous as it is not used.
4930 * gold.cc (queue_middle_tasks): Call target hook to define any
4931 target-specific symbols.
4932 * target.h (Target::define_standard_symbols): New method.
4933 (Target::do_define_standard_symbols): Same.
4934 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4935 * testsuite/Makefile.in: Regenerate.
4936 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4937 and __exidx_end.
4938 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4939 relocations are generated for __exidx_start and __exidx_end.
4940
7c6109da
DK
49412012-03-16 Doug Kwan <dougkwan@google.com>
4942
4943 * testsuite/Makefile.am: Disable test initpri3b.
4944 * testsuite/Makefile.in: Regenerate.
4945
7b8957f8
DK
49462012-03-15 Doug Kwan <dougkwan@google.com>
4947
4948 * arm.cc (Target_arm::got_section): Make .got section read-only
4949 if -z now is given.
4950
14dc9ef7
ILT
49512012-03-15 Ian Lance Taylor <iant@google.com>
4952
4953 PR gold/13850
4954 * layout.cc (Layout::make_output_section): Correctly mark
4955 SHT_INIT_ARRAY, et. al., as relro.
4956
fa40b62a
DK
49572012-03-14 Doug Kwan <dougkwan@google.com>
4958
4959 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4960 dynamic relocations for protected symbols in shared objects.
4961
fd325007
ILT
49622012-03-13 Ian Lance Taylor <iant@google.com>
4963
4964 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4965 keep the larger alignment.
4966
e8dd54e1
CC
49672012-03-12 Cary Coutant <ccoutant@google.com>
4968
4969 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4970 handling of DW_LNE_define_file.
4971
feb5f3b0
CC
49722012-03-12 Cary Coutant <ccoutant@google.com>
4973
4974 * reduced_debug_output.cc
4975 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4976 codes to switch.
4977
a1fb4256
CC
49782012-02-29 Cary Coutant <ccoutant@google.com>
4979
4980 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4981
5dd8762a
CC
49822012-02-29 Cary Coutant <ccoutant@google.com>
4983
4984 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4985 Call Object::decompressed_section_contents.
4986 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4987 New dtor.
4988 (Sized_dwarf_line_info::buffer_start_): New data member.
4989 * merge.cc (Output_merge_data::do_add_input_section): Call
4990 Object::decompressed_section_contents.
4991 (Output_merge_string::do_add_input_section): Likewise.
4992 * object.cc (need_decompressed_section): New function.
4993 (build_compressed_section_map): Decompress sections needed later.
4994 (Sized_relobj_file::do_decompressed_section_contents): New function.
4995 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4996 * object.h (Object::decompressed_section_contents): New function.
4997 (Object::discard_decompressed_sections): New function.
4998 (Object::do_decompressed_section_contents): New function.
4999 (Object::do_discard_decompressed_sections): New function.
5000 (Compressed_section_info): New type.
5001 (Compressed_section_map): Include decompressed section contents.
5002 (Sized_relobj_file::do_decompressed_section_contents): New function.
5003 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5004
7b5de7ee
CC
50052012-02-16 Cary Coutant <ccoutant@google.com>
5006
5007 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5008 * testsuite/Makefile.in: Regenerate.
5009
f9fa4a63
CC
50102012-02-14 Cary Coutant <ccoutant@google.com>
5011
5012 * options.cc (General_options::finalize): Disallow -pie and -static.
5013
2c175ebc
DK
50142012-02-03 Doug Kwan <dougkwan@google.com>
5015
5016 * arm.cc (Arm_relocate_functions::abs8,
5017 Arm_relocate_functions::abs16): Use
5018 Bits::has_signed_unsigned_overflow32.
5019 (Arm_relocate_functions::thm_abs8): Correct range of
5020 overflow check.
5021 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5022 in assertions.
5023
90cff06f
DK
50242012-02-02 Doug Kwan <dougkwan@google.com>
5025
5026 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5027 position independent outputs, not just shared objects.
5028
63887f3d
L
50292012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5030
5031 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5032 * configure: Regenerated.
5033
bef2b434
ILT
50342012-01-27 Ian Lance Taylor <iant@google.com>
5035
5036 * reloc.h (Bits): New class with static functions, copied from
5037 namespace utils in arm.cc.
5038 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5039 instead.
5040
c335b55d
L
50412012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5042
5043 * incremental.cc (write_info_blocks): Correct relocation offset.
5044
41194d9f
L
50452012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5046
5047 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5048 (Relocate::tls_gd_to_le): Likewise.
5049
1bae613c
L
50502012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5051
5052 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5053
24482ca0
L
50542012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5055
5056 * configure.ac: Check if -mcmodel=medium works.
5057 * configure: Regenerated.
5058
c2c7840a
CC
50592012-01-24 Cary Coutant <ccoutant@google.com>
5060
5061 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5062 definition and ...
5063 (read_unsigned_LEB_128_x): ... this new function.
5064 (read_signed_LEB_128): Replaced with inline definition and ...
5065 (read_signed_LEB_128_x): ... this new function.
5066 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5067 (read_unsigned_LEB_128): Add inline definition.
5068 (read_signed_LEB_128_x): New function.
5069 (read_signed_LEB_128): Add inline definition.
5070 * testsuite/Makefile.am (leb128_unittest): New unit test.
5071 * testsuite/Makefile.in: Regenerate.
5072 * testsuite/leb128_unittest.cc: New unit test.
5073
833de760 50742012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5075
5076 PR gold/13617
5077 * i386.cc (Target_i386::do_code_fill): When using a jmp
5078 instruction, pad with nop instructions.
5079 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5080
618d6666
L
50812012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5082
5083 * x86_64.cc (gc_process_relocs): Add typename on types used in
5084 template.
5085 (scan_relocs): Likewise.
5086 (relocate_section): Likewise.
5087 (apply_relocation): Likewise.
5088
3660ff06
L
50892012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5090
5091 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5092 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5093 under x32.
5094
fc51264f
L
50952012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5096
5097 * x86_64.cc: Initial support for x32.
5098
dd74ae06
CC
50992012-01-03 Cary Coutant <ccoutant@google.com>
5100
5101 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5102 Use abstract base class for GOT.
5103 * gold/output.h (class Output_data_got_base): New abstract base class.
5104 (class Output_data_got): Derive from new base class, adjust ctors.
5105 (Output_data_got::reserve_slot): Make virtual; rename to
5106 do_reserve_slot; Adjust callers.
5107 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5108 pointer to abstract base class.
5109 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5110
83896202
ILT
51112011-12-18 Ian Lance Taylor <iant@google.com>
5112
5113 * object.h (Relobj::local_symbol_value): New function.
5114 (Relobj::local_plt_offset): New function.
5115 (Relobj::local_has_got_offset): New function.
5116 (Relobj::local_got_offset): New function.
5117 (Relobj::set_local_got_offset): New function.
5118 (Relobj::do_local_symbol_value): New pure virtual function.
5119 (Relobj::do_local_plt_offset): Likewise.
5120 (Relobj::do_local_has_got_offset): Likewise.
5121 (Relobj::do_local_got_offset): Likewise.
5122 (Relobj::do_set_local_got_offset): Likewise.
5123 (Sized_relobj::do_local_has_got_offset): Rename from
5124 local_has_got_offset.
5125 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5126 (Sized_relobj::do_set_local_got_offset): Rename from
5127 set_local_got_offset.
5128 (Sized_relobj_file::do_local_plt_offset): Rename from
5129 local_plt_offset.
5130 (Sized_relobj_file::do_local_symbol_value): New function.
5131 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5132 local_plt_offset.
5133 * output.cc (Output_data_got::Got_entry::write): Change object to
5134 Relobj. Use local_symbol_value.
5135 (Output_data_got::add_global_with_rel): Change rel_dyn to
5136 Output_data_reloc_generic*. Use add_global_generic.
5137 (Output_data_got::add_global_with_rela): Remove. Change all
5138 callers to use add_global_with_rel.
5139 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5140 Output_data_reloc_generic*. Use add_global_generic.
5141 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5142 callers to use add_global_pair_with_rel.
5143 (Output_data_got::add_local): Change object to Relobj*.
5144 (Output_data_got::add_local_plt): Likewise.
5145 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5146 change rel_dyn to Output_data_reloc_generic*. Use
5147 add_local_generic.
5148 (Output_data_got::add_local_with_rela): Remove. Change all
5149 callers to use all_local_with_rel.
5150 (Output_data_got::add_local_pair_with_rel): Change object to
5151 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5152 add_output_section_generic.
5153 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5154 callers to use add_local_pair_with_rel.
5155 (Output_data_got::reserve_local): Change object to Relobj*.
5156 * output.h: (class Output_data_reloc_generic): Add pure virtual
5157 declarations for add_global_generic, add_local_generic,
5158 add_output_section_generic.
5159 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5160 functions for Output_data_reloc_generic. Update declarations for
5161 changes listed in output.cc.
5162 (class Output_data_got): Change template parameter to got_size.
5163 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5164 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5165 function.
5166 (Sized_relobj_incr::do_local_plt_offset): New function.
5167 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5168 add_global_generic.
5169
76677ad0
CC
51702011-12-17 Cary Coutant <ccoutant@google.com>
5171
5172 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5173 * resolve.cc (Symbol_table::resolve): Likewise.
5174 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5175 arrays.
5176 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5177
8b8dd8d5
ILT
51782011-12-16 Ian Lance Taylor <iant@google.com>
5179
5180 * output.h (Output_data_reloc_generic::add): Only call
5181 add_dynamic_reloc if this is a dynamic reloc section.
5182
d55525b9
L
51832011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5184
5185 PR gold/13505
5186 * target-reloc.h (apply_relocation): Replace <64, false> with
5187 <size, big_endian>.
5188
ff81c7c1
NC
51892011-11-25 Nick Clifton <nickc@redhat.com>
5190
5191 * po/it.po: New Italian translation.
5192
628f39be
SA
51932011-11-17 Sterling Augustine <saugustine@google.com>
5194
5195 * script.cc (script_include_directive): Implement.
5196 (read_script_file): New local variables name and search_path. Update
5197 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5198 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5199 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5200
98ef3ea4
SA
52012011-11-11 Sterling Augustine <saugustine@google.com>
5202
5203 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5204 (file_or_sections_cmd): Likewise.
5205
f4a8b6d7
DK
52062011-11-11 Doug Kwan <dougkwan@google.com>
5207
5208 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5209 if --just-symbols is given.
5210
29ab395d
DK
52112011-11-10 Doug Kwan <dougkwan@google.com>
5212
5213 PR gold/13362
5214 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5215 when processing data relocs.
5216 * reloc.h (Relocate_functions::rel_unaligned): New method.
5217 (Relocate_functions::pcrel_unaligned): Ditto.
5218 (Relocate_functions::rel32_unaligned): Ditto.
5219 (Relocate_functions::pcrel32_unaligned): Ditto.
5220
2c339f71
DK
52212011-11-09 Doug Kwan <dougkwan@google.com>
5222
5223 PR gold/13362
5224 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5225 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5226 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5227 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5228 (Relocate_functions::rel_unaligned): New.
5229 (Relocate_functions::rel32_unaligned): New.
5230 * target-reloc.h (relocate_for_relocatable): Add code to handle
5231 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5232 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5233 arm_unaligned_reloc_r): New targets.
5234 * testsuite/Makefile.in: Regenerate.
5235 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5236 linking.
5237
3f3cddf1
ILT
52382011-11-02 Ian Lance Taylor <iant@google.com>
5239
5240 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5241 NATIVE_LINKER.
5242 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5243 * options.cc (General_options::finalize): Use library search path
5244 from configure script if specified. If not native and no sysroot,
5245 only search TOOLLIBDIR.
5246 * options.h (Search_directory::Search_directory): Change name to
5247 const std::string&.
5248 (General_options::add_to_library_path_with_sysroot): Change arg to
5249 const std::string&.
5250 * configure, Makefile.in, config.in: Rebuild.
5251
a8e2273b
ILT
52522011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5253
5254 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5255 we are working around the ARM1176 Erratum.
5256 * options.h (General_options::fix_arm1176): Add option.
5257 * testsuite/Makefile.am: Add testcases, and keep current ones
5258 working.
5259 * testsuite/Makefile.in: Regenerate.
5260 * testsuite/arm_fix_1176.s: New file.
5261 * testsuite/arm_fix_1176.sh: Likewise.
5262
cd6eab1c
ILT
52632011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5264
5265 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5266 may_use_blx_.
5267 (Target_arm::may_use_blx): Remove method.
5268 (Target_arm::set_may_use_blx): Likewise.
5269 (Target_arm::may_use_v4t_interworking): New method.
5270 (Target_arm::may_use_v5t_interworking): Likewise.
5271 (Target_arm::may_use_blx_): Remove member variable.
5272 (Arm_relocate_functions::arm_branch_common): Check for v5T
5273 interworking.
5274 (Arm_relocate_functions::thumb_branch_common): Likewise.
5275 (Reloc_stub::stub_type_for_reloc): Likewise.
5276 (Target_arm::do_finalize_sections): Correct interworking checks.
5277 * testsuite/Makefile.am: Add new tests.
5278 * testsuite/Makefile.in: Regenerate.
5279 * testsuite/arm_farcall_arm_arm.s: New test.
5280 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5281 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5282 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5283 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5284 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5285 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5286 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5287
286adcf4
CC
52882011-10-31 Cary Coutant <ccoutant@google.com>
5289
5290 PR gold/13023
5291 * expression.cc (Expression::eval_with_dot): Add
5292 is_section_dot_assignment parameter.
5293 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5294 absolute and assigning to dot within a section.
5295 * script-sections.cc
5296 (Output_section_element_assignment::set_section_addresses): Pass
5297 dot_section to set_if_absolute.
5298 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5299 as is_section_dot_assignment flag to eval_with_dot.
5300 (Output_section_element_dot_assignment::set_section_addresses):
5301 Likewise.
5302 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5303 parameter. Also set value if relative to dot_section; set the
5304 symbol's output_section.
5305 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5306 parameter. Adjust all callers.
5307 (Expression::eval_maybe_dot): Likewise.
5308 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5309 Adjust all callers.
5310 * testsuite/script_test_2.t: Test assignment of an absolute value
5311 to dot within an output section element.
5312
9634ed06
CC
53132011-10-31 Cary Coutant <ccoutant@google.com>
5314
5315 * options.h (class General_options): Add --[no-]gnu-unique options.
5316 * symtab.cc (Symbol_table::sized_write_globals): Convert
5317 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5318
de4101c7
CC
53192011-10-31 Cary Coutant <ccoutant@google.com>
5320
5321 PR gold/13359
5322 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5323 unnecessary assertion.
5324 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5325
7257cc92
ST
53262011-10-31 Sriraman Tallam <tmsriram@google.com>
5327
5328 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5329 gc_mark_symbol.
5330 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5331 gc_mark_symbol.
5332 Change to just keep the section associated with symbol.
5333 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5334 they are externally visible and --export-dynamic is turned on.
5335 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5336
bfc34b3f
ILT
53372011-10-19 Ian Lance Taylor <iant@google.com>
5338
5339 PR gold/13163
5340 * script-sections.cc
5341 (Output_section_element_dot_assignment::needs_output_section): New
5342 function.
5343
ea0d8c47
ILT
53442011-10-19 Ian Lance Taylor <iant@google.com>
5345
5346 PR gold/13204
5347 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5348 --section-start option was seen.
5349 * options.h (General_options::any_section_start): New function.
5350
abd242a9
DM
53512011-10-18 David S. Miller <davem@davemloft.net>
5352
5353 PR binutils/13301
5354 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5355 member to track relocation locations that have moved during TLS
5356 reloc optimizations.
5357 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5358 (Target_sparc::Relocate::relocate): Adjust view down by 4
5359 bytes if it matches reloc_adjust_addr_.
5360 (Target_sparc::Relocate::relocate_tls): Always move the
5361 __tls_get_addr call delay slot instruction forward 4 bytes when
5362 performing relaxation.
5363
bab9090f
CC
53642011-10-18 Cary Coutant <ccoutant@google.com>
5365
5366 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5367 (Output_file::map_no_anonymous): Check for non-zero
5368 return code from posix_fallocate.
5369
f7c5b166
CC
53702011-10-17 Cary Coutant <ccoutant@google.com>
5371
5372 PR gold/13245
5373 * plugin.cc (is_visible_from_outside): Check for symbols
5374 referenced from dynamic objects.
5375 * resolve.cc (Symbol_table::resolve): Don't count references
5376 from dynamic objects as references from real ELF files.
5377 * testsuite/plugin_test_2.sh: Adjust expected result.
5378
b490c0bb
CC
53792011-10-17 Cary Coutant <ccoutant@google.com>
5380
5381 * gold.cc: Include timer.h.
5382 (queue_middle_tasks): Stamp time.
5383 (queue_final_tasks): Likewise.
5384 * main.cc (main): Store timer in parameters. Print timers
5385 for each pass.
5386 * parameters.cc (Parameters::Parameters): Initialize timer_.
5387 (Parameters::set_timer): New function.
5388 (set_parameters_timer): New function.
5389 * parameters.h (Parameters::set_timer): New function.
5390 (Parameters::timer): New function.
5391 (Parameters::timer_): New data member.
5392 (set_parameters_timer): New function.
5393 * timer.cc (Timer::stamp): New function.
5394 (Timer::get_pass_time): New function.
5395 * timer.h (Timer::stamp): New function.
5396 (Timer::get_pass_time): New function.
5397 (Timer::pass_times_): New data member.
5398
f475cf7b
CC
53992011-10-17 Cary Coutant <ccoutant@google.com>
5400
5401 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5402 task for members of lib groups.
5403
cdd7e244
CC
54042011-10-17 Cary Coutant <ccoutant@google.com>
5405
5406 PR gold/13288
4f95c8b4 5407 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5408 (File_read::make_view): Move bounds check (replace with assert)...
5409 (File_read::find_or_make_view): ... to here.
5410
dfb45471
CC
54112011-10-12 Cary Coutant <ccoutant@google.com>
5412
4f95c8b4 5413 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5414 ::read returns less than requested size.
5415
53bbcc1b
CC
54162011-10-10 Cary Coutant <ccoutant@google.com>
5417
4f95c8b4 5418 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5419 Initialize defined_count_.
5420 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5421 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5422 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5423 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5424 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5425 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5426 member.
5427 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5428 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5429 Return zeroes instead of internal error.
5430
397b129b
CC
54312011-10-10 Cary Coutant <ccoutant@google.com>
5432
5433 PR gold/13249
4f95c8b4 5434 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5435 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5436 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5437 (Output_reloc::type_): Adjust size of bit field.
5438 (Output_reloc::use_plt_offset_): New bit field.
5439 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5440 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5441 flag. Adjust all callers.
4f95c8b4 5442 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5443 creating RELATIVE relocations.
5444
d5698657
NC
54452011-10-10 Nick Clifton <nickc@redhat.com>
5446
5447 * po/es.po: Updated Spanish translation.
5448 * po/fi.po: Updated Finnish translation.
5449
6a59a5c2
DN
54502011-10-03 Diego Novillo <dnovillo@google.com>
5451
5452 * options.cc (parse_uint): Fix dereference of RETVAL.
5453
f0558624
ST
54542011-09-29 Sriraman Tallam <tmsriram@google.com>
5455
5456 * layout.h (section_order_map_): New member.
5457 (get_section_order_map): New member function.
5458 * output.cc (Output_section::add_input_section): Check for patterns
5459 only when --section-ordering-file is specified.
5460 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5461 output_sections have been formed.
5462 * layout.cc (Layout_Layout): Initialize section_order_map_.
5463 * plugin.cc (update_section_order): Store order in order_map. Do not
5464 update the order.
5465 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5466 * testsuite/Makefile.in: Regenerate.
5467 * testsuite/plugin_section_order.c: New file.
5468 * testsuite/plugin_final_layout.cc: New file.
5469 * testsuite/plugin_final_layout.sh: New file.
5470
a7dac153
CC
54712011-09-29 Cary Coutant <ccoutant@google.com>
5472
4f95c8b4 5473 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5474 Check for NULL.
4f95c8b4 5475 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5476 symbols during incremental update.
5477 (Symbol_table::add_from_dynobj): Likewise.
5478
eebd87a5
ILT
54792011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5480 Ian Lance Taylor <iant@google.com>
5481
5482 * symtab.cc (Symbol_table::define_special_symbol): Always
5483 canonicalize version string.
5484
403a3331
CC
54852011-09-26 Cary Coutant <ccoutant@google.com>
5486
4f95c8b4
CC
5487 * gold.cc (queue_initial_tasks): Move option checks ...
5488 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5489 some options; make others fatal.
5490
235061c2
CC
54912011-09-26 Cary Coutant <ccoutant@google.com>
5492
5493 gcc PR lto/47247
5494 * plugin.cc (get_symbols_v2): New function.
5495 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5496 (is_referenced_from_outside): New function.
5497 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5498 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5499 (get_symbols): Pass version parameter.
5500 (get_symbols_v2): New function.
5501 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5502 parameter.
5503 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5504 (onload): Add LDPT_GET_SYMBOLS_V2.
5505 (all_symbols_read_hook): Use get_symbols_v2; check for
5506 LDPR_PREVAILING_DEF_IRONLY_EXP.
5507 * testsuite/plugin_test_3.sh: Update expected results.
5508
dc87f620
ILT
55092011-09-23 Simon Baldwin <simonb@google.com>
5510
5511 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5512 configuration options.
5513 * configure: Regenerate.
5514 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5515 * Makefile.in: Regenerate.
5516 * testsuite/Makefile.in: Regenerate.
5517
a8279f82
ST
55182011-09-19 Sriraman Tallam <tmsriram@google.com>
5519
5520 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5521
0c9350c8
CC
55222011-09-19 Cary Coutant <ccoutant@google.com>
5523
5524 * incremental.cc (can_incremental_update): Fix typo in comment.
5525 * incremental.h (can_incremental_update): Likewise.
5526
aa06ae28
CC
55272011-09-18 Cary Coutant <ccoutant@google.com>
5528
5529 * incremental.cc (can_incremental_update): New function.
5530 * incremental.h (can_incremental_update): New function.
5531 * layout.cc (Layout::init_fixed_output_section): Call it.
5532 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5533 * object.cc (Sized_relobj_file::do_layout): Call
5534 can_incremental_update.
5535
ebb300b2
CC
55362011-09-13 Cary Coutant <ccoutant@google.com>
5537
5538 * configure.ac: Check for glibc support for gnu_indirect_function
5539 support with static linking, setting automake conditional
5540 IFUNC_STATIC.
5541 * Makefile.in: Regenerate.
5542 * configure: Regenerate.
5543
5544 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5545 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5546 for IFUNC_STATIC.
5547 * testsuite/Makefile.in: Regenerate.
5548
1206d0d5
CC
55492011-09-13 Cary Coutant <ccoutant@google.com>
5550
5551 * incremental.cc (Sized_relobj_incr::do_layout): Call
5552 report_comdat_group for kept comdat sections.
5553 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5554 * testsuite/Makefile.in: Regenerate.
5555 * testsuite/incr_comdat_test_1.cc: New source file.
5556 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5557 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5558 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5559
40b29874
ILT
55602011-09-13 Ian Lance Taylor <iant@google.com>
5561
5562 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5563 variable external_symbols_offset.
5564
1b045aac
ILT
55652011-09-12 Ian Lance Taylor <iant@google.com>
5566
5567 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5568 triggered if object has no symbols.
5569
24c6c55a
DM
55702011-09-09 David S. Miller <davem@davemloft.net>
5571
5572 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5573 (Output_fill_debug_line::do_write): Likewise.
5574
66570254
CC
55752011-08-29 Cary Coutant <ccoutant@google.com>
5576
5577 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5578 casts to match formatting specs.
5579 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5580
8ea8cd50
CC
55812011-08-26 Cary Coutant <ccoutant@google.com>
5582
5583 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5584 remaining hole size when allocating.
5585 (Layout::make_output_section): Set fill methods for debug sections.
5586 * layout.h (Free_list::Free_list_node): Move from private to
5587 public.
5588 (Free_list::set_min_hole_size): New function.
5589 (Free_list::begin, Free_list::end): New functions.
5590 (Free_list::min_hole_): New data member.
5591 * output.cc: Include dwarf.h.
5592 (Output_fill_debug_info::do_minimum_hole_size): New function.
5593 (Output_fill_debug_info::do_write): New function.
5594 (Output_fill_debug_line::do_minimum_hole_size): New function.
5595 (Output_fill_debug_line::do_write): New function.
5596 (Output_section::Output_section): Initialize new data member.
5597 (Output_section::set_final_data_size): Ensure patch space is larger
5598 than minimum hole size.
5599 (Output_section::do_write): Fill holes in debug sections.
5600 * output.h (Output_fill): New class.
5601 (Output_fill_debug_info): New class.
5602 (Output_fill_debug_line): New class.
5603 (Output_section::set_free_space_fill): New function.
5604 (Output_section::free_space_fill_): New data member.
5605 * testsuite/Makefile.am (incremental_test_3): Add
5606 --incremental-patch option.
5607 (incremental_test_4): Likewise.
5608 (incremental_test_5): Likewise.
5609 (incremental_test_6): Likewise.
5610 (incremental_copy_test): Likewise.
5611 (incremental_common_test_1): Likewise.
5612 * testsuite/Makefile.in: Regenerate.
5613
7cf80422
NC
56142011-08-26 Nick Clifton <nickc@redhat.com>
5615
5616 * po/es.po: Updated Spanish translation.
5617
c3f7b0e5
CC
56182011-08-01 Cary Coutant <ccoutant@google.com>
5619
5620 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5621 * gold/testsuite/Makefile.in: Regenerate.
5622 * gold/testsuite/justsyms_exec.c: New source file.
5623 * gold/testsuite/justsyms_lib.c: New source file.
5624
9590bf25
CC
56252011-08-01 Cary Coutant <ccoutant@google.com>
5626
5627 * layout.cc (Layout::set_segment_offsets): Don't realign text
5628 segment if -Ttext was specified.
5629 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5630 file type.
5631 * object.h (Sized_relobj_file::e_type): New function.
5632 (Sized_relobj_file::e_type_): New data member.
5633 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5634 base address for ET_EXEC files.
5635 * target.cc (Target::do_make_elf_object_implementation): Allow
5636 ET_EXEC files with --just-symbols option.
5637
dcd8d12e
CC
56382011-07-28 Cary Coutant <ccoutant@google.com>
5639
5640 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5641 Add thread_number parameter.
5642 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5643 * workqueue-threads.cc
5644 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5645 current thread if its thread number is greater than desired thread
5646 count.
5647 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5648 Add thread_number parameter.
5649 (Workqueue::should_cancel_thread): Likewise.
5650 (Workqueue::find_runnable_or_wait): Pass thread_number to
5651 should_cancel_thread.
5652 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5653 parameter.
5654
804eb480
ST
56552011-07-22 Sriraman Tallam <tmsriram@google.com>
5656
5657 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5658 only after checking if it cannot be forced local.
5659 * symtab.h (is_externally_visible): Check if the symbol is not forced
5660 local.
5661
f1ddb600
ILT
56622011-07-15 Ian Lance Taylor <iant@google.com>
5663
5664 * options.h (class General_options): Add --print-output-format.
5665 Move -EL next to -EB, for better --help output.
5666 * target-select.cc: Include <cstdio>, "options.h", and
5667 "parameters.h".
5668 (Target_selector::do_target_bfd_name): New function.
5669 (print_output_format): New function.
5670 * target-select.h (class Target_selector): Update declarations.
5671 (Target_selector::target_bfd_name): New function.
5672 (print_output_format): Declare.
5673 * main.cc: Include "target-select.h".
5674 (main): Handle --print-output-format.
5675 * gold.cc: Include "target-select.h".
5676 (queue_initial_tasks): Handle --print-output-format when there are
5677 no input files.
5678 * parameters.cc (parameters_force_valid_target): Give a better
5679 error message if -EB/-EL does not match target.
5680 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5681 function.
5682
7d172687
ILT
56832011-07-15 Ian Lance Taylor <iant@google.com>
5684
5685 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5686 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5687 (Output_data_plt_i386::do_write): Write address of .dynamic
5688 section to first entry in .got.plt section.
5689 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5690 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5691 Initialize layout_.
5692 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5693 section to first entry in .got.plt section.
5694 * layout.h (Layout::dynamic_section): New function.
5695
e9552f7e
ST
56962011-07-13 Sriraman Tallam <tmsriram@google.com>
5697
5698 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5699 to claim_file call.
5700 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5701 input_section_position_, and input_section_glob_.
5702 (read_layout_from_file): Call function section_ordering_specified.
5703 * layout.h (is_section_ordering_specified): New function.
5704 (section_ordering_specified): New function.
5705 (section_ordering_specified_): New boolean member.
5706 * main.cc(main): Call load_plugins after layout object is defined.
5707 * output.cc (Output_section::add_input_section): Use
5708 function section_ordering_specified to check if section ordering is
5709 needed.
5710 * output.cc (Output_section::add_relaxed_input_section): Use
5711 function section_ordering_specified to check if section ordering is
5712 needed.
5713 (Output_section::update_section_layout): New function.
5714 (Output_section::sort_attached_input_sections): Check if input section
5715 must be reordered.
5716 * output.h (Output_section::update_section_layout): New function.
5717 * plugin.cc (get_section_count): New function.
5718 (get_section_type): New function.
5719 (get_section_name): New function.
5720 (get_section_contents): New function.
5721 (update_section_order): New function.
58797674 5722 (allow_section_ordering): New function.
e9552f7e
ST
5723 (Plugin::load): Add the new interfaces to the transfer vector.
5724 (Plugin_manager::load_plugins): New parameter.
5725 (Plugin_manager::all_symbols_read): New parameter.
5726 (Plugin_manager::claim_file): New parameter. Save the elf object for
5727 unclaimed objects.
5728 (Plugin_manager::get_elf_object): New function.
5729 (Plugin_manager::get_view): Change to directly use the bool to check
5730 if get_view is called from claim_file_hook.
5731 * plugin.h (input_objects): New function
5732 (Plugin__manager::load_plugins): New parameter.
5733 (Plugin_manager::claim_file): New parameter.
5734 (Plugin_manager::get_elf_object): New function.
5735 (Plugin_manager::in_claim_file_handler): New function.
5736 (Plugin_manager::in_claim_file_handler_): New member.
5737 (layout): New function.
5738 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5739 handler with an extra parameter. Make the elf object before calling
5740 claim_file handler.
5741 * testsuite/plugin_test.c (get_section_count): New function pointer.
5742 (get_section_type): New function pointer.
5743 (get_section_name): New function pointer.
5744 (get_section_contents): New function pointer.
5745 (update_section_order): New function pointer.
5746 (allow_section_ordering): New function pointer.
5747 (onload): Check if the new interfaces exist.
5748
9446efde
ILT
57492011-07-13 Ian Lance Taylor <iant@google.com>
5750
5751 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5752 relro section.
5753 * x86_64.cc (Target_x86_64::got_section): Likewise.
5754 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5755 (relro_now_test_SOURCES): New variable.
5756 (relro_now_test_DEPENDENCIES): New variable.
5757 (relro_now_test_LDFLAGS): New variable.
5758 (relro_now_test_LDADD): New variable.
5759 (relro_now_test.so): New target.
5760 * testsuite/Makefile.in: Rebuild.
5761
07aa62f2
ILT
57622011-07-12 Ian Lance Taylor <iant@google.com>
5763
5764 PR gold/12980
5765 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5766 GLOB_DAT relocation rather than a RELATIVE relocation for a
5767 protected symbol when creating a shared library.
5768 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5769 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5770 * testsuite/protected_main_1.cc (main): Test that protected
5771 function has same address.
5772
e2153196
ILT
57732011-07-11 Ian Lance Taylor <iant@google.com>
5774
5775 PR gold/12979
5776 * options.h (class General_options): Add -Bgroup.
5777 * options.cc (General_options::finalize): If -Bgroup is set,
5778 default to --unresolved-symbols=report-all.
5779 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5780 * target-reloc.h (issue_undefined_symbol_error): Handle
5781 --unresolved-symbols=report-all.
5782
6daf5215
ILT
57832011-07-08 Ian Lance Taylor <iant@google.com>
5784
5785 PR gold/11985
5786 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5787 if linker script discards key sections.
5788 (Layout::create_dynamic_symtab): Likewise.
5789 (Layout::assign_local_dynsym_offsets): Likewise.
5790 (Layout::sized_create_version_sections): Likewise.
5791 (Layout::create_interp): Likewise.
5792 (Layout::finish_dynamic_section): Likewise.
5793 (Layout::set_dynamic_symbol_size): Likewise.
5794
beabb2c6
ILT
57952011-07-08 Ian Lance Taylor <iant@google.com>
5796
5797 PR gold/12386
5798 * options.h (class General_options): Add --unresolved-symbols.
5799 * target-reloc.h (issue_undefined_symbol_error): Check
5800 --unresolved-symbols. Add comments.
5801
9c16daf1
ILT
58022011-07-08 Ian Lance Taylor <iant@google.com>
5803
5804 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5805 expression more complex.
5806
191f1a2d
ILT
58072011-07-08 Ian Lance Taylor <iant@google.com>
5808
5809 PR gold/11317
5810 * target-reloc.h (issue_undefined_symbol_error): New inline
5811 function, broken out of relocate_section.
5812 (relocate_section): Call issue_undefined_symbol_error.
5813 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5814 there is no TLS segment if we are about to issue an undefined
5815 symbol error.
5816 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5817
62855347
ILT
58182011-07-08 Ian Lance Taylor <iant@google.com>
5819
5820 PR gold/12279
5821 * resolve.cc (Symbol_table::should_override): Add fromtype
5822 parameter. Change all callers. Give error when linking together
5823 TLS and non-TLS symbol.
5824 (Symbol_table::should_override_with_special): Add fromtype
5825 parameter. Change all callers.
5826 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5827 there is no TLS segment if we have reported some errors.
5828 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5829
67181c72
ILT
58302011-07-08 Ian Lance Taylor <iant@google.com>
5831
5832 PR gold/12372
5833 * target.h (Target::plt_address_for_global): New function.
5834 (Target::plt_address_for_local): New function.
5835 (Target::plt_section_for_global): Remove.
5836 (Target::plt_section_for_local): Remove.
5837 (Target::do_plt_address_for_global): New virtual function.
5838 (Target::do_plt_address_for_local): New virtual function.
5839 (Target::do_plt_section_for_global): Remove.
5840 (Target::do_plt_section_for_local): Remove.
5841 (Target::register_global_plt_entry): Add Symbol_table and Layout
5842 parameters.
5843 * output.cc (Output_data_got::Got_entry::write): Use
5844 plt_address_for_global and plt_address_for_local.
5845 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5846 address of output section.
5847 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5848 got_irelative_, and irelative_count_ fields. Update
5849 declarations.
5850 (Output_data_plt_i386::has_irelative_section): New function.
5851 (Output_data_plt_i386::entry_count): Add irelative_count_.
5852 (Output_data_plt_i386::set_final_data_size): Likewise.
5853 (class Target_i386): Add got_irelative_ and rel_irelative_
5854 fields. Update declarations.
5855 (Target_i386::Target_i386): Initialize new fields.
5856 (Target_i386::do_plt_address_for_global): New function replacing
5857 do_plt_section_for_global.
5858 (Target_i386::do_plt_address_for_local): New function replacing
5859 do_plt_section_for_local.
5860 (Target_i386::got_section): Create got_irelative_.
5861 (Target_i386::rel_irelative_section): New function.
5862 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5863 fields. Don't define __rel_iplt_{start,end}.
5864 (Output_data_plt_i386::add_entry): Add symtab and layout
5865 parameters. Change all callers. Use different PLT and GOT for
5866 IFUNC symbols.
5867 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5868 layout parameters. Change all callers. Use different PLT and
5869 GOT.
5870 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5871 (Output_data_plt_i386::rel_irelative): New function.
5872 (Output_data_plt_i386::address_for_global): New function.
5873 (Output_data_plt_i386::address_for_local): New function.
5874 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5875 IRELATIVE GOT when changing IFUNC GOT entries.
5876 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5877 reloc.
5878 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5879 if we didn't create an IRELATIVE GOT.
5880 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5881 plt_address_for_local.
5882 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5883 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5884 got_irelative_, and irelative_count_ fields. Update
5885 declarations.
5886 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5887 Initialize new fields. Remove symtab parameter. Change all
5888 callers.
5889 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5890 irelative_count_.
5891 (Output_data_plt_x86_64::has_irelative_section): New function.
5892 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5893 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5894 fields. Update declarations.
5895 (Target_x86_64::Target_x86_64): Initialize new fields.
5896 (Target_x86_64::do_plt_address_for_global): New function replacing
5897 do_plt_section_for_global.
5898 (Target_x86_64::do_plt_address_for_local): New function replacing
5899 do_plt_section_for_local.
5900 (Target_x86_64::got_section): Create got_irelative_.
5901 (Target_x86_64::rela_irelative_section): New function.
5902 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5903 all callers. Don't create __rel_iplt_{start,end}.
5904 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5905 parameters. Change all callers. Use different PLT and GOT for
5906 IFUNC symbols.
5907 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5908 layout parameters. Change all callers. Use different PLT and
5909 GOT.
5910 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5911 parameters. Change all callers. Use different PLT and GOT for
5912 IFUNC symbols.
5913 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5914 (Output_data_plt_x86_64::rela_irelative): New function.
5915 (Output_data_plt_x86_64::address_for_global): New function.
5916 (Output_data_plt_x86_64::address_for_local): New function.
5917 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5918 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5919 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5920 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5921 parameters.
5922 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5923 reloc.
5924 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5925 symbols if we didn't create an IRELATIVE GOT.
5926 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5927 plt_address_for_local.
5928 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5929 * testsuite/ifuncvar1.c: New test file.
5930 * testsuite/ifuncvar2.c: New test file.
5931 * testsuite/ifuncvar3.c: New test file.
5932 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5933 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5934 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5935 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5936 * testsuite/Makefile.in: Rebuild.
5937
33c15b45
CC
59382011-07-07 Cary Coutant <ccoutant@google.com>
5939
5940 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5941 (two_file_test_1_ndebug.o): Likewise.
5942 (two_file_test_1b_ndebug.o): Likewise.
5943 (two_file_test_2_ndebug.o): Likewise.
5944 (two_file_test_main_ndebug.o): Likewise.
5945 (incremental_test_2): Link with no-debug versions.
5946
f48b5fb7
CC
59472011-07-06 Cary Coutant <ccoutant@google.com>
5948
5949 * gold/incremental.cc
5950 (Output_section_incremental_inputs::write_info_blocks): Check for
5951 hidden and internal symbols.
5952
221597a5
CC
59532011-07-06 Cary Coutant <ccoutant@google.com>
5954
5955 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5956 Check disposition for startup file.
5957 (Incremental_inputs::report_command_line): Ignore
5958 --incremental-startup-unchanged option.
5959 * options.cc (General_options::parse_incremental_startup_unchanged):
5960 New function.
5961 (General_options::General_options): Initialize new data member.
5962 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5963 (General_options): Add --incremental-startup-unchanged option.
5964 (General_options::incremental_startup_disposition): New function.
5965 (General_options::incremental_startup_disposition_): New data member.
5966
e24719f6
CC
59672011-07-06 Cary Coutant <ccoutant@google.com>
5968
5969 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5970 input file index to Script_info ctor.
5971 (Sized_incremental_binary::do_file_has_changed): Find the
5972 command-line argument for files named in scripts.
5973 * incremental.h (Script_info::Script_info): New ctor
5974 with input file index.
5975 (Script_info::input_file_index): New function.
5976 (Script_info::input_file_index_): New data member.
5977 (Incremental_binary::get_library): Add const.
5978 (Incremental_binary::get_script_info): Add const.
5979 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5980 * testsuite/Makefile.am (incremental_test_5): New test case.
5981 (incremental_test_6): New test case.
5982 * testsuite/Makefile.in: Regenerate.
5983
8f7c81e8
CC
59842011-07-06 Cary Coutant <ccoutant@google.com>
5985
5986 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5987 debug output when command lines differ.
5988
9fbd3822
CC
59892011-07-06 Cary Coutant <ccoutant@google.com>
5990
5991 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5992 --incremental-patch option.
5993 * layout.cc (Free_list::allocate): Extend allocation beyond original
5994 end if enabled.
5995 (Layout::make_output_section): Mark sections that should get
5996 patch space.
5997 * options.cc (parse_percent): New function.
5998 * options.h (parse_percent): New function.
5999 (DEFINE_percent): New macro.
6000 (General_options): Add --incremental-patch option.
6001 * output.cc (Output_section::Output_section): Initialize new data
6002 members.
6003 (Output_section::add_input_section): Print section name when out
6004 of patch space.
6005 (Output_section::add_output_section_data): Likewise.
6006 (Output_section::set_final_data_size): Add patch space when
6007 doing --incremental-full.
6008 (Output_section::do_reset_address_and_file_offset): Remove patch
6009 space.
6010 (Output_segment::set_section_list_addresses): Print debug output
6011 only if --incremental-update.
6012 * output.h (Output_section::set_is_patch_space_allowed): New function.
6013 (Output_section::is_patch_space_allowed_): New data member.
6014 (Output_section::patch_space_): New data member.
6015 * parameters.cc (Parameters::incremental_full): New function.
6016 * parameters.h (Parameters::incremental_full): New function
6017 * testsuite/Makefile.am (incremental_test_2): Add test for
6018 --incremental-patch option.
6019 * testsuite/Makefile.in: Regenerate.
6020 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6021 (t18): Remove function body.
6022
f6cccc2c
DK
60232011-07-05 Doug Kwan <dougkwan@google.com>
6024
6025 PR gold/12771
6026 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6027 Arm_Address type for relocation result.
6028 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6029 overflow check.
6030 (Arm_relocate_functions::abs32): Use unaligned access.
6031 (Arm_relocate_functions::rel32): Ditto.
6032 (Arm_relocate_functions::prel31): Ditto.
6033 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6034 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6035 static data relocations.
6036 * testsuite/Makefile.in: Regnerate.
6037 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6038
28a13fec
ILT
60392011-07-05 Ian Lance Taylor <iant@google.com>
6040
6041 PR gold/12392
6042 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6043 symbols if necessary.
6044 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6045
24d47b34
ILT
60462011-07-05 Ian Lance Taylor <iant@google.com>
6047
6048 PR gold/12952
6049 * resolve.cc (Symbol::override_base_with_special): Simply override
6050 version with special symbol version, ignoring previous version.
6051
41f9cbbe
ILT
60522011-07-05 Ian Lance Taylor <iant@google.com>
6053
6054 * object.cc (Sized_relobj_file::include_section_group): Add
6055 information to comment about signature location.
6056
886288f1
ILT
60572011-07-02 Ian Lance Taylor <iant@google.com>
6058
6059 PR gold/12957
6060 * options.h (class General_options): Add -f and -F.
6061 * options.cc (General_options::finalize): Fatal error if -f/-F
6062 are used without -shared.
6063 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6064
ae3a6d4f
ILT
60652011-07-02 Ian Lance Taylor <iant@google.com>
6066
6067 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6068
21131061
ILT
60692011-07-01 Ian Lance Taylor <iant@google.com>
6070
6071 PR gold/12525
6072 PR gold/12952
6073 * resolve.cc (Symbol::override_base_with_special): Don't override
6074 the version if the overriding symbol has a different name.
6075 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6076 all callers. If we give an error about an undefined version,
6077 define the base version if necessary.
6078 * dynobj.h (class Versions): Update declaration.
6079 * testsuite/weak_alias_test_5.cc: New file.
6080 * testsuite/weak_alias_test.script: New file.
6081 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6082 and versioned_alias have the right value, and call t2.
6083 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6084 weak_alias_test_5.so.
6085 (weak_alias_test_LDADD): Likewise.
6086 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6087 * testsuite/Makefile.in: Rebuild.
6088
611062c0
ILT
60892011-07-01 Ian Lance Taylor <iant@google.com>
6090
6091 PR gold/12525
6092 * options.h (class General_options): Support -z notext.
6093 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6094 -Wl,-z,notext.
6095 (two_file_shared_nonpic.so): Likewise.
6096 (two_file_shared_mixed.so): Likewise.
6097 (two_file_shared_mixed_1.so): Likewise.
6098 (weak_undef_lib_nonpic.so): Likewise.
6099 (alt/weak_undef_lib_nonpic.so): Likewise.
6100 (tls_test_shared_nonpic.so): Likewise.
6101 * testsuite/Makefile.in: Rebuild.
6102
328c7c2f
ILT
61032011-07-01 Ian Lance Taylor <iant@google.com>
6104
6105 PR gold/12525
6106 * configure.ac: Test whether static linking works, setting
6107 the automake conditional HAVE_STATIC.
6108 * testsuite/Makefile.am: Disable tests using -static if
6109 HAVE_STATIC is not true.
6110 * configure, testsuite/Makefile.in: Rebuild.
6111
02d7cd44
ILT
61122011-07-01 Ian Lance Taylor <iant@google.com>
6113
6114 PR gold/12525
6115 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6116 Assert if we see DW_EH_PE_indirect.
6117 * target.h (Target::ehframe_datarel_base): New function.
6118 (Target::do_ehframe_datarel_base): New target function.
6119 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6120 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6121 function.
6122
07a60597
ILT
61232011-07-01 Ian Lance Taylor <iant@google.com>
6124
6125 PR gold/12571
6126 * options.h (class General_options): Add
6127 --ld-generated-unwind-info.
6128 * ehframe.cc (Fde::write): Add address parameter. Change all
6129 callers. If associated with PLT, fill in address and size.
6130 (Cie::set_output_offset): Only add merge mapping if there is an
6131 object.
6132 (Cie::write): Add address parameter. Change all callers.
6133 (Eh_frame::add_ehframe_for_plt): New function.
6134 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6135 input_offset_ fields into union u_, with new plt field.
6136 (Fde::Fde): Adjust for new union field.
6137 (Fde::Fde) [Output_data version]: New constructor.
6138 (Fde::add_mapping): Only add merge mapping if there is an object.
6139 (class Cie): Update declarations.
6140 (class Eh_frame): Declare add_ehframe_for_plt.
6141 * layout.cc (Layout::layout_eh_frame): Break out code into
6142 make_eh_frame_section, and call it.
6143 (Layout::make_eh_frame_section): New function.
6144 (Layout::add_eh_frame_for_plt): New function.
6145 * layout.h (class Layout): Update declarations.
6146 * merge.cc (Merge_map::add_mapping): Add assertion.
6147 * i386.cc: Include "dwarf.h".
6148 (class Output_data_plt_i386): Make first_plt_entry,
6149 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6150 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6151 and plt_eh_frame_fde.
6152 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6153 boundary. Call add_eh_frame_for_plt if appropriate.
6154 * x86_64.cc: Include "dwarf.h".
6155 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6156 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6157 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6158 and plt_eh_frame_fde.
6159 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6160 appropriate.
6161
14788a3f
ILT
61622011-06-29 Ian Lance Taylor <iant@google.com>
6163
6164 PR gold/12629
6165 * object.cc (Sized_relobj_file::layout_section): Change shdr
6166 parameter to be const.
6167 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6168 out of do_layout.
6169 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6170 appropriate. Call layout_eh_frame_section.
6171 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6172 sections.
6173 * object.h (class Sized_relobj_file): Update declarations.
6174
6c21fce1
ILT
61752011-06-29 Ian Lance Taylor <iant@google.com>
6176
37e41b03 6177 PR gold/12652
6c21fce1
ILT
6178 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6179 modifier.
6180 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6181
4d5e4e62
ILT
61822011-06-29 Ian Lance Taylor <iant@google.com>
6183
6184 PR gold/12675
6185 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6186 SHT_X86_64_UNWIND.
6187 * layout.cc (Layout::layout_eh_frame): Likewise.
6188
886f533a
ILT
61892011-06-29 Ian Lance Taylor <iant@google.com>
6190
6191 PR gold/12695
6192 * layout.cc (Layout::symtab_section_shndx): New function.
6193 * layout.h (class Layout): Declare symtab_section_shndx.
6194 * output.cc (Output_section::write_header): Call it.
6195
f3ae1b28
ILT
61962011-06-29 Ian Lance Taylor <iant@google.com>
6197
6198 PR gold/12818
6199 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6200 symbols which are not used in a relocation.
6201
aecf301f
ILT
62022011-06-28 Ian Lance Taylor <iant@google.com>
6203
6204 PR gold/12898
6205 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6206 script create indistinguishable segments.
6207 (Layout::set_segment_offsets): Use stable_sort when sorting
6208 segments. Pass this to Compare_segments constructor.
6209 * layout.h (class Layout): Make segment_precedes non-static.
6210 (class Compare_segments): Change from struct to class. Add
6211 layout_ field. Add constructor.
6212 * script-sections.cc
6213 (Script_sections::attach_sections_using_phdrs_clause): Rename
6214 local orphan to is_orphan. Don't report failure to put empty
6215 section in segment. On attachment failure, report name of
6216 section, and attach to first PT_LOAD segment.
6217
03ef7571
ILT
62182011-06-28 Ian Lance Taylor <iant@google.com>
6219
6220 PR gold/12934
6221 * target-select.cc (Target_selector::Target_selector): Add
6222 emulation parameter. Change all callers.
6223 (select_target_by_bfd_name): Rename from select_target_by_name.
6224 Change all callers.
6225 (select_target_by_emulation): New function.
6226 (supported_emulation_names): New function.
6227 * target-select.h (class Target_selector): Add emulation_ field.
6228 Update declarations.
6229 (Target_selector::recognize_by_bfd_name): Rename from
6230 recognize_by_name. Change all callers.
6231 (Target_selector::supported_bfd_names): Rename from
6232 supported_names. Change all callers.
6233 (Target_selector::recognize_by_emulation): New function.
6234 (Target_selector::supported_emulations): New function.
6235 (Target_selector::emulation): New function.
6236 (Target_selector::do_recognize_by_bfd_name): Rename from
6237 do_recognize_by_name. Change all callers.
6238 (Target_selector::do_supported_bfd_names): Rename from
6239 do_supported_names. Change all callers.
6240 (Target_selector::do_recognize_by_emulation): New function.
6241 (Target_selector::do_supported_emulations): New function.
6242 (select_target_by_bfd_name): Change name in declaration.
6243 (select_target_by_emulation): Declare.
6244 (supported_emulation_names): Declare.
6245 * parameters.cc (parameters_force_valid_target): Try to find
6246 target based on emulation from -m option.
6247 * options.h (class General_options): Change doc string for -m.
6248 * options.cc (help): Print emulations.
6249 (General_options::parse_V): Likewise.
6250 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6251 Add emulation parameter. Change all callers.
6252
200b2bb9
ILT
62532011-06-28 Ian Lance Taylor <iant@google.com>
6254
6255 * target.h (class Target): Add osabi_ field.
6256 (Target::osabi): New function.
6257 (Target::set_osabi): New function.
6258 (Target::Target): Initialize osabi_.
6259 (Target::do_adjust_elf_header): Make pure virtual.
6260 (Sized_target::do_adjust_elf_header): Declare.
6261 * target.cc (Sized_target::do_adjust_elf_header): New function.
6262 (class Sized_target): Instantiate all versions.
6263 * freebsd.h (class Target_freebsd): Remove.
6264 (Target_selector_freebsd::do_recognize): Call set_osabi on
6265 Target.
6266 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6267 (Target_selector_freebsd::set_osabi): Remove.
6268 * i386.cc (class Target_i386): Inherit from Sized_target rather
6269 than Target_freebsd.
6270 * x86_64.cc (class Target_x86_64): Likewise.
6271
b3ce541e
ILT
62722011-06-28 Ian Lance Taylor <iant@google.com>
6273
6274 * target.h (Target::can_check_for_function_pointers): Rewrite.
6275 Make non-virtual.
6276 (Target::can_icf_inline_merge_sections): Likewise.
6277 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6278 (Target::Target_info): Add can_icf_inline_merge_sections field.
6279 (Target::do_can_check_for_function_pointers): New virtual
6280 function.
6281 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6282 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6283 from can_check_for_function_pointers, move in file.
6284 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6285 section_may_have_icf_unsafe_poineters, move in file.
6286 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6287 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6288 Rename from can_check_for_function_pointers, move in file.
6289 (Target_i386::can_icf_inline_merge_sections): Remove.
6290 (Target_i386::i386_info): Initialize
6291 can_icf_inline_merge_sections.
6292 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6293 Initialize can_icf_inline_merge_sections.
6294 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6295 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6296 Rename from can_check_for_function_pointers, move in file.
6297 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6298 (Target_x86_64::x86_64_info): Initialize
6299 can_icf_inline_merge_sections.
6300 * testsuite/testfile.cc (Target_test::test_target_info):
6301 Likewise.
6302 * icf.cc (get_section_contents): Correct formatting.
6303
6d1c4efb
ILT
63042011-06-27 Ian Lance Taylor <iant@google.com>
6305
6306 * symtab.cc (Symbol::versioned_name): New function.
6307 (Symbol_table::add_to_final_symtab): Use versioned_name when
6308 appropriate.
6309 (Symbol_table::sized_write_symbol): Likewise.
6310 * symtab.h (class Symbol): Declare versioned_name.
6311 * stringpool.h (class Stringpool_template): Add variant of add
6312 which takes a std::basic_string.
6313 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6314 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6315 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6316 (ver_test_12.o): New target.
6317 * testsuite/Makefile.in: Rebuild.
6318
57eb9b50
DK
63192011-06-27 Doug Kwan <dougkwan@google.com>
6320
6321 * arm.cc (Arm_relocate_functions::thm_jump8,
6322 Arm_relocate_functions::thm_jump11): Use a wider signed
6323 type to compute offset.
6324 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6325 arm_thm_jump8.
6326 * testsuite/Makefile.in: Regenerate.
6327 * testsuite/arm_branch_in_range.sh: Check test results of
6328 arm_thm_jump11 and arm_thm_jump8.
6329 * testsuite/arm_thm_jump11.s: New test source file.
6330 * testsuite/arm_thm_jump11.t: New linker script.
6331 * testsuite/arm_thm_jump8.s: New test source file.
6332 * testsuite/arm_thm_jump8.t: New linker script.
6333
487b39df
ILT
63342011-06-24 Ian Lance Taylor <iant@google.com>
6335
6336 * layout.cc: Include "object.h".
6337 (ctors_sections_in_init_array): New static variable.
6338 (Layout::is_ctors_in_init_array): New function.
6339 (Layout::layout): Add entry to ctors_sections_in_init_array if
6340 appropriate.
6341 * layout.h (class Layout): Declare is_ctors_in_init_array.
6342 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6343 is_ctors_reverse_view is set.
6344 (Sized_relobj_file::write_sections): Add layout parameter. Change
6345 all callers. Set is_ctors_reverse_view field of View_size.
6346 (Sized_relobj_file::reverse_words): New function.
6347 * object.h (Sized_relobj_file::View_size): Add
6348 is_ctors_reverse_view field.
6349 (class Sized_relobj_file): Update declarations.
6350 * testsuite/initpri3.c: New test.
6351 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6352 initpri3b.
6353 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6354 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6355 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6356 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6357 * testsuite/Makefile.in: Rebuild.
6358
472076e4
CC
63592011-06-24 Cary Coutant <ccoutant@google.com>
6360
6361 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6362 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6363 (debug_msg_cdebug.err): New targets.
6364 * testsuite/Makefile.in: Regenerate.
6365 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6366 Fix checks for link with shared library.
6367
a60af0db
DK
63682011-06-24 Doug Kwan <dougkwan@google.com>
6369
6370 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6371 skip empty text sections.
6372 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6373
5393d741
ILT
63742011-06-22 Ian Lance Taylor <iant@google.com>
6375
6376 PR gold/12910
6377 * options.h (class General_options): Add --ctors-in-init-array.
6378 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6379 friends as SHT_PROGBITS for merging sections.
6380 (Layout::layout): Remove special handling of .init_array and
6381 friends. Don't sort if doing relocatable link. Sort for .ctors
6382 and .dtors if ctors_in_init_array.
6383 (Layout::make_output_section): Force correct section types for
6384 .init_array and friends. Don't sort if doing relocatable link,
6385 Don't sort .ctors and .dtors if ctors_in_init_array.
6386 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6387 (Layout::output_section_name): Add relobj parameter. Change all
6388 callers. Handle .ctors. and .dtors. in code rather than table.
6389 Handle .ctors and .dtors if ctors_in_init_array.
6390 (Layout::match_file_name): New function, moved from output.cc.
6391 * layout.h (class Layout): Update declarations.
6392 * output.cc: Include "layout.h".
6393 (Input_section_sort_entry::get_priority): New function.
6394 (Input_section_sort_entry::match_file_name): Just call
6395 Layout::match_file_name.
6396 (Output_section::Input_section_sort_init_fini_compare::operator()):
6397 Handle .ctors and .dtors. Sort by explicit priority rather than
6398 by name.
6399 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6400 * testsuite/initpri2.c: New test.
6401 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6402 (check_PROGRAMS): Add initpri2.
6403 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6404 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6405 * configure, testsuite/Makefile.in: Rebuild.
6406
e1f74f98
ILT
64072011-06-19 Ian Lance Taylor <iant@google.com>
6408
6409 PR gold/12880
6410 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6411 .interp section to a PT_INTERP segment even if we have seen a
6412 --dynamic-linker option. Don't do it if we have seen a PHDRS
6413 clause in a linker script.
6414 (Layout::finalize): Don't create a .interp section if we've
6415 already create a PT_INTERP segment.
6416 (Layout::create_interp): Always call choose_output_section (revert
6417 patch of 2011-06-17). Don't create PT_INTERP segment.
6418 * script-sections.cc
6419 (Script_sections::create_note_and_tls_segments): Add a .interp
6420 section to a PT_INTERP segment even if we have seen a
6421 --dynamic-linker option.
6422
766f91bb
ILT
64232011-06-18 Ian Lance Taylor <iant@google.com>
6424
6425 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6426 merely because a non-PT_LOAD segment has a dynamic reloc.
6427
0d212c3a
ILT
64282011-06-18 Ian Lance Taylor <iant@google.com>
6429
6430 * layout.cc (Layout::finish_dynamic_section): Don't create
6431 DT_FLAGS entry if not needed.
6432
911a5072
ILT
64332011-06-18 Ian Lance Taylor <iant@google.com>
6434
6435 PR gold/12745
6436 * layout.cc (Layout::layout_eh_frame): Correct handling of
6437 writable .eh_frame section.
6438
534b4e5f
ILT
64392011-06-17 Ian Lance Taylor <iant@google.com>
6440
6441 PR gold/12893
6442 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6443 symbol is redefined with the exact same object and value.
6444
10b4f102
ILT
64452011-06-17 Ian Lance Taylor <iant@google.com>
6446
6447 PR gold/12880
6448 * layout.h (class Layout): Add interp_segment_ field.
6449 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6450 (Layout::attach_allocated_section_to_segment): If making shared
6451 library, put .interp section in PT_INTERP segment.
6452 (Layout::finalize): Also call create_interp if -dynamic-linker
6453 option was used.
6454 (Layout::create_interp): Assert that there is no PT_INTERP
6455 segment. If not using a SECTIONS clause, use make_output_section.
6456 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6457 * script-sections.cc
6458 (Script_sections::create_note_and_tls_segments): If making shared
6459 library, put .interp section in PT_INTERP segment.
6460
a29b0dad
ILT
64612011-06-17 Ian Lance Taylor <iant@google.com>
6462
e588ea8d
ILT
6463 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6464 when making a shared library.
6465
64662011-06-17 Ian Lance Taylor <iant@google.com>
6467
6468 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6469 parameter. Change all callers. Don't issue warning about PC32
6470 against locally defined symbol.
a29b0dad 6471
9d3b0698
ILT
64722011-06-16 Ian Lance Taylor <iant@google.com>
6473
6474 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6475 occurs in same object.
6476
85b0f90c
AM
64772011-06-14 Alan Modra <amodra@gmail.com>
6478
6479 * po/POTFILES.in: Regenerate.
6480
a94907d9
ILT
64812011-06-09 Ian Lance Taylor <iant@google.com>
6482
6483 * script-sections.cc
6484 (Orphan_output_section::set_section_addresses): For a relocatable
6485 link set address to 0.
6486
4fb3a1c3
CC
64872011-06-09 Cary Coutant <ccoutant@google.com>
6488
6489 PR gold/12804
6490 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6491 used with --compress-debug-sections.
6492 * gold/object.cc (Sized_relobj_file::do_layout): Report
6493 uncompressed size of compressed input sections.
6494
61220854
CC
64952011-06-08 Cary Coutant <ccoutant@google.com>
6496
6497 PR gold/12804
6498 * testsuite/two_file_test_2_v1.cc: Change initialization of
6499 v2 to keep it in .data.
6500
e6455dfb
CC
65012011-06-07 Cary Coutant <ccoutant@google.com>
6502
6503 * common.cc (Symbol_table::do_allocate_commons_list): Call
6504 gold_fallback.
6505 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6506 (Errors::fallback): New function.
6507 (gold_fallback): New function.
6508 * errors.h (Errors::fallback): New function.
6509 * gold.cc (gold_exit): Change status parameter to enum; adjust
6510 all callers.
6511 (queue_initial_tasks): Call gold_fallback.
6512 * gold.h: Include cstdlib.
6513 (Exit_status): New enum type.
6514 (gold_exit): Change status parameter to enum.
6515 (gold_fallback): New function.
6516 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6517 (Layout::create_symtab_sections): Likewise.
6518 (Layout::create_shdrs): Likewise.
6519 * main.cc (main): Adjust call to gold_exit.
6520 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6521 (Output_data_got::add_got_entry_pair): Likewise.
6522 (Output_section::add_input_section): Likewise.
6523 (Output_section::add_output_section_data): Likewise.
6524 (Output_segment::set_section_list_addresses): Likewise.
6525 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6526
fb0e076f
CC
65272011-06-07 Cary Coutant <ccoutant@google.com>
6528
6529 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6530 for incremental links.
6531 * output.cc (Output_segment::set_section_list_addresses): Remove
6532 FIXME and test for TLS or BSS.
6533
a5ee4d5d
CC
65342011-06-07 Cary Coutant <ccoutant@google.com>
6535
6536 * testsuite/Makefile.am: Add incremental_copy_test,
6537 incremental_common_test_1.
6538 * testsuite/Makefile.in: Regenerate.
6539 * testsuite/common_test_1_v1.c: New source file.
6540 * testsuite/common_test_1_v2.c: New source file.
6541 * testsuite/copy_test_v1.cc: New source file.
6542
5146f448
CC
65432011-06-07 Cary Coutant <ccoutant@google.com>
6544
6545 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6546 update, allocate common from bss section's free list.
6547 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6548 linker-defined symbols.
6549 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6550 Skip GOT and PLT entries that are no longer referenced.
6551 (Output_section_incremental_inputs::write_info_blocks): Mark
6552 linker-defined symbols.
6553 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6554 * output.cc (Output_section::allocate): New function.
6555 * output.h (Output_section::allocate): New function.
6556 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6557 linker-defined symbols.
6558 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6559 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6560 (Symbol::init_base_output_data): Likewise.
6561 (Symbol::init_base_output_segment): Likewise.
6562 (Symbol::init_base_constant): Likewise.
6563 (Sized_symbol::init_output_data): Likewise.
6564 (Sized_symbol::init_output_segment): Likewise.
6565 (Sized_symbol::init_constant): Likewise.
6566 (Symbol_table::do_define_in_output_data): Likewise.
6567 (Symbol_table::do_define_in_output_segment): Likewise.
6568 (Symbol_table::do_define_as_constant): Likewise.
6569 * symtab.h (Symbol::is_predefined): New function.
6570 (Symbol::init_base_output_data): Add is_predefined parameter.
6571 (Symbol::init_base_output_segment): Likewise.
6572 (Symbol::init_base_constant): Likewise.
6573 (Symbol::is_predefined_): New data member.
6574 (Sized_symbol::init_output_data): Add is_predefined parameter.
6575 (Sized_symbol::init_output_segment): Likewise.
6576 (Sized_symbol::init_constant): Likewise.
6577 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6578
26d3c67d
CC
65792011-06-07 Cary Coutant <ccoutant@google.com>
6580
6581 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6582 instead of emit_copy_reloc.
6583 (Copy_relocs::emit_copy_reloc): Refactor.
6584 (Copy_relocs::make_copy_reloc): New function.
6585 (Copy_relocs::add_copy_reloc): Remove.
6586 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6587 section.
6588 (Copy_relocs::make_copy_reloc): New function.
6589 (Copy_relocs::add_copy_reloc): Remove.
6590 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6591 unchanged input files.
6592 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6593 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6594 Reserve BSS space for COPY relocations.
6595 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6596 (Output_section_incremental_inputs::write_info_blocks): Record
6597 whether a symbol is copied from a shared object.
6598 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6599 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6600 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6601 (Incremental_input_entry_reader::get_output_symbol_index): Add
6602 is_copy parameter.
6603 (Incremental_binary::emit_copy_relocs): New function.
6604 (Incremental_binary::do_emit_copy_relocs): New function.
6605 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6606 new data member.
6607 (Sized_incremental_binary::add_copy_reloc): New function.
6608 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6609 (Sized_incremental_binary::Copy_reloc): New struct.
6610 (Sized_incremental_binary::Copy_relocs): New typedef.
6611 (Sized_incremental_binary::copy_relocs_): New data member.
6612 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6613 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6614 * target.h (Sized_target::emit_copy_reloc): New function.
6615 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6616
7cdb37d9
CC
66172011-06-02 Cary Coutant <ccoutant@google.com>
6618
6619 PR gold/12163
6620 * gold/archive.cc (Archive::Archive): Initialize new data member.
6621 (Archive::include_all_members): Return if archive has already been
6622 included.
6623 * gold/archive.h (Archive::include_all_members_): New data member.
6624
cc643b88
NC
66252011-06-02 Nick Clifton <nickc@redhat.com>
6626
6627 * dynobj.h: Fix spelling mistake in comment.
6628 * output.cc: Likewise.
6629
f62a3ca7 66302011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6631 Asier Llano
f62a3ca7
DK
6632
6633 PR gold/12826
cc643b88 6634 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6635 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6636 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6637 redundant arm_exidx_test.so.
6638 * testsuite/Makefile.in: Regenerate.
6639 (check_SCRIPTS): Add pr12826.sh
6640 (check_DATA): Add pr12826.stdout
6641 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6642 * testsuite/pr12826.sh: New file.
6643 * testsuite/pr12826_1.s: Ditto.
6644 * testsuite/pr12826_1.s: Ditto.
6645
8dbe1edc
ILT
66462011-05-30 Ian Lance Taylor <iant@google.com>
6647
6648 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6649 sections.
6650
c49875be
ILT
66512011-05-29 Ian Lance Taylor <iant@google.com>
6652
6653 PR gold/12804
6654 * testsuite/Makefile.am: Use different file name for two_file_test
6655 temporary file for each incremental test.
6656 * testsuite/Makefile.in: Rebuild.
6657
69d53f7a
ILT
66582011-05-29 Ian Lance Taylor <iant@google.com>
6659
6660 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6661 binary input file is empty.
6662
41d0ab5f
ILT
66632011-05-27 Ian Lance Taylor <iant@google.com>
6664
6665 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6666 (ver_test_9.so): Likewise.
6667 * testsuite/Makefile.in: Rebuild.
6668
89d8a36b
CC
66692011-05-26 Cary Coutant <ccoutant@google.com>
6670
6671 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6672 * incremental.cc (Incremental_inputs::report_input_section): Fix
6673 comment, indentation.
6674 (Incremental_inputs::report_comdat_group): New function.
6675 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6676 of data for incremental input file entry.
6677 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6678 group count, COMDAT group signatures.
6679 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6680 an unchanged input file.
6681 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6682 Initialize new data member.
6683 (Incremental_object_entry::add_comdat_group): New function.
6684 (Incremental_object_entry::get_comdat_group_count): New function.
6685 (Incremental_object_entry::get_comdat_signature_key): New function.
6686 (Incremental_object_entry::groups_): New data member.
6687 (Incremental_inputs::report_comdat_group): New function.
6688 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6689 data for incremental input file entry.
6690 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6691 (Incremental_input_entry_reader::get_input_section): Adjust size of
6692 data for incremental input file entry.
6693 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6694 (Incremental_input_entry_reader::get_comdat_group_signature): New
6695 function.
6696 * object.cc (Sized_relobj::include_section_group): Report kept
6697 COMDAT groups for incremental links.
6698
1706a06f
ILT
66992011-05-24 David Meyer <pdox@google.com>
6700
6701 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6702 with name parameter. Add found_name parameter.
6703 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6704 * dirsearch.h (class Dirsearch): Update declaration.
6705
a10ae760
ILT
67062011-05-24 Ian Lance Taylor <iant@google.com>
6707
6708 * archive.cc (Library_base::should_include_member): Pull in object
6709 from archive if it defines the entry symbol.
6710 * parameters.cc (Parameters::entry): New function.
6711 * parameters.h (class Parameters): Declare entry.
6712 * output.h (class Output_file_header): Remove entry_ field.
6713 * output.cc (Output_file_header::Output_file_header): Remove entry
6714 parameter. Change all callers.
6715 (Output_file_header::entry): Use parameters->entry.
6716 * gold.cc (queue_middle_tasks): Likewise.
6717 * plugin.cc (Plugin_hook::run): Likewise.
6718
aa92d6ed
CC
67192011-05-24 Cary Coutant <ccoutant@google.com>
6720
6721 * gold.cc (queue_initial_tasks): Pass incremental base filename
6722 to Output_file::open_base_file; don't print error message.
6723 * incremental-dump.cc (main): Adjust call to
6724 Output_file::open_for_modification.
6725 * incremental-dump.cc (main): Likewise.
6726 * incremental.cc (Incremental_inputs::report_command_line):
6727 Ignore --incremental-base option when comparing command lines.
6728 Ignore parameter when given as separate argument.
6729 * options.h (class General_options): Add --incremental-base.
6730 * output.cc (Output_file::Output_file):
6731 (Output_file::open_base_file): Add base_name and writable parameters;
6732 read base file into new file; print error message here.
6733 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6734 callers.
6735 * output.h (Output_file::open_for_modification): Rename to...
6736 (Output_file::open_base_file): ...this; add base_name and
6737 writable parameters; adjust all callers.
6738 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6739 callers.
6740 * testsuite/Makefile.am (incremental_test_4): Test
6741 --incremental-base.
6742 * testsuite/Makefile.in: Regenerate.
6743
2eedd706
CC
67442011-05-24 Cary Coutant <ccoutant@google.com>
6745
6746 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6747 incremental_test_4.
6748 * testsuite/Makefile.in: Regenerate.
6749 * testsuite/two_file_test_1_v1.cc: New test source file.
6750 * testsuite/two_file_test_1b_v1.cc: New test source file.
6751 * testsuite/two_file_test_2_v1.cc: New test source file.
6752
0f1c85a6
CC
67532011-05-24 Cary Coutant <ccoutant@google.com>
6754
6755 * dynobj.h (Dynobj::do_dynobj): New function.
6756 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6757 flag and soname for shared objects.
6758 * incremental.cc (Incremental_inputs::report_object): Make
6759 either Incremental_object_entry or Incremental_dynobj_entry; add
6760 soname to string table.
6761 (Incremental_inputs::report_input_section): Add assertion.
6762 (Output_section_incremental_inputs::set_final_data_size): Adjust
6763 type of input file entry for shared libraries; adjust size of
6764 shared library info entry.
6765 (Output_section_incremental_inputs::write_input_files): Write
6766 as_needed flag for shared libraries.
6767 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6768 of input file entry for shared libraries; write soname.
6769 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6770 soname from incremental info.
6771 * incremental.h (enum Incremental_input_flags): Add
6772 INCREMENTAL_INPUT_AS_NEEDED.
6773 (Incremental_input_entry::Incremental_input_entry): Initialize new
6774 data member.
6775 (Incremental_input_entry::set_as_needed): New function.
6776 (Incremental_input_entry::as_needed): New function.
6777 (Incremental_input_entry::do_dynobj_entry): New function.
6778 (Incremental_input_entry::as_needed_): New data member.
6779 (Incremental_object_entry::Incremental_object_entry): Don't check
6780 for shared library.
6781 (Incremental_object_entry::do_type): Likewise.
6782 (class Incremental_dynobj_entry): New class.
6783 (Incremental_input_entry_reader::as_needed): New function.
6784 (Incremental_input_entry_reader::get_soname): New function.
6785 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6786 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6787 size of shared library info entry.
58797674 6788 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6789 incremental link when adding DT_NEEDED entries.
6790 * object.h (Object::Object): Initialize new data member.
6791 (Object::dynobj): New function.
6792 (Object::set_as_needed): New function.
6793 (Object::as_needed): New function.
6794 (Object::do_dynobj): New function.
6795 (Object::as_needed_): New data member.
6796
6fa2a40b
CC
67972011-05-24 Cary Coutant <ccoutant@google.com>
6798
6799 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6800 info; adjust display of GOT entries.
6801 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6802 vector of input objects; remove file_status_.
6803 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6804 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6805 got_plt reader; call target hooks to reserve GOT entries.
6806 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6807 of input file info header and GOT info entry.
6808 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6809 relocation info.
6810 (Got_plt_view_info::got_descriptor): Remove.
6811 (Got_plt_view_info::sym_index): New data member.
6812 (Got_plt_view_info::input_index): New data member.
6813 (Local_got_offset_visitor::visit): Write input file index.
6814 (Global_got_offset_visitor::visit): Write 0 for input file index.
6815 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6816 with sym_index and input_index.
6817 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6818 incremental info GOT entry; replace got_descriptor with input_index.
6819 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6820 map from input file index to object.
6821 (Sized_relobj_incr::do_layout): Replace direct data member reference
6822 with accessor function.
6823 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6824 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6825 Adjust size of input file info header.
6826 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6827 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6828 (Incremental_input_entry_reader::get_input_section): Adjust size of
6829 input file info header.
6830 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6831 of incremental info GOT entry.
6832 (Incremental_got_plt_reader::get_got_desc): Remove.
6833 (Incremental_got_plt_reader::get_got_symndx): New function.
6834 (Incremental_got_plt_reader::get_got_input_index): New function.
6835 (Sized_incremental_binary::Sized_incremental_binary): Remove
6836 file_status_; add input_objects_.
6837 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6838 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6839 (Sized_incremental_binary::file_is_unchanged): Remove.
6840 (Sized_incremental_binary::set_input_object): New function.
6841 (Sized_incremental_binary::input_object): New function.
6842 (Sized_incremental_binary::file_status_): Remove.
6843 (Sized_incremental_binary::input_objects_): New data member.
6844 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6845 references.
6846 (Sized_relobj_incr::invalid_address): Move to base class.
6847 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6848 class.
6849 (Sized_relobj_incr::do_output_section_offset): Likewise.
6850 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6851 (Sized_relobj_incr::section_offsets_): Likewise.
6852 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6853 function.
6854 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6855 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6856 with accessor function.
6857 (Sized_relobj_file::do_layout): Likewise.
6858 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6859 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6860 (Sized_relobj_file::compute_final_local_value): Replace refs to
6861 section_offsets_ with accessor function.
6862 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6863 * object.h (Relobj::Relobj): Initialize new data members.
6864 (Relobj::add_dyn_reloc): New function.
6865 (Relobj::first_dyn_reloc): New function.
6866 (Relobj::dyn_reloc_count): New function.
6867 (Relobj::first_dyn_reloc_): New data member.
6868 (Relobj::dyn_reloc_count_): New data member.
6869 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6870 references.
6871 (Sized_relobj::Address): New typedef.
6872 (Sized_relobj::invalid_address): Move here from child class.
6873 (Sized_relobj::Sized_relobj): Initialize new data members.
6874 (Sized_relobj::sized_relobj): New function.
6875 (Sized_relobj::is_output_section_offset_invalid): Move here from
6876 child class.
6877 (Sized_relobj::get_output_section_offset): Likewise.
6878 (Sized_relobj::local_has_got_offset): Likewise.
6879 (Sized_relobj::local_got_offset): Likewise.
6880 (Sized_relobj::set_local_got_offset): Likewise.
6881 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6882 (Sized_relobj::clear_got_offsets): New function.
6883 (Sized_relobj::section_offsets): Move here from child class.
6884 (Sized_relobj::do_output_section_offset): Likewise.
6885 (Sized_relobj::do_set_section_offset): Likewise.
6886 (Sized_relobj::Local_got_offsets): Likewise.
6887 (Sized_relobj::local_got_offsets_): Likewise.
6888 (Sized_relobj::section_offsets_): Likewise.
6889 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6890 references.
6891 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6892 class.
6893 (Sized_relobj_file::sized_relobj): New function
6894 (Sized_relobj_file::local_has_got_offset): Move to base class.
6895 (Sized_relobj_file::local_got_offset): Likewise.
6896 (Sized_relobj_file::set_local_got_offset): Likewise.
6897 (Sized_relobj_file::get_output_section_offset): Likewise.
6898 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6899 (Sized_relobj_file::do_output_section_offset): Likewise.
6900 (Sized_relobj_file::do_set_section_offset): Likewise.
6901 (Sized_relobj_file::Local_got_offsets): Likewise.
6902 (Sized_relobj_file::local_got_offsets_): Likewise.
6903 (Sized_relobj_file::section_offsets_): Likewise.
6904 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6905 (all constructors).
6906 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6907 (Output_reloc::get_symbol_index): Likewise.
6908 (Output_reloc::local_section_offset): Likewise.
6909 (Output_reloc::get_address): Likewise.
6910 (Output_reloc::symbol_value): Likewise.
6911 (Output_data_got::reserve_slot): Move to class definition.
6912 (Output_data_got::reserve_local): New function.
6913 (Output_data_got::reserve_slot_for_global): Remove.
6914 (Output_data_got::reserve_global): New function.
6915 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6916 (all constructors, two instantiations).
6917 (Output_reloc::get_relobj): New function (two instantiations).
6918 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6919 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6920 (Output_data_reloc::add_global): Adjust type of relobj.
6921 (Output_data_reloc::add_global_relative): Likewise.
6922 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6923 (Output_data_reloc::add_local): Likewise.
6924 (Output_data_reloc::add_local_relative): Likewise.
6925 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6926 (Output_data_reloc::add_local_section): Likewise.
6927 (Output_data_reloc::add_output_section): Likewise.
6928 (Output_data_reloc::add_absolute): Likewise.
6929 (Output_data_reloc::add_target_specific): Likewise.
6930 (Output_data_got::reserve_slot): Move definition here.
6931 (Output_data_got::reserve_local): New function.
6932 (Output_data_got::reserve_global): New function.
6933 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6934 section_offsets_ with accessor function.
6935 (Sized_relobj_file::write_sections): Likewise.
6936 (Sized_relobj_file::do_relocate_sections): Likewise.
6937 * target.h (Sized_target::reserve_local_got_entry): New function.
6938 (Sized_target::reserve_global_got_entry): New function.
6939 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6940 (Target_x86_64::reserve_global_got_entry): New function.
6941 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6942
4829d394
CC
69432011-05-23 Cary Coutant <ccoutant@google.com>
6944
6945 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6946 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6947 bit when checking got_type.
6948 * incremental.cc (Sized_incremental_binary::setup_readers):
6949 Store symbol table and string table locations; initialize bit vector
6950 of file status flags.
6951 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6952 unchanged files.
6953 (Sized_incremental_binary::do_process_got_plt): New function.
6954 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6955 (Output_section_incremental_inputs::set_final_data_size): Record
6956 file index for each input file.
6957 (Output_section_incremental_inputs::write_got_plt): Store file index
6958 instead of input entry offset for each GOT entry.
6959 * incremental.h
6960 (Incremental_input_entry::Incremental_input_entry): Initialize new
6961 data member.
6962 (Incremental_input_entry::set_offset): Store file index.
6963 (Incremental_input_entry::get_file_index): New function.
6964 (Incremental_input_entry::file_index_): New data member.
6965 (Incremental_binary::process_got_plt): New function.
6966 (Incremental_binary::do_process_got_plt): New function.
6967 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6968 data members.
6969 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6970 (Sized_incremental_binary::set_file_is_unchanged): New function.
6971 (Sized_incremental_binary::file_is_unchanged): New function.
6972 (Sized_incremental_binary::do_process_got_plt): New function.
6973 (Sized_incremental_binary::file_status_): New data member.
6974 (Sized_incremental_binary::main_symtab_loc_): New data member.
6975 (Sized_incremental_binary::main_strtab_loc_): New data member.
6976 * output.cc (Output_data_got::Got_entry::write): Add case
6977 RESERVED_CODE.
6978 (Output_data_got::add_global): Call add_got_entry.
6979 (Output_data_got::add_global_plt): Likewise.
6980 (Output_data_got::add_global_with_rel): Likewise.
6981 (Output_data_got::add_global_with_rela): Likewise.
6982 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6983 (Output_data_got::add_global_pair_with_rela): Likewise.
6984 (Output_data_got::add_local): Call add_got_entry.
6985 (Output_data_got::add_local_plt): Likewise.
6986 (Output_data_got::add_local_with_rel): Likewise.
6987 (Output_data_got::add_local_with_rela): Likewise.
6988 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6989 (Output_data_got::add_local_pair_with_rela): Likewise.
6990 (Output_data_got::reserve_slot): New function.
6991 (Output_data_got::reserve_slot_for_global): New function.
6992 (Output_data_got::add_got_entry): New function.
6993 (Output_data_got::add_got_entry_pair): New function.
6994 (Output_section::add_output_section_data): Edit FIXME.
6995 * output.h
6996 (Output_section_data_build::Output_section_data_build): New
6997 constructor with size parameter.
6998 (Output_data_space::Output_data_space): Likewise.
6999 (Output_data_got::Output_data_got): Initialize new data member; new
7000 constructor with size parameter.
7001 (Output_data_got::add_constant): Call add_got_entry.
7002 (Output_data_got::reserve_slot): New function.
7003 (Output_data_got::reserve_slot_for_global): New function.
7004 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7005 (Output_data_got::add_got_entry): New function.
7006 (Output_data_got::add_got_entry_pair): New function.
7007 (Output_data_got::free_list_): New data member.
7008 * target.h (Sized_target::init_got_plt_for_update): New function.
7009 (Sized_target::register_global_plt_entry): New function.
7010 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7011 Initialize new data member; call init; add constructor with PLT count.
7012 (Output_data_plt_x86_64::init): New function.
7013 (Output_data_plt_x86_64::add_relocation): New function.
7014 (Output_data_plt_x86_64::reserve_slot): New function.
7015 (Output_data_plt_x86_64::free_list_): New data member.
7016 (Target_x86_64::init_got_plt_for_update): New function.
7017 (Target_x86_64::register_global_plt_entry): New function.
7018 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7019 incremental updates.
7020 (Output_data_plt_x86_64::add_relocation): New function.
7021 * testsuite/object_unittest.cc (Object_test): Set default options.
7022
ec69d6da
ILT
70232011-05-16 Ian Lance Taylor <iant@google.com>
7024
7025 * options.h (class General_options): Make -i a synonym for -r.
7026
732e31de
ILT
70272011-05-16 Ian Lance Taylor <iant@google.com>
7028
7029 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7030
403676b5
CC
70312011-05-10 Cary Coutant <ccoutant@google.com>
7032
7033 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7034 strip_all (-s).
7035
5b7b7d6e
ILT
70362011-05-06 Ian Lance Taylor <iant@google.com>
7037
7038 * layout.cc (Layout::layout): If the output section flags change,
7039 update the ordering.
7040
f0f9babf
CC
70412011-04-25 Cary Coutant <ccoutant@google.com>
7042
7043 * incremental-dump.cc (dump_incremental_inputs): Print local
7044 symbol info for each input file.
7045 * incremental.cc
7046 (Output_section_incremental_inputs::set_final_data_size): Add local
7047 symbol info to input file entries in incremental info.
7048 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7049 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7050 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7051 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7052 implementation.
7053 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7054 (Sized_incr_relobj::do_relocate): Write the local symbols.
7055 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7056 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7057 Adjust size of input file header.
7058 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7059 (Incremental_inputs_reader::get_local_symbol_count): New function.
7060 (Incremental_inputs_reader::get_input_section): Adjust size of input
7061 file header.
7062 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7063 (Sized_incr_relobj::This): New typedef.
7064 (Sized_incr_relobj::sym_size): New const data member.
7065 (Sized_incr_relobj::Local_symbol): New struct.
7066 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7067 (Sized_incr_relobj::do_local_symbol_offset): New function.
7068 (Sized_incr_relobj::local_symbol_count_): New data member.
7069 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7070 (Sized_incr_relobj::local_symbol_index_): New data member.
7071 (Sized_incr_relobj::local_symbol_offset_): New data member.
7072 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7073 (Sized_incr_relobj::local_symbols_): New data member.
7074 * object.h (Relobj::output_local_symbol_count): New function.
7075 (Relobj::local_symbol_offset): New function.
7076 (Relobj::do_output_local_symbol_count): New function.
7077 (Relobj::do_local_symbol_offset): New function.
7078 (Sized_relobj::do_output_local_symbol_count): New function.
7079 (Sized_relobj::do_local_symbol_offset): New function.
7080
d0a9ace3
ILT
70812011-04-22 Vladimir Simonov <sv@sw.ru>
7082
7083 * descriptors.cc (set_close_on_exec): New function.
7084 (Descriptors::open): Use set_close_on_exec.
7085 * output.cc (S_ISLNK): Define if not defined.
7086
94a3fc8b
CC
70872011-04-22 Cary Coutant <ccoutant@google.com>
7088
7089 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7090 global symbol map.
7091 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7092 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7093 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7094 relocations.
7095 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7096 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7097 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7098 * incremental.h
7099 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7100 function.
7101 (Incremental_binary::apply_incremental_relocs): New function.
7102 (Incremental_binary::do_apply_incremental_relocs): New function.
7103 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7104 data member.
7105 (Sized_incremental_binary::add_global_symbol): New function.
7106 (Sized_incremental_binary::global_symbol): New function.
7107 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7108 (Sized_incremental_binary::symbol_map_): New data member.
7109 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7110 * target.h (Sized_target::apply_relocation): New function.
7111 * target-reloc.h (apply_relocation): New function.
7112 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7113
c87e4302
DK
71142011-04-22 Doug Kwan <dougkwan@google.com>
7115
7116 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7117 flag of a SHT_ARM_EXIDX section.
2e702c99 7118 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7119 * testsuite/Makefile.in: Regenerate.
7120 * testsuite/arm_exidx_test.s: New file.
7121 * testsuite/arm_exidx_test.sh: Same.
7122
e7782cf6
CC
71232011-04-20 Cary Coutant <ccoutant@google.com>
7124
7125 PR gold/12689
7126 * archive.h (Incremental_archive_entry::Archive_member):
7127 Initialize arg_serial_ (second constructor).
7128
308ecdc7
ILT
71292011-04-17 Ian Lance Taylor <iant@google.com>
7130
7131 * object.cc (Relocate_info::location): Simplify location string.
7132 * errors.cc (Errors::error_at_location): Don't print program
7133 name.
7134 (Errors::warning_at_location): Likewise.
7135 (Errors::undefined_symbol): Likewise.
7136 * testsuite/debug_msg.sh: Update accordingly.
7137
bec5b579
CC
71382011-04-14 Cary Coutant <ccoutant@google.com>
7139
7140 * gold/layout.cc (Layout::symtab_section_offset): New function.
7141 * gold/layout.h (Layout::symtab_section_offset): New function.
7142 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7143
88597d34
ILT
71442011-04-12 Ian Lance Taylor <iant@google.com>
7145
7146 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7147 with MREMAP_MAYMOVE.
7148 * output.h (class Output_file): Add map_is_allocated_ field.
7149 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7150 not available, provide stubs. If mremap is not available, #define
7151 it to gold_mremap.
7152 (MREMAP_MAYMOVE): Define if not defined.
7153 (Output_file::Output_file): Initialize map_is_allocated_.
7154 (Output_file::resize): Check map_is_allocated_.
7155 (Output_file::map_anonymous): If mmap fails, use malloc.
7156 (Output_file::unmap): Don't do anything for an anonymous map.
7157 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7158 is not available, provide stubs.
7159 (File_read::View::~View): Use free rather than delete[].
7160 (File_read::make_view): Use malloc rather than new[]. If mmap
7161 fails, use malloc.
7162 (File_read::find_or_make_view): Use malloc rather than new[].
7163 * gold.h: Remove HAVE_REMAP code.
7164 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7165 exists. Rename mremap to gold_mremap. If mmap is not available
7166 don't do anything.
7167 * configure, config.in: Rebuild.
7168
11e361bc
ILT
71692011-04-11 Ian Lance Taylor <iant@google.com>
7170
7171 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7172 initialize local variable v.
7173
cdc29364
CC
71742011-04-11 Cary Coutant <ccoutant@google.com>
7175
7176 * archive.cc (Archive::include_member): Adjust call to
7177 report_object.
7178 (Add_archive_symbols::run): Track argument serial numbers.
7179 (Lib_group::include_member): Likewise.
7180 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7181 * archive.h (Incremental_archive_entry::Archive_member):
7182 Initialize arg_serial_.
7183 (Archive_member::arg_serial_): New data member.
7184 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7185 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7186 incremental link.
7187 (Sized_dynobj::do_for_all_local_got_entries): New function.
7188 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7189 function.
7190 * fileread.cc (get_mtime): New function.
7191 * fileread.h (get_mtime): New function.
7192 * gold.cc (queue_initial_tasks): Check for incremental update.
7193 (process_incremental_input): New function.
7194 (queue_middle_tasks): Don't force valid target for incremental
7195 update.
7196 * incremental-dump.cc (find_input_containing_global): Adjust
7197 size of symbol info entry.
7198 (dump_incremental_inputs): Dump argument serial number and
7199 in_system_directory flag; bias shndx by 1; print symbol names
7200 when dumping per-file symbol lists; use new symbol info readers.
7201 * incremental.cc
7202 (Output_section_incremental_inputs:update_data_size): New function.
7203 (Sized_incremental_binary::setup_readers): Setup input readers
7204 for each input file; build maps for files added from libraries
7205 and scripts.
7206 (Sized_incremental_binary::check_input_args): New function.
7207 (Sized_incremental_binary::do_check_inputs): Build map of argument
7208 serial numbers to input arguments.
7209 (Sized_incremental_binary::do_file_has_changed): Rename
7210 do_file_is_unchanged to this; compare file modification times.
7211 (Sized_incremental_binary::do_init_layout): New function.
7212 (Sized_incremental_binary::do_reserve_layout): New function.
7213 (Sized_incremental_binary::do_get_input_reader): Remove.
7214 (Sized_incremental_binary::get_symtab_view): New function.
7215 (Incremental_checker::can_incrementally_link_output_file): Remove.
7216 (Incremental_inputs::report_command_line): Exclude --debug options.
7217 (Incremental_inputs::report_archive_begin): Add parameter; track
7218 argument serial numbers; don't put input file entry for archive
7219 before archive members.
7220 (Incremental_inputs::report_archive_end): Put input file entry
7221 for archive after archive members.
7222 (Incremental_inputs::report_object): Add parameter; track argument
7223 serial numbers and in_system_directory flag.
7224 (Incremental_inputs::report_script): Add parameter; track argument
7225 serial numbers.
7226 (Output_section_incremental_inputs::set_final_data_size): Adjust
7227 size of symbol info entry; check for forwarding symbols.
7228 (Output_section_incremental_inputs::write_input_files): Write
7229 in_system_directory flag and argument serial number.
7230 (Output_section_incremental_inputs::write_info_blocks): Map section
7231 indices between incremental info and original input file; store
7232 input section index for each symbol.
7233 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7234 change operator() to visit().
7235 (class Global_got_offset_visitor): Likewise.
7236 (class Global_symbol_visitor_got_plt):
7237 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7238 classes.
7239 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7240 (Sized_incr_relobj::do_read_symbols): New function.
7241 (Sized_incr_relobj::do_layout): New function.
7242 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7243 (Sized_incr_relobj::do_add_symbols): New function.
7244 (Sized_incr_relobj::do_should_include_member): New function.
7245 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7246 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7247 (Sized_incr_relobj::do_section_size): New function.
7248 (Sized_incr_relobj::do_section_name): New function.
7249 (Sized_incr_relobj::do_section_contents): New function.
7250 (Sized_incr_relobj::do_section_flags): New function.
7251 (Sized_incr_relobj::do_section_entsize): New function.
7252 (Sized_incr_relobj::do_section_address): New function.
7253 (Sized_incr_relobj::do_section_type): New function.
7254 (Sized_incr_relobj::do_section_link): New function.
7255 (Sized_incr_relobj::do_section_info): New function.
7256 (Sized_incr_relobj::do_section_addralign): New function.
7257 (Sized_incr_relobj::do_initialize_xindex): New function.
7258 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7259 (Sized_incr_relobj::do_read_relocs): New function.
7260 (Sized_incr_relobj::do_gc_process_relocs): New function.
7261 (Sized_incr_relobj::do_scan_relocs): New function.
7262 (Sized_incr_relobj::do_count_local_symbols): New function.
7263 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7264 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7265 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7266 (Sized_incr_relobj::do_relocate): New function.
7267 (Sized_incr_relobj::do_set_section_offset): New function.
7268 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7269 (Sized_incr_dynobj::do_read_symbols): New function.
7270 (Sized_incr_dynobj::do_layout): New function.
7271 (Sized_incr_dynobj::do_add_symbols): New function.
7272 (Sized_incr_dynobj::do_should_include_member): New function.
7273 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7274 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7275 (Sized_incr_dynobj::do_section_size): New function.
7276 (Sized_incr_dynobj::do_section_name): New function.
7277 (Sized_incr_dynobj::do_section_contents): New function.
7278 (Sized_incr_dynobj::do_section_flags): New function.
7279 (Sized_incr_dynobj::do_section_entsize): New function.
7280 (Sized_incr_dynobj::do_section_address): New function.
7281 (Sized_incr_dynobj::do_section_type): New function.
7282 (Sized_incr_dynobj::do_section_link): New function.
7283 (Sized_incr_dynobj::do_section_info): New function.
7284 (Sized_incr_dynobj::do_section_addralign): New function.
7285 (Sized_incr_dynobj::do_initialize_xindex): New function.
7286 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7287 (make_sized_incremental_object): New function.
7288 (Incremental_library::copy_unused_symbols): New function.
7289 (Incremental_library::do_for_all_unused_symbols): New function.
7290 * incremental.h (enum Incremental_input_flags): New type.
7291 (class Incremental_checker): Remove.
7292 (Incremental_input_entry::Incremental_input_entry): Add argument
7293 serial number.
7294 (Incremental_input_entry::arg_serial): New function.
7295 (Incremental_input_entry::set_is_in_system_directory): New function.
7296 (Incremental_input_entry::is_in_system_directory): New function.
7297 (Incremental_input_entry::arg_serial_): New data member.
7298 (Incremental_input_entry::is_in_system_directory_): New data member.
7299 (class Script_info): Move here from script.h.
7300 (Script_info::Script_info): Add filename parameter.
7301 (Script_info::filename): New function.
7302 (Script_info::filename_): New data member.
7303 (Incremental_script_entry::Incremental_script_entry): Add argument
7304 serial number.
7305 (Incremental_object_entry::Incremental_object_entry): Likewise.
7306 (Incremental_object_entry::add_input_section): Build list of input
7307 sections with map to original shndx.
7308 (Incremental_object_entry::get_input_section_index): New function.
7309 (Incremental_object_entry::shndx_): New data member.
7310 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7311 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7312 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7313 serial number.
7314 (Incremental_inputs::report_archive_begin): Likewise.
7315 (Incremental_inputs::report_object): Likewise.
7316 (Incremental_inputs::report_script): Likewise.
7317 (class Incremental_global_symbol_reader): New class.
7318 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7319 and store flags and input file type.
7320 (Incremental_input_entry_reader::arg_serial): New function.
7321 (Incremental_input_entry_reader::type): Extract type from flags.
7322 (Incremental_input_entry_reader::is_in_system_directory): New function.
7323 (Incremental_input_entry_reader::get_input_section_count): Call
7324 accessor function for type.
7325 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7326 function for type; adjust size of global symbol entry.
7327 (Incremental_input_entry_reader::get_global_symbol_count): Call
7328 accessor function for type.
7329 (Incremental_input_entry_reader::get_object_count): Likewise.
7330 (Incremental_input_entry_reader::get_object_offset): Likewise.
7331 (Incremental_input_entry_reader::get_member_count): Likewise.
7332 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7333 (Incremental_input_entry_reader::get_member_offset): Likewise.
7334 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7335 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7336 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7337 (Incremental_input_entry_reader::get_global_symbol_reader): New
7338 function.
7339 (Incremental_input_entry_reader::get_output_symbol_index): New
7340 function.
7341 (Incremental_input_entry_reader::type_): Remove.
7342 (Incremental_input_entry_reader::flags_): New data member.
7343 (Incremental_inputs_reader::input_file_offset): New function.
7344 (Incremental_inputs_reader::input_file_index): New function.
7345 (Incremental_inputs_reader::input_file): Call input_file_offset.
7346 (Incremental_inputs_reader::input_file_at_offset): New function.
7347 (Incremental_relocs_reader::get_r_type): Reformat.
7348 (Incremental_relocs_reader::get_r_shndx): Reformat.
7349 (Incremental_relocs_reader::get_r_offset): Reformat.
7350 (Incremental_relocs_reader::data): New function.
7351 (Incremental_binary::Incremental_binary): Initialize new data members.
7352 (Incremental_binary::check_inputs): Add cmdline parameter.
7353 (Incremental_binary::file_is_unchanged): Remove.
7354 (Input_reader::arg_serial): New function.
7355 (Input_reader::get_unused_symbol_count): New function.
7356 (Input_reader::get_unused_symbol): New function.
7357 (Input_reader::do_arg_serial): New function.
7358 (Input_reader::do_get_unused_symbol_count): New function.
7359 (Input_reader::do_get_unused_symbol): New function.
7360 (Incremental_binary::input_file_count): New function.
7361 (Incremental_binary::get_input_reader): Change signature to use
7362 index instead of filename.
7363 (Incremental_binary::file_has_changed): New function.
7364 (Incremental_binary::get_input_argument): New function.
7365 (Incremental_binary::get_library): New function.
7366 (Incremental_binary::get_script_info): New function.
7367 (Incremental_binary::init_layout): New function.
7368 (Incremental_binary::reserve_layout): New function.
7369 (Incremental_binary::output_file): New function.
7370 (Incremental_binary::do_check_inputs): New function.
7371 (Incremental_binary::do_file_is_unchanged): Remove.
7372 (Incremental_binary::do_file_has_changed): New function.
7373 (Incremental_binary::do_init_layout): New function.
7374 (Incremental_binary::do_reserve_layout): New function.
7375 (Incremental_binary::do_input_file_count): New function.
7376 (Incremental_binary::do_get_input_reader): Change signature.
7377 (Incremental_binary::input_args_map_): New data member.
7378 (Incremental_binary::library_map_): New data member.
7379 (Incremental_binary::script_map_): New data member.
7380 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7381 new data members.
7382 (Sized_incremental_binary::output_section): New function.
7383 (Sized_incremental_binary::inputs_reader): Add const.
7384 (Sized_incremental_binary::symtab_reader): Add const.
7385 (Sized_incremental_binary::relocs_reader): Add const.
7386 (Sized_incremental_binary::got_plt_reader): Add const.
7387 (Sized_incremental_binary::get_symtab_view): New function.
7388 (Sized_incremental_binary::Inputs_reader): New typedef.
7389 (Sized_incremental_binary::Input_entry_reader): New typedef.
7390 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7391 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7392 (Sized_incremental_binary::do_file_has_changed): New function.
7393 (Sized_incremental_binary::do_init_layout): New function.
7394 (Sized_incremental_binary::do_reserve_layout): New function.
7395 (Sized_input_reader::Inputs_reader): Remove.
7396 (Sized_input_reader::Input_entry_reader): Remove.
7397 (Sized_input_reader::do_arg_serial): New function.
7398 (Sized_input_reader::do_get_unused_symbol_count): New function.
7399 (Sized_input_reader::do_get_unused_symbol): New function.
7400 (Sized_incremental_binary::do_input_file_count): New function.
7401 (Sized_incremental_binary::do_get_input_reader): Change signature;
7402 use index instead of filename.
7403 (Sized_incremental_binary::section_map_): New data member.
7404 (Sized_incremental_binary::input_entry_readers_): New data member.
7405 (class Sized_incr_relobj): New class.
7406 (class Sized_incr_dynobj): New class.
7407 (make_sized_incremental_object): New function.
7408 (class Incremental_library): New class.
7409 * layout.cc (Free_list::num_lists): New static data member.
7410 (Free_list::num_nodes): New static data member.
7411 (Free_list::num_removes): New static data member.
7412 (Free_list::num_remove_visits): New static data member.
7413 (Free_list::num_allocates): New static data member.
7414 (Free_list::num_allocate_visits): New static data member.
7415 (Free_list::init): New function.
7416 (Free_list::remove): New function.
7417 (Free_list::allocate): New function.
7418 (Free_list::dump): New function.
7419 (Free_list::print_stats): New function.
7420 (Layout_task_runner::run): Resize output file for incremental updates.
7421 (Layout::Layout): Initialize new data members.
7422 (Layout::set_incremental_base): New function.
7423 (Layout::init_fixed_output_section): New function.
7424 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7425 incremental updates.
7426 (Layout::create_gold_note): Do not create gold note section for
7427 incremental updates.
7428 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7429 for incremental updates.
7430 (Layout::set_section_offsets): For incremental updates, allocate space
7431 from free list.
7432 (Layout::create_symtab_sections): Layout with offsets relative to
7433 start of section; for incremental updates, allocate space from free
7434 list.
7435 (Layout::create_shdrs): For incremental updates, allocate space from
7436 free list.
7437 (Layout::finish_dynamic_section): For incremental updates, do not
7438 check --as-needed (fixed in subsequent patch).
7439 * layout.h (class Free_list): New class.
7440 (Layout::set_incremental_base): New function.
7441 (Layout::incremental_base): New function.
7442 (Layout::init_fixed_output_section): New function.
7443 (Layout::allocate): New function.
7444 (Layout::incremental_base_): New data member.
7445 (Layout::free_list_): New data member.
7446 * main.cc (main): Print Free_list statistics.
7447 * object.cc (Relobj::finalize_incremental_relocs): Add
7448 clear_counts parameter; clear counts only when clear_counts is set.
7449 (Sized_relobj::Sized_relobj): Initialize new base class.
7450 (Sized_relobj::do_layout): Don't report special sections.
7451 (Sized_relobj::do_for_all_local_got_entries): New function.
7452 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7453 symtab_off to all symbol table offsets.
7454 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7455 * object.h (class Got_offset_list): Move to top of file.
7456 (Object::Object): Allow case where input_file == NULL.
7457 (Object::~Object): Likewise.
7458 (Object::input_file): Assert that input_file != NULL.
7459 (Object::lock): Allow case where input_file == NULL.
7460 (Object::unlock): Likewise.
7461 (Object::is_locked): Likewise.
7462 (Object::token): Likewise.
7463 (Object::release): Likewise.
7464 (Object::is_incremental): New function.
7465 (Object::get_mtime): New function.
7466 (Object::for_all_local_got_entries): New function.
7467 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7468 (Object::set_is_in_system_directory): New function.
7469 (Object::is_in_system_directory): New function.
7470 (Object::do_is_incremental): New function.
7471 (Object::do_get_mtime): New function.
7472 (Object::do_for_all_local_got_entries): New function.
7473 (Object::is_in_system_directory_): New data member.
7474 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7475 (class Sized_relobj_base): New class.
7476 (class Sized_relobj): Derive from Sized_relobj_base.
7477 (class Sized_relobj::Symbols): Redeclare from base class.
7478 (class Sized_relobj::local_got_offset_list): Remove.
7479 (class Sized_relobj::Output_sections): Redeclare from base class.
7480 (class Sized_relobj::do_for_all_local_got_entries): New function.
7481 (class Sized_relobj::write_local_symbols): Add offset parameter.
7482 (class Sized_relobj::local_symbol_offset_): Update comment.
7483 (class Sized_relobj::local_dynsym_offset_): Update comment.
7484 * options.cc (Input_arguments::add_file): Remove const.
7485 * options.h (Input_file_argument::Input_file_argument):
7486 Initialize arg_serial_ (all constructors).
7487 (Input_file_argument::set_arg_serial): New function.
7488 (Input_file_argument::arg_serial): New function.
7489 (Input_file_argument::arg_serial_): New data member.
7490 (Input_arguments::Input_arguments): Initialize file_count_.
7491 (Input_arguments::add_file): Remove const.
7492 (Input_arguments::number_of_input_files): New function.
7493 (Input_arguments::file_count_): New data member.
7494 (Command_line::number_of_input_files): Call
7495 Input_arguments::number_of_input_files.
7496 * output.cc (Output_segment_headers::Output_segment_headers):
7497 Set current size.
7498 (Output_section::Input_section::current_data_size): New function.
7499 (Output_section::Output_section): Initialize new data members.
7500 (Output_section::add_input_section): Don't do merge sections for
7501 an incremental link; allocate space from free list for an
7502 incremental update.
7503 (Output_section::add_output_section_data): Allocate space from
7504 free list for an incremental update.
7505 (Output_section::update_data_size): New function.
7506 (Output_section::set_fixed_layout): New function.
7507 (Output_section::reserve): New function.
7508 (Output_segment::set_section_addresses): Remove const.
7509 (Output_segment::set_section_list_addresses): Remove const; allocate
7510 space from free list for an incremental update.
7511 (Output_segment::set_offset): Adjust size of RELRO segment for an
7512 incremental update.
7513 * output.h (Output_data::current_data_size): Move here from
7514 child classes.
7515 (Output_data::pre_finalize_data_size): New function.
7516 (Output_data::update_data_size): New function.
7517 (Output_section_headers::update_data_size): new function.
7518 (Output_section_data_build::current_data_size): Move to Output_data.
7519 (Output_data_strtab::update_data_size): New function.
7520 (Output_section::current_data_size): Move to Output_data.
7521 (Output_section::set_fixed_layout): New function.
7522 (Output_section::has_fixed_layout): New function.
7523 (Output_section::reserve): New function.
7524 (Output_section::update_data_size): New function.
7525 (Output_section::has_fixed_layout_): New data member.
7526 (Output_section::free_list_): New data member.
7527 (Output_segment::set_section_addresses): Remove const.
7528 (Output_segment::set_section_list_addresses): Remove const.
7529 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7530 New function.
7531 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7532 New function.
7533 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7534 parameter when calling Add_symbols constructor; store argument
7535 serial number for members of a lib group.
7536 (Add_symbols::locks): Allow case where token == NULL.
7537 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7538 (Read_member::~Read_member): New function.
7539 (Read_member::is_runnable): New function.
7540 (Read_member::locks): New function.
7541 (Read_member::run): New function.
7542 (Check_script::~Check_script): New function.
7543 (Check_script::is_runnable): New function.
7544 (Check_script::locks): New function.
7545 (Check_script::run): New function.
7546 (Check_library::~Check_library): New function.
7547 (Check_library::is_runnable): New function.
7548 (Check_library::locks): New function.
7549 (Check_library::run): New function.
7550 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7551 (Add_symbols::library_): New data member.
7552 (class Read_member): New class.
7553 (class Check_script): New class.
7554 (class Check_library): New class.
7555 * reloc.cc (Read_relocs::is_runnable): Allow case where
7556 token == NULL.
7557 (Read_relocs::locks): Likewise.
7558 (Scan_relocs::locks): Likewise.
7559 (Relocate_task::locks): Likewise.
7560 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7561 to clear counters.
7562 (Sized_relobj::incremental_relocs_scan): Fix comment.
7563 (Sized_relobj::do_relocate): Pass output file offset to
7564 write_local_symbols.
7565 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7566 from class declaration.
7567 * script.cc (read_input_script): Allocate Script_info; pass
7568 argument serial number to report_script.
7569 * script.h (class Script_info): Move to incremental.h.
7570 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7571 * symtab.h (Symbol_table::add_from_incrobj): New function.
7572 (Symbol_table::set_file_offset): New function.
7573
b961d0d7
CC
75742011-04-05 Cary Coutant <ccoutant@google.com>
7575
7576 * incremental-dump.cc (dump_incremental_inputs): Change signature
7577 to take a Sized_incremental_binary; change caller. Use readers
7578 in Sized_incremental_binary.
7579 * incremental.cc
7580 (Sized_incremental_binary::find_incremental_inputs_sections):
7581 Rename do_find_incremental_inputs_sections to this.
7582 (Sized_incremental_binary::setup_readers): New function.
7583 (Sized_incremental_binary::do_check_inputs): Check
7584 has_incremental_info_ flag; move setup code to setup_readers;
7585 use input readers.
7586 (Sized_incremental_binary::do_file_is_unchanged): New function.
7587 (Sized_incremental_binary::do_get_input_reader): New function.
7588 * incremental.h (class Incremental_binary): Move to end of file.
7589 (Incremental_binary::file_is_unchanged): New function.
7590 (Incremental_binary::do_file_is_unchanged): New function.
7591 (Incremental_binary::Input_reader): New class.
7592 (Incremental_binary::get_input_reader): New function.
7593 (class Sized_incremental_binary): Move to end of file.
7594 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7595 input section reader classes.
7596 (Sized_incremental_binary::has_incremental_info): New function.
7597 (Sized_incremental_binary::inputs_reader): New function.
7598 (Sized_incremental_binary::symtab_reader): New function.
7599 (Sized_incremental_binary::relocs_reader): New function.
7600 (Sized_incremental_binary::got_plt_reader): New function.
7601 (Sized_incremental_binary::do_file_is_unchanged): New function.
7602 (Sized_incremental_binary::Sized_input_reader): New class.
7603 (Sized_incremental_binary::get_input_reader): New function.
7604 (Sized_incremental_binary::find_incremental_inputs_sections):
7605 Rename do_find_incremental_inputs_sections to this.
7606 (Sized_incremental_binary::setup_readers): New function.
7607 (Sized_incremental_binary::has_incremental_info_): New data member.
7608 (Sized_incremental_binary::inputs_reader_): New data member.
7609 (Sized_incremental_binary::symtab_reader_): New data member.
7610 (Sized_incremental_binary::relocs_reader_): New data member.
7611 (Sized_incremental_binary::got_plt_reader_): New data member.
7612 (Sized_incremental_binary::current_input_file_): New data member.
7613
a869183f
PP
76142011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7615
7616 PR gold/12640
7617 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7618 violation.
7619
76202011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7621
7622 * archive.cc (Archive::include_member): Adjust call to report_object.
7623 (Add_archive_symbols::run): Add script_info to call to
7624 report_archive_begin.
7625 (Lib_group::include_member): Adjust call to report_object.
7626 (Add_lib_group_symbols::run): Adjust call to report_object.
7627 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7628 blocks. Add object count for script input files.
7629 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7630 script_info parameter; change all callers.
7631 (Incremental_inputs::report_object): Add script_info parameter;
7632 change all callers.
7633 (Incremental_inputs::report_script): Store backpointer to
7634 incremental info entry.
7635 (Output_section_incremental_inputs::set_final_data_size): Record
7636 additional information for scripts.
7637 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7638 * incremental.h (Incremental_script_entry::add_object): New function.
7639 (Incremental_script_entry::get_object_count): New function.
7640 (Incremental_script_entry::get_object): New function.
7641 (Incremental_script_entry::objects_): New data member; adjust
7642 constructor.
7643 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7644 (Incremental_inputs::report_object): Add script_info parameter.
7645 (Incremental_inputs_reader::get_object_count): New function.
7646 (Incremental_inputs_reader::get_object_offset): New function.
7647 * options.cc (Input_arguments::add_file): Return reference to
7648 new input argument.
7649 * options.h (Input_argument::set_script_info): New function.
7650 (Input_argument::script_info): New function.
7651 (Input_argument::script_info_): New data member; adjust all
7652 constructors.
7653 (Input_file_group::add_file): Return reference to new input argument.
7654 (Input_file_lib::add_file): Likewise.
7655 (Input_arguments::add_file): Likewise.
7656 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7657 * script.cc (Parser_closure::Parser_closure): Add script_info
7658 parameter; adjust all callers.
7659 (Parser_closure::script_info): New function.
7660 (Parser_closure::script_info_): New data member.
7661 (read_input_script): Report scripts earlier to incremental info.
7662 (script_add_file): Set script_info in Input_argument.
7663 (script_add_library): Likewise.
7664 * script.h (Script_options::Script_info): Rewrite class.
7665
a869183f 76662011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7667
7668 * archive.cc (Library_base::should_include_member): Move
7669 method here from class Archive.
7670 (Archive::Archive): Initialize base class.
7671 (Archive::should_include_member): Move to base class.
7672 (Archive::do_for_all_unused_symbols): New function.
7673 (Add_archive_symbols::run): Remove redundant access to
7674 incremental_inputs.
7675 (Lib_group::Lib_group): Initialize base class.
7676 (Lib_group::do_filename): New function.
7677 (Lib_group::include_member): Pass pointer to Lib_group to
7678 report_object.
7679 (Lib_group::do_for_all_unused_symbols): New function.
7680 (Add_lib_group_symbols::run): Report archive information for
7681 incremental links.
7682 * archive.h (class Library_base): New base class.
7683 (class Archive): Derive from Library_base.
7684 (Archive::filename): Move to base class.
7685 (Archive::set_incremental_info): Likewise.
7686 (Archive::incremental_info): Likewise.
7687 (Archive::Should_include): Likewise.
7688 (Archive::should_include_member): Likewise.
7689 (Archive::Armap_entry): Remove.
7690 (Archive::Unused_symbol_iterator): Remove.
7691 (Archive::unused_symbols_begin): Remove.
7692 (Archive::unused_symbols_end): Remove.
7693 (Archive::do_filename): New function.
7694 (Archive::do_get_mtime): New function.
7695 (Archive::do_for_all_unused_symbols): New function.
7696 (Archive::task_): Move to base class.
7697 (Archive::incremental_info_): Likewise.
7698 (class Lib_group): Derive from Library_base.
7699 (Lib_group::do_filename): New function.
7700 (Lib_group::do_get_mtime): New function.
7701 (Lib_group::do_for_all_unused_symbols): New function.
7702 (Lib_group::task_): Move to base class.
7703 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7704 function.
7705 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7706 function.
7707 * incremental.cc (Incremental_inputs::report_archive_begin):
7708 Use Library_base; call library's get_mtime; add incremental inputs
7709 entry before members.
7710 (class Unused_symbol_visitor): New class.
7711 (Incremental_inputs::report_archive_end): Use Library_base; use
7712 visitor class to record unused symbols; don't add incremental inputs
7713 entry after members.
7714 (Incremental_inputs::report_object): Use Library_base.
7715 * incremental.h
7716 (Incremental_archive_entry::Incremental_archive_entry): Remove
7717 unused Archive parameter.
7718 (Incremental_inputs::report_archive_begin): Use Library_base.
7719 (Incremental_inputs::report_archive_end): Likewise.
7720 (Incremental_inputs::report_object): Likewise.
7721 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7722 function.
7723 * object.h (Object::for_all_global_symbols): New function.
7724 (Object::do_for_all_global_symbols): New function.
7725 (Sized_relobj::do_for_all_global_symbols): New function.
7726 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7727 function.
7728 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7729 function.
7730
61ab3e40
ILT
77312011-03-27 Ian Lance Taylor <iant@google.com>
7732
7733 * archive.cc (Archive::interpret_header): Return -1 if something
7734 goes wrong. Change callers accordingly.
7735
30e1f9e6
CC
77362011-03-25 Cary Coutant <ccoutant@google.com>
7737
7738 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7739 * testsuite/Makefile.in: Regenerate.
7740
9370ce59 77412011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7742
7743 * plugin.cc (get_view): New.
7744 (Plugin::load): Pass get_view to the plugin.
7745 (Plugin_manager::get_view): New.
7746
9312bb0a
ILT
77472011-03-21 Ian Lance Taylor <iant@google.com>
7748
7749 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7750 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7751
7e12ba9e
ST
77522011-03-21 Sriraman Tallam <tmsriram@google.com>
7753
7754 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7755 Change == to -eq.
7756 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7757 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7758 Change == to -eq.
7759 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7760 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7761
fd7a005d
ILT
77622011-03-14 Ian Lance Taylor <iant@google.com>
7763
7764 * script-sections.cc (Sort_output_sections::script_compare):
7765 Rename from is_before, change return type.
7766 (Sort_output_sections::operator()): Adjust accordingly.
7767
ed16fd1b
ILT
77682011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7769
7770 PR gold/12572
7771 * testsuite/odr_violation2.cc: Add comment to make all error line
7772 numbers double digits.
7773 * testsuite/debug_msg.sh: Adjust expected errors.
7774
71ff8986
ILT
77752011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7776
7777 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7778 but mark earlier ones as non-canonical
7779 (offset_to_iterator): Update search target and example
7780 (do_addr2line): Return extra lines in a vector*
7781 (format_file_lineno): Extract from do_addr2line
7782 (one_addr2line): Add vector* out-param
7783 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7784 when a lineno entry appeared last for its instruction
7785 (Dwarf_line_info): Add vector* out-param
7786 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7787 * symtab.cc (Odr_violation_compare): Include the lineno in the
7788 comparison again.
7789 (linenos_from_loc): New. Combine the canonical line for an
7790 address with its other lines.
7791 (True_if_intersect): New. Helper functor to make
7792 std::set_intersection a query.
7793 (detect_odr_violations): Compare sets of lines instead of just
7794 one line for each function. This became less deterministic, but
7795 has fewer false positives.
7796 * symtab.h: Declarations.
7797 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7798 mix an optimized and non-optimized object in the same binary
7799 (odr_violation2.so): Same.
7800 * testsuite/Makefile.in: Regenerate from Makefile.am.
7801 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7802 * testsuite/debug_msg.sh: Update line numbers and add
7803 assertions.
7804 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7805 non-optimized context.
7806 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7807 isn't inlined, and use OdrDerived in an optimized context.
7808 * testsuite/odr_header1.h: Defines OdrDerived, where
7809 optimization will change the
7810 first-instruction-in-the-destructor's file and line number.
7811 * testsuite/odr_header2.h: Defines OdrBase.
7812
a19fefdc
ILT
78132011-03-09 Ian Lance Taylor <iant@google.com>
7814
7815 * fileread.cc (File_read::clear_views): Don't delete the whole
7816 file view.
7817
ecb351e9
ILT
78182011-03-08 Ian Lance Taylor <iant@google.com>
7819
7820 PR gold/12525
7821 * fileread.cc: #include <climits>.
7822 (GOLD_IOV_MAX): Define.
7823 (File_read::read_multiple): Limit number of entries by iov_max.
7824 * fileread.h (class File_read): Always set max_readv_entries to
7825 128.
7826
b821d13c
ILT
78272011-03-07 Ian Lance Taylor <iant@google.com>
7828
7829 PR gold/12525
7830 * options.h (class General_options): Add -dy and -dn.
7831
89243142
CC
78322011-03-02 Cary Coutant <ccoutant@google.com>
7833
7834 * testsuite/script_test_9.t: Add TLS segment.
7835
d0773f31
ILT
78362011-03-02 Simon Baldwin <simonb@google.com>
7837
7838 * configure.ac: Add check for gnu_indirect_function support in
7839 the toolchain building binutils.
7840 * configure: Rebuild.
7841
9370ce59 78422011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7843
7844 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7845 plugin only symbols.
7846 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7847 in plugin files as not needed in the symbol table.
7848
4cf7a849
ST
78492011-02-11 Sriraman Tallam <tmsriram@google.com>
7850
7851 * output.cc (Output_section::add_input_section): Delay fill
7852 generation for section ordering.
7853
b578bd7d
ILT
78542011-02-09 Ian Lance Taylor <iant@google.com>
7855
7856 PR gold/12316
7857 * object.h (class Sized_relobj): Remove clear_local_symbols.
7858 * reloc.cc (Sized_relobj::do_relocate): Don't call
7859 clear_local_symbols.
7860
9370ce59 78612011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7862
7863 * plugin.cc (is_visible_from_outside): Return true for symbols
7864 in the -u option.
7865
55382fb7
ILT
78662011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7867
7868 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7869 filename.
7870
4e271fff
ST
78712011-02-02 Sriraman Tallam <tmsriram@google.com>
7872
7873 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7874 to std::string.
4e271fff 7875 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7876 section_name to be std::string.
4e271fff
ST
7877 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7878
d433c3ac
ILT
78792011-01-25 Ian Lance Taylor <iant@google.com>
7880
7881 * script.cc (script_add_extern): Rewrite to use
7882 add_symbol_reference.
7883
880473a6
DK
78842011-01-25 Doug Kwan <dougkwan@google.com>
7885
d433c3ac 7886 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7887
f30f86fa
ILT
78882011-01-24 Ian Lance Taylor <iant@google.com>
7889
7890 * options.h (class General_options): Accept
7891 --no-detect-odr-violations.
7892
8e51a0b9
ILT
78932011-01-24 Ian Lance Taylor <iant@google.com>
7894
7895 * version.cc (version_string): Bump to 1.11.
7896
0f3b89d8
ILT
78972011-01-24 Ian Lance Taylor <iant@google.com>
7898
7899 * plugin.cc (class Plugin_rescan): Define new class.
7900 (Plugin_manager::claim_file): Set any_claimed_.
7901 (Plugin_manager::save_archive): New function.
7902 (Plugin_manager::save_input_group): New function.
7903 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7904 necessary.
7905 (Plugin_manager::new_undefined_symbol): New function.
7906 (Plugin_manager::rescan): New function.
7907 (Plugin_manager::rescannable_defines): New function.
7908 (Plugin_manager::add_input_file): Set any_added_.
7909 * plugin.h (class Plugin_manager): define new fields rescannable_,
7910 undefined_symbols_, any_claimed_, and any_added_. Declare
7911 Plugin_rescan as friend. Declare new functions.
7912 (Plugin_manager::Rescannable): Define type.
7913 (Plugin_manager::Rescannable_list): Define type.
7914 (Plugin_manager::Undefined_symbol_list): Define type.
7915 (Plugin_manager::Plugin_manager): Initialize new fields.
7916 * archive.cc (Archive::defines_symbol): New function.
7917 (Add_archive_symbols::run): Pass archive to plugins if any.
7918 * archive.h (class Archive): Declare defines_symbol.
7919 * readsyms.cc (Input_group::~Input_group): New function.
7920 (Finish_group::run): Pass input_group to plugins if any.
7921 * readsyms.h (class Input_group): Declare destructor.
7922 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7923 any.
7924
3bb951e5
ILT
79252011-01-10 Ian Lance Taylor <iant@google.com>
7926
7927 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7928 section as relro.
7929 (Layout::set_segment_offsets): Reset increase_relro before calling
7930 set_section_addresses a second time.
7931
0aa45fac
CC
79322011-01-04 Cary Coutant <ccoutant@google.com>
7933
7934 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7935 sections before NOBITS sections.
7936
0db46eb4
L
79372011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7938
7939 * version.cc (print_version): Update copyright to 2011.
7940
829c9745
CC
79412010-12-23 Cary Coutant <ccoutant@google.com>
7942
7943 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7944 of OS to this->add. Add OD parameter to second form of the function.
7945
7500420b
ILT
79462010-12-20 Ian Lance Taylor <iant@google.com>
7947
7948 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7949 second of two consecutive entries with same offset.
7950
f8e9a930
RW
79512010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7952
7953 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7954 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7955 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7956 to avoid unneeded links against $(LDADD).
7957 * testsuite/Makefile.in: Regenerate.
7958
2fbb4320
ILT
79592010-12-15 Ian Lance Taylor <iant@google.com>
7960
7961 PR gold/12324
7962 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7963 for R_X86_64_32 and R_X86_64_PC32.
7964 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7965 ver_matching_def_pic.o.
7966 (ver_matching_def_pic.o): New target.
7967
fedb228d
RW
79682010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7969
7970 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7971 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7972 Move definition before File_read::View member definitions.
7973 (File_read::View::~View): Initialize and hold lock before
7974 updating current_mapped_bytes.
7975
9b547ce6
RW
79762010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7977
7978 * dwarf_reader.cc: Remove outdated comment.
7979 * gold-threads.cc: Fix typo in error message.
7980 * archive.cc: Fix typos in comments.
7981 * archive.h: Likewise.
7982 * arm-reloc-property.cc: Likewise.
7983 * arm-reloc-property.h: Likewise.
7984 * arm-reloc.def: Likewise.
7985 * arm.cc: Likewise.
7986 * attributes.h: Likewise.
7987 * cref.cc: Likewise.
7988 * ehframe.cc: Likewise.
7989 * fileread.h: Likewise.
7990 * gold.h: Likewise.
7991 * i386.cc: Likewise.
7992 * icf.cc: Likewise.
7993 * incremental.h: Likewise.
7994 * int_encoding.cc: Likewise.
7995 * layout.h: Likewise.
7996 * main.cc: Likewise.
7997 * merge.h: Likewise.
7998 * object.cc: Likewise.
7999 * object.h: Likewise.
8000 * options.cc: Likewise.
8001 * readsyms.cc: Likewise.
8002 * reduced_debug_output.cc: Likewise.
8003 * reloc.cc: Likewise.
8004 * script-sections.cc: Likewise.
8005 * sparc.cc: Likewise.
8006 * symtab.h: Likewise.
8007 * target-reloc.h: Likewise.
8008 * target.cc: Likewise.
8009 * target.h: Likewise.
8010 * timer.cc: Likewise.
8011 * timer.h: Likewise.
8012 * x86_64.cc: Likewise.
8013
83e17bd5
CC
80142010-12-09 Cary Coutant <ccoutant@google.com>
8015
8016 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8017 stack.
8018 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8019 parameter; change all callers.
8020 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8021 * options.h (warn_execstack): New option.
8022
017257f8
DK
80232010-12-07 Doug Kwan <dougkwan@google.com>
8024
8025 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8026 like function call relocations.
8027
c20cbc06
ILT
80282010-12-07 Ian Lance Taylor <iant@google.com>
8029
8030 * archive.cc (Archive::get_elf_object_for_member): Permit
8031 punconfigured to be NULL.
8032 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8033 (Archive::include_member): Pass NULL to get_elf_object_for_member
8034 if we searched for the archive and this is the first included
8035 object.
8036
4dbfafcc
ILT
80372010-12-01 Ian Lance Taylor <iant@google.com>
8038
8039 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8040 track_relocs_type_ field.
8041 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8042 Set track_relocs_type_.
8043 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8044 contents when using RELA relocs.
8045 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8046 reloc_map_.
8047 * reloc.cc (Track_relocs::next_addend): New function.
8048 * reloc.h (class Track_relocs): Declare next_addend.
8049
e5e19edd
ILT
80502010-12-01 Ian Lance Taylor <iant@google.com>
8051
8052 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8053 virtual destructor.
8054
9a5ce24c
ILT
80552010-12-01 Ian Lance Taylor <iant@google.com>
8056
8057 * README: Update compilers known to work and fail.
8058
c7791212
NC
80592010-11-23 Matthias Klose <doko@ubuntu.com>
8060
8061 * configure.in: For --enable-gold, handle value `default' instead of
8062 `both*'. Always install ld as ld.bfd, install as ld if gold is
8063 not the default.
8064 * configure: Regenerate.
8065
0ad220c9
DK
80662010-11-18 Doug Kwan <dougkwan@google.com>
8067
8068 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8069 and right_alignment to be zero. Store result alignment only if it is
8070 greater than existing alignment.
8071
ab8056e0
CC
80722010-11-16 Cary Coutant <ccoutant@google.com>
8073
8074 PR gold/12220
8075 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8076 Check for ".zdebug_line".
8077
fd064a5b
CC
80782010-11-16 Doug Kwan <dougkwan@google.com>
8079 Cary Coutant <ccoutant@google.com>
8080
8081 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8082 by reference; adjust all callers.
8083 * output.cc (Output_segment::set_section_addresses): Adjust references
8084 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8085 list is empty.
8086 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8087 end at page boundary.
8088
6fc6ea19
CC
80892010-11-16 Cary Coutant <ccoutant@google.com>
8090
8091 PR gold/12220
8092 * layout.cc (Layout::choose_output_section): Transform names of
8093 compressed sections even when using a script with a SECTIONS clause.
8094 (Layout::output_section_name): Remove code to transform
8095 compressed debug section names.
8096 * output.cc (Output_section::add_input_section): Use uncompressed
8097 section size when tracking input sections.
8098
95a2c8d6
RS
80992010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8100
8101 * symtab.h (Symbol::NON_PIC_REF): Remove.
8102 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8103 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8104 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8105 (Symbol::use_plt_offset): Take a flags argument and pass it
8106 directly to needs_dynamic_reloc. Restrict check for undefined
8107 weak symbols to function calls.
8108 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8109 (Target_arm::Scan::global): Use it.
8110 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8111 (Target_arm::Relocate::relocate): Likewise.
8112 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8113 parameter with an r_type parameter. Use get_reference_flags
8114 to get the flags.
8115 (Target_arm::Relocate::relocate): Update accordingly.
8116 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8117 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8118 (Target_i386::Scan::global): Likewise.
8119 (Target_i386::Relocate::relocate): Likewise.
8120 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8121 parameter with an r_type parameter. Use get_reference_flags
8122 to get the flags.
8123 (Target_i386::Relocate::relocate): Update accordingly.
8124 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8125 (Target_powerpc::Scan::global): Use it.
8126 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8127 (Target_powerpc::Relocate::relocate): Likewise.
8128 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8129 (Target_sparc::Scan::global): Use it.
8130 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8131 (Target_sparc::Relocate::relocate): Likewise.
8132 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8133 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8134 (Target_x86_64::Scan::global): Likewise.
8135 (Target_x86_64::Relocate::relocate): Likewise.
8136
f625ae50
DK
81372010-11-08 Doug Kwan <dougkwan@google.com>
8138 Cary Coutant <ccoutant@google.com>
8139
8140 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8141 (Arm_exidx_merge_section::section_contents_): New data member.
8142 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8143 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8144 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8145 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8146 in parameters instead of calling Object::section_contents without
8147 locking.
8148 (Arm_output_section::group_section): New parameter TASK. Pass it
8149 to callees that need locking objects.
8150 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8151 to lock EXIDX input sections. Fix a formatting issue. Call
8152 Arm_exidx_merged_section::build_contents to create merged section
8153 contents.
8154 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8155 to lock object of stub table owner.
8156 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8157 TEXT_SIZE to initialize data member TEXT_SIZE_.
8158 (Arm_exidx_input_section::addralign): Fix typo in comment.
8159 (Arm_exidx_input_section::text_size): New method.
8160 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8161 that require locking objects. Lock objects before scanning for stubs
8162 and updating local symbols.
8163 (Arm_input_section<big_endian>::init): Copy contents of original
8164 input section.
2e702c99 8165 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8166 original input section instead of calling Object::section_contents
8167 without locking.
8168 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8169 size without calling Object::section_size().
8170 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8171 for size. Allocate a buffer for merged EXIDX entries.
8172 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8173 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8174 building code to Arm_exidx_merged_section::build_contetns. Write
8175 out contetns in buffer instead of building it on the fly.
8176 (Arm_relobj::make_exidx_input_section): Also pass text section size
8177 to Arm_exidx_input_section constructor.
8178 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8179 (Arm_dynobj::do_read_symbols): Fix memory leak.
8180 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8181 * target.h: (class Task): Add forward declaration.
8182 (Target::relax): Add new parameter TASK and pass it to
8183 Target::do_relax().
8184 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8185
5f9bcf58
CC
81862010-11-05 Cary Coutant <ccoutant@google.com>
8187
8188 PR gold/10708
8189 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8190 object when reading from the file.
8191 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8192 second layout pass.
8193 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8194 when reading section contents.
8195 (get_section_contents): Likewise.
8196 (icf::find_identical_sections): Likewise.
8197 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8198 object when reading from the file.
8199 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8200 the object when doing deferred section layout.
8201
e597fa08
NC
82022010-11-03 Nick Clifton <nickc@redhat.com>
8203
8204 PR gold/12001
8205 * script.h (class Symbol_assignment: name): New member. Returns
8206 the name of the symbol.
8207 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8208 Returns true if the given symbol name is on the list of
8209 assignments wating to be processed.
8210 * archive.cc (should_incldue_member): If the symbol is undefined,
8211 check to see if it is on the list of symbols pending assignment.
8212
3f9a3278
ILT
82132010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8214
8215 * script-sections.cc (Script_sections::find_memory_region): Check
8216 for a NULL output section pointer.
8217
d06fb4d1
DK
82182010-10-29 Doug Kwan <dougkwan@google.com>
8219
8220 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8221 Output_section::add_relaxed_input_section.
8222 * output.cc (Output_section::add_relaxed_input_section): Add new
8223 arguments LAYOUT and NAME. Set section order index.
8224 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8225 Copy section order index.
8226 * output.h (Output_section::add_relaxed_input_section): Add new
8227 arguments LAYOUT and NAME.
8228
90e24de5
ILT
82292010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8230
8231 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8232 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8233 * testsuite/Makefile.in: Regenerate.
8234
c9484ea5
DK
82352010-10-20 Doug Kwan <dougkwan@google.com>
8236
8237 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8238 without SHF_LINK_ORDER flags.
8239 * layout.cc (Layout::choose_output_section): Do not filter
8240 SHF_LINK_ORDER flag in a relocatable link.
8241
5bc2f5be
CC
82422010-10-17 Cary Coutant <ccoutant@google.com>
8243
8244 * output.h (Output_segment::set_section_addresses): Change function
8245 signature. Update all callers.
8246 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8247 sections.
8248 (Output_segment::set_section_addresses): Align after last TLS
8249 section. Add padding before last relro section instead of after.
8250
0c91cf04
DK
82512010-10-17 Doug Kwan <dougkwan@google.com>
8252
8253 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8254 GOT output section to be writable.
8255
8c21d9d3
CC
82562010-10-14 Cary Coutant <ccoutant@google.com>
8257
8258 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8259 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8260 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8261 mode.
8262 * incremental.cc (report_command_line): Ignore all forms of
8263 --incremental.
8264 * layout.cc (Layout::Layout): Check parameters for incremental link
8265 mode.
8266 * options.cc (General_options::parse_incremental): New function.
8267 (General_options::parse_no_incremental): New function.
8268 (General_options::parse_incremental_full): New function.
8269 (General_options::parse_incremental_update): New function.
8270 (General_options::incremental_mode_): New data member.
8271 (General_options::finalize): Check incremental_mode_.
8272 * options.h (General_options): Update help text for --incremental.
8273 Add --no-incremental, --incremental-full, --incremental-update.
8274 (General_options::Incremental_mode): New enum type.
8275 (General_options::incremental_mode): New function.
8276 (General_options::incremental_mode_): New data member.
8277 * parameters.cc (Parameters::incremental_mode_): New data member.
8278 (Parameters::set_options): Set incremental_mode_.
8279 (Parameters::set_incremental_full): New function.
8280 (Parameters::incremental): New function.
8281 (Parameters::incremental_update): New function.
8282 (set_parameters_incremental_full): New function.
8283 * parameters.h (Parameters::set_incremental_full): New function.
8284 (Parameters::incremental): New function.
8285 (Parameters::incremental_update): New function.
8286 (Parameters::incremental_mode_): New data member.
8287 (set_parameters_incremental_full): New function.
8288 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8289 incremental link mode.
8290 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8291 (Sized_relobj::do_relocate_sections): Likewise.
8292 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8293 option.
8294 * testsuite/Makefile.in: Regenerate.
8295 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8296
bb32aa18 82972010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8298
8299 * script-sections.h (class Script_sections): Make
8300 Sections_elements typedef public.
8301 * script-sections.cc (class Sort_output_sections): Add elements_
8302 field. Add constructor which sets it; change all callers.
8303 (Sort_output_sections::is_before): New function.
8304 (Sort_output_sections::operator()): Call is_before.
8305 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8306 conditional.
8307 * testsuite/script_test_10.sh: New test. Test script section
8308 order.
8309 * testsuite/script_test_10.t: Likewise.
8310 * testsuite/script_test_10.s: Likewise.
8311 * testsuite/Makefile.am: Wrap the cross linker tests and the
8312 common tests into NATIVE_OR_CROSS_LINKER.
8313 (check_SCRIPTS): Add script_test_10.sh.
8314 (check_DATA): Add script_test_10.stdout.
8315 (script_test_10.o, script_test_10): New targets.
8316 (script_test_10.stdout): New target.
8317 * configure, testsuite/Makefile.in: Regenerate.
8318
3cef7179
ILT
83192010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8320
8321 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8322 error for the deprecated relocations.
8323 (Target_arm::Scan::global): Likewise.
8324 (Target_arm::Relocate::relocate): Likewise.
8325
7411e9a8
RS
83262010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8327
8328 * fileread.cc (Input_file::find_file): Initialize *found_name
8329 and *namep when using the fallback search for case 4.
8330
6a9da32a
CC
83312010-10-11 Cary Coutant <ccoutant@google.com>
8332
8333 * options.h (class General_options): Redefine -z lazy as an alias for
8334 the negation of -z now.
8335
ac897c20
ILT
83362010-10-11 Ian Lance Taylor <iant@google.com>
8337
8338 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8339 binding.
8340
ea5cae92
NC
83412010-10-06 Nick Clifton <nickc@redhat.com>
8342
8343 * script-sections.cc(class Memory_region): Remove
8344 current_lma_offset_ field. Rename current_vma_offset_ to
8345 current_offset_. Add last_section_ field.
8346 (Memory_region::get_current_vma_address): Rename to
8347 get_current_address.
8348 (Memory_region::get_current_lma_address): Delete.
8349 (Memory_region::increment_vma_offset): Rename to
8350 increment_offset.
8351 (Memory_region::increment_lma_offset): Delete.
8352 (Memory_region::attributes_compatible): New method. Returns
8353 true if the provided section is compatible with the region.
8354 (Memory_region::get_last_section): New method. Returns the last
8355 section to use the region.
8356 (Memory_region::set_last_section): New method. Stores the last
8357 section to use the region.
8358 (Script_sections::block_in_region): New method. Returns true if
8359 a block of memory is contained within a region.
8360 (Script_sections::find_memory_region): New method. Locates a
8361 memory region to be used to set a VMA or LMA address.
8362 (Output_section_definition::set_section_addresses): Add code to
8363 check for addresses set by memory regions.
8364 (Output_segment::set_section_addresses): Remove memory region
8365 walking code.
8366 (Script_sections::create_segment): Add a warning if a header
8367 segment is created outside of any region.
8368 * script-sections.h (class Script_sections): Add prototypes for
8369 find_memory_region and block_in_region methods.
8370 * testsuite/memory_test.s: Use .long instead of .word.
8371 * testsuite/memory_test.t: Add some more output sections.
8372 * testsuite/memory_test.sh: Update expected output.
8373
a9bfd952
DK
83742010-10-02 Doug Kwan <dougkwan@google.com>
8375
8376 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8377 defintion to symtab.h
8378 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8379 declaration to defintion.
8380
bacff3ab
NC
83812010-10-01 Nick Clifton <nickc@redhat.com>
8382
8383 * expression.cc (eval): Replace dummy argument with NULL.
8384 (eval_maybe_dot): Check for a NULL result section pointer.
8385 (Symbol_expression::value): Likewise.
8386 (Dot_expression::value): Likewise.
8387 (BINARY_EXPRESSION): Likewise.
8388 (Max_expression::value): Likewise.
8389 (Min_expression::value): Likewise.
8390 (Absolute_expression::value): Likewise.
8391 (Addr_expression::value_from_output_section): Likewise.
8392 (Loaddddr_expression::value_from_output_section): Likewise.
8393 (Segment_start_expression::value): Likewise.
8394 * script-sections.cc
8395 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8396 argument with NULL.
8397 (Sections_elememt_dot_assignment::set_section_addresses):
8398 Likewise.
8399 (Output_data_expression::do_write_to_buffer): Likewise.
8400 (Output_section_definition::finalize_symbols): Likewise.
8401 (Output_section_definition::set_section_addresses): Likewise.
8402
f81bc8b5
DK
84032010-09-30 Doug Kwan <dougkwan@google.com>
8404
8405 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8406
c95e9f27
ST
84072010-09-28 Sriraman Tallam <tmsriram@google.com>
8408
8409 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8410 function.
c95e9f27
ST
8411 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8412 virtual function.
8413 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8414 virtual function.
8415 * icf.cc (get_section_contents): Inline merge sections only when
8416 target allows it.
8417
3cac54d2
RW
84182010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8419
8420 * configure: Regenerate.
8421
2904037a
ILT
84222010-09-17 Ian Lance Taylor <iant@google.com>
8423
8424 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8425 * testsuite/Makefile.am (memory_test.o): New target.
8426 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8427 memory_test.t.
8428 * testsuite/Makefile.in: Rebuild.
2904037a 8429
bca7fb63
DK
84302010-09-17 Doug Kwan <dougkwan@google.com>
8431
8432 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8433 defintion if relocation uses GOT entries of the symbol.
8434 * testsuite/icf_safe_test.sh: Fix test.
8435 * testsuite/icf_safe_so_test.sh: Fix test.
8436
4ef28648
CC
84372010-09-16 Cary Coutant <ccoutant@google.com>
8438
8439 * script_sections.cc (class Memory_region): Remove "NULL" from
8440 vector initializations.
8441
793990de
CC
84422010-09-15 Cary Coutant <ccoutant@google.com>
8443
8444 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8445 Resolve forwarding symbols.
8446
81e015e2
DK
84472010-09-15 Doug Kwan <dougkwan@google.com>
8448
8449 * gold/testsuite/script_test_3.t: Add ARM special sections.
8450 * gold/testsuite/script_test_4.t: Same.
8451 * gold/testsuite/script_test_5.t: Same.
8452 * gold/testsuite/script_test_6.t: Same.
8453 * gold/testsuite/script_test_7.t: Same.
8454 * gold/testsuite/script_test_7.t: Same.
8455 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8456
36171d64
CC
84572010-09-14 Cary Coutant <ccoutant@google.com>
8458
8459 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8460 (Target_x86_64::Relocate::relocate_tls): Replace check for
8461 saw_tls_block_reloc_ with test for executable section.
8462
d89051bd
CC
84632010-09-12 Cary Coutant <ccoutant@google.com>
8464
8465 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8466 position-independent executables to shared libraries need dynamic
8467 relocations.
8468 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8469 position-independent executables.
8470 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8471 * testsuite/Makefile.in: Regenerate.
8472
fca41f0f
NC
84732010-09-10 Nick Clifton <nickc@redhat.com>
8474
8475 PR gold/11997
8476 * testsuite/memory_test.t: Discard any sections that are not
8477 needed.
8478
6695e4b3
L
84792010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8480
8481 PR gold/11996
8482 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8483 "This::" to work around a bug in gcc 4.2.
8484
8485 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8486
0f72bf6f
RÁE
84872010-09-09 Rafael Espindola <espindola@google.com>
8488
8489 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8490 sections with different PF_X flags in the same segment.
8491 (Layout::find_first_load_seg): Search all segments to find the first
8492 one.
8493 * options.h (rosegment): New.
8494
84952010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8496
05a79166 8497 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8498
aa98ff75
DK
84992010-09-08 Doug Kwan <dougkwan@google.com>
8500
8501 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8502 (Arm_relobj::do_relocate_sections): Add new parameter for output
8503 file to match the parent.
8504 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8505 of local symbols instead of input values. Update code to track
8506 changes in gold::relocate_section.
8507 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8508 (Sized_relobj::compute_final_local_value_internal): New methods.
8509 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8510 body into private version of Sized_relobj::compute_final_local_value.
8511 Call the inline method.
8512 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8513 merged symbol value if there is one.
8514 (Symbol_value::has_output_value): New method defintiion.
8515 (Sized_relobj::Compute_final_local_value_status): New enum type.
8516 (Sized_relobj::compute_final_local_value): New methods.
8517 (Sized_relobj::compute_final_local_value_internal): New methods.
8518 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8519 and arm_cortex_a8.sh.
8520 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8521 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8522 New tests.
8523 * Makefile.in: Regenerate.
8524 * testsuite/arm_bl_out_of_range.s: Update test.
8525 * testsuite/thumb_bl_out_of_range.s: Ditto.
8526 * testsuite/thumb_blx_out_of_range.s: Ditto.
8527 * testsuite/arm_branch_out_of_range.sh: New file.
8528 * testsuite/arm_cortex_a8.sh: Ditto.
8529 * testsuite/arm_cortex_a8_b.s: Ditto.
8530 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8531 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8532 * testsuite/arm_cortex_a8_bl.s: Ditto.
8533 * testsuite/arm_cortex_a8_blx.s: Ditto.
8534 * testsuite/arm_cortex_a8_local.s: Ditto.
8535 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8536 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8537
05a79166
L
85382010-09-08 Rafael Espindola <espindola@google.com>
8539
8540 * Makefile.am (memory_test.stdout): Run readelf with -W.
8541 * Makefile.in: Regenerate.
8542 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8543 64 bit output.
8544
33dbc701
RÁE
85452010-09-08 Rafael Espindola <espindola@google.com>
8546
8547 * script-sections.cc (Script_sections::add_memory_region): Convert
8548 field precision to int.
8549 * script.cc (script_set_section_region, script_set_section_region):
8550 Convert field precision to int.
8551
731ca54a
RÁE
85522010-09-08 Rafael Espindola <espindola@google.com>
8553
8554 * arm.cc (do_finalize_sections): Create the __exidx_start and
8555 __exdix_end symbols even when the section is missing.
8556
7f8cd844
NC
85572010-09-08 Nick Clifton <nickc@redhat.com>
8558
8559 * README: Remove claim that MEMORY is not supported.
8560 * expression.cc (script_exp_function_origin)
8561 (script_exp_function_length): Move from here to ...
8562 * script.cc: ... here.
8563 (script_set_section_region, script_add_memory)
8564 (script_parse_memory_attr, script_include_directive): New
8565 functions.
8566 * script-sections.cc
8567 (class Memory_region): New class.
8568 (class Output_section_definition): Add set_memory_region,
8569 set_section_vma, set_section_lma and get_section_name methods.
8570 (class Script_Sections): Add add_memory_region,
8571 find_memory_region, find_memory_region_origin,
8572 find_memory_region_length and set_memory_region methods.
8573 Have set_section_addresses method walk the list of set memory
8574 regions.
8575 Extend the print methos to display memory regions.
8576 * script-sections.h: Add prototypes for new methods.
8577 Add enum for MEMORY region attributes.
8578 * yyscript.y: Add support for parsing MEMORY regions.
8579 * script-c.h: Add prototypes for new functions.
8580 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8581 * testsuite/Makefile.in: Regenerate.
8582 * testsuite/memory_test.sh: New script.
8583 * testsuite/memory_test.s: New assembler source file.
8584 * testsuite/memory_test.t: New linker script.
8585
a4649286
DK
85862010-08-27 Doug Kwan <dougkwan@google.com>
8587
8588 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8589 reference override an existing dynamic weak reference.
8590 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8591 * testsuite/Makefile.in: Regenerate.
8592 * testsuite/dyn_weak_ref.sh: New file.
8593 * testsuite/dyn_weak_ref_1.c: Ditto.
8594 * testsuite/dyn_weak_ref_2.c: Ditto.
8595
b56648ad
ILT
85962010-08-27 Ian Lance Taylor <iant@google.com>
8597
8598 * incremental.h (class Incremental_input_entry): Add virtual
8599 destructor.
8600
809313cb
ILT
86012010-08-27 Ian Lance Taylor <iant@google.com>
8602
8603 * testsuite/start_lib_test_3.c: Mark t3 as used.
8604
11e32464
NC
86052010-08-27 Nick Clifton <nickc@redhat.com>
8606
8607 * options.cc (version_script): Fix small typo in previous
8608 whitespace tidyup.
8609
ca09d69a
NC
86102010-08-25 Nick Clifton <nickc@redhat.com>
8611
8612 * archive.cc: Formatting fixes: Remove whitespace between
8613 typename and following asterisk. Remove whitespace between
8614 function name and opening parenthesis.
8615 * archive.h: Likewise.
8616 * arm.cc: Likewise.
8617 * attributes.cc: Likewise.
8618 * attributes.h: Likewise.
8619 * common.cc: Likewise.
8620 * copy-relocs.cc: Likewise.
8621 * dirsearch.h: Likewise.
8622 * dynobj.cc: Likewise.
8623 * ehframe.cc: Likewise.
8624 * ehframe.h: Likewise.
8625 * expression.cc: Likewise.
8626 * fileread.cc: Likewise.
8627 * fileread.h: Likewise.
8628 * gc.h: Likewise.
8629 * gold-threads.cc: Likewise.
8630 * gold.cc: Likewise.
8631 * i386.cc: Likewise.
8632 * icf.h: Likewise.
8633 * incremental-dump.cc: Likewise.
8634 * incremental.cc: Likewise.
8635 * layout.cc: Likewise.
8636 * layout.h: Likewise.
8637 * main.cc: Likewise.
8638 * merge.cc: Likewise.
8639 * merge.h: Likewise.
8640 * object.cc: Likewise.
8641 * object.h: Likewise.
8642 * options.cc: Likewise.
8643 * options.h: Likewise.
8644 * output.cc: Likewise.
8645 * output.h: Likewise.
8646 * plugin.cc: Likewise.
8647 * plugin.h: Likewise.
8648 * powerpc.cc: Likewise.
8649 * reloc.cc: Likewise.
8650 * script-c.h: Likewise.
8651 * script-sections.cc: Likewise.
8652 * script.cc: Likewise.
8653 * stringpool.cc: Likewise.
8654 * symtab.cc: Likewise.
8655 * symtab.h: Likewise.
8656 * target.cc: Likewise.
8657 * timer.cc: Likewise.
8658 * timer.h: Likewise.
8659 * version.cc: Likewise.
8660 * x86_64.cc: Likewise.
8661
b8fa8750
NC
86622010-08-24 Nick Clifton <nickc@redhat.com>
8663
8664 PR 11899
8665 * layout.cc (segment_precedes): Sort segments by their physical
8666 addresses, if they have been set.
8667
9919d93b
CC
86682010-08-23 Cary Coutant <ccoutant@google.com>
8669
8670 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8671 symbols data.
8672 (Lib_group::include_member): Unlock object after deleting its
8673 symbols data.
8674 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8675 the bug fixed here.
8676
97b4be1c
CC
86772010-08-19 Neil Vachharajani <nvachhar@google.com>
8678 Cary Coutant <ccoutant@google.com>
8679
8680 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8681 constructor, and set_blocker.
8682 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8683 readsyms_blocker_.
8684 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8685 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8686 * testsuite/Makefile.am (start_lib_test): New test case.
8687 * testsuite/Makefile.in: Regenerate.
8688 * testsuite/start_lib_test_main.c: New file.
8689 * testsuite/start_lib_test_1.c: New file.
8690 * testsuite/start_lib_test_2.c: New file.
8691 * testsuite/start_lib_test_3.c: New file.
8692
dd0b1884
ILT
86932010-08-19 Ian Lance Taylor <iant@google.com>
8694
8695 * Makefile.in: Rebuild with automake 1.11.1.
8696 * aclocal.m4: Likewise.
8697 * testsuite/Makefile.in: Likewise.
8698
7223e9ca
ILT
86992010-08-19 Ian Lance Taylor <iant@google.com>
8700
8701 PR 10893
8702 * i386.cc (class Output_data_plt_i386): Update declarations.
8703 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8704 local_ifuncs_ fields.
8705 (Target_i386::do_plt_section_for_global): New function.
8706 (Target_i386::do_plt_section_for_local): New function.
8707 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8708 parameter; change all callers. Initialize global_ifuncs_ and
8709 local_ifuncs_. If doing a static link define __rel_iplt_start and
8710 __rel_iplt_end.
8711 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8712 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8713 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8714 symbols.
8715 (Target_i386::make_plt_section): New function, broken out of
8716 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8717 (Target_i386::make_plt_entry): Call make_plt_section.
8718 (Target_i386::make_local_ifunc_plt_entry): New function.
8719 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8720 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8721 R_386_IRELATIVE to switch.
8722 (Target_i386::Scan::global): Likewise.
8723 (Target_i386::Relocate::relocate): Likewise.
8724 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8725 switch.
8726 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8727 (Target_x86_64::do_plt_section_for_global): New function.
8728 (Target_x86_64::do_plt_section_for_local): New function.
8729 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8730 parameter; change all callers. If doing a static link define
8731 __rela_iplt_start and __rela_iplt_end.
8732 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8733 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8734 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8735 to point to .plt.
8736 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8737 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8738 switch.
8739 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8740 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8741 R_X86_64_IRELATIVE to switch.
8742 (Target_x86_64::Scan::global): Likewise.
8743 (Target_x86_64::Relocate::relocate): Likewise.
8744 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8745 switch.
8746 * target.h (class Target): Add plt_section_for_global and
8747 plt_section_for_local functions. Add do_plt_section_for_global
8748 and do_plt_section_for_local virtual functions.
8749 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8750 clarifying comments.
8751 (Symbol::use_plt_offset): Handle IFUNC symbol.
8752 * object.cc (Sized_relobj::Sized_relobj): Initialize
8753 local_plt_offsets_.
8754 (Sized_relobj::local_has_plt_offset): New function.
8755 (Sized_relobj::local_plt_offset): New function.
8756 (Sized_relobj::set_local_plt_offset): New function.
8757 (Sized_relobj::do_count): Handle IFUNC symbol.
8758 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8759 a bit away from input_shndx_ field. Add set_is_func_symbol and
8760 is_ifunc_symbol functions.
8761 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8762 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8763 local_plt_offsets_ field.
8764 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8765 * output.h (class Output_section_data): Add non-const
8766 output_section function.
8767 (class Output_data_got): Update declarations.
8768 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8769 Add use_plt_offset parameter to global and local constructors.
8770 Change all callers. Change local_sym_index_ field to 31 bits.
8771 Change GSYM_CODE and CONSTANT_CODE accordingly.
8772 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8773 doing a static link don't set sh_link field.
8774 (Output_data_got::Got_entry::write): Use PLT offset if
8775 appropriate.
8776 (Output_data_got::add_global_plt): New function.
8777 (Output_data_got::add_local_plt): New function.
8778 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8779 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8780 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8781 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8782 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8783 IFUNC conditional.
8784 * testsuite/ifunc-sel.h: New file.
8785 * testsuite/ifuncmain1.c: New file.
8786 * testsuite/ifuncmain1vis.c: New file.
8787 * testsuite/ifuncmod1.c: New file.
8788 * testsuite/ifuncdep2.c: New file.
8789 * testsuite/ifuncmain2.c: New file.
8790 * testsuite/ifuncmain3.c: New file.
8791 * testsuite/ifuncmod3.c: New file.
8792 * testsuite/ifuncmain4.c: New file.
8793 * testsuite/ifuncmain5.c: New file.
8794 * testsuite/ifuncmod5.c: New file.
8795 * testsuite/ifuncmain6pie.c: New file.
8796 * testsuite/ifuncmod6.c: New file.
8797 * testsuite/ifuncmain7.c: New file.
8798 * configure, testsuite/Makefile.in: Rebuild.
8799
56f75c03
ILT
88002010-08-18 Ian Lance Taylor <iant@google.com>
8801
8802 * incremental.cc
8803 (Output_section_incremental_inputs::write_input_files): Add cast
8804 to avoid signed/unsigned comparison warning.
8805 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8806
55455f89
CC
88072010-08-12 Cary Coutant <ccoutant@google.com>
8808
8809 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8810
e2054bcb
ILT
88112010-08-13 Ian Lance Taylor <iant@google.com>
8812
8813 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8814
74f67560
DK
88152010-08-12 Cary Coutant <ccoutant@google.com>
8816 Doug Kwan <dougkwan@google.com>
8817
8818 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8819 defintion overrides non-weak undef, remember that the original undef
8820 is not weak.
8821 * symtab.cc (Symbol_table::sized_write_global): For undef without
8822 an original weak binding, set binding to global in output.
8823 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8824 * testsuite/Makefile.in: Regenerate.
8825 * testsuite/strong_ref_weak_def.sh: New file.
8826 * testsuite/strong_ref_weak_def_1.c: Ditto.
8827 * testsuite/strong_ref_weak_def_2.c: Ditto.
8828
d1238d12
CC
88292010-08-12 Cary Coutant <ccoutant@google.com>
8830
8831 * testsuite/incremental_test.sh: Rewrite.
8832 * testsuite/incremental_test_1.c: Rewrite.
8833 * testsuite/incremental_test_2.c: Rewrite.
8834
0e70b911
CC
88352010-08-12 Cary Coutant <ccoutant@google.com>
8836
8837 * arm.cc (Target_arm::got_size): Add const.
8838 (Target_arm::got_entry_count): New function.
8839 (Target_arm::plt_entry_count): New function.
8840 (Target_arm::first_plt_entry_offset): New function.
8841 (Target_arm::plt_entry_size): New function.
8842 (Output_data_plt_arm::entry_count): New function.
8843 (Output_data_plt_arm::first_plt_entry_offset): New function.
8844 (Output_data_plt_arm::get_plt_entry_size): New function.
8845 * i386.cc (Target_i386::got_size): Add const.
8846 (Target_i386::got_entry_count): New function.
8847 (Target_i386::plt_entry_count): New function.
8848 (Target_i386::first_plt_entry_offset): New function.
8849 (Target_i386::plt_entry_size): New function.
8850 (Output_data_plt_i386::entry_count): New function.
8851 (Output_data_plt_i386::first_plt_entry_offset): New function.
8852 (Output_data_plt_i386::get_plt_entry_size): New function.
8853 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8854 find_incremental_inputs_sections. Dump incremental_got_plt section.
8855 * incremental.cc: Include target.h.
8856 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8857 parameter. Adjust all callers. Find incremental_got_plt section.
8858 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8859 section.
8860 (Output_section_incremental_inputs::set_final_data_size): Calculate
8861 size of incremental_got_plt section.
8862 (Output_section_incremental_inputs::do_write): Write the
8863 incremental_got_plt section.
8864 (Got_plt_view_info): New struct.
8865 (Local_got_offset_visitor): New class.
8866 (Global_got_offset_visitor): New class.
8867 (Global_symbol_visitor_got_plt): New class.
8868 (Output_section_incremental_inputs::write_got_plt): New function.
8869 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8870 Add parameter. Adjust all callers.
8871 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8872 (Incremental_inputs::got_plt_section): New function.
8873 (Incremental_inputs::got_plt_section_): New data member.
8874 (Incremental_got_plt_reader): New class.
8875 * layout.cc (Layout::create_incremental_info_sections): Add the
8876 incremental_got_plt section.
8877 * object.h (Got_offset_list::get_list): New function.
8878 (Got offset_list::for_all_got_offsets): New function.
8879 (Sized_relobj::local_got_offset_list): New function.
8880 * powerpc.cc (Target_powerpc::got_size): Add const.
8881 (Target_powerpc::got_entry_count): New function.
8882 (Target_powerpc::plt_entry_count): New function.
8883 (Target_powerpc::first_plt_entry_offset): New function.
8884 (Target_powerpc::plt_entry_size): New function.
8885 (Output_data_plt_powerpc::entry_count): New function.
8886 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8887 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8888 * sparc.cc (Target_sparc::got_size): Add const.
8889 (Target_sparc::got_entry_count): New function.
8890 (Target_sparc::plt_entry_count): New function.
8891 (Target_sparc::first_plt_entry_offset): New function.
8892 (Target_sparc::plt_entry_size): New function.
8893 (Output_data_plt_sparc::entry_count): New function.
8894 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8895 (Output_data_plt_sparc::get_plt_entry_size): New function.
8896 * symtab.h (Symbol::got_offset_list): New function.
8897 (Symbol_table::for_all_symbols): New function.
8898 * target.h (Sized_target::got_entry_count): New function.
8899 (Sized_target::plt_entry_count): New function.
8900 (Sized_target::plt_entry_size): New function.
8901 * x86_64.cc (Target_x86_64::got_size): Add const.
8902 (Target_x86_64::got_entry_count): New function.
8903 (Target_x86_64::plt_entry_count): New function.
8904 (Target_x86_64::first_plt_entry_offset): New function.
8905 (Target_x86_64::plt_entry_size): New function.
8906 (Output_data_plt_x86_64::entry_count): New function.
8907 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8908 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8909
09ec0418
CC
89102010-08-12 Cary Coutant <ccoutant@google.com>
8911
8912 * archive.cc: Include incremental.h.
8913 (Archive::Archive): Initialize incremental_info_.
8914 (Archive::include_member): Record archive members in incremental info.
8915 (Add_archive_symbols::run): Record begin and end of an archive in
8916 incremental info.
8917 (Lib_group::include_member): Record objects in incremental info.
8918 * archive.h (Incremental_archive_entry): Forward declaration.
8919 (Archive::set_incremental_info): New member function.
8920 (Archive::incremental_info): New member function.
8921 (Archive::Unused_symbol_iterator): New class.
8922 (Archive::unused_symbols_begin): New member function.
8923 (Archive::unused_symbols_end): New member function.
8924 (Archive::incremental_info_): New data member.
8925 * incremental-dump.cc (find_input_containing_global): New function.
8926 (dump_incremental_inputs): Dump new incremental info sections.
8927 * incremental.cc: Include symtab.h.
8928 (Output_section_incremental_inputs): New class.
8929 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8930 new incremental info sections.
8931 (Sized_incremental_binary::do_check_inputs): Likewise.
8932 (Incremental_inputs::report_archive): Remove.
8933 (Incremental_inputs::report_archive_begin): New function.
8934 (Incremental_inputs::report_archive_end): New function.
8935 (Incremental_inputs::report_object): New function.
8936 (Incremental_inputs::finalize_inputs): Remove.
8937 (Incremental_inputs::report_input_section): New function.
8938 (Incremental_inputs::report_script): Rewrite.
8939 (Incremental_inputs::finalize): Do nothing but finalize string table.
8940 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8941 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8942 (Incremental_inputs::create_data_sections): New function.
8943 (Incremental_inputs::relocs_entsize): New function.
8944 (Output_section_incremental_inputs::set_final_data_size): New function.
8945 (Output_section_incremental_inputs::do_write): New function.
8946 (Output_section_incremental_inputs::write_header): New function.
8947 (Output_section_incremental_inputs::write_input_files): New function.
8948 (Output_section_incremental_inputs::write_info_blocks): New function.
8949 (Output_section_incremental_inputs::write_symtab): New function.
8950 * incremental.h (Incremental_script_entry): Forward declaration.
8951 (Incremental_object_entry): Forward declaration.
8952 (Incremental_archive_entry): Forward declaration.
8953 (Incremental_inputs): Forward declaration.
8954 (Incremental_inputs_header_data): Remove.
8955 (Incremental_inputs_header): Remove.
8956 (Incremental_inputs_header_write): Remove.
8957 (Incremental_inputs_entry_data): Remove.
8958 (Incremental_inputs_entry): Remove.
8959 (Incremental_inputs_entry_write): Remove.
8960 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8961 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8962 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8963 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8964 Likewise.
8965 (Incremental_input_entry): New class.
8966 (Incremental_script_entry): New class.
8967 (Incremental_object_entry): New class.
8968 (Incremental_archive_entry): New class.
8969 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8970 (Incremental_inputs::report_inputs): Remove.
8971 (Incremental_inputs::report_archive): Remove.
8972 (Incremental_inputs::report_archive_begin): New function.
8973 (Incremental_inputs::report_archive_end): New function.
8974 (Incremental_inputs::report_object): Change prototype.
8975 (Incremental_inputs::report_input_section): New function.
8976 (Incremental_inputs::report_script): Change prototype.
8977 (Incremental_inputs::get_reloc_count): New function.
8978 (Incremental_inputs::set_reloc_count): New function.
8979 (Incremental_inputs::create_data_sections): New function.
8980 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8981 (Incremental_inputs::inputs_section): New function.
8982 (Incremental_inputs::symtab_section): New function.
8983 (Incremental_inputs::relocs_section): New function.
8984 (Incremental_inputs::get_stringpool): Add const.
8985 (Incremental_inputs::command_line): Add const.
8986 (Incremental_inputs::inputs): Remove.
8987 (Incremental_inputs::command_line_key): New function.
8988 (Incremental_inputs::input_file_count): New function.
8989 (Incremental_inputs::input_files): New function.
8990 (Incremental_inputs::relocs_entsize): New function.
8991 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8992 (Incremental_inputs::finalize_inputs): Remove.
8993 (Incremental_inputs::Input_info): Remove.
8994 (Incremental_inputs::lock_): Remove.
8995 (Incremental_inputs::inputs_): Change type.
8996 (Incremental_inputs::inputs_map_): Remove.
8997 (Incremental_inputs::current_object_entry_): New data member.
8998 (Incremental_inputs::inputs_section_): New data member.
8999 (Incremental_inputs::symtab_section_): New data member.
9000 (Incremental_inputs::relocs_section_): New data member.
9001 (Incremental_inputs::reloc_count_): New data member.
9002 (Incremental_inputs_reader): New class.
9003 (Incremental_symtab_reader): New class.
9004 (Incremental_relocs_reader): New class.
9005 * layout.cc (Layout::finalize): Move finalization of incremental info
9006 and creation of incremental info sections to follow finalization of
9007 symbol table. Set offsets for postprocessing sections.
9008 (Layout::create_incremental_info_sections): Call
9009 Incremental_inputs::create_data_sections. Add incremental symtab
9010 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9011 sections to layout after input sections.
9012 * layout.h (struct Timespec): Forward declaration.
9013 (Layout::incremental_inputs): Add const.
9014 (Layout::create_incremental_info_sections): Add parameter.
9015 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9016 * object.cc: Include incremental.h.
9017 (Relobj::finalize_incremental_relocs): New function.
9018 (Sized_relobj::do_layout): Record input sections in incremental info.
9019 * object.h (Object::output_section): New function.
9020 (Object::output_section_offset): Moved from Relobj.
9021 (Object::get_incremental_reloc_base): New function.
9022 (Object::get_incremental_reloc_count): New function.
9023 (Object::do_output_section): New function.
9024 (Object::do_output_section_offset): Moved from Relobj.
9025 (Object::do_get_incremental_reloc_base): New function.
9026 (Object::do_get_incremental_reloc_count): New function.
9027 (Object::Object): Initialize new data members.
9028 (Relobj::output_section): Renamed do_output_section and moved to
9029 protected.
9030 (Relobj::output_section_offset): Moved to Object.
9031 (Relobj::do_get_incremental_reloc_base): New function.
9032 (Relobj::do_get_incremental_reloc_count): New function.
9033 (Relobj::allocate_incremental_reloc_counts): New function.
9034 (Relobj::count_incremental_reloc): New function.
9035 (Relobj::finalize_incremental_relocs): New function.
9036 (Relobj::next_incremental_reloc_index): New function.
9037 (Relobj::reloc_counts_): New data member.
9038 (Relobj::reloc_bases_): New data member.
9039 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9040 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9041 (Sized_relobj::incremental_relocs_scan): New function.
9042 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9043 (Sized_relobj::incremental_relocs_write): New function.
9044 (Sized_relobj::incremental_relocs_write_reltype): New function.
9045 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9046 incremental link.
9047 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9048 archives and object files elsewhere.
9049 (Add_symbols::run): Report object files here.
9050 (Finish_group::run): Report end of archive at end of group.
9051 * reloc.cc: Include layout.h, incremental.h.
9052 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9053 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9054 (Sized_relobj::incremental_relocs_scan): New function.
9055 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9056 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9057 (Sized_relobj::incremental_relocs_write): New function.
9058 (Sized_relobj::incremental_relocs_write_reltype): New function.
9059 * script.cc (read_input_script): Rewrite test for incremental link.
9060 Change call to Incremental_inputs::report_script.
9061 * symtab.h (Symbol_table::first_global_index): New function.
9062 (Symbol_table::output_count): New function.
9063
ce0d1972
DK
90642010-08-12 Doug Kwan <dougkwan@google.com>
9065
9066 * arm.cc (Target_arm::merge_object_attributes): Check command line
9067 options --no-wchar-size-warning and --no-enum-size-warning.
9068 * options.h (General_options): Add ld-compatible options
9069 --no-enum-size-warning and --no-wchar-size-warning.
9070
6e5710ce
ILT
90712010-08-04 Ian Lance Taylor <iant@google.com>
9072
9073 * x86_64.cc (Target_x86_64::Scan::local): Use
9074 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9075 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9076 (Target_x86_64::Scan::global): Likewise.
9077 (Target_x86_64::Relocate::relocate): Likewise.
9078 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9079 Likewise.
9080
fef830db
CC
90812010-08-03 Cary Coutant <ccoutant@google.com>
9082
9083 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9084 to reserve space in merged_strings vector. Keep total input size
9085 for stats.
9086 (Output_merge_string::do_print_merge_stats): Print total input size.
9087 * merge.h (Output_merge_string): Add input_size_ field.
9088 * stringpool.cc (Stringpool_template::string_length): Move
9089 implementations out of Stringpool_template class and place in
9090 stringpool.h.
9091 * stringpool.h (string_length): Move out of Stringpool_template.
9092
1e3811b0
ILT
90932010-08-03 Ian Lance Taylor <iant@google.com>
9094
9095 PR 11712
9096 * layout.cc (relaxation_loop_body): If address of load segment is
9097 set, adjust address to include headers if possible.
9098
7af0c620
ILT
90992010-08-03 Ian Lance Taylor <iant@google.com>
9100
9101 * version.cc (version_string): Bump to 1.10.
9102
22f0da72
ILT
91032010-08-03 Ian Lance Taylor <iant@google.com>
9104
9105 PR 11805
9106 * layout.h (enum Output_section_order): Define.
9107 (class Layout): Update declarations.
9108 * layout.cc (Layout::get_output_section): Add order parameter.
9109 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9110 is_first_non_relro parameters. Change all callers.
9111 (Layout::choose_output_section): Likewise.
9112 (Layout::add_output_section_data): Likewise.
9113 (Layout::make_output_section): Likewise. Set order.
9114 (Layout::default_section_order): New function.
9115 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9116 * output.cc (Output_section::Output_section): Initialize order_.
9117 Don't initialize deleted fields.
9118 (Output_segment::Output_segment): Don't initialize deleted
9119 fields.
9120 (Output_segment::add_output_section_to_load): New function
9121 replacing add_output_section. Change all callers to call this or
9122 add_output_section_to_nonload.
9123 (Output_segment::add_output_section_to_nonload): New function.
9124 (Output_segment::remove_output_section): Rewrite.
9125 (Output_segment::add_initial_output_data): Likewise.
9126 (Output_segment::has_any_data_sections): Likewise.
9127 (Output_segment::is_first_section_relro): Likewise.
9128 (Output_segment::maximum_alignment): Likewise.
9129 (Output_segment::has_dynamic_reloc): New function replacing
9130 dynamic_reloc_count. Change all callers.
9131 (Output_segment::has_dynamic_reloc_list): New function replacing
9132 dynamic_reloc_count_list. Change all callers.
9133 (Output_segment::set_section_addresses): Rewrite.
9134 (Output_segment::set_offset): Rewrite.
9135 (Output_segment::find_first_and_last_list): Remove.
9136 (Output_segment::set_tls_offsets): Rewrite.
9137 (Output_segment::first_section_load_address): Likewise.
9138 (Output_segment::output_section_count): Likewise.
9139 (Output_segment::section_with_lowest_load_address): Likewise.
9140 (Output_segment::write_section_headers): Likewise.
9141 (Output_segment::print_sections_to_map): Likewise.
9142 * output.h (class Output_data): Remove dynamic_reloc_count_
9143 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9144 (Output_data::add_dynamic_reloc): Rewrite.
9145 (Output_data::has_dynamic_reloc): New function.
9146 (Output_data::dynamic_reloc_count): Remove.
9147 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9148 is_last_relro_, is_first_non_relro_, is_interp_,
9149 is_dynamic_linker_section_ fields. Add order and set_order
9150 functions. Remove is_relro_local, set_is_relro_local,
9151 is_last_relro, set_is_last_relro, is_first_non_relro,
9152 set_is_first_non_relro functions, is_interp, set_is_interp,
9153 is_dynamic_linker_section, and set_is_dynamic_linker_section
9154 functions.
9155 (class Output_segment): Change Output_data_list from std::list to
9156 std:;vector. Add output_lists_ field. Remove output_data_ and
9157 output_bss_ fields. Update declarations.
9158
3ff2ccb0
ILT
91592010-08-02 Ian Lance Taylor <iant@google.com>
9160
9161 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9162 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9163 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9164
88a4108b
ILT
91652010-08-02 Ian Lance Taylor <iant@google.com>
9166
9167 PR 11855
9168 * script.cc (Script_options::Script_options): Initialize
9169 symbol_definitions_ and symbol_references_.
9170 (Script_options::add_symbol_assignment): Update
9171 symbol_definitions_ and symbol_references_.
9172 (Script_options::add_symbol_reference): New function.
9173 (script_symbol): New function.
9174 * script.h (class Script_options): Add symbol_definitions_ and
9175 symbol_references_ fields.
9176 (Script_options::referenced_const_iterator): New type.
9177 (Script_options::referenced_begin): New function.
9178 (Script_options::referenced_end): New function.
9179 (Script_options::is_referenced): New function.
9180 (Script_options::any_unreferenced): New function.
9181 * script-c.h (script_symbol): Declare.
9182 * yyscript.y (exp): Call script_symbol.
9183 * symtab.cc: Include "script.h".
9184 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9185 Change all callers. Check symbols referenced by scripts.
9186 (Symbol_table::add_undefined_symbols_from_command_line): Add
9187 layout parameter. Change all callers.
9188 (Symbol_table::do_add_undefined_symbols_from_command_line):
9189 Likewise. Break out loop body. Check symbols referenced by
9190 scripts.
9191 (Symbol_table::add_undefined_symbol_from_command_line): New
9192 function broken out of
9193 do_add_undefined_symbols_from_command_line.
9194 * symtab.h (class Symbol_table): Update declarations.
9195 * archive.cc: Include "layout.h".
9196 (Archive::should_include_member): Add layout parameter. Change
9197 all callers. Check for symbol mentioned in expression.
9198 * archive.h (class Archive): Update declaration.
9199 * object.cc (Sized_relobj::do_should_include_member): Add layout
9200 parameter.
9201 * object.h (Object::should_include_member): Add layout parameter.
9202 Change all callers.
9203 (Object::do_should_include_member): Add layout parameter.
9204 (class Sized_relobj): Update declaration.
9205 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9206 parameter.
9207 * dynobj.h (class Sized_dynobj): Update declaration.
9208 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9209 layout parameter.
9210 * plugin.h (class Sized_pluginobj): Update declaration.
9211
5f1ab67a
ILT
92122010-08-02 Ian Lance Taylor <iant@google.com>
9213
9214 PR 11866
9215 * output.cc (Output_segment::set_offset): Search for the first and
9216 last sections rather than assuming that the list is in order.
9217 (Output_segment::find_first_and_last_list): New function.
9218 * output.h (class Output_segment): Update declarations.
9219 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9220 (relro_strip_test_SOURCES): New variable.
9221 (relro_strip_test_DEPENDENCIES): New variable.
9222 (relro_strip_test_LDFLAGS): New variable.
9223 (relro_strip_test_LDADD): New variable.
9224 (relro_strip_test.so): New target.
9225
a8df5856
ILT
92262010-08-02 Ian Lance Taylor <iant@google.com>
9227
9228 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9229 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9230 (Target_i386::got_tlsdesc_section): New function.
9231 (Target_i386::got_section): Create space for GOT entries for
9232 TLSDESC relocations.
9233 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9234 R_386_TLS_GOTDESC.
9235 (Target_i386::Scan::global): Likewise.
9236 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9237 using TLSDESC GOT.
9238 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9239 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9240 (Target_x86_64::got_tlsdesc_section): New function.
9241 (Target_x86_64::got_section): Create space for GOT entries for
9242 TLSDESC relocations.
9243 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9244 R_386_TLS_GOTDESC.
9245 (Target_x86_64::Scan::global): Likewise.
9246 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9247 using TLSDESC GOT.
9248
0c10a0a6
ILT
92492010-08-02 Ian Lance Taylor <iant@google.com>
9250
9251 * testsuite/final_layout.sh: Use dc to convert from hex to
9252 decimal.
9253
41cbeecc
ST
92542010-07-29 Sriraman Tallam <tmsriram@google.com>
9255
9256 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9257 paramter to the call to gold::gc_process_relocs.
9258 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9259 paramter to the call to gold::gc_process_relocs.
9260 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9261 parameter to the call to gold::gc_process_relocs.
9262 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9263 template parameter to the call to gold::gc_process_relocs.
9264 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9265 paramter to the call to gold::gc_process_relocs.
9266 * gc.h (get_embedded_addend_size): New function.
9267 (gc_process_relocs): Save the size of the reloc for use by ICF.
9268 * icf.cc (get_section_contents): Get the addend from the text section
9269 for SHT_REL relocation sections.
9270 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9271 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9272 * int_encoding.h (read_from_pointer): New overloaded function.
9273 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9274 * testsuite/icf_sht_rel_addend_test.sh: New file.
9275 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9276 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9277
6ea55b82
RW
92782010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9279
9280 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9281 * Makefile.in: Regenerate.
9282 * testsuite/Makefile.in: Regenerate.
9283
9691462b
ILT
92842010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9285
9286 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9287 * gold/testsuite/debug_msg.cc: Likewise.
9288 * gold/testsuite/odr_violation1.cc
9289 * gold/testsuite/odr_violation2.cc
9290
76897331
CC
92912010-07-21 Cary Coutant <ccoutant@google.com>
9292
9293 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9294 string, and length fields.
9295 (Output_merge_string::Merged_strings_list): New type.
9296 (Output_merge_string::Merged_strings_lists): New typedef.
9297 (Output_merge_string): Replace merged_strings_ with
9298 merged_strings_lists_.
9299 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9300 Merged_strings_list per input object and section. Don't store pointer
9301 to the string. Don't store length with each merged string entry.
9302 (Output_merge_string::finalize_merged_data): Loop over list of merged
9303 strings lists. Recompute length of each merged string.
9304
78384e8f
CC
93052010-07-15 Cary Coutant <ccoutant@google.com>
9306
9307 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9308 here.
9309
783659f9
ILT
93102010-07-14 Ian Lance Taylor <iant@google.com>
9311
9312 * descriptors.cc (Descriptors::open): Report correct name in error
9313 message.
9314
131687b4
DK
93152010-07-13 Doug Kwan <dougkwan@google.com>
9316
9317 * arm.cc (Arm_input_section::Arm_input_section): For a
9318 SHT_ARM_EXIDX section, always keeps the input sections.
9319 (Arm_input_section::set_exidx_section_link): New method.
9320 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9321 has_errors_ to false.
9322 (Arm_exidx_input_section::has_errors,
9323 Arm_exidx_input_section::set_has_errors): New methods.
9324 (Arm_exidx_input_section::has_errors_): New data member.
9325 (Arm_relobj::get_exidx_shndx_list): New method.
9326 (Arm_output_section::append_text_sections_to_list): Do not skip
9327 section without SHF_EXECINSTR.
9328 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9329 errors.
2e702c99 9330 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9331 section header. Make error messages more verbose. Check for
9332 a non-executable section linked to an EXIDX section.
9333 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9334 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9335 check that there is no deferred EXIDX section if we exit early.
9336 Instead of not making an EXIDX section in case of an error, make one
9337 and set the has_errors flag of it.
9338 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9339 in a relocatable link.
9340 (Target_arm::do_relax): Look for the EXIDX output section instead of
9341 assuming that it is called .ARM.exidx.
2e702c99 9342 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9343 section list. Do not check for SHF_EXECINSTR section flags but
9344 skip any input section with errors.
9345 * output.cc (Output_section::Output_section): Initialize
9346 always_keeps_input_sections_ to false.
9347 (Output_section::add_input_section): Check for
9348 always_keeps_input_sections_.
9349 * output.h (Output_section::always_keeps_input_sections,
9350 Output_section::set_always_keeps_input_sections): New methods.
9351 (Output_section::always_keeps_input_sections): New data member.
9352
69517287
RÁE
93532010-07-13 Rafael Espindola <espindola@google.com>
9354
9355 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9356 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9357
82742395
ILT
93582010-07-13 Philip Herron <herron.philip@googlemail.com>
9359 Ian Lance Taylor <iant@google.com>
9360
9361 * output.h (Output_section_lookup_maps::add_merge_section):
9362 Correct check of whether value was inserted.
9363 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9364 (Output_section_lookup_maps::add_relaxed_input_section):
9365 Likewise.
9366 * arm.cc (Target_arm::got_section): Remove used local os.
9367 * i386.cc (Target_i386::got_section): Likewise.
9368 * x86_64.cc (Target_x86_64::got_section): Likewise.
9369 * sparc.cc (Target_sparc::got_section): Likewise.
9370 (Target_sparc::relocate): Remove unused local have_got_offset.
9371 * powerpc.cc (Target_powerpc::relocate): Likewise.
9372
f2d707b5
ILT
93732010-07-13 Ian Lance Taylor <iant@google.com>
9374
241531d6
ILT
9375 * compressed_output.cc (zlib_decompress): Fix signature in
9376 !HAVE_ZLIB_H case.
9377
f2d707b5
ILT
9378 * archive.cc (Archive::include_member): Unlock an external member
9379 of a thin archive. Don't bother to delete an object we know is
9380 NULL.
9381
a2e47362
CC
93822010-07-12 Cary Coutant <ccoutant@google.com>
9383
9384 * compressed_output.cc (zlib_decompress): New function.
9385 (get_uncompressed_size): New function.
9386 (decompress_input_section): New function.
9387 * compressed_output.h (get_uncompressed_size): New function.
9388 (decompress_input_section): New function.
9389 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9390 Handle compressed debug sections.
9391 * layout.cc (is_compressed_debug_section): New function.
9392 (Layout::output_section_name): Map compressed section names to
9393 canonical names.
9394 * layout.h (is_compressed_debug_section): New function.
9395 (is_debug_info_section): Recognize compressed debug sections.
9396 * merge.cc: Include compressed_output.h.
9397 (Output_merge_data::do_add_input_section): Handle compressed
9398 debug sections.
9399 (Output_merge_string::do_add_input_section): Handle compressed
9400 debug sections.
9401 * object.cc: Include compressed_output.h.
9402 (Sized_relobj::Sized_relobj): Initialize new data members.
9403 (build_compressed_section_map): New function.
9404 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9405 * object.h (Object::section_is_compressed): New method.
9406 (Object::do_section_is_compressed): New method.
9407 (Sized_relobj::Compressed_section_map): New type.
9408 (Sized_relobj::do_section_is_compressed): New method.
9409 (Sized_relobj::compressed_sections_): New data member.
9410 * output.cc (Output_section::add_input_section): Handle compressed
9411 debug sections.
9412 * reloc.cc: Include compressed_output.h.
9413 (Sized_relobj::write_sections): Handle compressed debug sections.
9414
ce279a62
CC
94152010-07-08 Cary Coutant <ccoutant@google.com>
9416
9417 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9418 weak when resolving to a dynamic def.
9419 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9420 for weak undef/dynamic def cases. Adjust callers.
9421 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9422 undef_binding_weak_.
9423 (Symbol_table::sized_write_globals): Adjust symbol binding.
9424 (Symbol_table::sized_write_symbol): Add binding parameter.
9425 * symtab.h (Symbol::set_undef_binding): New method.
9426 (Symbol::is_undef_binding_weak): New method.
9427 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9428 (Symbol_table::should_override): Add new parameter.
9429 (Symbol_table::sized_write_symbol): Add new parameter.
9430
9431 * testsuite/weak_undef_file1.cc: Add new test case.
9432 * testsuite/weak_undef_file2.cc: Fix header comment.
9433 * testsuite/weak_undef_test.cc: Add new test case.
9434
b2286c10
DK
94352010-06-29 Doug Kwan <dougkwan@google.com>
9436
9437 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9438 Initialize USE_SYMBOL_.
9439 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9440 definition.
9441 (Arm_reloc_property::uses_symbol_): New data member declaration.
9442 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9443 uses symbol value and symbol is undefined but not weakly undefined.
9444
4802450a
RÁE
94452010-06-28 Rafael Espindola <espindola@google.com>
9446
9447 * plugin.cc (Plugin::load): Use dlerror.
9448
e5ca47ba
ILT
94492010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9450
9451 * symtab.cc (detect_odr_violations): When reporting an ODR
9452 violation, report an object where the symbol is defined.
9453
8a75a161
DK
94542010-06-25 Doug Kwan <dougkwan@google.com>
9455
9456 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9457 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9458 definition.
9459 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9460 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9461 target hook to detect function points.
9462 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9463 * icf.h (Icf::check_section_for_function_pointers): Change type of
9464 parameter SECTION_NAME to const reference to std::string. Use
9465 target hook to determine if section may have unsafe pointers.
9466 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9467 method definition.
9468
42218b9f
RÁE
94692010-06-21 Rafael Espindola <espindola@google.com>
9470
9471 * fileread.cc (Input_file::find_fie): New
9472 (Input_file::open): Use Input_file::find_fie.
9473 * fileread.h (Input_file::find_fie): New
9474 * plugin.cc (set_extra_library_path): New.
9475 (Plugin::load): Add set_extra_library_path to the transfer vector.
9476 (Plugin_manager::set_extra_library_path): New.
9477 (Plugin_manager::add_input_file): Use the extra search path if set.
9478 (set_extra_library_path(): New.
9479 * plugin.h (Plugin_manager): Add set_extra_library_path and
9480 extra_search_path_.
9481
a0506cca
CC
94822010-06-19 Cary Coutant <ccoutant@google.com>
9483
9484 * layout.cc (gdb_sections): Add .debug_types.
9485 (lines_only_debug_sections): Likewise.
9486
6508b958
RÁE
94872010-06-18 Rafael Espindola <espindola@google.com>
9488
9489 * plugin.cc (add_input_file,add_input_library)
9490 (Plugin_manager::add_input_file): Make filename arguments const.
9491 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9492 const.
9493
3e235302
DK
94942010-06-16 Doug Kwan <dougkwan@google.com>
9495
9496 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9497 .ARM.attributes section if we have not merged any input
9498 attributes sections.
9499
106e8a6c
DK
95002010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9501
9502 * arm.cc: Allow combining objects with no EABI version
9503 information.
9504
91ff43fe
RÁE
95052010-06-15 Rafael Espindola <espindola@google.com>
9506
9507 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9508
68ed838c
ILT
95092010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9510
9511 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9512 (struct iovec): Correct !HAVE_READV definition.
9513
f3a2388f
CC
95142010-06-10 Cary Coutant <ccoutant@google.com>
9515
9516 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9517 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9518 reloc sections.
9519 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9520
9521 PR 11683
9522 * symtab.h (Symbol::is_placeholder): New member function.
9523 * target-reloc.h (relocate_section): Check for placeholder symbols.
9524
9525 * testsuite/Makefile.am (plugin_test_8): New test.
9526 (plugin_test_9): New test.
9527 * testsuite/Makefile.in: Regenerate.
9528
e1df38aa
NC
95292010-06-09 Nick Clifton <nickc@redhat.com>
9530
9531 * yyscript.y (input_list_element): Allow strings prefixed with
9532 the '-' character. Treat these as libraries.
9533 * script.cc (script_add_library): New function. Adds a library
9534 specified by "-l<name>" found in an input script.
9535 * script-c.h: Add prototype for script_add_library.
9536
25bbe950
DK
95372010-06-07 Doug Kwan <dougkwan@google.com>
9538
9539 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9540 Restrict stub-group size to be within long conditional branch
9541 range when working around cortex-A8 erratum.
9542
0f32ea4c
ILT
95432010-06-07 Damien Diederen <dd@crosstwine.com>
9544
9545 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9546 #ifdef typo.
9547
8fe2a369
ST
95482010-06-03 Sriraman Tallam <tmsriram@google.com>
9549
9550 PR gold/11658
9551 * output.cc
9552 (Output_section::Input_section_sort_entry::compare_section_ordering):
9553 Change to return non-zero correctly.
9554 (Output_section::Input_section_sort_section_order_index_compare
9555 ::operator()): Change to fix ambiguity in comparisons.
9556
6e9ba2ca
ST
95572010-06-01 Sriraman Tallam <tmsriram@google.com>
9558
9559 * gold.h (is_wildcard_string): New function.
9560 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9561 (Layout::layout_eh_frame): Ditto.
9562 (Layout::find_section_order_index): New method.
9563 (Layout::read_layout_from_file): New method.
9564 * layout.h (Layout::find_section_order_index): New method.
9565 (Layout::read_layout_from_file): New method.
9566 (Layout::input_section_position_): New private member.
9567 (Layout::input_section_glob_): New private member.
9568 * main.cc (main): Call read_layout_from_file here.
9569 * options.h (--section-ordering-file): New option.
9570 * output.cc (Output_section::input_section_order_specified_): New
9571 member.
9572 (Output_section::Output_section): Initialize new member.
9573 (Output_section::add_input_section): Add new parameter.
9574 Keep input sections when --section-ordering-file is used.
9575 (Output_section::set_final_data_size): Sort input sections when
9576 section ordering file is specified.
9577 (Output_section::Input_section_sort_entry): Add new parameter.
9578 Check sorting type.
9579 (Output_section::Input_section_sort_entry::compare_section_ordering):
9580 New method.
9581 (Output_section::Input_section_sort_compare::operator()): Change to
9582 consider section_order_index.
9583 (Output_section::Input_section_sort_init_fini_compare::operator()):
9584 Change to consider section_order_index.
9585 (Output_section::Input_section_sort_section_order_index_compare
9586 ::operator()): New method.
9587 (Output_section::sort_attached_input_sections): Change to sort
9588 according to section order when specified.
e1df38aa
NC
9589 (Output_section::add_input_section<32, true>): Add new parameter.
9590 (Output_section::add_input_section<64, true>): Add new parameter.
9591 (Output_section::add_input_section<32, false>): Add new parameter.
9592 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9593 * output.h (Output_section::add_input_section): Add new parameter.
9594 (Output_section::input_section_order_specified): New
9595 method.
9596 (Output_section::set_input_section_order_specified): New method.
9597 (Input_section::Input_section): Initialize section_order_index_.
9598 (Input_section::section_order_index): New method.
9599 (Input_section::set_section_order_index): New method.
9600 (Input_section::section_order_index_): New member.
9601 (Input_section::Input_section_sort_section_order_index_compare): New
9602 struct.
9603 (Output_section::input_section_order_specified_): New member.
9604 * script-sections.cc (is_wildcard_string): Delete and move modified
9605 method to gold.h.
9606 (Output_section_element_input::Output_section_element_input): Modify
9607 call to is_wildcard_string.
9608 (Output_section_element_input::Input_section_pattern
9609 ::Input_section_pattern): Ditto.
9610 (Output_section_element_input::Output_section_element_input): Ditto.
9611 * testsuite/Makefile.am (final_layout): New test case.
9612 * testsuite/Makefile.in: Regenerate.
9613 * testsuite/final_layout.cc: New file.
9614 * testsuite/final_layout.sh: New file.
9615
3537c84b
RÁE
96162010-06-01 Rafael Espindola <espindola@google.com>
9617
9618 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9619
105b6afd
RÁE
96202010-06-01 Rafael Espindola <espindola@google.com>
9621
9622 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9623 visibility of symbols.
9624
29e11421
DK
96252010-05-27 Doug Kwan <dougkwan@google.com>
9626
9627 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9628 from start of output section instead of address for a local symbol
9629 in a merged or relaxed section when doing a relocatable link.
9630
5e0f337e
RÁE
96312010-05-26 Rafael Espindola <espindola@google.com>
9632
703d02da 9633 PR 11604
5e0f337e
RÁE
9634 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9635 adding sections the garbage collector removed.
9636 * gold/testsuite/Makefile.am: Add test.
9637 * gold/testsuite/Makefile.in: Regenerate.
9638 * gold/testsuite/plugin_test_7.sh: New.
9639 * gold/testsuite/plugin_test_7_1.c: New.
9640 * gold/testsuite/plugin_test_7_2.c: New.
9641
f4187277
RÁE
96422010-05-26 Rafael Espindola <espindola@google.com>
9643
9644 * script-sections.cc (Output_section_definition::set_section_addresses):
9645 Check for --section-start.
9646
5c388529
DK
96472010-05-26 Doug Kwan <dougkwan@google.com>
9648
9649 * arm.cc (Arm_scan_relocatable_relocs): New class.
9650 (Target_arm::relocate_special_relocatable): New method.
9651 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9652 (Arm_relocate_functions::thumb_branch_common): Same.
9653 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9654 instead of Default_scan_relocatable_relocs.
9655 * target-reloc.h (relocate_for_relocatable): Let target handle
9656 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9657 * target.h (Sized_target::relocate_special_relocatable): New method.
9658
bca1c3ae
ILT
96592010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9660
9661 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9662
0439c796
DK
96632010-05-23 Doug Kwan <dougkwan@google.com>
9664
9665 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9666 instead of a cast.
9667 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9668 with a direct branch, not a conditional branch, to a stub.
9669 * merge.cc (Output_merge_base::record_input_section): New method
9670 defintion.
9671 (Output_merge_data::do_add_input_section): Record input section if
9672 keeps-input-sections flag is set.
9673 (Output_merge_string::do_add_input_section): Ditto.
9674 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9675 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9676 INPUT_SECTIONS_.
9677 (Output_merge_base::keeps_input_sections,
9678 Output_merge_base::set_keeps_input_sections,
9679 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9680 method definitions.
9681 (Output_merge_base::Input_sections): New type declaration.
9682 (Output_merge_base::input_sections_begin,
9683 Output_merge_base::input_sections_end,
9684 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9685 (Output_merge_base::bool keeps_input_sections_,
9686 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9687 Output_merge_base::input_sections_): New data members.
9688 (Output_merge_data::do_set_keeps_input_sections): New method
9689 defintion.
9690 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9691 * output.cc (Output_section::Input_section::relobj): Move method
9692 defintion from class declaration to here and handle merge sections.
9693 (Output_section::Input_section::shndx): Ditto.
9694 (Output_section::Output_section): Remove initializations of removed
9695 data members and initialize new data member LOOKUP_MAPS_.
9696 (Output_section::add_input_section): Set keeps-input-sections flag
9697 for a newly created merge output section as appropriate. Adjust code
9698 to use Output_section_lookup_maps class.
9699 (Output_section::add_relaxed_input_section): Adjst code for lookup
9700 maps code refactoring.
2e702c99 9701 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9702 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9703 class. If adding input section to a newly created merge output
9704 section fails, remove the new merge section.
9705 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9706 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9707 (Output_section::find_merge_section): Ditto.
0439c796 9708 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9709 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9710 Output_section_lookup_maps class.
9711 (Output_section::get_input_sections): Export merge sections. Adjust
9712 code to use Output_section_lookup_maps class.
9713 (Output_section:::add_script_input_section): Adjust code to use
9714 Output_section_lookup_maps class. Update lookup maps for merge
9715 sections also.
9716 (Output_section::discard_states): Use Output_section_lookup_maps.
9717 (Output_section::restore_states): Same.
9718 * output.h (Merge_section_properties): Move class defintion out of
9719 Output_section.
9720 (Output_section_lookup_maps): New class.
9721 (Output_section::Input_section::is_merge_section): New method
9722 defintion.
9723 (Output_section::Input_section::relobj): Move defintion out of class
9724 defintion. Declare method only.
9725 (Output_section::Input_section::shndx): Ditto.
9726 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9727 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9728 (Output_section::Merge_section_by_properties_map,
9729 Output_section::Output_section_data_by_input_section_map,
9730 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9731 Remove types.
2e702c99 9732 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9733 KEEPS_INPUT_SECTIONS.
9734 (Output_section::build_lookup_maps): New method declaration.
9735 (Output_section::merge_section_map_,
9736 Output_section::merge_section_by_properties_map_,
9737 Output_section::relaxed_input_section_map_,
9738 Output_section::is_relaxed_input_section_map_valid_): Remove data
9739 members.
9740 (Output_section::lookup_maps_): New data member.
9741
76295588
L
97422010-05-21 Doug Kwan <dougkwan@google.com>
9743
9744 PR gold/11619
9745 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9746 avoid a compilation error.
9747
d103a984
RÁE
97482010-05-19 Rafael Espindola <espindola@google.com>
9749
9750 * script-sections.cc (Output_section_definition::allocate_to_segment):
9751 Update the phdrs_list even when the output section is NULL.
9752 * testsuite/Makefile.am: Add test.
9753 * testsuite/Makefile.in: Regenerate.
9754 * testsuite/script_test_9.cc: New.
9755 * testsuite/script_test_9.sh: New.
9756 * testsuite/script_test_9.t: New.
9757
6625d24e
DK
97582010-05-19 Doug Kwan <dougkwan@google.com>
9759
9760 * arm.cc (Arm_input_section::original_size): New method.
9761 (Arm_input_section::do_addralign): Add a cast.
9762 (Arm_input_section::do_output_offset): Remove static cast.
9763 (Arm_input_section::original_addralign,
9764 Arm_input_section::original_size_): Change type to uint32_t.
9765 (Arm_input_section::init): Add safe casts for section alignment
9766 and size.
9767 (Arm_input_section::set_final_data_size): Do not set address and
9768 offset of stub table.
9769 (Arm_output_section::fix_exidx_coverage): Change use of of
9770 Output_section::Simple_input_section to that of
9771 Output_section::Input_section.
9772 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9773 except for the first pass.
9774 * output.cc (Output_section::get_input_sections): Change type of
9775 input_sections to std::list<Input_section>.
9776 (Output_section::add_script_input_section): Rename from
9777 Output_section::add_simple_input_section. Change type of SIS
9778 parameter from Simple_input_section to Input_section.
9779 * output.h (Output_section::Simple_input_section): Remove class.
9780 (Output_section::Input_section): Change class visibility to public.
9781 (Output_section::Input_section::addralign): Use stored alignments
9782 for special input sections if set.
9783 (Output_section::Input_section::set_addralign): New method.
9784 (Output_section::get_input_sections): Change parameter type from
9785 list of Simple_input_section to list of Input_section.
9786 (Output_section::add_script_input_section): Rename from
9787 Output_section::add_simple_input_section. Change first parameter's
9788 type from Simple_input_section to Input_section and remove the
9789 second and third parameters.
9790 * script-sections.cc (Input_section::Input_section_list): Change
9791 type to list of Output_section::Input_section/
9792 (Input_section_info::Input_section_info): Change parameter type of
9793 INPUT_SECTION to Output_section::Input_section.
9794 (Input_section_info::input_section): Change return type.
9795 (Input_section_info::input_section_): Change type to
9796 Output_section::Input_section.
9797 (Output_section_element_input::set_section_addresses): Adjust code
9798 to use Output_section::Input_section instead of
9799 Output_section::Simple_input_section. Adjust code for renaming
9800 of Output_section::add_simple_input_section.
9801 (Orphan_output_section::set_section_addresses): Ditto.
9802
e1e82ea4
RW
98032010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9804
9805 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9806 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9807
91e75c8a
RÁE
98082010-05-18 Rafael Espindola <espindola@google.com>
9809
9810 * options.cc (General_options::finalize): Handle -nostdlib.
9811 * options.h (nostdlib): New option.
9812 * script.cc (script_add_search_dir): Handle -nostdlib.
9813
da59ad79
DK
98142010-05-12 Doug Kwan <dougkwan@google.com>
9815
9816 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9817 attributes section only if there no attributes section after merging.
9818 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9819 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9820 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9821 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9822 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9823 and arm_attr_merge_7.stdout.
9824 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9825 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9826 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9827 arm_attr_merge_7b.o): New rules.
9828 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9829 arm_attr_merge_7
9830 * testsuite/Makefile.in: Regenerate.
9831 * testsuite/arm_attr_merge.sh: New file.
9832 * testsuite/arm_attr_merge_[67][ab].s: Same.
9833
3e01a7fd
NC
98342010-05-05 Nick Clifton <nickc@redhat.com>
9835
9836 * po/es.po: Updated Spanish translation.
9837
7ad2014a
L
98382010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9839
9840 * Makefile.am (install-exec-local): Properly install gold as
9841 default cross linker.
9842 * Makefile.in: Regenerated.
9843
4fda8867
NC
98442010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9845 Nick Clifton <nickc@redhat.com>
9846
9847 * configure.ac (install_as_default): Define and set to false
9848 unless --enable-gold or --enable-gold=both/gold has been
9849 specified.
9850 * configure: Regenerate.
9851
9852 * Makefile.am (install-exec-local): Install the executable as
9853 'ld.gold'. If install_as_default is true then also install it as
9854 'ld'.
9855 * Makefile.in: Regenerated.
9856
bd288ea2
ILT
98572010-04-24 Ian Lance Taylor <iant@google.com>
9858
9859 * layout.cc (Layout::layout_reloc): In relocatable link don't
9860 combine reloc sections for grouped sections.
9861
ef38fd8a
ST
98622010-04-23 Sriraman Tallam <tmsriram@google.com>
9863
9864 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9865 sections that are not ordinary to icf.
9866 * icf.cc (get_section_contents): Handle relocation pointing to section
9867 with no object or shndx information.
9868 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9869 * testsuite/Makefile.in: Regenerate.
9870 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9871 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9872
f6973bdc
ILT
98732010-04-22 Ian Lance Taylor <iant@google.com>
9874
9875 * expression.cc (Expression::Expression_eval_info): Add
9876 result_alignment_pointer field.
9877 (Expression::eval_with_dot): Add result_alignment_pointer
9878 parameter. Change all callers.
9879 (Expression::eval_maybe_dot): Likewise.
9880 (class Binary_expression): Add alignment_pointer parameter to
9881 left_value and right_value. Change all callers.
9882 (BINARY_EXPRESSION): Set result alignment.
9883 (class Trinary_expression): Add alignment_pointer parameter to
9884 arg2_value and arg3_value. Change all callers.
9885 (Trinary_cond::value): Set result alignment.
9886 (Max_expression::value, Min_expression::value): Likewise.
9887 (Align_expression::value): Likewise.
9888 * script-sections.cc (class Sections_element): Add dot_alignment
9889 parameter to set_section_addresses virtual function. Update
9890 instantiations.
9891 (class Output_section_element): Likewise.
9892 (Script_sections::create_segments): Add dot_alignment parameter.
9893 Change all callers.
9894 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9895 (Script_sections::set_phdrs_clause_addresses): Likewise.
9896 * script-sections.h: Update declarations.
9897 * script.h: Update declarations.
9898 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9899 min_p_align.
9900 * testsuite/script_test_3.t: Set large alignment.
9901 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9902 segment has expected alignment.
9903
9c9c98a5
NC
99042010-04-22 Nick Clifton <nickc@redhat.com>
9905
9906 * po/gold.pot: Updated by the Translation project.
9907 * po/vi.po: Updated Vietnamese translation.
9908
2253bfba
L
99092010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9910
9911 * testsuite/Makefile.am (check_PROGRAMS): Add
9912 icf_virtual_function_folding_test.
9913 * testsuite/Makefile.in: Regenerated.
9914
85fdf906
AH
99152010-04-15 Andrew Haley <aph@redhat.com>
9916
9917 * options.h (merge_exidx_entries): New option.
9918 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9919 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9920 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9921 (Target_arm::merge_exidx_entries): New function.
9922 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9923 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9924 to Arm_exidx_fixup constructor.
9925 Add new arg, merge_exidx_entries.
9926 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9927 Arm_output_section::fix_exidx_coverage.
9928
ce97fa81
ST
99292010-04-18 Sriraman Tallam <tmsriram@google.com>
9930
9931 * icf.cc (get_section_contents): Check for preemptible functions.
9932 Ignore addend when appropriate.
9933 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9934 section folded.
9935 (add_from_relobj): Check for section folded.
9936 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9937 * symtab.h (should_add_dynsym_entry): Add new parameter.
9938 * target-reloc.h (scan_relocs): Check for section folded.
9939 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9940 Check reloc types for function pointers in shared objects.
9941 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9942 case.
9943 (icf_preemptible_functions_test): New test case.
9944 (icf_string_merge_test): New test case.
9945 * testsuite.Makefile.in: Regenerate.
9946 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9947 bar_glob. Refactor code.
9948 * testsuite/icf_preemptible_functions_test.cc: New file.
9949 * testsuite/icf_preemptible_functions_test.sh: New file.
9950 * testsuite/icf_string_merge_test.cc: New file.
9951 * testsuite/icf_string_merge_test.sh: New file.
9952 * testsuite/icf_virtual_function_folding_test.cc: New file.
9953 * testsuite/icf_virtual_function_folding_test.sh: New file.
9954
04ceb17c
DK
99552010-04-14 Doug Kwan <dougkwan@google.com>
9956
9957 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9958 for local symbol recounting if we remove a section due to ICF.
9959 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9960 there are no regular objects in input.
9961
153e7da4
DK
99622010-04-13 Doug Kwan <dougkwan@google.com>
9963
9964 * arm.cc (Arm_input_section::set_final_data_size): Compute
9965 accurate final data size instead of using current data size.
9966
4dbd9faf
DK
99672010-04-09 Doug Kwan <dougkwan@google.com>
9968
9969 * layout.cc (Layout::choose_output_section): Handle script section
9970 types.
9971 (Layout::make_output_section_for_script): Add section type parameter.
9972 Handle script section types.
9973 * layout.h (Layout::make_output_section_for_script): Add section
9974 type parameter.
9975 * output.cc (Output_section::Output_section): Initialize data member
9976 is_noload_.
9977 (Output_section::do_reset_address_and_file_offset): Do not set address
9978 to 0 if section is a NOLOAD section.
9979 * output.h (Output_section::is_noload): New method.
9980 (Output_section::set_is_noload): Ditto.
9981 (Output_section::is_noload_): New data member.
9982 * script-c.h (Script_section_type): New enum type.
9983 (struct Parser_output_section_header): Add new file section_type.
9984 * script-sections.cc (Sections_element::output_section_name): Add
9985 parameter for returning script section type.
9986 (Output_section_definition::output_section_name): Ditto.
9987 (Output_section_definition::section_type)P; New method.
9988 (Output_section_definiton::script_section_type_name): Ditto.
9989 (Output_section_definition::script_section_type_): New data member.
9990 (Output_section_definition::Output_section_definition): Initialize
9991 data member Output_section_definition::script_section_type_.
9992 (Output_section_definition::create_sections): Pass script section type
9993 to Layout::make_output_section_for_script.
9994 (Output_section_definition::output_section_name): Return script
9995 section type to caller.
9996 (Output_section_definition::set_section_address): Do not advance
9997 dot value and load address if section type is NOLOAD. Set address
9998 of NOLOAD sections regardless of section flags.
9999 (Output_section_definition::print): Print section type if it is
10000 not SCRIPT_SECTION_TYPE_NONE.
10001 (Output_section_definition::section_type): New method.
10002 (Output_section_definition::script_section_type_name): Ditto.
10003 (Script_sections::output_section_name): Add new parameter
10004 PSECTION_TYPE for returning script section type. Pass it to
10005 section elements. Handle discard sections.
10006 (Sort_output_sections::operator()): Handle NOLOAD sections.
10007 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10008 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10009 returning script section type.
10010 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10011 INFO and NOLOAD.
10012 * yyscript.y (union): Add new field SECTION_TYPE.
10013 (COPY, DSECT, INFO, NOLOAD): New tokens.
10014 (opt_address_and_section_type): Change type to output_section_header.
10015 (section_type): New non-terminal
10016 (section_header): Handle section type.
2253bfba 10017 (opt_address_and_section_type): Return section type value.
4dbd9faf 10018
721ea635
L
100192010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10020
10021 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10022 * testsuite/plugin_common_test_2.c (foo): Likewise.
10023
6bf924b0
DK
100242010-04-08 Doug Kwan <dougkwan@google.com>
10025
10026 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10027 Output_merge_data.
10028 * output.cc (Output_section::add_merge_input_section): Simplify
10029 code and return status of Output_merge_base::add_input_section.
e1df38aa 10030 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10031 returns true.
10032
24af6f92
DK
100332010-04-07 Doug Kwan <dougkwan@google.com>
10034
10035 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10036 if section is marked as containing instructions but has no mapping
10037 symbols.
10038 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10039 correct section index.
10040 (Arm_relobj::find_linked_text_section): Ditto.
10041
00698fc5
CC
100422010-04-07 Cary Coutant <ccoutant@google.com>
10043
10044 * archive.cc (include_member): Destroy Read_symbols_data object before
10045 releasing file.
10046 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10047 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10048 (Read_symbols_data::~Read_symbols_data) New destructor.
10049 (Section_relocs::Section_relocs) New constructor.
10050 (Section_relocs::~Section_relocs) New destructor.
10051 (Read_relocs_data::Read_relocs_data) New constructor.
10052 (Read_relocs_data::~Read_relocs_data) New destructor.
10053 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10054 pointers to NULL after deleting.
10055
7296d933
DK
100562010-04-07 Doug Kwan <dougkwan@google.com>
10057
10058 * arm.cc: Replace "endianity" with "endianness" in comments.
10059 (Arm_exidx_cantunwind): Ditto.
10060 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10061 (Arm_relobj::merge_flags_and_attributes): New method.
10062 (Arm_relobj::merge_flags_and_attributes_): New data member.
10063 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10064 (Arm_relobj::scan_sections_for_stubs): Ditto.
10065 (Arm_relobj::do_read_symbols): Check to see if we really want to
10066 merge processor-specific flags and attributes. Exit early if
10067 an object is empty except for section names and the undefined symbol.
10068 (Target_arm::do_finalize_sections): Move check for ELF format to
10069 Arm_relobj::do_read_symbols. Merge processor specific flags and
10070 attributes from a regular object only when we have determined that
10071 it is aapropriate. Do not create an .ARM.attributes section in
10072 output if there is no regular input object.
10073 (Target_arm::merge_processor_specific_flags): Check
10074 --warn-mismatch before printing any error.
10075 (Target_arm::merge_object_attributes): Ditto.
10076 * gold.cc (queue_middle_tasks): Handle the case in which there is
10077 no regular object in input.
10078 * options.cc (General_options::parse_EB): New method.
10079 (General_options::parse_EL): Same.
10080 (General_options::General_options): Initialize endianness_.
10081 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10082 New options.
10083 (General_options::Endianness): New enum.
10084 (General_options::endianness): New method.
10085 (General_options::endianness_): New data member.
10086 * parameters.cc (Parameters::set_options): Check target endianness.
10087 (Parameters::set_target_once): Ditto.
10088 (Parameters::check_target_endianness): New method.
10089 (parameters_force_valid_target): If either -EL or -EB is specified,
10090 use it to define endianness of default target.
10091 * parameters.h (Parameters::check_target_endianness): New method
10092 declaration.
10093 * target.h (class Target): Change "endianity" to "endianness"
10094 in comments.
10095
efc8d4f2
RW
100962010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10097
10098 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10099 * configure: Regenerate.
10100 * Makefile.in: Regenerate.
10101 * testsuite/Makefile.in: Regenerate.
10102
be234d88
CC
101032010-04-06 Cary Coutant <ccoutant@google.com>
10104
10105 gcc PR lto/42757
10106 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10107 prevailing definitions of common symbols.
10108 * testsuite/plugin_test_6.sh: New test case.
10109 * testsuite/plugin_common_test_1.c: New test case.
10110 * testsuite/plugin_common_test_2.c: New test case.
10111 * testsuite/Makefile.am (plugin_test_6): New test case.
10112 * testsuite/Makefile.in: Regenerate.
10113
bd32c6bd
NC
101142010-04-06 Nick Clifton <nickc@redhat.com>
10115
10116 * po/vi.po: New Vietnamese translation.
10117
323c532f
DK
101182010-03-30 Doug Kwan <dougkwan@google.com>
10119
10120 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10121
4fcd97eb
DK
101222010-03-25 Doug Kwan <dougkwan@google.com>
10123
10124 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10125 to avoid a conversion warning on a 32-bit host.
10126
4ebf39db
ILT
101272010-03-24 Ian Lance Taylor <iant@google.com>
10128
10129 * testsuite/script_test_3.t: Add a TLS segment.
10130 * testsuite/Makefile.am (check_PROGRAMS): Add
10131 tls_phdrs_script_test.
10132 (tls_phdrs_script_test_SOURCES): Define.
10133 (tls_phdrs_script_test_DEPENDENCIES): Define.
10134 (tls_phdrs_script_test_LDFLAGS): Define.
10135 (tls_phdrs_script_test_LDADD): Define.
10136 * testsuite/Makefile.in: Rebuild.
10137
4a599bdd
CC
101382010-03-23 Cary Coutant <ccoutant@google.com>
10139
10140 * fileread.cc (find_or_make_view): Fix comment.
10141
6c93b22c
ILT
101422010-03-23 Ian Lance Taylor <iant@google.com>
10143
10144 * script-sections.cc (class Orphan_section_placement): Define
10145 PLACE_TLS and PLACE_TLS_BSS.
10146 (Orphan_section_placement::Orphan_section_placement): Initialize
10147 new places.
10148 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10149 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10150 (tls_script_test_SOURCES): Define.
10151 (tls_script_test_DEPENDENCIES): Define.
10152 (tls_script_test_LDFLAGS): Define.
10153 (tls_script_test_LDADD): Define.
10154 * testsuite/Makefile.in: Rebuild.
10155
a2c7281b
DK
101562010-03-22 Doug Kwan <dougkwan@google.com>
10157
10158 * arm.cc (Arm_relocate_functions::abs8,
10159 Arm_relocate_functions::abs16): Use correct check for overflow
10160 specified in the ARM ELF specs.
10161 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10162 target of a BLX instruction specially.
10163 (Reloc_stub::stub_type_for_reloc): Ditto.
10164 (Relocate::relocate): Use symbolic names instead of numeric relocation
10165 codes to report error.
10166 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10167 workaround.
10168 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10169 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10170 thumb2_blx_out_of_range.stdout
10171 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10172 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10173 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10174 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10175 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10176 thumb2_blx_in_range, thumb2_blx_in_range.o,
10177 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10178 thumb2_blx_out_of_range.o): New rules.
2e702c99 10179 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10180 thumb2_blx_in_range and thumb2_blx_out_of_range.
10181 * testsuite/Makefile.in: Regenerate.
10182 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10183 * testsuite/thumb_blx_in_range.s: New file.
10184 * testsuite/thumb_blx_out_of_range.s: New file.
10185
b0193076
RÁE
101862010-03-22 Rafael Espindola <espindola@google.com>
10187
10188 * archive.cc (Should_include): Move to archive.h.
10189 (should_include_member): Make it a member of Archive.
10190 (Lib_group): New.
10191 (Add_lib_group_symbols): New.
10192 * archive.h: Include options.h.
10193 (Archive_member): Moved from Archive.
10194 (Should_include): Moved from archive.cc.
10195 (Lib_group): New.
10196 (Add_lib_group_symbols): New.
10197 * dynobj.cc (do_should_include_member): New.
10198 * dynobj.h (do_should_include_member): New.
10199 * gold.cc (queue_initial_tasks): Update call to queue.
10200 * main.cc (main): Print lib group stats.
10201 * object.cc (do_should_include_member): New.
10202 * object.h: Include archive.h.
10203 (Object::should_include_member): New.
10204 (Object::do_should_include_member): New.
10205 (Sized_relobj::do_should_include_member): New.
10206 * options.cc (General_options::parse_start_lib): New.
10207 (General_options::parse_end_lib): New.
10208 (Input_arguments::add_file): Handle lib groups.
10209 (Input_arguments::start_group): Check we are not in a lib.
10210 (Input_arguments::start_lib): New.
10211 (Input_arguments::end_lib): New.
10212 * options.h (General_options): Add start_lib and end_lib.
10213 (Input_argument::lib_): New.
10214 (Input_argument::lib): New.
10215 (Input_argument::is_lib): New.
10216 (Input_file_lib): New.
10217 (Input_arguments::in_lib_): New.
10218 (Input_arguments::in_lib): New.
10219 (Input_arguments::start_lib): New.
10220 (Input_arguments::end_lib_): New.
10221 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10222 in unused members as preempted.
10223 (Sized_pluginobj::do_should_include_member): New.
10224 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10225 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10226 return the blocker.
10227 (Read_symbols::do_whole_lib_group): New.
10228 (Read_symbols::do_lib_group): New.
10229 (Read_symbols::do_read_symbols): Handle lib groups.
10230 (Read_symbols::get_name): Handle lib groups.
10231 * readsyms.h (Read_symbols): Add an archive member pointer.
10232 (Read_symbols::do_whole_lib_group): New.
10233 (Read_symbols::do_lib_group): New.
10234 (Read_symbols::member_): New.
10235 * script.cc (read_input_script): Update call to queue_soon.
10236
d099120c
DK
102372010-03-19 Doug Kwan <dougkwan@google.com>
10238
10239 * arm.cc (Stub_table::Stub_table): Initialize new data members
10240 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10241 (Stub_table::add_reloc_stub): Assign stub offset and update
10242 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10243 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10244 New data members.
2e702c99 10245 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10246 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10247 instead of going over all reloc stubs.
2e702c99 10248 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10249 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10250 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10251 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10252 Stringpool_template::offset_.
10253 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10254 Stringpool_template::offset_ to zero.
10255
1aa37384
DK
102562010-03-15 Doug Kwan <dougkwan@google.com>
10257
10258 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10259 offset_.
10260 (Stringpool_template::new_key_offset): New method.
10261 (Stringpool_template::add_string): Assign offsets when adding new
10262 strings.
10263 (Stringpool_template::set_string_offsets): Do not set string offsets
10264 when not optimizing.
10265 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10266 member size_.
2e702c99
RM
10267 (Chunked_vector::clear): Clear size_.
10268 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10269 (Chunked_vector::size): Return size_.
10270 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10271 (Chunked_vector::size_): New data member.
1aa37384
DK
10272 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10273 (Stringpool_template::new_key_offset): New method declaration.
10274 (Stringpool_template::offset_): New data member.
10275
b672b057
RÁE
102762010-03-15 Rafael Espindola <espindola@google.com>
10277
10278 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10279 Add_symbols' constructor.
10280 * readsyms.h (Add_symbols): Remove the input_group member.
10281
b6848d3c
ILT
102822010-03-10 Ian Lance Taylor <iant@google.com>
10283
10284 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10285 target to ask whether a reference to a symbol requires a stack
10286 split.
10287 * target.h (Target::is_call_to_non_split): New function.
10288 (Target::do_is_call_to_non_split): Declare virtual function.
10289 * target.cc: Include "symtab.h".
10290 (Target::do_is_call_to_non_split): New function.
10291 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10292
a2a5469e
CC
102932010-03-10 Cary Coutant <ccoutant@google.com>
10294
10295 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10296 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10297 (File_read::open[2]): Add whole_file_view_ to list of views.
10298 (File_read::make_view): Remove test of whole_file_view_.
10299 (File_read::find_or_make_view): Create whole_file_view_ if
10300 necessary.
10301 (File_read::clear_views): Replace bool parameter with enum;
10302 adjust all callers. Don't delete views with permanent data;
10303 do delete cached views and views from archives if
10304 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10305 if clearing the corresponding view.
10306 * fileread.h (File_read::Clear_views_mode): New enum.
10307 (File_read::View::is_permanent_view): New method.
10308 (File_read::clear_views): Replace bool parameter
10309 with enum; adjust all callers.
10310 * options.h (General_options): Change keep_files_mapped option;
10311 add map_whole_files.
10312 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10313 releasing the file.
10314 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10315 the file.
10316
8861f32b
DM
103172010-03-10 David S. Miller <davem@davemloft.net>
10318
10319 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10320
d62d0f5f
ST
103212010-03-09 Sriraman Tallam <tmsriram@google.com>
10322
10323 * icf.cc (get_section_contents): Add '@' marker after processing the
10324 merge reloc.
10325
9177756d
DK
103262010-03-08 Doug Kwan <dougkwan@google.com>
10327
10328 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10329 due to a conversion warning.
10330 (Arm_relobj::update_output_local_symbol_count): Check for local
10331 symbol with unset output index.
10332
9e9e071b
ILT
103332010-03-05 Ian Lance Taylor <iant@google.com>
10334
10335 * options.h (class General_options): Add --spare-dynamic-tags.
10336 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10337 --spare-dynamic-tags.
10338
a81ee015
ILT
103392010-03-05 Ian Lance Taylor <iant@google.com>
10340
10341 * incremental.cc: Include "libiberty.h".
10342
44ec90b9
RO
103432010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10344
10345 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10346 function, is_info_ member.
10347 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10348 (Versions::Versions): Update caller.
10349 (Versions::define_base_version): Likewise.
10350 (Versions::add_def): Likewise.
10351
0897ed3b
ST
103522010-03-03 Sriraman Tallam <tmsriram@google.com>
10353
10354 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10355 (Scan::possible_function_pointer_reloc): New function.
10356 (Scan::local_reloc_may_be_function_pointer): Change to call
10357 possible_function_pointer_reloc.
10358 (Scan::global_reloc_may_be_function_pointer): Ditto.
10359 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10360 relocations in ".data.rel.ro._ZTV" section.
10361 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10362 * testsuite/icf_safe_so_test.cc: Ditto.
10363 * testsuite/icf_safe_test.cc: Ditto.
10364 * testsuite/icf_safe_test.sh: Ditto.
10365
d3bbad62
ILT
103662010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10367 Ian Lance Taylor <iant@google.com>
10368
10369 * target-reloc.h (relocate_section): Check the symbol table index
10370 for -1U before setting the local symbol index.
10371 (scan_relocatable_relocs): If copying the relocation, record that
10372 the local symbol is required.
10373 * object.h (Symbol_value::is_output_symtab_index_set): New
10374 function.
10375 (Symbol_value::may_be_discarded_from_output_symtab): New
10376 function.
10377 (Symbol_value::has_output_symtab_entry): New function.
10378 (Symbol_value::needs_output_symtab_entry): Remove.
10379 (Symbol_value::output_symtab_index): Make sure the symbol index is
10380 set.
10381 (Symbol_value::set_output_symtab_index): Make sure the symbol
10382 index is not set. Make sure the new index is valid.
10383 (Symbol_value::set_must_have_output_symtab_entry): New function.
10384 (Symbol_value::has_output_dynsym_entry): New function.
10385 (Symbol_value::set_output_dynsym_index): Make sure the new index
10386 is valid.
10387 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10388 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10389 local symbol if permitted.
10390 (Sized_relobj::do_finalize_local_symbols): Call
10391 is_output_symtab_index_set rather than needs_output_symtab_entry.
10392 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10393 rather than needs_output_symtab_entry. Call
10394 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10395 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10396 is_output_symtab_index_set rather than needs_output_symtab_entry.
10397 * testsuite/discard_locals_relocatable_test.c: New file.
10398 * testsuite/discard_locals_test.sh: Test -r.
10399 * testsuite/Makefile.am (check_DATA): Add
10400 discard_locals_relocatable_test1.syms,
10401 discard_local_relocatable_test2.syms.
10402 (MOSTLYCLEANFILES): Likewise. Also add
10403 discard_locals_relocatable_test1.lout and
10404 discard_locals_relocatable_test2.out.
10405 (discard_locals_relocatable_test1.syms): New target.
10406 (discard_locals_relocatable_test.o): New target.
10407 (discard_locals_relocatable_test1.out): New target.
10408 (discard_locals_relocatable_test2.syms): New target.
10409 (discard_locals_relocatable_test2.out): New target.
10410 (various): Add missing ../ld-new dependencies.
10411 * testsuite/Makefile.in: Rebuild.
10412
7e8ccf26
NC
104132010-03-03 Nick Clifton <nickc@redhat.com>
10414
10415 * po/fi.po: New Finnish translation.
10416
2a0ff005
DK
104172010-03-01 Doug Kwan <dougkwan@google.com>
10418
10419 * layout.cc (Layout::Layout): Force section types of .init_array*,
10420 .preinit_array* and .fini_array* sections.
10421 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10422 Fix check of return value of std::string::find.().
10423 (Output_section::Input_section_sort_compare::operator()): Remove
10424 comment about .init_array.
10425 (Output_section::Input_section_sort_init_fini_compare::operator()):
10426 New method.
10427 (Output_section::sort_attached_input_sections): Handle .init_array
10428 and .fini_array specially.
10429 * output.h (Output_section::Inut_section_sort_compare): Update
10430 comment.
10431 (Output_section::Input_section_sort_init_fini_compare): New struct.
10432
c3e4ae29
DK
104332010-02-26 Doug Kwan <dougkwan@google.com>
10434
10435 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10436 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10437 * testsuite/debug_msg.sh: Avoid matching source line number for
10438 use of global variable undef_int.
10439
2fd9ae7a
DK
104402010-02-26 Doug Kwan <dougkwan@google.com>
10441
10442 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10443 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10444 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10445 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10446 * options.cc (General_options::General_options): Initialize member
10447 fix_v4bx_.
10448 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10449 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10450 and rm_no_fix_v4bx.stdout
10451 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10452 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10453 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10454 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10455 and arm_no_fix_v4bx.
10456 * Makefile.in: Regenerate.
10457 * testsuite/arm_fix_v4bx.s: New file.
10458 * testsuite/arm_fix_v4bx.sh: Ditto.
10459
67ec7d0b
DK
104602010-02-24 Doug Kwan <dougkwan@google.com>
10461
10462 * arm.cc (Target_arm::got_section): Make the .got section the first
10463 non RELRO section in the data segment.
10464 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10465 suffixes of section names.
10466
10165461
DK
104672010-02-24 Doug Kwan <dougkwan@google.com>
10468
10469 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10470 flags and attributes merging if an input file is a binary file.
10471 * fileread.cc (Input_file::open): Record format of original file.
10472 * fileread.h (Input_file::Format): New enum type.
2e702c99 10473 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10474 (Input_file::format): New method definition.
10475 (Input_file::format_):: New data member.
10476
4a54abbb
DK
104772010-02-24 Doug Kwan <dougkwan@google.com>
10478
10479 * arm.cc (Arm_output_data_got): New class.
10480 (ARM_TCB_SIZE): New constant
10481 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10482 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10483 If user uses a script with a SECTIONS clause, issue only a warning
10484 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10485 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10486 garbage collection.
10487 (Target_arm::got_mode_index_entry): Handle static linking.
10488 (Target_arm::Scan::local): Ditto.
10489 (Target_arm::Scan::global): Ditto.
10490 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10491 all incorrectly implemented relocations.
e1df38aa 10492 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10493 Arm_output_section::fix_exidx_coverage.
10494 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10495 from ".ARM.exidx." and ".ARM.extab.".
10496
ca419a6f
ILT
104972010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10498
10499 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10500 section if it does not already exist.
10501 * attributes.cc (Attributes_section_data::Attributes_section_data):
10502 Don't crash if size is zero.
10503
135b9c78
ILT
105042010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10505 Ian Lance Taylor <iant@google.com>
10506
10507 * gold.cc (queue_middle_tasks): If no input files were opened,
10508 exit.
10509 * workqueue.h (Task_function::Task_function): Assert that there is
10510 a blocker.
10511
bb0bfe4f
DK
105122010-02-22 Doug Kwan <dougkwan@google.com>
10513
10514 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10515 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10516 types to avoid warnings due to different uint64_t implementations
10517 on different hosts.
10518
2a2b6d42
DK
105192010-02-21 Doug Kwan <dougkwan@google.com>
10520
10521 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10522 handling of the maximum backward branch offset.
2e702c99 10523 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10524 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10525 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10526 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10527 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10528 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10529 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10530 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10531 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10532 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10533 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10534 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10535 thumb2_bl_out_of_range.o): New rules.
10536 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10537 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10538 thumb2_bl_out_of_range
10539 * testsuite/Makefile.in: Regenerate.
10540 * testsuite/arm_bl_in_range.s: New file.
10541 * testsuite/arm_bl_out_of_range.s: Ditto.
10542 * testsuite/arm_branch_in_range.sh: Ditto.
10543 * testsuite/arm_branch_range.t: Ditto.
10544 * testsuite/thumb2_branch_range.t: Ditto.
10545 * testsuite/thumb_bl_in_range.s: Ditto.
10546 * testsuite/thumb_bl_out_of_range.s: Ditto.
10547 * testsuite/thumb_branch_range.t: Ditto.
10548
b487ad64
ST
105492010-02-20 Sriraman Tallam <tmsriram@google.com>
10550
10551 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10552 Add reloc offset information.
10553 * icf.cc (get_section_contents): Change iterators to point to the new
10554 vectors. Add reloc offset information to the contents.
10555 * icf.h (Icf::Sections_reachable_info): New typedef.
10556 (Icf::Sections_reachable_list): New typedef.
10557 (Icf::Offset_info): New typedef.
10558 (Icf::Reloc_info): New struct typedef.
10559 (Icf::Reloc_info_list): New typedef.
10560 (Icf::symbol_reloc_list): Delete method.
10561 (Icf::addend_reloc_list): Delete method.
10562 (Icf::section_reloc_list): Delete method.
10563 (Icf::reloc_info_list): New method.
10564 (Icf::reloc_info_list_): New member.
10565
f96accdf
DK
105662010-02-19 Doug Kwan <dougkwan@google.com>
10567
10568 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10569 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10570 * arm.cc (Arm_relocation_functions): New forward declaration.
10571 (Target_arm::Target_arm): Initialize new data members
10572 got_mod_index_offset_ and tls_base_symbol_defined_.
10573 (Target_arm::Relocate::relocate_tls): New method.
10574 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10575 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10576 New methods.
2e702c99 10577 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10578 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10579 (Target_arm::got_mod_index_offset_,
10580 Target_arm::tls_base_symbol_defined_): New data members.
10581 (Target_arm::Scan::local, Target::Scan::global,
10582 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10583 relocations.
10584
c8761b9a
DK
105852010-02-18 Doug Kwan <dougkwan@google.com>
10586
10587 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10588 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10589 text section as a parameter becuase some broken tools may not set
10590 the link in section header.
10591 (Target_arm::has_got_section): New method.
10592 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10593 without any mapping symbol as data only. Remove warning.
10594 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10595 link in its section header, try to discover the link by inspecting the
10596 REL31 relocation at the beginning of the section.
10597 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10598 in error message.
10599 (Target_arm::Scan::global): Treat any reference to the symbol
10600 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10601
21bb3914
ST
106022010-02-12 Sriraman Tallam <tmsriram@google.com>
10603
10604 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10605 (Scan::global_reloc_may_be_function_pointer): New function.
10606 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10607 (Scan::global_reloc_may_be_function_pointer): New function.
10608 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10609 (Scan::global_reloc_may_be_function_pointer): New function.
10610 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10611 (Scan::global_reloc_may_be_function_pointer): New function.
10612 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10613 (Scan::global_reloc_may_be_function_pointer): New function.
10614 (Scan::possible_function_pointer_reloc): New function.
10615 (Target_x86_64::can_check_for_function_pointers): New function.
10616 * gc.h (gc_process_relocs): Scan relocation types to determine if
10617 function pointers were taken for targets that support it.
10618 * icf.cc (Icf::find_identical_sections): Include functions for
10619 folding in safe ICF whose pointer is not taken.
10620 * icf.h (Secn_fptr_taken_set): New typedef.
10621 (fptr_section_id_): New member.
10622 (section_has_function_pointers): New function.
10623 (set_section_has_function_pointers): New function.
10624 (check_section_for_function_pointers): New function.
10625 * options.h: Fix comment for safe ICF option.
10626 * target.h (can_check_for_function_pointers): New function.
10627 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10628 Modify icf_safe_test for X86-64.
10629 * testsuite/Makefile.in: Regenerate.
10630 * testsuite/icf_safe_so_test.cc: New file.
10631 * testsuite/icf_safe_so_test.sh: New file.
10632 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10633 (main): Change to take pointer to function kept_func_3.
10634 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10635 folding is done correctly for X86-64.
10636
0da6fa6c
DM
106372010-02-12 David S. Miller <davem@davemloft.net>
10638
10639 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10640 is_symbolless parameter.
10641 (Output_reloc<SHT_REL>::is_symbolless): New.
10642 (Output_reloc<SHT_REL>::is_symbolless_): New.
10643 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10644 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10645 (Output_reloc<SHT_RELA>::is_symbolless): New.
10646 (Output_data_reloc::add_global): Handle is_symbolless.
10647 (Output_data_reloc::add_global_relative): Likewise.
10648 (Output_data_reloc::add_local): Likewise.
10649 (Output_data_reloc::add_local_relative): Likewise.
10650 (Output_data_reloc::add_symbolless_global_addend): New.
10651 (Output_data_reloc::add_symbolless_local_addend): New.
10652 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10653 is_symbolless.
10654 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10655 instead of ->is_relative_
10656 (Output_reloc::write): Likewise.
10657 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10658 (Output_reloc::write_rel): Simplify.
10659
10660 * sparc.cc (Target_sparc::Scan::local): Use
10661 ->add_symbolless_local_addend as needed.
10662 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10663 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10664 based upon relocation offset.
10665
e4782e83
DK
106662010-02-11 Doug Kwan <dougkwan@google.com>
10667
10668 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10669 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10670 beginning of function.
10671 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10672 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10673 parameter is_32bit in calls to should_apply_static_reloc.
10674 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10675 (check_DATA): Add arm_abs_global.stdout.
10676 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10677 arm_abs_global.stdout): New rules.
10678 (MOSTLLYCLEANFILES): Add arm_abs_global
10679 * Makefile.in: Regenerate.
10680 * testsuite/arm_abs_global.s: New file.
10681 * testsuite/arm_abs_global.sh: Ditto.
10682 * testsuite/arm_abs_lib.s: Ditto.
10683
93ceb764
ILT
106842010-02-11 Ian Lance Taylor <iant@google.com>
10685
10686 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10687 Read_relocs task.
10688 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10689 Allocate_commons_task first.
10690 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10691 task, rather than symtab_lock_.
10692 (Gc_process_relocs::~Gc_process_relocs): New function.
10693 (Gc_process_relocs::is_runnable): Check this_blocker_.
10694 (Gc_process_relocs::locks): Use next_blocker_ rather than
10695 blocker_.
10696 (Scan_relocs::~Scan_relocs): New function.
10697 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10698 symtab_lock_.
10699 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10700 next_blocker_.
10701 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10702 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10703 constructor accordingly.
10704 (class Gc_process_relocs): Likewise.
10705 (class Scan_relocs): Likewise.
10706 * common.h (class Allocate_commons_task): Remove symtab_lock_
10707 field, and corresponding constructor parameter.
10708 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10709 symtab_lock_.
10710 (Allocate_commons_task::locks): Likewise.
10711
114dfbe1
ILT
107122010-02-11 Ian Lance Taylor <iant@google.com>
10713
10714 * gold-threads.h (class Once): Define.
10715 (class Initialize_lock): Rewrite as child of Once.
10716 * gold-threads.cc (class Once_initialize): Define.
10717 (once_pointer_control): New static variable.
10718 (once_pointer, once_arg): New static variables.
10719 (c_run_once): New static function.
10720 (Once::Once, Once::run_once, Once::internal_run): New functions.
10721 (class Initialize_lock_once): Remove.
10722 (initialize_lock_control): Remove.
10723 (initialize_lock_pointer): Remove.
10724 (initialize_lock_once): Remove.
10725 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10726 (Initialize_lock::initialize): Rewrite.
10727 (Initialize_lock::do_run_once): New function.
10728 * archive.cc (Archive::interpret_header): Only clear name if it is
10729 not already empty.
10730 * fileread.cc: Include "gold-threads.h"
10731 (file_counts_lock): New static variable.
10732 (file_counts_initialize_lock): Likewise.
10733 (File_read::release): Only increment counts when using --stats.
10734 Use a lock around the increment.
10735 * parameters.cc (class Set_parameters_target_once): Define.
10736 (set_parameters_target_once): New static variable.
10737 (Parameters::Parameters): Move here from parameters.h.
10738 (Parameters::set_target): Rewrite.
10739 (Parameters::set_target_once): New function.
10740 (Parameters::clear_target): Move here and rewrite.
10741 * parameters.h (class Parameters): Update declarations. Add
10742 set_parameters_target_once_ field.
10743 (Parameters::Parameters): Move to parameters.cc.
10744 (Parameters::clear_target): Likewise.
10745 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10746 task.
10747 (Start_group::~Start_group): New function.
10748 (Start_group::is_runnable): New function.
10749 (Start_group::locks, Start_group::run): New functions.
10750 (Finish_group::run): Change saw_undefined to size_t.
10751 * readsyms.h (class Start_group): Define.
10752 (class Finish_group): Change saw_undefined_ field to size_t.
10753 (Finish_group::Finish_group): Remove saw_undefined and
10754 this_blocker parameters. Change all callers.
10755 (Finish_group::set_saw_undefined): New function.
10756 (Finish_group::set_blocker): New function.
10757 * symtab.h (class Symbol_table): Change saw_undefined to return
10758 size_t. Change saw_undefined_ field to size_t.
10759 * target-select.cc (Set_target_once::do_run_once): New function.
10760 (Target_selector::Target_selector): Initialize set_target_once_
10761 field. Don't initialize lock_ and initialize_lock_ fields.
10762 (Target_selector::instantiate_target): Rewrite.
10763 (Target_selector::set_target): New function.
10764 * target-select.h (class Set_target_once): Define.
10765 (class Target_selector): Update declarations. Make
10766 Set_target_once a friend. Remove lock_ and initialize_lock_
10767 fields. Add set_target_once_ field.
10768
fa17a3f4
ILT
107692010-02-10 Ian Lance Taylor <iant@google.com>
10770
10771 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10772 queueing any tasks.
10773 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10774 (queue_middle_tasks): Add all blockers before queueing any tasks.
10775 (queue_final_tasks): Likewise.
10776 * token.h (Task_token::add_blockers): New function.
10777 * object.h (Input_objects::number_of_relobjs): New function.
10778
c7177d31
ILT
107792010-02-10 Ian Lance Taylor <iant@google.com>
10780
5de0e392
ILT
10781 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10782 shared, not if not position independent.
10783 * x86_64.cc (Relocate::relocate_tls): Likewise.
10784 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10785 (tls_pie_pic_test): New target.
10786 * testsuite/Makefile.in: Rebuild.
10787
c7177d31
ILT
10788 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10789 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10790 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10791 * testsuite/Makefile.in: Rebuild.
10792
684b268a
DM
107932010-02-09 David S. Miller <davem@davemloft.net>
10794
10795 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10796 R_SPARC_RELATIVE using ->add_local_relative().
10797 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10798
612a8d3d
DM
10799 * output.h (Output_data_dynamic::add_section_size): New method
10800 that takes two Output_data objects.
10801 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10802 entry param. Handle it in initializers.
10803 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10804 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10805 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10806 arg.
10807 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10808 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10809 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10810 for dynrel_includes_plt.
10811 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10812 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10813 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10814 before .rela.plt
10815 (Target_sparc::do_finalize_sections): Update to pass true for
10816 dynrel_includes_plt.
10817 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10818 output before .rela.plt
10819 (Target_powerpc::do_finalize_sections): Update to pass true for
10820 dynrel_includes_plt when 32-bit.
10821
cb1be87e
DK
108222010-02-08 Doug Kwan <dougkwan@google.com>
10823
10824 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10825 method.
10826 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10827 Arm_relobj::scan_section_for_cortex_a8_stubs,
10828 Arm_relobj::do_relocation_section): Instead of calling
10829 Output_section::output_address, use faster
10830 Arm_relobj::simple_input_section_output_address.
10831
705b5121
DM
108322010-02-08 David S. Miller <davem@davemloft.net>
10833
10834 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10835 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10836 relocation helper function.
10837
024c4466
DM
10838 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10839 just like R_SPARC_GOT{10,13,22}.
10840 (Target_sparc::Scan::local): Likewise.
10841 (Target_sparc::Relocate:relocate): Likewise.
10842
9109c078
ILT
108432010-02-06 Ian Lance Taylor <iant@google.com>
10844
10845 * configure.ac: Rewrite targetobjs duplicate removal code to use
10846 only shell constructs.
10847 * configure: Rebuild.
10848
cf846138
DK
108492010-02-05 Doug Kwan <dougkwan@google.com>
10850
10851 PR 11247
10852 * arm.cc (Arm_relobj::section_is_scannable): New method.
10853 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10854 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10855
6cfaf60b
DK
108562010-02-04 Doug Kwan <dougkwan@google.com>
10857
10858 PR 11247
10859 * arm-reloc-property.cc (cstdio): Include.
10860 * configure.ac (targetobjs): Remove duplicates.
10861 * configure: Regenerate.
10862 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10863 big and little endian version for a given address size.
10864
5c57f1be
DK
108652010-02-03 Doug Kwan <dougkwan@google.com>
10866
10867 * arm-reloc-property.cc
10868 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10869 definition.
10870 * arm-reloc-property.h
10871 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10872 New method definition.
10873 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10874 declaration.
10875 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10876 overflow to N.
10877 (GOT_PREL): Change implemented to Y.
10878 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10879 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10880 (Arm_relocate_functions::movw_abs_nc): Remove method.
10881 (Arm_relocate_functions::movt_abs): Ditto.
10882 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10883 (Arm_relocate_functions::thm_movt_abs): Ditto.
10884 (Arm_relocate_functions::movw_rel_nc): Ditto.
10885 (Arm_relocate_functions::movw_rel): Ditto.
10886 (Arm_relocate_functions::movt_rel): Ditto.
10887 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10888 (Arm_relocate_functions:thm_movw_rel): Ditto.
10889 (Arm_relocate_functions:thm_movt_rel): Ditto.
10890 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10891 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10892 New method definitions.
10893 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10894 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10895 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10896 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10897 (Target_arm::Relocate::relocate): Check for non-static or
10898 unimplemented relocation code and exit early. Change calls to
10899 Target_arm::reloc_uses_thumb_bit and
10900 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10901 instead. Refactor code to handle similar relocations to increase
10902 code sharing. Remove check for unsupported relocation code in switch
10903 statement.
10904 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10905 relocation property table to find out size. Change error message to
10906 print out the name of a relocation code instead of the numeric value.
10907 (Target_arm::scan_reloc_for_stub): Use relocation property table
10908 instead of calling Target_arm::reloc_uses_thumb_bit().
10909
218c5831
DK
109102010-02-02 Doug Kwan <dougkwan@google.com>
10911
10912 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10913 types of relaxed input section.
10914
0d31c79d
DK
109152010-02-02 Doug Kwan <dougkwan@google.com>
10916
10917 * Makefile.am (HFILES): Add arm-reloc-property.h.
10918 (DEFFILES): New.
2e702c99
RM
10919 (TARGETSOURCES): Add arm-reloc-property.cc
10920 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10921 (libgold_a_SOURCES): $(DEFFILES)
10922 * Makefile.in: Regenerate.
10923 * arm-reloc-property.cc: New file.
10924 * arm-reloc-property.h: New file.
10925 * arm-reloc.def: New file.
10926 * arm.cc: Update comments.
10927 (arm-reloc-property.h): New included header.
10928 (arm_reloc_property_table): New global variable.
10929 (Target_arm::do_select_as_default_target): New method definition.
10930 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10931 arm-reloc-property to targ_extra_obj.
10932 * parameters.cc (set_parameters_target): Call
10933 Target::select_as_default_target().
10934 * target.h (Target::select_as_default_target): New method definition.
10935 (Target::do_select_as_default_target): Same.
10936
546c7457
DK
109372010-02-01 Doug Kwan <dougkwan@google.com>
10938
10939 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10940 first_output_text_section_.
10941 (Arm_exidx_fixup::first_output_text_section): New method definition.
10942 (Arm_exidx_fixup::first_output_text_section_): New data member.
10943 (Arm_exidx_fixup::process_exidx_section): Record the first text
10944 output section seen.
10945 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10946 and entsize in output section header.
10947
11b861d5
DK
109482010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10949
10950 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10951 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10952 (Arm_relocate_functions::thm_alu11): New Method.
10953 (Arm_relocate_functions::thm_pc8): New Method.
10954 (Arm_relocate_functions::thm_pc12): New Method.
10955 (Target_arm::Scan::local): Handle the relocations.
10956 (Target_arm::Scan::global): Likewise.
10957 (Target_arm::Relocate::relocate): Likewise.
10958 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10959
c9a2c125
DK
109602010-01-29 Doug Kwan <dougkwan@google.com>
10961
10962 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10963 of relocation types as ld.
10964
1521477a
DK
109652010-01-29 Doug Kwan <dougkwan@google.com>
10966
10967 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10968 to public.
10969 (Arm_relocate_functions::thumb_branch_common): Ditto.
10970 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10971 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10972 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10973 Arm_relocate_functions::jump24): Remove.
10974 (Target_arm::Relocate::relocate): Adjust code to call
10975 Arm_relocation_functions::arm_branch_common and
10976 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10977 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10978
e7eca48c
DK
109792010-01-29 Doug Kwan <dougkwan@google.com>
10980
10981 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10982 output_local_symbol_count_needs_update_.
10983 (Arm_relobj::output_local_symbol_count_needs_update,
10984 Arm_relobj::set_output_local_symbol_count_needs_update,
10985 Arm_relobj::update_output_local_symbol_count): New methods.
10986 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10987 member.
10988 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10989 of pointed function as in a R_ARM_PREL31 relocation.
10990 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10991 for output local symbol count updating.
10992 (Target_arm::do_relax): Update output local symbol counts in objects
10993 if necessary.
10994 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10995
02961d7e
ILT
109962010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10997
10998 * arm.cc: Added support for the ARM relocations:
10999 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11000 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11001 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11002 movw_prel_nc).
11003 (Arm_relocate_functions::movw_rel): New method.
11004 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11005 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11006 thm_movw_prel_nc).
11007 (Arm_relocate_functions::thm_movw_rel): New method.
11008 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11009 thm_movt_prel).
11010 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11011 relocations.
11012 (Target_arm::Scan::global): Likewise.
11013 (Target_arm::Relocate::relocate): Likewise.
11014 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11015 Likewise.
11016
b10d2873
ILT
110172010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11018
11019 * arm.cc: Added support for ARM group relocations.
11020 (Target_arm::reloc_needs_sym_origin): New method.
11021 (Arm_relocate_functions::calc_grp_kn): New method.
11022 (Arm_relocate_functions::calc_grp_residual): New method.
11023 (Arm_relocate_functions::calc_grp_gn): New method.
11024 (Arm_relocate_functions::arm_grp_alu): New Method.
11025 (Arm_relocate_functions::arm_grp_ldr): New Method.
11026 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11027 (Arm_relocate_functions::arm_grp_ldc): New Method.
11028 (Target_arm::Scan::local): Handle the ARM group relocations.
11029 (Target_arm::Scan::global): Likewise.
11030 (Target_arm::Relocate::relocate): Likewise.
11031 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11032 Likewise.
11033
2b328d4e
DK
110342010-01-26 Doug Kwan <dougkwan@google.com>
11035
11036 * arm.cc (set): Include.
11037 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11038 pointer type.
2e702c99 11039 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11040 (Arm_output_section::append_text_sections_to_list): New method.
11041 (Arm_output_section::fix_exidx_coverage): Ditto.
11042 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11043 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11044 Relobj::set_section_offset() instead of
11045 Sized_relobj::invalidate_section_offset().
2e702c99 11046 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11047 parameter for section headers. Ignore relocation sections for
11048 unallocated sections and EXIDX sections.
11049 (Target_arm::fix_exidx_coverage): New method.
11050 (Target_arm::output_section_address_less_than): New type.
11051 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11052 linked text section instead of the EXIDX section.
11053 (Arm_output_section::create_stub_group): Add an assertion to check
11054 that this is not an EXIDX output section.
11055 (Arm_output_section::append_text_sections_to_list): New method.
11056 (Arm_output_section::fix_exidx_coverage): Ditto.
11057 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11058 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11059 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11060 first pass.
11061 (Target_arm::fix_exidx_coverage): New method.
11062 * object.h (Relobj::set_output_section): New method.
11063 (Sized_relobj::invalidate_section_offset): Remove method.
11064 (Sized_relobj::do_invalidate_section_offset): Remove method.
11065 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11066
c7f3c371
DK
110672010-01-25 Doug Kwan <dougkwan@google.com>
11068
11069 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11070 Fix warning due to signed and unsigned comparison on a 32-bit host.
11071
8923b24c
DK
110722010-01-22 Doug Kwan <dougkwan@google.com>
11073
11074 * arm.cc (Target_arm::do_relax): Record an output section for section
11075 offset adjustment it contains any stub table that has changed.
11076 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11077 offsets in an output section if necessary.
11078 * output.cc (Output_section::Output_section): Initialize
11079 section_offsets_need_adjustments_.
11080 (Output_section::add_input_section_for_script): Renamed to
11081 Output_section::add_simple_input_section.
11082 (Output_section::save_states): Add a comment.
11083 (Output_section::discard_states): New method defintion.
11084 (Output_section::adjust_section_offsets): Same.
11085 * output.h (Output_section::add_input_section_for_script): Renamed to
11086 Output_section::add_simple_input_section.
11087 (Output_section::discard_states): New method declaration.
11088 (Output_section::adjust_section_offsets): Same.
11089 (Output_section::section_offsets_need_adjustment,
11090 Output_section::set_section_offsets_need_adjustment): New method
11091 definitions.
11092 (Output_section::section_offsets_need_adjustment_): New data member.
11093 * script-sections.cc
11094 (Output_section_element_input::set_section_address): Adjust code for
11095 renaming of Output_section::add_input_section_for_script.
11096 (Orphan_output_section::set_section_address): Same.
11097
9b2fd367
DK
110982010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11099
11100 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11101 Fix_v4bx enum values .
11102 * gold/options.h (General_options): New option definitions.
11103 (General_options::fix_v4bx): New method.
11104 (General_options::Fix_v4bx): New enum.
11105 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11106 (General_options::parse_fix_v4bx_interworking): New method.
11107
80d0d023
DK
111082010-01-22 Doug Kwan <dougkwan@google.com>
11109
11110 * arm.cc (Arm_exidx_fixup): New class.
11111
af2cdeae
DK
111122010-01-21 Doug Kwan <dougkwan@google.com>
11113
11114 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11115 classes.
11116 (Arm_exidx_section_offset_map): New type.
11117
993d07c1
DK
111182010-01-21 Doug Kwan <dougkwan@google.com>
11119
11120 * arm.cc (Arm_exidx_input_section): New class.
11121 (Arm_relobj::exidx_input_section_by_link,
11122 Arm_relobj::exidx_input_section_by_shndx,
11123 Arm_relobj::make_exidx_input_section): New methods.
11124 (read_arm_attributes_section): Remove.
11125 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11126 information about them.
11127 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11128 to here.
11129
5ac169d4
DK
111302010-01-20 Doug Kwan <dougkwan@google.com>
11131
11132 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11133 Input_section_specifier to Section_id.
11134 (Target_arm::new_arm_input_section: Adjust code for change of key
11135 type.
11136 (Target_arm::find_arm_input_section): Ditto.
11137 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11138 (Section_id): Remove.
11139 (Garbage_collection::Section_id_hash): Remove.
11140 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11141 (Section_id): Remove.
11142 (Icf::Section_id_hash): Remove.
11143 * object.h (Section_id, Const_section_id, Section_id_hash,
11144 Const_section_id_hash): New type definitions.
11145 * output.cc (Output_section::add_relaxed_input_section): Change to
11146 use Const_section_id instead of Input_section_specifier as key type.
11147 (Output_section::add_merge_input_section): Ditto.
11148 (Output_section::build_relaxation_map): Change to use Section_id
11149 instead of Input_section_specifier as key type.
2e702c99 11150 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11151 Ditto.
11152 (Output_section::convert_input_sections_to_relaxed_sections): Change
11153 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11154 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11155 (Output_section::find_relaxed_input_section): Ditto.
11156 * output.h (Input_section_specifier): Remove class.
11157 (Output_section::Output_section_data_by_input_section_map): Change
11158 key type to Const_section_id.
11159 (Output_section::Output_relaxed_input_section_by_input_section_map):
11160 Ditto.
11161 (Output_section::Relaxation_map): Change key type to Section_id.
11162
a2162063
ILT
111632010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11164
11165 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11166 (class Arm_v4bx_stub): New class.
11167 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11168 (Stub_factory::make_arm_v4bx_stub): New method.
11169 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11170 (Stub_table::empty): Handle v4bx stubs.
11171 (Stub_table::add_arm_v4bx_stub): New method.
11172 (Stub_table::find_arm_v4bx_stub): New method.
11173 (Arm_relocate_functions::v4bx): New method.
11174 (Target_arm::fix_v4bx): New method.
11175 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11176 (Stub_table::relocate_stubs): Likewise.
11177 (Stub_table::do_write): Likewise.
11178 (Stub_table::update_data_size_and_addralign): Likewise.
11179 (Stub_table::finalize_stubs): Likewise.
11180 (Target_arm::Scan::local): Likewise.
11181 (Target_arm::Scan::global): Likewise.
11182 (Target_arm::do_finalize_sections): Likewise.
11183 (Target_arm::Relocate::relocate): Likewise.
11184 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11185 Likewise.
11186 (Target_arm::scan_reloc_for_stub): Likewise.
11187 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11188
5696ab0b
ILT
111892010-01-19 Ian Lance Taylor <iant@google.com>
11190
11191 * output.cc (Output_section_headers::do_sized_write): Write large
11192 segment count to sh_info field.
11193 (Output_file_header::do_sized_write): For large segment count,
11194 write PN_XNUM to e_phnum field.
11195
800d0f56
ILT
111962010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11197
11198 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11199 (Arm_relocate_functions::thm_jump8): New function.
11200 (Arm_relocate_functions::thm_jump11): New function.
11201 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11202 R_ARM_THM_JUMP11.
11203 (Target_arm::Scan::global): Likewise.
11204 (Target_arm::Relocate::relocate): Likewise.
11205 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11206 Likewise.
11207
41263c05
DK
112082010-01-14 Doug Kwan <dougkwan@google.com>
11209
11210 * arm.cc (map, utility): Include headers.
11211 (Target_arm::apply_cortex_a8_workaround): New method.
11212 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11213 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11214 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11215 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11216 the --[no-]fix-cortex-a8 command line options.
11217 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11218 (Target_arm::relocate_stub): Use addend in instruction template.
11219 * options.h (DEFINE_bool): Set the user-set flag.
11220 (General_options): Add --[no-]-fix-cortex options.
11221 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11222 : Update fast look-up map after conversion.
41263c05 11223
459e9b03
ST
112242010-01-14 Sriraman Tallam <tmsriram@google.com>
11225
11226 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11227 in the first pass of do_layout.
11228
b521dfe4
DK
112292010-01-13 Doug Kwan <dougkwan@google.com>
11230
11231 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11232 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11233 apparent compiler problem of not folding static constant integral
11234 data members of elfcpp::Elf_sizes<32>.
11235
44272192
DK
112362010-01-13 Doug Kwan <dougkwan@google.com>
11237
11238 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11239 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11240 Arm_relobj::scan_section_for_cortex_a8_erratum,
11241 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11242 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11243 sections to scan for relocation stubs into a new method
11244 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11245 relocation and Cortex-A8 stub scanning.
11246 (Target_arm::do_relax): Force stubs to be after stubbed sections
11247 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11248 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11249 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11250
44b71ece
ILT
112512010-01-12 Ian Lance Taylor <iant@google.com>
11252
11253 * target-reloc.h (visibility_error): New inline function.
11254 (relocate_section): Call visibility_error.
11255 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11256 (MOSTLYCLEANFILES): Likewise.
11257 (protected_4_pic.o, protected_3.err): New targets.
11258 * testsuite/protected_4.cc: New file.
11259
a120bc7f
DK
112602010-01-12 Doug Kwan <dougkwan@google.com>
11261
11262 * arm.cc (Cortex_a8_reloc): New class.
11263 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11264 and cortex_a8_relocs_info_.
11265 (Target_arm::fix_cortex_a8): New method definition.
11266 (Target_arm::Cortex_a8_relocs_info): New type.
11267 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11268 New data member declarations.
11269 (Target_arm::scan_reloc_for_stub): Record information about
11270 relocations for THUMB branches that might be exempted from the
11271 Cortex-A8 workaround.
11272 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11273 at the beginning of a relaxation pass.
11274
20138696
DK
112752010-01-12 Doug Kwan <dougkwan@google.com>
11276
11277 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11278 (Arm_relobj::Mapping_symbol_position,
11279 Arm_reloj::Mapping_symbol_position_less,
11280 Arm_relobj::Mapping_symbols_info): New types.
11281 (Target_arm::is_mapping_symbol_name): New method definition.
11282 (Arm_relobj::do_count_local_symbols): Save information about mapping
11283 symbols.
11284
089d69dc
DK
112852010-01-11 Doug Kwan <dougkwan@google.com>
11286
11287 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11288 Arm_relocate_functions::thumb32_branch_upper,
11289 Arm_relocate_functions::thumb32_branch_lower,
11290 Arm_relocate_functions::thumb32_cond_branch_offset,
11291 Arm_relocate_functions::thumb32_cond_branch_upper,
11292 Arm_relocate_functions::thumb32_cond_branch_lower,
11293 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11294 branch offset encoding.
11295 (Arm_relocate_functions::thumb_branch_common): Use new branch
11296 offset encoding methods to avoid code duplication.
11297 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11298 (Stub_addend_reader::operator()): Use new branch encoding method
11299 to avoid code duplication.
11300
99e5bff2
DK
113012010-01-11 Doug Kwan <dougkwan@google.com>
11302
11303 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11304 (Target_arm::do_finalize_sections): Define special EXIDX section
11305 symbols only if referenced.
11306 * gc.h (Garbage_collection::add_reference): New method.
11307 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11308 code duplication.
11309
98e090bd
ILT
113102010-01-11 Ian Lance Taylor <iant@google.com>
11311
d0a91bd8
ILT
11312 * script.cc (Version_script_info::build_expression_list_lookup):
11313 Change complaing about duplicate wildcard match from error to
11314 warning.
11315
98e090bd
ILT
11316 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11317 of 2009-12-30.
11318 (Version_script_info::Version_script_info): Initialize globs_,
11319 default_version_, default_is_global_, and exact_. Don't
11320 initialize globals_ or locals_.
11321 (Version_script_info::build_lookup_tables): Build local symbols
11322 first.
11323 (Version_script_info::unquote): New function.
11324 (Version_script_info::add_exact_match): New function.
11325 (Version_script_info::build_expression_list_lookup): Remove lookup
11326 parameter. Add is_global parameter. Change all callers. Handle
11327 wildcard pattern specially. Unquote pattern. Call
11328 add_exact_match.
11329 (Version_script_info::get_name_to_match): New function.
11330 (Version_script_info::get_symbol_version): New function.
11331 (Version_script_info::get_symbol_version_helper): Remove.
11332 (Version_script_info::check_unmatched_names): Call unquote.
11333 * script.h (class Version_script_info): Change get_symbol_version
11334 to be non-inline and add is_global parameter; change all callers.
11335 Rewrite symbol_is_local. Update declarations. Define struct
11336 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11337 Remove globals_ and locals_ members. Add exact_, globs_,
11338 default_version_, is_global_.
11339 (Version_script_info::Glob): Remove pattern, add expression and
11340 is_global. Update constructor. Change all callers.
11341 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11342 default version.
11343 (Versions::symbol_section_contents): If a symbol is undefined, or
11344 defined in a dynamic object, set the version index to
11345 VER_NDX_LOCAL.
11346 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11347 symbol_is_local.
11348 (Symbol_table::add_from_pluginobj): Likewise.
11349 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11350
d56962d3
DK
113512010-01-11 Doug Kwan <dougkwan@google.com>
11352
11353 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11354 (incremental_dump_LDADD): Add linking option for libintl.
11355 * Makefile.in: Regenerate.
11356
94e6ee91
L
113572010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11358
11359 PR gold/11144
11360 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11361 instead of -Ds.
11362 * testsuite/Makefile.in: Regenerated.
11363
e96c574b
DK
113642010-01-10 Doug Kwan <dougkwan@google.com>
11365
11366 * options.h (DEFINE_var): Use parentheses around argument varname__
11367 in macro body to avoid any unintended subsequent substitutions.
11368
7198066b
ILT
113692010-01-10 Ian Lance Taylor <iant@google.com>
11370
ba4d53bf
ILT
11371 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11372 candidates before doing symbol resolution.
11373
7198066b
ILT
11374 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11375 ODR candidates if only one is weak.
11376
a2beed37
ILT
113772010-01-08 Ian Lance Taylor <iant@google.com>
11378
11379 * script.cc (Version_script_info::build_expression_list_lookup):
11380 Don't warn about ambiguous version, just record the ambiguity.
11381 (Version_script_info::get_symbol_version_helper): Give error if
11382 version is ambiguous.
11383
2fb7225c
DK
113842010-01-08 Doug Kwan <dougkwan@google.com>
11385
11386 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11387 prev_data_size_ and prev_addralign_. Remove initializer for
11388 deleted data member has_been_changed_.
11389 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11390 to determine if the table is empty.
11391 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11392 Remove.
11393 (Stub_table::add_reloc_stub): Define method in class definition
11394 instead of just declaring it there.
11395 (Stub_table::add_cortex_a8_stub): New method definition.
11396 (Stub_table::update_data_size_and_addralign): Ditto.
11397 (Stub_table::finalize_stubs): Ditto.
11398 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11399 (Stub_table::do_addralign_): Return address alignment in the
11400 (Stub_table::do_reset_address_and_file_offset): Define method in
11401 class definition instead of declaring it there. Set current data
11402 size to be the data size of the previous pass.
11403 (Stub_table::set_final_data_size): Use current data size as the
11404 final data size.
11405 (Stub_table::relocate_stub): Change parameter type of stub from
11406 Reloc_stub pointer to Stub pointer.
11407 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11408 (Stub_table::Cortex_a8_stub_list): New typedef.
11409 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11410 Stub_table::prev_addralign_): New data member.
11411 (Arm_relobj::Arm_relobj): Initialize data member
11412 section_has_cortex_a8_workaround_.
11413 (Arm_relobj::section_has_cortex_a8_workaround,
11414 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11415 definitions.
11416 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11417 declarations.
11418 (Target_arm::relocate_stub): Change parameter type of stub from
11419 Reloc_stub pointer to Stub pointer.
11420 (Insn_template::size, Insn_template::alignment): Handle
11421 THUMB16_SPECIAL_TYPE.
11422 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11423 Stub_table::update_data_size_and_addralign,
11424 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11425 definitions.
11426 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11427 (Stub_table::do_write): Ditto.
11428 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11429
880cd20d
ILT
114302010-01-08 Ian Lance Taylor <iant@google.com>
11431
11432 PR 11108
11433 * symtab.h (class Symbol): Remove fields is_target_special_ and
11434 has_plt_offset_. Add field is_defined_in_discarded_section_.
11435 (Symbol::is_defined_in_discarded_section): New function.
11436 (Symbol::set_is_defined_in_discarded_section): New function.
11437 (Symbol::has_plt_offset): Rewrite.
11438 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11439 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11440 Don't initialize is_target_special_ or has_plt_offset_.
11441 Initialize is_defined_in_discarded_section_.
11442 (Symbol_table::add_from_relobj): If appropriate, set
11443 is_defined_in_discarded_section.
11444 * resolve.cc (Symbol::override_base_with_special): Don't test
11445 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11446 * target-reloc.h (relocate_section): Do special handling for
11447 symbols defined in discarded sections for global symbols as well
11448 as local symbols.
11449
2703e3eb
ILT
114502010-01-08 Ian Lance Taylor <iant@google.com>
11451
11452 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11453 the SHT_SYMTAB case.
11454
339d40a3
ILT
114552010-01-08 Ian Lance Taylor <iant@google.com>
11456
11457 * object.cc (Sized_relobj::do_layout): Don't get confused if
11458 layout_eh_frame returns NULL.
11459
abecea76
ILT
114602010-01-08 Ian Lance Taylor <iant@google.com>
11461
11462 PR 11084
11463 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11464 dynamic symbol table, use the normal symbol table.
11465 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11466 symbol table.
11467
6b7dd3f3
ILT
114682010-01-08 Ian Lance Taylor <iant@google.com>
11469
11470 PR 11072
11471 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11472 sections.
11473
36c50e63
L
114742010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11475
11476 * version.cc (print_version): Change to "Copyright 2010".
11477
e291e7b9
ILT
114782010-01-08 Ian Lance Taylor <iant@google.com>
11479
11480 PR 10287
11481 PR 11063
11482 * i386.cc (class Target_i386): Change return type of plt_section
11483 to be non-const.
11484 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11485 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11486 tls_desc_rel_ field.
11487 (Output_data_plt_i386::rel_tls_desc): New function.
11488 (Target_i386::rel_tls_desc_section): New function.
11489 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11490 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11491 R_386_TLS_DESC reloc in rel_tls_desc_section.
11492 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11493 Define struct Tlsdesc_info.
11494 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11495 (Target_x86_64::do_reloc_symbol_index): New function.
11496 (Target_x86_64::add_tlsdesc_info): New function.
11497 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11498 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11499 tlsdesc_rel_ field.
11500 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11501 all callers.
11502 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11503 (Target_x86_64::rela_tlsdesc_section): New function.
11504 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11505 handling.
11506 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11507 (Target_x86_64::do_reloc_addend): New function.
11508 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11509 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11510 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11511 (Output_reloc::type): New function.
11512 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11513 (Output_reloc::is_target_specific): New function.
11514 (Output_reloc::target_arg): New function.
11515 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11516 absolute relocs and target specific relocs.
11517 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11518 add_target_specific.
11519 (class Output_data_reloc) [SHT_RELA]: Likewise.
11520 * output.cc (Output_reloc::Output_reloc): Add four new versions
11521 for absolute relocs and target specific relocs.
11522 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11523 (Output_reloc::get_symbol_index): Likewise.
11524 (Output_reloc::local_section_offset): Check that local_sym_index_
11525 is not TARGET_CODE or 0.
11526 (Output_reloc::symbol_value): Likewise.
11527 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11528 reloc.
11529 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11530 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11531 functions.
11532 * layout.cc (add_target_dynamic_tags): Use output section for
11533 DT_PLTRELSZ and DT_JMPREL.
11534
3a44184e
ILT
115352010-01-07 Ian Lance Taylor <iant@google.com>
11536
11537 PR 11061
11538 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11539 function.
11540 (class Output_data_reloc_generic): Define.
11541 (class Output_data_reloc_base): Change base class to
11542 Output_data_reloc_generic. Change add() method to call
11543 bump_relative_reloc_count for a relative reloc. Remove
11544 sort_relocs_ field.
11545 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11546 to sort_relocs().
11547 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11548 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11549 appropriate.
11550 * layout.h (class Layout): Update declaration.
11551
ea715a34
ILT
115522010-01-07 Ian Lance Taylor <iant@google.com>
11553
11554 * output.h (class Output_data): Add const version of
11555 output_section and do_output_section.
11556 (class Output_section_data): Add const version of
11557 do_output_section.
11558 (class Output_section): Likewise.
11559 * layout.cc (Layout::add_target_dynamic_tags): New function.
11560 * layout.h (class Layout): Update declarations.
11561 * arm.cc (Target_arm::do_finalize_sections): Use
11562 add_target_dynamic_tags.
11563 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11564 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11565 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11566 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11567
659948a4
ILT
115682010-01-07 Ian Lance Taylor <iant@google.com>
11569
11570 PR 11042
11571 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11572 object as needed.
11573
9d3b86f6
ILT
115742010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11575 Ian Lance Taylor <iant@google.com>
11576
11577 PR 11019
11578 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11579 Xindex::read_symtab_xindex.
11580
bb0d3eb0
DK
115812010-01-07 Doug Kwan <dougkwan@google.com>
11582
11583 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11584 (Insn_template::thumb16_bcond_insn): New method declaration.
11585 (Insn_template): Fix spelling.
11586 (Stub::thumb16_special): New method declaration.
11587 (Stub::do_write): Define virtual method which was previously pure
11588 virtual.
11589 (Stub::do_thumb16_special): New method declaration.
11590 (Stub::do_fixed_endian_write): New template member.
11591 (Reloc_stub::do_write): Remove.
11592 (Reloc_stub::do_fixed_endian_write): Remove.
11593 (Cortex_a8_stub): New class definition.
11594 (Stub_factory::make_cortex_a8_stub): New method definition.
11595 (Stub_factory::Stub_factory): Add missing static storage class
11596 qualifier for elf32_arm_stub_a8_veneer_blx.
11597
ffeef7df
ILT
115982010-01-07 Ian Lance Taylor <iant@google.com>
11599
dc3f80fe
ILT
11600 PR 10980
11601 * options.h (class General_options): Add --warn-unresolved-symbols
11602 and --error-unresolved-symbols.
11603 * errors.cc (Errors::undefined_symbol): Implement
11604 --warn-unresolved-symbols.
11605
ffeef7df
ILT
11606 * options.h (class General_options): Add -z text and -z textoff.
11607 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11608
f1ec9ded
ST
116092010-01-06 Sriraman Tallam <tmsriram@google.com>
11610
11611 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11612 (Garbage_collection::cident_sections): New function.
11613 (Garbage_collection::add_cident_section): New function.
11614 (Garbage_collection::cident_sections_): New member.
11615 (gc_process_relocs): Add references to sections whose names are C
11616 identifiers.
11617 * gold.h (cident_section_start_prefix): New constant.
11618 (cident_section_stop_prefix): New constant.
11619 (is_cident): New function.
11620 * layout.cc (Layout::define_section_symbols): Replace string constants
11621 with the newly defined constants.
11622 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11623 C identifiers.
11624 * testsuite/Makefile.am: Add gc_orphan_section_test.
11625 * testsuite/Makefile.in: Regenerate.
11626 * testsuite/gc_orphan_section_test.cc: New file.
11627 * testsuite/gc_orphan_section_test.sh: New file.
11628
6eda8c29
ILT
116292010-01-06 Ian Lance Taylor <iant@google.com>
11630
b9674e17
ILT
11631 PR 10980
11632 * options.h (class General_options): Add --warn-shared-textrel.
11633 * layout.cc (Layout::finish_dynamic_section): Implement
11634 --warn-shared-textrel.
11635
6eda8c29
ILT
11636 PR 10980
11637 * options.h (class General_options): Add --warn-multiple-gp.
11638
32dcd44e
ILT
116392010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11640
11641 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11642 $(THREADSLIB) and $(LIBDL).
11643 * Makefile.in: Rebuild.
11644
a192ba05
ILT
116452010-01-06 Ian Lance Taylor <iant@google.com>
11646
11647 PR 10980
11648 * options.cc (General_options::parse_section_start): New function.
11649 (General_options::section_start): New function.
11650 (General_options::General_options): Initialize all members.
11651 * options.h: Include <map>
11652 (class General_options): Add --section-start. Add section_starts_
11653 member.
11654 * layout.cc (Layout::attach_allocated_section_to_segment): If
11655 --section-start was used, set the address of the segment. Remove
11656 local sort_sections.
11657 (Layout::relaxation_loop_body): If the address of the load segment
11658 has been set by --section-start, don't use it.
11659 * output.h (Output_segment::update_flags_for_output_section): New
11660 function.
11661 * output.cc (Output_segment::add_output_section): Call
11662 update_flags_for_output_section.
11663
dde3f402
ILT
116642010-01-05 Ian Lance Taylor <iant@google.com>
11665
62dfdd4d
ILT
11666 PR 10980
11667 * options.h (class General_options): Add --undefined-version.
11668 * script.cc (struct Version_expression): Add was_matched_by_symbol
11669 field.
11670 (Version_script_info::matched_symbol): New function.
11671 (Version_script_info::get_symbol_version_helper): Call
11672 matched_symbol.
11673 (Version_script_info::check_unmatched_names): New function.
11674 * script.h (class Version_script_info): Update declarations.
11675 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11676
9c4ae156
ILT
11677 * options.h (class General_options): Use DEFINE_bool_alias for
11678 allow_multiple_definition.
11679 * resolve.cc (Symbol_table::should_override): Don't test
11680 allow_multiple_definition.
11681
dde3f402
ILT
11682 PR 10980
11683 * options.h (class General_options): Add --cref.
11684 * main.cc (main): Print cref table if --cref. Don't close mapfile
11685 until after printing cref table.
11686 * cref.cc: Include "symtab.h".
11687 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11688 (Cref_table_compare::operator()): New function.
11689 (Cref_inputs::gather_cref): New function.
11690 (filecol): New static const.
11691 (Cref_inputs::print_cref): New function.
11692 (Cref::print_cref): New function.
11693 * cref.h: Include <cstdio>.
11694 (class Cref): Update declarations.
11695 * mapfile.h (Mapfile::file): New function.
11696 * object.h (class Object): Define Symbols. Declare virtual
11697 do_get_global_symbols.
11698 (Object::get_global_symbols): New function.
11699 * object.cc (Input_objects::add_object): Pass object to cref_ if
11700 --cref.
11701 (Input_objects::archive_start): Likewise.
11702 (Input_objects::archive_stop): Likewise.
11703 (Input_objects::print_cref): New function.
11704 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11705 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11706 --cref.
11707 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11708 function.
11709 * plugin.h (class Sized_pluginobj): Update declarations.
11710
8781f709
ILT
117112010-01-05 Ian Lance Taylor <iant@google.com>
11712
11713 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11714 to is_default_version. Rename insdef to insdefault.
11715 (Symbol_table::add_from_relobj): Rename def to is_default_version
11716 and local to is_forced_local.
11717 (Symbol_table::add_from_pluginobj): Likewise.
11718 (Symbol_table::add_from_dynobj): Likewise.
11719 (Symbol_table::define_special_symbol): Rename insdef to
11720 insdefault.
11721
fe35d28d
ILT
117222010-01-04 Ian Lance Taylor <iant@google.com>
11723
30bc8c46
ILT
11724 PR 10980
11725 * options.h (class General_options): Add
11726 --allow-multiple-definition and -z muldefs.
11727 * resolve.cc (Symbol_table::should_override): Don't warn about a
11728 multiple symbol definition if --allow-multiple-definition or -z
11729 muldefs.
11730
7eaea549
ILT
11731 PR 10980
11732 * options.h (class General_options): Add --add-needed and
11733 --copy-dt-needed-entries. Tweak --as-needed help entry.
11734 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11735 error if --copy-dt-needed-entries aka --add-needed is used and
11736 would cause a change in behaviour.
11737
fe35d28d
ILT
11738 PR 10980
11739 * options.h (class General_options): Add -G as a short version of
11740 --shared. Add no-op options -assert, -g, and -i.
11741
55a2bb35
ST
117422010-01-04 Sriraman Tallam <tmsriram@google.com>
11743
11744 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11745 check for .text or .gnu.linkonce.t sections.
11746 * icf.cc (Icf::find_identical_sections): Ditto.
11747 Change the detection for mangled function name within the section
11748 name.
11749 * icf.h (is_section_foldable_candidate): New function.
11750
719328e1
ILT
117512009-12-30 Ian Lance Taylor <iant@google.com>
11752
11753 PR 10980
11754 * options.h (class General_options): Permit two dashes with
11755 --retain-symbols-file.
11756
d7bb5745
ILT
117572009-12-30 Ian Lance Taylor <iant@google.com>
11758
403a15dd
ILT
11759 PR 10979
11760 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11761 don't put the file header and segment headers in the text
11762 segment.
11763
eda294df
ILT
11764 PR 10979
11765 * common.cc (Sort_commons::operator()): Stabilize sort when both
11766 entries are NULL.
11767 (Symbol_table::do_allocate_commons_list): When allocating common
11768 symbols, skip a symbol which is no longer common.
11769 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11770 an object before checking its type.
11771 * testsuite/common_test_2.c: New file.
11772 * testsuite/common_test_3.c: New file.
11773 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11774 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11775 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11776 (common_test_2_pic.o, common_test_2.so): New targets.
11777 (common_test_3_pic.o, common_test_3.so): New targets.
11778 * testsuite/Makefile.in: Rebuild.
11779
d7bb5745
ILT
11780 PR 10979
11781 * script.cc (read_input_script): If we see a new SECTIONS clause,
11782 and we have added an input section, give an error.
11783 * layout.h (class Layout): Add have_added_input_section function.
11784 Add have_added_input_section_ field.
11785 * layout.cc (Layout::Layout): Initialize
11786 have_added_input_section_.
11787 (Layout::layout): Set have_added_input_section_.
11788 (Layout::layout_eh_frame): Likewise.
11789
fc59c572
ILT
117902009-12-30 Ian Lance Taylor <iant@google.com>
11791
11792 PR 10931
11793 * options.h (class General_options): Add --sort-common option.
11794 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11795 * common.cc (Sort_common): Add sort_order parameter to
11796 constructor. Add sort_order_ field.
11797 (Sort_commons::operator): Check sort_order_.
11798 (Symbol_table::allocate_commons): Determine the sort order.
11799 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11800 Change all callers.
11801 (Symbol_table::do_allocate_commons_list): Likewise.
11802
1c74fab0
ILT
118032009-12-30 Ian Lance Taylor <iant@google.com>
11804
11805 PR 10916
11806 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11807 symbols from this object, don't change the visibility of an
11808 undefined symbol.
11809 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11810
6affe781
ILT
118112009-12-30 Ian Lance Taylor <iant@google.com>
11812
11813 PR 10861
11814 * script.h (class Version_script_info): Define Language enum.
11815 Update declarations. Define Glob, Exact, and Lookup types. Add
11816 new fields globals_, locals_, and is_finalized_.
11817 * script.cc: Various formatting fixes.
11818 (class Parser_closure): Change language_stack_ from a vector of
11819 std::string to one of Version_script_info::Language. Adjust all
11820 uses accordingly.
11821 (class Lazy_demangler): Remove.
11822 (struct Version_expression): Change language from std::string to
11823 Version_script_info::Language.
11824 (Version_script_info::Version_script_info): New function.
11825 (Version_script_info::~Version_script_info): Don't call clear.
11826 (Version_script_info::finalize): New function.
11827 (Version_script_info::build_lookup_tables): New function.
11828 (Version_script_info::build_expression_list_lookup): New
11829 function.
11830 (Version_script_info::get_symbol_version_helper): Rewrite to use
11831 lookup tables.
11832 (Version_script_info::print_expression_list): Adjust to use
11833 Version_script_info::Language.
11834 (script_push_lex_into_version_mode): Check that the version script
11835 has not been finalized.
11836 (version_script_push_lang): Change language string to
11837 Version_script_info::Language.
11838 * options.cc (Command_line::version_script): New function.
11839 * options.h (class General_options): Add finalize_dynamic_list
11840 function. Change version_script from declaration to definition.
11841 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11842 * testsuite/version_script.map: Remove duplicate def of foo.
11843 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11844 version_script.map.
11845 * testsuite/Makefile.in: Rebuild.
11846
818bf354
ILT
118472009-12-30 Ian Lance Taylor <iant@google.com>
11848
11849 PR 10843
11850 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11851 if the input symbol index is 0, make the output symbol index 0.
11852
ebcc8304
ILT
118532009-12-30 Ian Lance Taylor <iant@google.com>
11854
11855 PR 10670
11856 * options.h (class General_options): Add -x/--discard-all.
11857 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11858 --discard-all. If the local symbol needs a dynamic entry, check
11859 that before handling --discard-locals.
11860
176fe33f
ILT
118612009-12-30 Ian Lance Taylor <iant@google.com>
11862
bb321bb1
ILT
11863 PR 10450
11864 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11865 flags to PF_R.
11866 (Output_segment::add_output_section): Don't change the flags if
11867 the type is PT_TLS.
11868
176fe33f
ILT
11869 PR 10450
11870 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11871 GNU hash table if they need a dynamic value. Otherwise, don't add
11872 them if they are defined in a dynamic object or are forced local.
11873
e8cd95c7
ILT
118742009-12-29 Ian Lance Taylor <iant@google.com>
11875
1b81fb71
ILT
11876 PR 10450
11877 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11878 .gnu.hash table for a 32-bit target.
11879
8d6d383d
ILT
11880 PR 10450
11881 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11882 regular and a dynamic object only needs a dynamic symbol table
11883 entry if it is externally visible.
11884
e785ec03
ILT
11885 PR 10450
11886 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11887 constructor. Add global_offset_table_ field.
11888 (Target_i386::got_section): Set global_offset_table_.
11889 (Target_i386::do_finalize_sections): Set global_offset_table_
11890 size.
11891 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11892 in constructor. Add global_offset_table_ field.
11893 (Target_x86_64::got_section): Set global_offset_table_.
11894 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11895 size.
11896
1a2dff53
ILT
11897 * layout.cc (Layout::Layout): Initialize increase_relro_.
11898 (Layout::get_output_section): Add is_relro, is_last_relro, and
11899 is_first_non_relro parameters. Change all callers.
11900 (Layout::choose_output_section): Likewise.
11901 (Layout::add_output_section_data): Likewise.
11902 (Layout::make_output_section): Likewise.
11903 (Layout::set_segment_offsets): Clear increase_relro when using a
11904 linker script.
11905 * layout.h (class Layout): Add increase_relro method. Add
11906 increase_relro_ field. Update declarations.
11907 * output.cc (Output_section::Output_section): Initialize
11908 is_last_relro_ and is_first_non_relro_.
11909 (Output_segment::add_output_section): Group relro sections is
11910 do_sort is true. Handle is_last_relro and is_first_non_relro.
11911 (Output_segment::maximum_alignment): Remove relro handling.
11912 (Output_segment::set_section_addresses): Add increase_relro
11913 parameter. Change all callers. Add initial alignment to align
11914 relro sections on separate page. Remove old relro handling.
11915 (Output_segment::set_section_list_addresses): Remove in_relro
11916 parameter. Change all callers.
11917 (Output_segment::set_offset): Add increase parameter. Change all
11918 callers. Remove old relro handling.
11919 * output.h (class Output_section): Add new methods: is_last_relro,
11920 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11921 Add is_last_relro_ and is_first_non_relro_ fields.
11922 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11923 Create separate .got.plt section. Call increase_relro.
11924 * x86_64.cc (Target_x86_64::got_section): Likewise.
11925 * testsuite/relro_script_test.t: Add .got.plt.
11926
f0ba79e2
ILT
11927 PR 10450
11928 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11929 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11930 (Layout::finalize): Call set_dynamic_symbol_size.
11931 (Layout::set_dynamic_symbol_size): New function.
11932 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11933 set_dynamic_symbol_size.
11934
e8cd95c7
ILT
11935 PR 10450
11936 * output.h (class Output_section): Add is_entsize_zero_ field.
11937 * output.cc (Output_section::Output_section): Initialize
11938 is_entsize_zero_.
11939 (Output_section::set_entsize): If two different entsizes are
11940 requested, force it to zero.
11941 (Output_section::add_input_section): Set flags for .debug_str
11942 before updating section flags. Set entsize.
11943 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11944 and SHF_STRING if all input sections have those flags.
11945
3e1b9a8a
RÁE
119462009-12-29 Rafael Espindola <espindola@google.com>
11947
11948 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11949 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11950 reporting.
3e1b9a8a 11951
3dcad376
ST
119522009-12-29 Sriraman Tallam <tmsriram@google.com>
11953
11954 * options.cc (General_options::parse_version): Allow -v to exit
11955 without an error if there is nothing to link.
11956
084e2665
ILT
119572009-12-29 Ian Lance Taylor <iant@google.com>
11958
11959 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11960 using a version of gcc before 4.1.
11961 * configure: Rebuild.
11962
250acde3
CD
119632009-12-28 Chris Demetriou <cgd@google.com>
11964
11965 * attributes.cc (Output_attributes_section_data::do_write): Use
11966 std::vector::front rather than std::vector::data.
11967
99fff23b
ILT
119682009-12-28 Ian Lance Taylor <iant@google.com>
11969
11970 * symtab.h (class Symbol_table): Add enum Defined.
11971 * resolve.cc (Symbol_table::should_override): Add defined
11972 parameter. Change all callers. Test whether object is NULL
11973 before calling a method on it.
11974 (Symbol_table::report_resolve_problem): Add defined parameter.
11975 Change all callers.
11976 (Symbol_table::should_override_with_special): Likewise.
11977 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11978 parameter. Change all callers.
11979 (Symbol_table::do_define_in_output_data): Likewise.
11980 (Symbol_table::define_in_output_segment): Likewise.
11981 (Symbol_table::do_define_in_output_segment): Likewise.
11982 (Symbol_table::define_as_constant): Likewise.
11983 (Symbol_table::do_define_as_constant): Likewise.
11984 * script.h (class Symbol_assignment): Add is_defsym parameter to
11985 constructor; change all callers.
11986 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11987 parameter. Change all callers. Add is_defsym_ field.
11988 (class Parser_closure): Add parsing_defsym parameter to
11989 constructor; change all callers. Add parsing_defsym accessor
11990 function. Add parsing_defsym_ field.
11991
556bd683
ILT
119922009-12-28 Ian Lance Taylor <iant@google.com>
11993
11994 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11995 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11996
1782c879
ILT
119972009-12-23 Ian Lance Taylor <iant@google.com>
11998
11999 * i386.cc (Target_i386::do_calls_non_split): Recognize
12000 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12001 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12002 -fsplit-stack prologue when using %r11.
1782c879 12003
329ca2b1
ST
120042009-12-21 Sriraman Tallam <tmsriram@google.com>
12005
12006 * options.cc (General_options::parse_version): Make -v continue and do
12007 the link like GNU ld does.
12008
d675ff46
RÁE
120092009-12-17 Rafael Avila de Espindola <espindola@google.com>
12010
12011 * Makefile.am (CCFILES): Add timer.cc.
12012 (HFILES): Add timer.h.
12013 * configure.ac: Check for sysconf and times.
12014 * main.cc: include timer.h.
12015 (main): Use Timer instead of get_run_time.
12016 * timer.cc: New.
12017 * timer.h: New.
12018 * workqueue.cc: include timer.h.
12019 (Workqueue::find_and_run_task):
12020 Report user, sys and wall time.
12021 * Makefile.in: Regenerate.
12022 * config.in: Regenerate.
12023 * configure: Regenerate.
12024
d6344fb5
DK
120252009-12-16 Doug Kwan <dougkwan@google.com>
12026
12027 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12028 sections.
12029 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12030 relaxed input sections.
12031 * output.cc (Output_section::find_relaxed_input_section): Change
12032 return type to Output_relaxed_input_section pointer. Adjust code
12033 for new type of relaxed_input_section_map_.
12034 * output.h (Output_section::find_relaxed_input_section): Change
12035 return type to Output_relaxed_input_section pointer.
12036 (Output_section::Output_relaxed_input_section_by_input_section_map):
12037 New type.
12038 (Output_section::relaxed_input_section_map_): Change type to
12039 Output_section::Output_relaxed_input_section_by_input_section_map.
12040 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12041 input section.
12042
0e0d5469
ILT
120432009-12-15 Ian Lance Taylor <iant@google.com>
12044
12045 * layout.cc (Layout::create_shstrtab): Only write out after input
12046 sections if we are compressing debug sections.
12047
0649a889
ILT
120482009-12-15 Ian Lance Taylor <iant@google.com>
12049
12050 * archive.cc (Archive::add_symbols): Only look up a symbol without
12051 a version if there is, in fact, a version.
12052
2ea97941
ILT
120532009-12-14 Ian Lance Taylor <iant@google.com>
12054
12055 Revert -Wshadow changes, all changes from:
12056 2009-12-11 Doug Kwan <dougkwan@google.com>
12057 2009-12-11 Nick Clifton <nickc@redhat.com>
12058 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12059
b0eec2cc
DK
120602009-12-11 Doug Kwan <dougkwan@google.com>
12061
12062 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12063 due to -Wshadow.
12064 * attributes.cc (Object_attribute::size): Ditto.
12065 (Attributes_section_data::size): Ditto.
12066 (Attributes_section_data::Attributes_section_data): Ditto.
12067 (Output_attributes_section_data::do_write): Ditto.
12068 * attributes.h (Object_attribute::set_type): Ditto.
12069 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12070
91d6fa6a
NC
120712009-12-11 Nick Clifton <nickc@redhat.com>
12072
12073 * archive.cc: Fix shadowed variable warnings.
12074 * arm.cc: Likewise.
12075 * compressed_output.cc: Likewise.
12076 * compressed_output.h: Likewise.
12077 * configure: Likewise.
12078 * dwarf_reader.cc: Likewise.
12079 * dynobj.cc: Likewise.
12080 * dynobj.h: Likewise.
12081 * ehframe.cc: Likewise.
12082 * ehframe.h: Likewise.
12083 * errors.cc: Likewise.
12084 * expression.cc: Likewise.
12085 * fileread.cc: Likewise.
12086 * fileread.h: Likewise.
12087 * freebsd.h: Likewise.
12088 * i386.cc: Likewise.
12089 * icf.cc: Likewise.
12090 * incremental.h: Likewise.
12091 * layout.cc: Likewise.
12092 * layout.h: Likewise.
12093 * mapfile.cc: Likewise.
12094 * merge.cc: Likewise.
12095 * merge.h: Likewise.
12096 * object.cc: Likewise.
12097 * object.h: Likewise.
12098 * options.h: Likewise.
12099 * output.cc: Likewise.
12100 * output.h: Likewise.
12101 * parameters.cc: Likewise.
12102 * plugin.cc: Likewise.
12103 * powerpc.cc: Likewise.
12104 * reduced_debug_output.cc: Likewise.
12105 * reduced_debug_output.h: Likewise.
12106 * reloc.cc: Likewise.
12107 * reloc.h: Likewise.
12108 * resolve.cc: Likewise.
12109 * script-sections.cc: Likewise.
12110 * script.cc: Likewise.
12111 * script.h: Likewise.
12112 * sparc.cc: Likewise.
12113 * symtab.cc: Likewise.
12114 * symtab.h: Likewise.
12115 * target-select.cc: Likewise.
12116 * target-select.h: Likewise.
12117 * token.h: Likewise.
12118 * workqueue.cc: Likewise.
12119 * workqueue.h: Likewise.
12120 * x86_64.cc: Likewise.
12121
a0351a69
DK
121222009-12-10 Doug Kwan <dougkwan@google.com>
12123
12124 * arm.cc (attributes.h): New include.
12125 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12126 (Arm_relobj::~Arm_relobj): Delete object pointed by
12127 attributes_section_data_.
12128 (Arm_relobj::attributes_section_data): New method definition.
12129 (Arm_relobj::attributes_section_data_): New data member declaration.
12130 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12131 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12132 attributes_section_data_.
12133 (Arm_dynobj::attributes_section_data): New method definition.
12134 (Arm_dynobj::attributes_section_data_): New data member declaration.
12135 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12136 initialization value of may_use_blx_ to false.
2e702c99 12137 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12138 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12139 object attributes to compute results instead of hard-coding.
12140 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12141 Target_arm::get_secondary_compatible_arch,
12142 Target_arm::set_secondary_compatible_arch
12143 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12144 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12145 New method declarations.
12146 (Target_arm::get_aeabi_object_attribute): New method definition.
12147 (Target_arm::attributes_section_data_): New data member declaration.
12148 (read_arm_attributes_section): New template definition.
12149 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12150 (Arm_dynobj::do_read_symbols): Ditto.
12151 (Target_arm::do_finalize_sections): Merge attributes sections from
12152 input. Check for BLX use after attributes section merging.
12153 Fix __exidx_start and __exidx_end visibility. Create an
12154 .ARM.attributes section if necessary.
12155 (Target_arm::get_secondary_compatible_arch,
12156 Target_arm::set_secondary_compatible_arch,
12157 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12158 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12159 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12160 New method definitions.
12161
b59befec
ILT
121622009-12-09 Ian Lance Taylor <iant@google.com>
12163
12164 * plugin.cc (Plugin::load): Don't cast from void* to a function
12165 pointer.
12166
1276bc89
ILT
121672009-12-09 Ian Lance Taylor <iant@google.com>
12168
12169 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12170 information fields.
12171
2f2de248
L
121722009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12173
12174 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12175 Replace two_file_shared_1.so with two_file_shared_2.so.
12176 * testsuite/Makefile.in: Regenerated.
12177
4f787271
DK
121782009-12-08 Doug Kwan <dougkwan@google.com>
12179
12180 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12181 (HFILES): Add attributes.h and int_encoding.h.
12182 * Makefile.in: Regenerate.
12183 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12184 function definitions to int_encoding.cc
12185 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12186 prototypes to int_encoding.h
12187 * reduced_debug_output.cc (int_encoding.h): New include.
12188 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12189 function definitions to int_encoding.cc
12190 (insert_into_vector, read_from_pointer): Move template definitions to
12191 int_encoding.h
12192 * attributes.cc: New file.
12193 * attributes.h: New file.
12194 * int_encoding.cc: New file.
12195 * int_encoding.h: New file.
12196
20b52f1a
RÁE
121972009-12-07 Rafael Avila de Espindola <espindola@google.com>
12198
12199 PR gold/11055
12200 * incremental-dump.cc (dump_incremental_inputs): New.
12201 (main): Use dump_incremental_inputs.
12202
53d7974c
L
122032009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12204
12205 PR gold/10893
12206 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12207 checking elfcpp::STT_FUNC.
12208 (Target_i386::Relocate::relocate): Likewise.
12209 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12210
12211 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12212 symbols from shared libraries into normal FUNC symbols.
12213
12214 * symtab.h (Symbol): Add is_func and use it.
12215
05a352e6
DK
122162009-12-05 Doug Kwan <dougkwan@google.com>
12217
12218 * arm.cc (Target_arm::arm_info): Initialize new fields
12219 attributes_section and attributes_vendor.
12220 * i386.cc (Target_i386::i386_info): Same.
12221 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12222 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12223 fields attributes_section and attributes_vendor.
53d7974c 12224 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12225 * target.h (Target::attributes_section, Target::attributes_vendor,
12226 Target::is_attributes_section, Target::attribute_arg_type,
12227 Target::attributes_order): New method definitions.
12228 (Target::Target_info::attributes_section,
12229 Target::Target_info::attributes_vendor): New fields.
12230 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12231 virtual method definitions.
12232 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12233 attributes_section and attributes_vendor.
12234 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12235
f4e5969c
DK
122362009-12-05 Doug Kwan <dougkwan@google.com>
12237
12238 * arm.cc: Update comments about interworking and stub generation.
12239 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12240 considered as non-PIC.
12241 (Arm_relocate_functions::base_abs): Fix formatting.
12242 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12243 of function to use GOT entry address instead of offset.
12244 (Target_arm::Scan::global): Issue an error if a symbol would need a
12245 PLT does not get one because it is untyped. Remove code to create
12246 dynamic symbols for relative branches.
12247 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12248 takes unsigned integer instead of boolean.
12249
1abce4a6
L
122502009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12251
12252 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12253 (two_file_test_LDADD): Likewise.
12254 (common_test_1_LDADD): Likewise.
12255 (exception_test_LDADD) Likewise.
12256 (weak_test_LDADD): Likewise.
12257 (many_sections_test_LDADD): Likewise.
12258 (initpri1_LDADD): Likewise.
12259 (script_test_1_LDADD): Likewise.
12260 (script_test_2_LDADD): Likewise.
12261 (justsyms_LDADD): Likewise.
12262 (binary_test_LDADD): Likewise.
12263 (large_LDADD): Likewise.
12264 * testsuite/Makefile.in: Regenerated.
12265
adcf2816 122662009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12267
adcf2816
L
12268 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12269 (Symbol_table::override_with_special): Likewise.
12270 (Symbol_table::add_from_object): Likewise.
12271
28e67f5d
RÁE
122722009-12-04 Rafael Avila de Espindola <espindola@google.com>
12273
12274 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12275 Don't set the data_offset twice.
12276
ae10a101
RÁE
122772009-12-04 Rafael Avila de Espindola <espindola@google.com>
12278
12279 * testsuite/Makefile.in: Regenerate.
12280
f59f41f3
DK
122812009-12-03 Doug Kwan <dougkwan@google.com>
12282
12283 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12284 (Target_arm::do_finalize_sections): Add parameter for symbol table
12285 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12286 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12287 parameter for symbol table pointer.
12288 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12289 an additional parameter for a pointer to symbol table.
12290 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12291 parameter for a symbol table pointer.
12292 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12293 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12294 Ditto.
12295 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12296 parameter for a symbol table pointer.
12297
ca55d848
RÁE
122982009-12-03 Rafael Avila de Espindola <espindola@google.com>
12299
12300 * incremental.cc (Incremental_inputs_header)
12301 (Incremental_inputs_header_write, Incremental_inputs_entry)
12302 (Incremental_inputs_entry_write): Move ...
12303 * incremental.h (Incremental_inputs_header)
12304 (Incremental_inputs_header_write, Incremental_inputs_entry)
12305 (Incremental_inputs_entry_write): here.
12306
3aec4f9c
RÁE
123072009-12-02 Rafael Avila de Espindola <espindola@google.com>
12308
12309 * incremental.cc (make_sized_incremental_binary): Set the target.
12310 Error if it is incompatible.
12311 * output.h (Output_file): Add filename method.
12312
9c0ae74d
RÁE
123132009-12-02 Rafael Avila de Espindola <espindola@google.com>
12314
12315 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12316 from the get_* methods.
12317
a45500ae
RÁE
123182009-12-02 Rafael Avila de Espindola <espindola@google.com>
12319
12320 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12321 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12322 Write 0 for the data_offset of scripts.
12323
325e6408
RÁE
123242009-12-02 Rafael Avila de Espindola <espindola@google.com>
12325
12326 * testsuite/Makefile.am: Add the incremental_test.sh test.
12327 * testsuite/incremental_test.sh: New.
12328 * testsuite/incremental_test_1.c: New.
12329 * testsuite/incremental_test_2.c: New.
12330
954c3e2e
RÁE
123312009-12-01 Rafael Avila de Espindola <espindola@google.com>
12332
703d02da 12333 * incremental-dump.cc (main): Fix typos.
954c3e2e 12334
f8086623
RÁE
123352009-11-27 Rafael Avila de Espindola <espindola@google.com>
12336
12337 PR gold/11025
12338 * incremental-dump.cc (main): Use llu to print 64 bit values.
12339
3b0dd6ac
L
123402009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12341 H.J. Lu <hongjiu.lu@intel.com>
12342
12343 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12344 $(LIBDL).
12345 (incremental_dump_LDADD): Likewise.
12346 * Makefile.in: Regenerated.
12347
a6d1ef57 123482009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12349
a6d1ef57
DK
12350 Revert:
12351
12352 2009-11-25 Doug Kwan <dougkwan@google.com>
12353
12354 * arm.cc (Target_arm::Target_arm): Move method definition
12355 outside of class definition. Add code to handle
12356 --target1-rel, --target1-abs and --target2= options.
12357 (Target_arm::get_reloc_reloc_type): Change method to be
12358 non-static and const.
12359 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12360 New data member declaration.
12361 (Target_arm::Scan::local, Target_arm::Scan::global,
12362 Target_arm::Relocate::relocate,
12363 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12364 Adjust call to Target_arm::get_real_reloc_type.
12365 (Target_arm::get_real_reloc_type): Use command line options
12366 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12367 * options.h (--target1-rel, --target1-abs, --target2): New
12368 ARM-only options.
12369
50aeb7d4
DK
123702009-11-25 Doug Kwan <dougkwan@google.com>
12371
12372 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12373 class definition. Add code to handle --target1-rel, --target1-abs
12374 and --target2= options.
12375 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12376 and const.
12377 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12378 member declaration.
12379 (Target_arm::Scan::local, Target_arm::Scan::global,
12380 Target_arm::Relocate::relocate,
12381 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12382 call to Target_arm::get_real_reloc_type.
12383 (Target_arm::get_real_reloc_type): Use command line options to
12384 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12385 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12386 options.
12387
51938283
DK
123882009-11-25 Doug Kwan <dougkwan@google.com>
12389
12390 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12391 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12392 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12393 formatting.
12394 (Arm_relocate_functions::thm_call): Replace body with a call to
12395 Arm_relocate_functions::thumb_branch_common.
12396 (Arm_relocate_functions::thm_jump24,
12397 Arm_relocate_functions::thm_xpc22): New method definitions.
12398 (Arm_relocate_functions::thumb_branch_common): New method definition.
12399 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12400 operator.
12401 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12402 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12403
e2b8f3c4
RÁE
124042009-11-24 Rafael Avila de Espindola <espindola@google.com>
12405
12406 * Makefile.am: Build incremental-dump
12407 * Makefile.in: Regenerate.
12408 * incremental-dump.cc: New.
12409 * incremental.cc (Incremental_inputs_header_data,
12410 Incremental_inputs_entry_data): Move to incremental.h
12411 * incremental.h: (Incremental_inputs_header_data,
12412 Incremental_inputs_entry_data): Move from incremental.cc
12413
bcba9aec
RÁE
124142009-11-24 Rafael Avila de Espindola <espindola@google.com>
12415
12416 * incremental.cc (Incremental_inputs_header,
12417 Incremental_inputs_header_write, Incremental_inputs_entry,
12418 Incremental_inputs_entry_write): Add a typedef with the data type.
12419
7c3afe08
RÁE
124202009-11-24 Rafael Avila de Espindola <espindola@google.com>
12421
12422 * incremental.cc (Incremental_inputs_header,
12423 Incremental_inputs_header_write, Incremental_inputs_entry,
12424 Incremental_inputs_entry_write): Update comment about which
12425 type has the filed descriptions.
12426
d204b6e9
DK
124272009-11-15 Doug Kwan <dougkwan@google.com>
12428
12429 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12430 (Arm_relocate_functions::arm_branch_common): Change method defintion
12431 in class definition to a method declaration and update list of formal
12432 parameters.
12433 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12434 Arm_relocation_functions::jump24): Adjust call to
12435 Arm_relocate_functions::arm_branch_common. Update list of formal
12436 parameters.
12437 (Arm_relocate_functions::xpc25): New method definition.
12438 (Arm_relocate_functions::arm_branch_common): Move method defintion
12439 out from class definition. Use stubs for mode-switching and extending
12440 branch ranges.
12441 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12442 specially. Change code to enable use of stubs in ARM branches.
12443
43d12afe
DK
124442009-11-10 Doug Kwan <dougkwan@google.com>
12445
12446 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12447 in method declaration.
12448 (Target_arm::relocate_stub): New method declaration.
12449 (Target_arm::default_target): Change to return a pointer instead of
12450 a const reference.
12451 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12452 Target_arm::default_target.
12453 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12454 method definition.
12455 (Target_arm::relocate_section): Adjust view.
12456 (Target_arm::relocate_stub): New method definition.
12457
ac33a407
DK
124582009-11-10 Doug Kwan <dougkwan@google.com>
12459
12460 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12461 a format warning.
12462 * incremental.cc (open_incremental_binary): Initialized local
12463 variables to avoid warnings.
12464 * object.cc (make_elf_object): Ditto.
12465 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12466 a format warning.
e1df38aa 12467
88ee28e9
L
12468009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12469
12470 PR gold/10930
12471 * testsuite/plugin_test.c: Include "config.h".
12472
2daedcd6
DK
124732009-11-09 Doug Kwan <dougkwan@google.com>
12474
12475 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12476 (arm_symbol_value): Remove.
12477 (Arm_relocate_functions::arm_branch_common,
12478 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12479 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12480 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12481 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12482 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12483 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12484 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12485 Arm_relocate_functions::thm_mobw_abs_nc,
12486 Arm_relocate_functions::thm_mov_abs,
12487 Arm_relocate_functions::movw_prel_nc,
12488 Arm_relocate_functions::thm_movt_abs,
12489 Arm_relocate_functions::movt_prel,
12490 Arm_relocate_functions::thm_movw_prel_nc,
12491 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12492 (Target_arm::Relocate::relocate): Only decompose address into two
12493 parts if relocation type uses the thumb-bit and pass the actual
12494 bit instead of a flag indicating that the thumb-bit is used. Adjust
12495 calls to methods in Arm_relocate_functions for this change.
12496
1276bc89 124972009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12498
12499 PR 10925
12500 * reloc.cc: Instantiate
12501 Sized_relobj::initialize_input_to_output_maps and
12502 Sized_relobj:free_input_to_output_maps.
12503
e53ad1b5
ILT
125042009-11-06 Ian Lance Taylor <iant@google.com>
12505
12506 PR 10876
12507 * defstd.cc (in_segment): Set only_if_ref true for "end".
12508
eb44217c
DK
125092009-11-06 Doug Kwan <dougkwan@google.com>
12510
12511 * arm.cc (class Reloc_stub): Correct a comment.
12512 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12513 (Target_arm::scan_section_for_stubs): New method declaration.
12514 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12515 Change methods from private to protected.
12516 (Target_arm::do_may_relax): New method definition.
12517 (Target_arm::do_relax, Target_arm::group_sections,
12518 Target_arm::scan_reloc_for_stub,
12519 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12520 (Target_arm::arm_input_section_map_): New data member declaration.
12521 (Target_arm::scan_reloc_for_stub,
12522 Target_arm::scan_reloc_section_for_stubs,
12523 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12524 Target_arm::do_relax): New method definitions.
12525
5d329b7d
ILT
125262009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12527
12528 * configure.ac: Check for (struct stat)::st_mtim
12529 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12530 * config.in: Regenerate.
12531 * configure: Regenerate.
12532
96a0d71b
ILT
125332009-11-05 Ian Lance Taylor <iant@google.com>
12534
12535 PR 10910
12536 * output.cc (Output_segment::add_output_section): Add missing
12537 return statement.
12538
594c8e5e
ILT
125392009-11-04 Ian Lance Taylor <iant@google.com>
12540
12541 PR 10880
12542 * object.h (class Object): Add is_needed and set_is_needed
12543 methods. Add is_needed_ field. Make bool fields into bitfields.
12544 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12545 defined in a dynamic object and referenced by a regular object,
12546 set is_needed for the dynamic object.
12547 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12548 if the file is marked with as_needed and it is not needed.
12549
22b127cc
ILT
125502009-11-04 Ian Lance Taylor <iant@google.com>
12551
12552 PR 10887
12553 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12554 tags if data is discarded by linker script.
12555 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12556 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12557 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12558 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12559
f5c870d2
ILT
125602009-11-04 Ian Lance Taylor <iant@google.com>
12561
12562 * layout.cc (Layout::get_output_section): Add is_interp and
12563 is_dynamic_linker_section parameters. Change all callers.
12564 (Layout::choose_output_section): Likewise.
12565 (Layout::make_output_section): Likewise.
12566 (Layout::add_output_section_data): Add is_dynamic_linker_section
12567 parameter. Change all callers.
12568 * layout.h (class Layout): Update declarations.
12569 * output.h (class Output_section): Add is_interp, set_is_interp,
12570 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12571 Add is_interp_, is_dynamic_linker_section_ fields. Change
12572 generate_code_fills_at_write_ to a bitfield.
12573 * output.cc (Output_section::Output_sections): Initialize new
12574 fields.
12575 (Output_segment::add_output_section): Add do_sort parameter.
12576 Change all callers.
12577
1ae4d23b
ILT
125782009-11-03 Ian Lance Taylor <iant@google.com>
12579
12580 PR 10860
12581 * options.h (class General_options): Add --warn-common.
12582 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12583 merging two common symbols.
12584 (Symbol_table::should_override): Handle --warn-common when merging
12585 a common symbol with a defined symbol. Use report_resolve_problem
12586 for multiple definitions.
12587 (Symbol_table::report_resolve_problem): New function.
12588 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12589
55da9579
DK
125902009-11-03 Doug Kwan <dougkwan@google.com>
12591
12592 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12593 stub_factory_.
12594 (Target_arm::stub_factory): New method definition.
12595 (Target_arm::new_arm_input_section,
12596 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12597 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12598 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12599 New type definitions.
12600 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12601 member declarations.
12602 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12603 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12604 New method definitions.
12605
37a9ac43
ILT
126062009-11-03 Ian Lance Taylor <iant@google.com>
12607
12608 * options.h (class General_options): Add --warn_constructors.
12609
b3d6a3d4
ILT
126102009-11-03 Ian Lance Taylor <iant@google.com>
12611
12612 PR 10893
12613 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12614 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12615
934b01dd
ILT
126162009-11-03 Ian Lance Taylor <iant@google.com>
12617
12618 PR 10895
12619 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12620 --msgid-bugs-address.
12621 (install-pdf): New target.
12622 (install-data_yes): Look up one directory to find mkinstalldirs.
12623
03c1939b
L
126242009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12625
12626 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12627 tree.
12628
ebd95253
DK
126292009-10-30 Doug Kwan <dougkwan@google.com>
12630
12631 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12632
e9bbb538
DK
126332009-10-30 Doug Kwan <dougkwan@google.com>
12634
12635 * arm.cc (Stub_addend_reader): New struct template definition
12636 and partial specializations.
12637 (Stub_addend_reader::operator()): New method definition for a
12638 partially specialized template.
12639
d5b40221
DK
126402009-10-30 Doug Kwan <dougkwan@google.com>
12641
12642 * arm.cc (Arm_relobj::processor_specific_flags): New method
12643 definition.
12644 (Arm_relobj::do_read_symbols): New method declaration.
12645 (Arm_relobj::processor_specific_flags_): New data member declaration.
12646 (Arm_dynobj): New class definition.
12647 (Target_arm::do_finalize_sections): Add input_objects parameter.
12648 (Target_arm::do_adjust_elf_header): New method declaration.
12649 (Target_arm::are_eabi_versions_compatible,
12650 (Target_arm::merge_processor_specific_flags): New method declaration.
12651 (Target_arm::do_make_elf_object): New overloaded method definitions
12652 and declaration.
12653 (Arm_relobj::do_read_symbols): New method definition.
12654 (Arm_dynobj::do_read_symbols): Ditto.
12655 (Target_arm::do_finalize_sections): Add input_objects parameters.
12656 Merge processor-specific flags from all input objects.
12657 (Target_arm::are_eabi_versions_compatible,
12658 Target_arm::merge_processor_specific_flags,
12659 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12660 New method definitions.
12661 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12662 Input_objects pointer type parameter.
12663 * layout.cc (Layout::finalize): Pass input objects to target's.
12664 finalize_sections function.
12665 * output.cc (Output_file_header::do_sized_write): Set ELF file
12666 header's processor-specific flags.
12667 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12668 Input_objects pointer type parameter.
12669 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12670 * target.h (Input_objects): New forward class declaration.
12671 (Target::processor_specific_flags,
12672 Target::are_processor_specific_flags_sect): New method definitions.
12673 (Target::finalize_sections): Add input_objects parameter.
12674 (Target::Target): Initialize processor_specific_flags_ and
12675 are_processor_specific_flags_set_.
12676 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12677 parameter.
12678 (Target::set_processor_specific_flags): New method definition.
12679 (Target::processor_specific_flags_,
12680 Target::are_processor_specific_flags_set_): New data member
12681 declarations.
12682 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12683 Input_objects pointer type parameter.
12684
ebabffbd
DK
126852009-10-30 Doug Kwan <dougkwan@google.com>
12686
12687 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12688
ad0f2072
ILT
126892009-10-28 Ian Lance Taylor <iant@google.com>
12690
12691 * object.h (class Relobj): Drop options parameter from
12692 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12693 do_scan_relocs, do_relocate. Change all callers.
12694 (class Sized_relobj): Drop options parameters from
12695 do_gc_process_relocs, do_scan_relocs, do_relocate,
12696 do_relocate_sections, relocate_sections, emit_relocs_scan,
12697 emit_relocs_scan_reltype. Change all callers.
12698 (struct Relocate_info): Remove options field and all references to
12699 it.
12700 * reloc.h (class Read_relocs): Remove options constructor
12701 parameter and options_ field. Change all callers.
12702 (class Gc_process_relocs, class Scan_relocs): Likewise.
12703 (class Relocate_task): Likewise.
12704 * target-reloc.h (scan_relocs): Remove options parameter. Change
12705 all callers.
12706 (scan_relocatable_relocs): Likewise.
12707 * target.h (class Sized_target): Remove options parameter from
12708 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12709 all callers.
12710 * gc.h (gc_process_relocs): Remove options parameter. Change all
12711 callers.
12712 * arm.cc: Update functions to remove options parameters.
12713 * i386.cc: Likewise.
12714 * powerpc.cc: Likewise.
12715 * sparc.cc: Likewise.
12716 * x86_64.cc: Likewise.
12717 * testsuite/testfile.cc: Likewise.
12718
8ffa3667
DK
127192009-10-28 Doug Kwan <dougkwan@google.com>
12720
12721 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12722 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12723 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12724 New method definitions.
12725
40f36857
CC
127262009-10-28 Cary Coutant <ccoutant@google.com>
12727
12728 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12729 (Plugin::cleanup_done_): New member.
12730 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12731 (Plugin_manager::cleanup_done_): Remove.
12732 (Plugin_manager::add_input_file): Edit error message.
12733 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12734 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12735
2c849493
ILT
127362009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12737
12738 * fileread.cc: (File_read::View::~View): Use the new
12739 data_ownership_ filed.
12740 (File_read::~File_read): Dispose the new whole_file_view_.
12741 (File_read::open): Mmap the whole file if needed.
12742 (File_read::open): Use whole_file_view_ instead of contents_.
12743 (File_read::find_view): Use whole_file_view_ if applicable.
12744 (File_read::do_read): Use whole_file_view_ instead of contents_.
12745 (File_read::make_view): Use whole_file_view_ instead of contents_,
12746 update File_read::View::View call.
12747 (File_read::find_or_make_view): Update File_read::View::View
12748 call.
12749 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12750 remove contents_
12751 (File_read::View::Data_ownership): New enum.
12752 (File_read::View::View): Replace bool mapped_ with Data_ownership
12753 argument.
12754 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12755 (File_read::View::data_ownership_): New field.
12756 (File_read::contents_): Remove (replaced by whole_file_view_).
12757 (File_read::whole_file_view_): New field.
12758 * options.h (class General_options): Add --keep-files-mapped.
12759
24998053
CC
127602009-10-27 Cary Coutant <ccoutant@google.com>
12761
12762 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12763 * testsuite/Makefile.am (plugin_test_5): New test case.
12764 * testsuite/Makefile.in: Regenerate.
12765
72adc4fa
DK
127662009-10-25 Doug Kwan <dougkwan@google.com>
12767
12768 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12769 from private to protected to allow access by child class.
12770 (Sized_relobj::do_relocate_sections): New method declaration.
12771 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12772 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12773 Sized_relobj::relocate_sections. Instantiate template explicitly
12774 for different target sizes and endianity.
12775
07f508a2
DK
127762009-10-24 Doug Kwan <dougkwan@google.com>
12777
12778 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12779 (Arm_input_section::as_arm_input_section): New method.
12780 (Arm_output_section): New class definition.
12781 (Arm_output_section::create_stub_group,
12782 Arm_output_section::group_sections): New method definitions.
12783
10ad9fe5
DK
127842009-10-22 Doug Kwan <dougkwan@google.com>
12785
12786 * arm.cc (Arm_input_section): New class definition.
12787 (Arm_input_section::init, Arm_input_section:do_write,
12788 Arm_input_section::set_final_data_size,
12789 Arm_input_section::do_reset_address_and_file_offset): New method
12790 definitions.
12791
56ee5e00
DK
127922009-10-21 Doug Kwan <dougkwan@google.com>
12793
12794 * arm.cc (Stub_table, Arm_input_section): New forward class
12795 declarations.
12796 (Stub_table): New class defintion.
12797 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12798 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12799 New method definition.
12800
b569affa
DK
128012009-10-21 Doug Kwan <dougkwan@google.com>
12802
12803 * arm.cc: Update copyright comments.
12804 (Target_arm): New forward class template declaration.
12805 (Arm_address): New type.
12806 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12807 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12808 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12809 constants.
12810 (Insn_template): Same.
12811 (DEF_STUBS): New macro.
12812 (Stub_type): New enum type.
12813 (Stub_template): New class definition.
12814 (Stub): Same.
12815 (Reloc_stub): Same.
12816 (Stub_factory): Same.
12817 (Target_arm::Target_arm): Initialize may_use_blx_ and
12818 should_force_pic_veneer_.
12819 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12820 Target_arm::should_force_pic_veneer,
12821 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12822 Target_arm::using_thumb_only, Target_arm:;default_target): New
12823 method defintions.
12824 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12825 New data member declarations.
12826 (Insn_template::size, Insn_template::alignment): New method defintions.
12827 (Stub_template::Stub_template): New method definition.
12828 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12829 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12830 (Stub_factory::Stub_factory): New method definition.
12831 * gold.h (string_hash): New template.
12832 * output.h (Input_section_specifier::hash_value): Use
12833 gold::string_hash.
12834 (Input_section_specifier::string_hash): Remove.
12835 * stringpool.cc (Stringpool_template::string_hash): Use
12836 gold::string_hash.
12837
6c172549
DK
128382009-10-20 Doug Kwan <dougkwan@google.com>
12839
12840 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12841 symbols of relaxed input sections.
12842 * output.h (Output_section::find_relaxed_input_section): Make
12843 method public.
12844
c5617f2f
DK
128452009-10-16 Doug Kwan <dougkwan@google.com>
12846
12847 * dynobj.cc (Versions::Versions): Initialize version_script_.
12848 Only insert base version symbol definition for a shared object
12849 if version script defines any version versions.
12850 (Versions::define_base_version): New method definition.
12851 (Versions::add_def): Check that base version is not needed.
12852 (Versions::add_need): Define base version lazily.
12853 * dynobj.h (Versions::define_base_version): New method declaration.
12854 (Versions::needs_base_version_): New data member declaration.
12855 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12856 (check_DATA): Add no_version_test.stdout.
12857 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12858 New make rules.
12859 * testsuite/Makefile.in: Regenerate.
12860 * testsuite/no_version_test.c: New file.
12861 * testsuite/no_version_test.sh: Ditto.
12862
3c12dcdb
DK
128632009-10-16 Doug Kwan <dougkwan@google.com>
12864
12865 * expression.cc (class Segment_start_expression): New class definition.
12866 (Segment_start_expression::value): New method definition.
12867 (script_exp_function_segment_start): Return a new
12868 Segment_start_expression.
12869 * gold/script-c.h (script_saw_segment_start_expression): New function
12870 prototype.
12871 * script-sections.cc (Script_sections::Script_sections): Initialize
12872 SAW_SEGMENT_START_EXPRESSION_ to false.
12873 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12874 and -Tbbs options to specify section addresses if given in
12875 command line and no SEGMENT_START expression is seen in a script.
12876 * script-sections.h (Script_sections::saw_segment_start_expression,
12877 Script_sections::set_saw_segment_start_expression): New method
12878 definition.
12879 (Script_sections::saw_segment_start_expression_): New data member
12880 declaration.
12881 * script.cc (script_saw_segment_start_expression): New function.
12882 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12883 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12884 script_test_7.sh and script_test_8.sh.
12885 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12886 script_test_8.stdout.
12887 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12888 (script_test_6, script_test_6.stdout, script_test_7,
12889 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12890 * Makefile.in: Regenerate.
12891 * testsuite/script_test_6.sh: New file.
12892 * testsuite/script_test_6.t: Same.
12893 * testsuite/script_test_7.sh: Same.
12894 * testsuite/script_test_7.t: Same.
12895 * testsuite/script_test_8.sh: Same.
12896
64b1ae37
DK
128972009-10-16 Doug Kwan <dougkwan@google.com>
12898
12899 * output.cc (Output_segment::set_section_list_address): Cast
12900 expressions to unsigned long long type to avoid format warnings.
12901
661be1e2
ILT
129022009-10-15 Ian Lance Taylor <iant@google.com>
12903
12edd763 12904 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12905 dot assignment to script_sections_.
12edd763
ILT
12906 * script-sections.cc (Script_sections::add_dot_assignment):
12907 Initialize if necessary.
12908
68b6574b
ILT
12909 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12910 program headers with no load segment if there is a linker script.
12911
661be1e2
ILT
12912 * layout.cc (Layout::set_segment_offsets): Align the file offset
12913 to the segment aligment for -N or -n with no load segment.
12914 * output.cc (Output_segment::add_output_section): Don't crash if
12915 the first section is a TLS section.
12916 (Output_segment::set_section_list_addresses): Print an error
12917 message if the address moves backward in a linker script.
12918 * script-sections.cc
12919 (Output_section_element_input::set_section_addresses): Don't
12920 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12921 (Orphan_output_section::set_section_addresses): Likewise.
12922
f15f61a7
DK
129232009-10-15 Doug Kwan <dougkwan@google.com>
12924
12925 * layout.cc (Layout::finish_dynamic_section): Generate tags
12926 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12927 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12928 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12929
82bb573a
ILT
129302009-10-14 Ian Lance Taylor <iant@google.com>
12931
12932 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12933 fields.
12934 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12935 data_shdr fields of relinfo.
12936 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12937 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12938 R_386_TLS_LDO_32, adjust based on section flags.
12939 (Target_i386::Relocate::fix_up_ldo): Remove.
12940
374ad285
ILT
129412009-10-13 Ian Lance Taylor <iant@google.com>
12942
12943 Add support for -pie.
12944 * options.h (class General_options): Add -pie and
12945 --pic-executable.
12946 (General_options::output_is_position_independent): Test -pie.
12947 (General_options::output_is_executable): Return true if not shared
12948 and not relocatable.
12949 (General_options::output_is_pie): Remove.
12950 * options.cc (General_options::finalize): Reject incompatible uses
12951 of -pie.
12952 * gold.cc (queue_middle_tasks): A -pie link is not static.
12953 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12954 * symtab.cc (Symbol::final_value_is_known): Return false if
12955 output_is_position_independent.
12956 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12957 output_is_position_independent.
12958 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12959 output_is_position_independent.
12960 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12961 output_is_position_independent.
12962 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12963 two_file_pie_test.
12964 (basic_pie_test.o, basic_pie_test): New targets.
12965 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12966 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12967 (two_file_pie_test): New target.
12968 * testsuite/Makefile.in: Rebuild.
12969 * README: Remove note saying that -pie is not supported.
12970
c6585162
ILT
129712009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12972
12973 * options.h (class General_options): Add -init and -fini.
12974 * layout.cc (Layout::finish_dynamic_section): Emit
12975 given init and fini functions.
12976
032ce4e9
ST
129772009-10-13 Sriraman Tallam <tmsriram@google.com>
12978
12979 * gc.h (gc_process_relocs): Check if icf is enabled using new
12980 function.
12981 * gold.cc (queue_initial_tasks): Likewise.
12982 (queue_middle_tasks): Likewise.
12983 * object.cc (do_layout): Likewise.
12984 * symtab.cc (is_section_folded): Likewise.
12985 * main.cc (main): Likewise.
12986 * reloc.cc (Read_relocs::run): Likewise.
12987 (Sized_relobj::do_scan_relocs): Likewise.
12988 * icf.cc (is_function_ctor_or_dtor): New function.
12989 (Icf::find_identical_sections): Check if function is ctor or dtor when
12990 safe icf is chosen.
12991 * options.h (General_options::icf): Change option to be an enum.
12992 (Icf_status): New enum.
12993 (icf_enabled): New method.
12994 (icf_safe_folding): New method.
12995 (set_icf_status): New method.
12996 (icf_status_): New variable.
12997 * (options.cc) (General_options::finalize): Set icf_status_.
12998 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12999 icf_test and icf_keep_unique_test to use the --icf enum flag.
13000 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13001 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13002
f345227a
ST
130032009-10-12 Sriraman Tallam <tmsriram@google.com>
13004
13005 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13006 includes to gc.h and icf.h.
13007 * arm.cc: Include gc.h.
13008 * gold.cc: Likewise.
13009 * i386.cc: Likewise.
13010 * powerpc.cc: Likewise.
13011 * sparc.cc: Likewise.
13012 * x86_64.cc: Likewise.
13013 * gc.h: Include icf.h.
13014
1c7814ed
ILT
130152009-10-11 Ian Lance Taylor <iant@google.com>
13016
13017 * plugin.cc: Include "gold.h" before other header files.
13018
ae3b5189
CD
130192009-10-10 Chris Demetriou <cgd@google.com>
13020
13021 * options.h (Input_file_argument::Input_file_type): New enum.
13022 (Input_file_argument::is_lib_): Replace with...
13023 (Input_file_argument::type_): New member.
13024 (Input_file_argument::Input_file_argument): Take Input_file_type
13025 'type' rather than boolean 'is_lib' as second argument.
13026 (Input_file_argument::is_lib): Use type_.
13027 (Input_file_argument::is_searched_file): New function.
13028 (Input_file_argument::may_need_search): Handle is_searched_file.
13029 * options.cc (General_options::parse_library): Support -l:filename.
13030 (General_options::parse_just_symbols): Update for Input_file_argument
13031 changes.
13032 (Command_line::process): Likewise.
13033 * archive.cc (Archive::get_file_and_offset): Likewise.
13034 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13035 * script.cc (read_script_file, script_add_file): Likewise.
13036 * fileread.cc (Input_file::Input_file): Likewise.
13037 (Input_file::will_search_for): Handle is_searched_file.
13038 (Input_file::open): Likewise.
13039 * readsyms.cc (Read_symbols::get_name): Likewise.
13040 * testsuite/Makefile.am (searched_file_test): New test.
13041 * testsuite/Makefile.in: Regenerate.
13042 * testsuite/searched_file_test.cc: New file.
13043 * testsuite/searched_file_test_lib.cc: New file.
13044
f3048a1d
ILT
130452009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13046 Ian Lance Taylor <iant@google.com>
13047
13048 * descriptor.cc: Include <cstdio> and "binary-io.h".
13049 (Descriptors::open): Open the files in binary mode always.
13050 * script.cc (Lex::get_token): Treat \r as whitespace.
13051
d4780e57
ILT
130522009-10-09 Ian Lance Taylor <iant@google.com>
13053
13054 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13055
d9a893b8
ILT
130562009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13057 Ian Lance Taylor <iant@google.com>
13058
13059 * configure.ac: Check for readv function also.
13060 * fileread.cc (readv): Define if not HAVE_READV.
13061 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13062 does not exist.
13063 * config.in: Regenerate.
13064 * configure: Regenerate.
13065
c0a62865
DK
130662009-10-09 Doug Kwan <dougkwan@google.com>
13067
13068 * layout.cc (Layout::make_output_section): Call target hook to make
13069 ordinary output section.
13070 (Layout::finalize): Adjust parameter list of call the
13071 Target::may_relax().
13072 * layout.h (class Layout::section_list): New method.
13073 * merge.h (Output_merge_base::entsize): Change visibility to public.
13074 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13075 New methods.
13076 (Output_merge_string::do_is_string): New method.
13077 * object.cc (Sized_relobj::do_setup): renamed from
13078 Sized_relobj::set_up.
13079 * object.h (Sized_relobj::adjust_shndx,
13080 Sized_relobj::initializ_input_to_output_maps,
13081 Sized_relobj::free_input_to_output_maps): Change visibilities to
13082 protected.
13083 (Sized_relobj::setup): Virtualize.
13084 (Sized_relobj::do_setup): New method declaration.
13085 (Sized_relobj::invalidate_section_offset,
13086 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13087 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13088 * options.cc (parse_int): New function.
13089 * options.h (parse_int): New declaration.
13090 (DEFINE_int): New macro.
13091 (stub_group_size): New option.
13092 * output.cc (Output_section::Output_section): Initialize memebers
13093 merge_section_map_, merge_section_by_properties_map_,
13094 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13095 (Output_section::add_input_section): Handled deferred code-fill
13096 generation and remove an old comment.
13097 (Output_section::add_relaxed_input_section): New method definition.
13098 (Output_section::add_merge_input_section): Use merge section by
13099 properties map to speed to search. Update merge section maps
13100 as appropriate.
13101 (Output_section::build_relaxation_map): New method definition.
13102 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13103 Same.
13104 (Output_section::relax_input_section): Renamed to
13105 Output_section::convert_input_sections_to_relaxed_sections and change
13106 interface to take a vector of pointers to relaxed sections.
13107 (Output_section::find_merge_section,
13108 Output_section::find_relaxed_input_section): New method definitions.
13109 (Output_section::is_input_address_mapped,
13110 Output_section::output_offset, Output_section::output_address):
13111 Use output section data maps to speed up searching.
13112 (Output_section::find_starting_output_address): Add comments.
13113 (Output_section::do_write,
13114 Output_section::write_to_postprocessing_buffer): Do code-fill
13115 generation as appropriate.
13116 (Output_section::get_input_sections): Invalidate relaxed input section
13117 map.
13118 (Output_section::restore_states): Adjust type of checkpoint .
13119 Invalidate relaxed input section map.
13120 * output.h (Output_merge_base): New class declaration.
13121 (Input_section_specifier): New class defintion.
13122 (class Output_relaxed_input_section) Change base class to
13123 Output_section_data_build.
13124 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13125 base class initializer.
13126 (Output_section::add_relaxed_input_section): New method declaration.
13127 (Output_section::Input_section): Change visibility to protected.
2e702c99 13128 (Output_section::Input_section::relobj,
c0a62865
DK
13129 Output_section::Input_section::shndx): Handle relaxed input sections.
13130 Output_section::input_sections) Change visibility to protected. Also
13131 define overload to return a non-const pointer.
13132 (Output_section::Merge_section_properties): New class defintion.
13133 (Output_section::Merge_section_by_properties_map,
13134 Output_section::Output_section_data_by_input_section_map,
13135 Output_section::Relaxation_map): New types.
13136 (Output_section::relax_input_section): Rename method to
13137 Output_section::convert_input_sections_to_relaxed_sections and change
13138 interface to take a vector of relaxed section pointers.
13139 (Output_section::find_merge_section,
13140 Output_section::find_relaxed_input_section,
13141 Output_section::build_relaxation_map,
13142 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13143 New method declarations.
13144 (Output_section::merge_section_map_
13145 Output_section::merge_section_by_properties_map_,
13146 Output_section::relaxed_input_section_map_,
13147 Output_section::is_relaxed_input_section_map_valid_,
13148 Output_section::generate_code_fills_at_write_): New data members.
13149 * script-sections.cc
13150 (Output_section_element_input::set_section_addresses): Call
13151 current_data_size and addralign methods of relaxed input sections.
13152 (Orphan_output_section::set_section_addresses): Call current_data_size
13153 and addralign methods of relaxed input sections.
13154 * symtab.cc (Symbol_table::compute_final_value): Extract template
13155 from the body of Symbol_table::sized_finalize_symbol.
13156 (Symbol_table::sized_finalized_symbol): Call
13157 Symbol_table::compute_final_value.
13158 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13159 (Symbol_table::compute_final_value): New templated method declaration.
13160 * target.cc (Target::do_make_output_section): New method defintion.
13161 * target.h (Target::make_output_section): New method declaration.
13162 (Target::relax): Add more parameters for input objects, symbol table
13163 and layout. Adjust call to do_relax.
13164 (Target::do_make_output_section): New method declaration.
13165 (Target::do_relax): Add parameters for input objects, symbol table
13166 and layout.
13167
d446d6c4
ILT
131682009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13169
13170 * pread.c: Include stdio.h.
13171
bc06c745
ILT
131722009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13173
13174 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13175 defined.
13176
75aea3d0
ILT
131772009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13178
13179 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13180 Change read_shndx type to unsigned int.
13181 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13182 int.
13183 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13184 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13185 Change read_shndx type to unsigned int.
13186 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13187 int.
13188 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13189 * layout.cc (Layout::create_symtab_sections): Cast the result of
13190 local_symcount * symsize to off_t in the gold_assert.
13191
be8fcb75
ILT
131922009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13193
13194 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13195 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13196 R_ARM_BASE_ABS.
13197 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13198 (Arm_relocate_functions::thm_abs5): New function.
13199 (Arm_relocate_functions::abs12): New function.
13200 (Arm_relocate_functions::abs16): New function.
13201 (Arm_relocate_functions::base_abs): New function.
13202 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13203 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13204 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13205 R_ARM_BASE_ABS.
13206 (Scan::global): Likewise.
13207 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13208 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13209 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13210 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13211 R_ARM_BASE_ABS.
13212
c2a122b6
ILT
132132009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13214
13215 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13216 (Arm_relocate_functions::movt_prel): New function.
13217 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13218 (Arm_relocate_functions::thm_movt_prel): New function.
13219 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13220 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13221 (Scan::global, Relocate::relocate): Likewise.
13222 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13223
c4aa1e2d
ILT
132242009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13225
13226 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13227 Incremental_checker.
13228 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13229 unsigned int.
13230 (class Incremental_inputs_header): New class.
13231 (Incremental_inputs_header_writer): Edit comment.
13232 (Incremental_inputs_entry): New class.
13233 (Incremental_inputs_entry_writer): Edit comment.
13234 (Sized_incremental_binary::do_find_incremental_inputs_section):
13235 Add *strtab_shndx parameter, fill it.
13236 (Sized_incremental_binary::do_check_inputs): New method.
13237 (Incremental_checker::can_incrementally_link_output_file): Use
13238 Sized_incremental_binary::check_inputs.
13239 (Incremental_inputs::report_command_line): Save command line in
13240 command_line_.
13241 * incremental.h:
13242 (Incremental_binary::find_incremental_inputs_section): New
13243 method.
13244 (Incremental_binary::do_find_incremental_inputs_section): Add
13245 strtab_shndx parameter.
13246 (Incremental_binary::do_check_inputs): New pure virtual method.
13247 (Sized_incremental_binary::do_check_inputs): Declare.
13248 (Incremental_checker::Incremental_checker): Add incremental_inputs
13249 parameter, use it to initialize incremental_inputs_.
13250 (Incremental_checker::incremental_inputs_): New field.
13251 (Incremental_checker::command_line): New method.
13252 (Incremental_checker::inputs): New method.
13253 (Incremental_checker::command_line_): New field.
13254
c549a694
ILT
132552009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13256
13257 * incremental.cc: Include <cstdarg> and "target-select.h".
13258 (vexplain_no_incremental): New function.
13259 (explain_no_incremental): New function.
13260 (Incremental_binary::error): New method.
13261 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13262 method.
13263 (make_sized_incremental_binary): New function.
13264 (open_incremental_binary): New function.
13265 (can_incrementally_link_file): Add checks if output is ELF and has
13266 inputs section.
13267 * incremental.h: Include "elfcpp_file.h" and "output.h".
13268 (Incremental_binary): New class.
13269 (Sized_incremental_binary): New class.
13270 (open_incremental_binary): Declare.
13271 * object.cc (is_elf_object): Use
13272 elfcpp::Elf_recognizer::is_elf_file.
13273 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13274 * output.h (Output_file::filesize): New method.
13275
fd3c5f0b
ILT
132762009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13277
13278 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13279 New function.
13280 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13281 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13282 function.
13283 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13284 function.
13285 (Arm_relocate_functions::movw_abs_nc): New function.
13286 (Arm_relocate_functions::movt_abs): New function.
13287 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13288 (Arm_relocate_functions::thm_movt_abs): New function.
13289 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13290 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13291 (Scan::global): Likewise.
13292 (Relocate::relocate): Likewise.
13293 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13294
7f5309a5
ILT
132952009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13296
13297 * arm.cc (Arm_relocate_functions::got_prel) New function.
13298 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13299 (Relocate::relocate): Likewise.
13300 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13301
364c7fa5
ILT
133022009-10-06 Ian Lance Taylor <iant@google.com>
13303
13304 * options.h (class General_options): Define
13305 split_stack_adjust_size parameter.
13306 * object.h (class Object): Add uses_split_stack_ and
13307 has_no_split_stack_ fields. Add uses_split_stack and
13308 has_no_split_stack accessor functions. Declare
13309 handle_split_stack_section.
13310 (class Reloc_symbol_changes): Define.
13311 (class Sized_relobj): Define Function_offsets. Declare
13312 split_stack_adjust, split_stack_adjust_reltype, and
13313 find_functions.
13314 * object.cc (Object::handle_split_stack_section): New function.
13315 (Sized_relobj::do_layout): Call handle_split_stack_section.
13316 * dynobj.cc (Sized_dynobj::do_layout): Call
13317 handle_split_stack_section.
13318 * reloc.cc (Sized_relobj::relocate_sections): Call
13319 split_stack_adjust for executable sections in split_stack
13320 objects. Pass reloc_map to relocate_section.
13321 (Sized_relobj::split_stack_adjust): New function.
13322 (Sized_relobj::split_stack_adjust_reltype): New function.
13323 (Sized_relobj::find_functions): New function.
13324 * target-reloc.h: Include "object.h".
13325 (relocate_section): Add reloc_symbol_changes parameter. Change
13326 all callers.
13327 * target.h (class Target): Add calls_non_split method. Declare
13328 do_calls_non_split virtual method. Declare match_view and
13329 set_view_to_nop.
13330 * target.cc: Include "elfcpp.h".
13331 (Target::do_calls_non_split): New function.
13332 (Target::match_view): New function.
13333 (Target::set_view_to_nop): New function.
13334 * gold.cc (queue_middle_tasks): Give an error if mixing
13335 split-stack and non-split-stack objects with -r.
13336 * i386.cc (Target_i386::relocate_section): Add
13337 reloc_symbol_changes parameter.
13338 (Target_i386::do_calls_non_split): New function.
13339 * x86_64.cc (Target_x86_64::relocate_section): Add
13340 reloc_symbol_changes parameter.
13341 (Target_x86_64::do_calls_non_split): New function.
13342 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13343 parameter.
13344 * powerpc.cc (Target_powerpc::relocate_section): Add
13345 reloc_symbol_changes parameter.
13346 * sparc.cc (Target_sparc::relocate_section): Add
13347 reloc_symbol_changes parameter.
13348 * configure.ac: Call AM_CONDITIONAL for the default target.
13349 * configure: Rebuild.
13350 * testsuite/Makefile.am (TEST_AS): New variable.
13351 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13352 (check_DATA): Add split_i386 and split_x86_64 files.
13353 (SPLIT_DEFSYMS): Define.
13354 (split_i386_[1234n].o): New targets.
13355 (split_i386_[124]): New targets.
13356 (split_i386_[1234r].stdout): New targets.
13357 (split_x86_64_[1234n].o): New targets.
13358 (split_x86_64_[124]): New targets.
13359 (split_x86_64_[1234r].stdout): New targets.
13360 (MOSTLYCLEANFILES): Add new executables.
13361 * testsuite/split_i386.sh: New file.
13362 * testsuite/split_x86_64.sh: New file.
13363 * testsuite/split_i386_1.s: New file.
13364 * testsuite/split_i386_2.s: New file.
13365 * testsuite/split_i386_3.s: New file.
13366 * testsuite/split_i386_4.s: New file.
13367 * testsuite/split_i386_n.s: New file.
13368 * testsuite/split_x86_64_1.s: New file.
13369 * testsuite/split_x86_64_2.s: New file.
13370 * testsuite/split_x86_64_3.s: New file.
13371 * testsuite/split_x86_64_4.s: New file.
13372 * testsuite/split_x86_64_n.s: New file.
13373 * testsuite/testfile.cc (Target_test): Update relocation_section
13374 function.
13375 * testsuite/Makefile.in: Rebuild.
13376
e8a9fcda
ILT
133772009-10-06 Ian Lance Taylor <iant@google.com>
13378
13379 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13380 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13381 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13382 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13383 the address on ldo_addrs_.
13384 (Target_i386::Relocate::fix_up_ldo): New function.
13385
e99daf92
ILT
133862009-10-06 Rafael Espindola <espindola@google.com>
13387
13388 * plugin.cc (add_input_library): New.
13389 (Plugin::load): Add add_input_library to tv.
13390 (Plugin_manager::add_input_file): Add the is_lib argument.
13391 (add_input_file): Update call to Plugin_manager::add_input_file.
13392 (add_input_library): New.
13393 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13394
966d4097
DK
133952009-09-30 Doug Kwan <dougkwan@google.com>
13396
13397 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13398 symbol and call Symbol::may_need_copy_reloc to determine if
13399 a copy reloc is needed.
13400 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13401 nocopyreloc is given in command line.
13402 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13403 given in command line.
13404 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13405 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13406 of the removed Target_i386::may_need_copy_reloc.
13407 * options.h (copyreloc): New option with default value false.
13408 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13409 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13410 instead of the removed Target_powerpc::may_need_copy_reloc.
13411 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13412 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13413 instead of the removed Target_sparc::may_need_copy_reloc.
13414 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13415 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13416 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13417 instead of the removed Target_x86_64::may_need_copy_reloc.
13418
029ba973
ILT
134192009-09-30 Ian Lance Taylor <iant@google.com>
13420
13421 * object.h (class Object): Remove target_ field, and target,
13422 sized_target, and set_target methods.
13423 (Object::sized_target): Remove.
13424 (class Sized_relobj): Update declarations. Remove sized_target.
13425 * object.cc (Sized_relobj::setup): Remove target parameter.
13426 Change all callers.
13427 (Input_objects::add_object): Don't do anything with the target.
13428 (make_elf_sized_object): Add punconfigured parameter. Change all
13429 callers. Set or test parameter target.
13430 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13431 Change all callers.
13432 * parameters.cc (Parameters::set_target): Change parameter type to
13433 be non-const.
13434 (Parameters::default_target): Remove.
13435 (set_parameters_target): Change parameter type to be non-const.
13436 (parameters_force_valid_target): New function.
13437 (parameters_clear_target): New function.
13438 * parameters.h (class Parameters): Update declarations. Remove
13439 default_target method. Add sized_target and clear_target
13440 methods. Change target_ to be non-const.
13441 (set_parameters_target): Update declaration.
13442 (parameters_force_valid_target): Declare.
13443 (parameters_clear_target): Declare.
13444 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13445 as NULL if we aren't searching.
13446 (Add_symbols::run): Don't check for compatible target.
13447 * fileread.cc (Input_file::open_binary): Call
13448 parameters_force_valid_target.
13449 * gold.cc (queue_middle_tasks): Likewise.
13450 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13451 set_target on object.
13452 * dynobj.h (class Sized_dynobj): Update declarations.
13453 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13454 make_elf_object returns NULL.
13455 (Archive::include_member): Don't check whether object target is
13456 compatible.
13457 * output.cc (Output_section::add_input_section): Get target from
13458 parameters.
13459 (Output_section::relax_input_section): Likewise.
13460 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13461 parameters.
13462 (Sized_relobj::do_scan_relocs): Likewise.
13463 (Sized_relobj::relocate_sections): Likewise.
13464 * resolve.cc (Symbol_table::resolve): Likewise.
13465 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13466 parameter. Change all callers.
13467 (Symbol_table::add_from_object): Get target from parameters.
13468 (Symbol_table::add_from_relobj): Don't check object target.
13469 (Symbol_table::add_from_dynobj): Likewise.
13470 (Symbol_table::define_special_symbol): Get target from
13471 parameters.
13472 * symtab.h (class Symbol_table): Update declaration.
13473 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13474 parameter. Change all callers. Clear parameter target.
13475 (Binary_test): Test target here.
13476 * testsuite/object_unittest.cc (gold_testsuite): Remove
13477 target_test_pointer parameter. Change all callers.
13478 (Object_test): Test target here.
13479
a6a22b83
ILT
134802009-09-26 Ian Lance Taylor <iant@google.com>
13481
13482 * testsuite/initpri1.c: Don't try to use constructor priorities if
13483 compiling with gcc before 4.3.
13484
6a8f49fe
ILT
134852009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13486
13487 * testsuite/retain_symbols_file_test.sh (check_present): Change
13488 output file name to retain_symbols_file_test.stdout.
13489 (check_absent): Likewise.
13490
8c604651
CS
134912009-09-18 Craig Silverstein <csilvers@google.com>
13492
13493 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13494 * options.cc: Include <cerrno> and <fstream>.
13495 (General_options::finalize): Parse -retain-symbols-file tag.
13496 * options.h: New flag.
13497 (General_options): New method should_retain_symbol, new
13498 variable symbols_to_retain.
13499 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13500 should_retain_symbol map.
13501 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13502 * testsuite/Makefile.in: Regenerate.
13503 * testsuite/retain_symbols_file_test.sh: New file.
13504
ca58b19f
NC
135052009-09-18 Nick Clifton <nickc@redhat.com>
13506
13507 * po/es.po: Updated Spanish translation.
13508
20e6d0d6
DK
135092009-09-17 Doug Kwan <dougkwan@google.com>
13510
13511 * debug.h (DEBUG_RELAXATION): New constant.
13512 (DEBUG_ALL): Add DEBUG_RELAXATION.
13513 (debug_string_to_enum): Add relaxation debug option.
13514 * layout.cc
13515 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13516 Layout::Relaxation_debug_check::read_sections,
13517 Layout::Relaxation_debug_check::read_sections): New method definitions.
13518 (Layout::Layout): Initialize data members
13519 record_output_section_data_from_scrips_,
13520 script_output_section_data_list_ and relaxation_debug_check_.
13521 (Layout::save_segments, Layout::restore_segments,
13522 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13523 Layout::relaxation_loop_body): New method definitions.
13524 (Layout::finalize): Support relaxation. Move section layout code to
13525 Layout::relaxation_loop_body.
13526 (Layout::set_asection_address_from_script): Move code for orphan
13527 section placement out.
13528 (Layout::place_orphan_sections_in_script): New method definition.
13529 * layout.h (Output_segment_headers, Output_file_header):
13530 New forward class declarations.
13531 (Layout::~Layout): Define.
13532 (Layout::new_output_section_data_from_script): New method definition.
13533 (Layout::place_orphan_sections_in_script): New method declaration.
13534 (Layout::Segment_states): New type declaration.
13535 (Layout::save_segments, Layout::restore_segments,
13536 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13537 Layout::relaxation_loop_body): New method declarations.
13538 (Layout::Output_section_data_list): New type declaration.
13539 (Layout::Relaxation_debug_check): New class definition.
13540 (Layout::record_output_section_data_from_script_,
13541 Layout::script_output_section_data_list_, Layout::segment_states_,
13542 Layout::relaxation_debug_check_): New data members.
13543 * output.cc: (Output_section_headers::do_size): New method definition.
13544 (Output_section_headers::Output_section_headers): Move size
13545 computation to Output_section_headers::do_size.
13546 (Output_segment_headers::do_size): New method definition.
e1df38aa 13547 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13548 Output_file_header::do_size and call it.
13549 (Output_file_header::do_size): New method definition.
13550 (Output_data_group::Output_data_group): Adjust call to
13551 Output_section_data.
13552 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13553 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13554 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13555 RELAXED_INPUT_SECTION_CODE.
13556 (Output_section::Output_section): Initialize data member checkpoint_.
13557 (Output_section::~Output_section): Delete checkpoint object pointed
13558 by checkpoint_.
13559 (Output_section::add_input_section): Always add an Input_section if
13560 relaxing.
13561 (Output_section::add_merge_input_section): Add assert.
13562 (Output_section::relax_input_section): New method definition.
13563 (Output_section::set_final_data_size): Set load address to zero for
13564 an unallocated section.
13565 (Output_section::do_address_and_file_offset_have_reset_values):
13566 New method definition.
13567 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13568 Handle relaxed input section.
13569 (Output_section::sort_attached_input_sections): Checkpoint input
13570 section list lazily.
13571 (Output_section::get_input_sections): Change type of input_sections to
13572 list of Simple_input_section pointers. Checkpoint input section list
13573 lazily. Also handle relaxed input sections.
13574 (Output_section::add_input_section_for_script): Take a reference to
13575 a Simple_input_section object instead of Relobj pointer and section
13576 index as parameter. Handle relaxed input sections.
13577 (Output_section::save_states, Output_section::restore_states): New
13578 method definitions.
13579 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13580 (Output_data::is_data_size_fixed): New method definition.
13581 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13582 if it is fixed.
13583 (Output_data::address_and_file_offset_have_reset_values): New method
13584 definition.
13585 (Output_data::do_address_and_file_offset_have_reset_values): New method
13586 definition.
13587 (Output_data::set_data_size): Check that data size is not fixed.
13588 (Output_data::fix_data_size): New method definition.
13589 (Output_data::is_data_size_fixed_): New data member.
13590 (Output_section_headers::set_final_data_size): New method definition.
13591 (Output_section_headers::do_size): New method declaration.
13592 (Output_segment_headers::set_final_data_size): New method definition.
13593 (Output_segment_headers::do_size): New method declaration.
13594 (Output_file_header::set_final_data_size)::New method definition.
13595 (Output_file_header::do_size)::New method declaration.
13596 (Output_section_data::Output_section_data): Add new parameter
13597 is_data_size_fixed and use it to fix data size.
13598 (Output_data_const::Output_data_const): Adjust call to base class
13599 constructor and fix data size.
13600 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13601 base class constructor and fix data size.
13602 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13603 base class constructor and fix data size.
13604 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13605 class constructor and fix data size.
13606 (Output_data_group::set_final_data_size): New method definition.
13607 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13608 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13609 class constructor and fix data size.
13610 (Output_relaxed_input_section): New class definition.
13611 (Output_section::Simple_input_section): New class definition.
13612 (Output_section::get_input_sections): Adjust parameter list.
13613 (Output_section::add_input_section_for_script): Same.
13614 (Output_section::save_states, Output_section::restore_states,
13615 Output_section::do_address_and_file_offset_have_reset_values,
13616 (Output_section::Input_section::Input_section): Handle
13617 RELAXED_INPUT_SECTION_CODE. Add new overload for
13618 Output_relaxed_input_section.
13619 (Output_section::Input_section::is_input_section,
13620 Output_section::Input_section::set_output_section): Handle relaxed
13621 input section.
13622 (Output_section::Input_section::is_relaxed_input_section,
13623 Output_section::Input_section::output_section_data,
13624 Output_section::Input_section::relaxed_input_section): New method
13625 definitions.
13626 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13627 value.
13628 (Output_section::Input_section::u1_): Update comments.
13629 (Output_section::Input_section::u2_): Add new union member poris.
13630 (Output_section::Checkpoint_output_section): New classs definition.
13631 (Output_section::relax_input_section): New method declaration.
13632 (Output_section::checkpoint_): New data member.
13633 (Output_segment): Update comments.
13634 (Output_segment::Output_segment): Un-privatize copy constructor.
13635 (Output_segment::operator=): Un-privatize.
13636 * script-sections.cc (Output_section_element::Input_section_list):
13637 Change element type to Output_section::Simple_input_section.
13638 (Output_section_element_dot_assignment::set_section_addresses):
13639 Register output section data for relaxation clean up.
13640 (Output_data_exression::Output_data_expression): Adjust call to base
13641 constructor to fix data size.
13642 (Output_section_element_data::set_section_addresses): Register
13643 Output_data_expression object for relaxation clean up.
13644 (struct Input_section_info): Replace Relobj pointer and section index
13645 pair with Output_section::Simple_input_section and Convert struct to a
13646 class.
13647 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13648 Input_section_info data member to use accessors.
20e6d0d6
DK
13649 (Output_section_element_input::set_section_addresses): Use layout
13650 parameter. Adjust code to use Output_section::Simple_input_section
13651 and Input_secction_info classes. Register filler for relaxation
13652 clean up.
13653 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13654 and section index pair with Output_section::Simple_input_section
13655 class. Adjust code accordingly.
13656 (Phdrs_element::release_segment): New method definition.
13657 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13658 segment list.
13659 (Script_sections::release_segments): New method definition.
13660 * gold/script-sections.h (Script_sections::release_segments): New
13661 method declaration.
13662 * gold/target.h (Target::may_relax, Target::relax,
13663 Target::do_may_relax, Target::do_relax): New method definitions.
13664
5e445df6
ILT
136652009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13666
13667 * arm.cc (has_signed_unsigned_overflow): New function.
13668 (Arm_relocate_functions::abs8): New function.
13669 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13670 (Target_arm::Scan::global): Likewise.
13671 (Target_arm::relocate::relocate): Likewise.
13672 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13673 Likewise.
13674
8c604651 136752009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13676
13677 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13678 * testsuite/Makefile.in: Regenerate.
13679
1e9cc1c2
NC
136802009-09-11 Nick Clifton <nickc@redhat.com>
13681
13682 * po/gold.pot: Updated by the Translation project.
13683
6a89f575
CC
136842009-09-08 Cary Coutant <ccoutant@google.com>
13685
13686 * output.cc (Output_file::open): Add execute permission to empty file.
13687 * testsuite/Makefile.am (permission_test): New test.
13688 * testsuite/Makefile.in: Regenerate.
13689
fdcac5af
ILT
136902009-09-02 Ian Lance Taylor <iant@google.com>
13691
13692 * output.cc (Output_file::resize): Call map_no_anonymous rather
13693 than map.
13694
44453f85
ILT
136952009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13696
13697 * gold.cc: Include "incremental.h".
13698 (queue_initial_tasks): Call Incremental_checker methods.
13699 * incremental.cc: Include "output.h".
13700 (Incremental_checker::can_incrementally_link_output_file): New
13701 method.
13702 * incremental.h (Incremental_checker): New class.
13703
13704 * output.cc (Output_file::open_for_modification): New method.
13705 (Output_file::map_anonymous): Changed return type to bool. Record
13706 map in base_ field.
13707 (Output_file::map_no_anonymous): New method, broken out of map.
13708 (Output_file::map): Use map_no_anonymous and map_anonymous.
13709 * output.h (class Output_file): Update declarations.
13710
293c1386
CC
137112009-08-24 Cary Coutant <ccoutant@google.com>
13712
13713 * options.h (Command_line::Pre_options): New class.
13714 (Command_line::pre_options): New member.
13715 * options.cc (gold::options::ready_to_register): New variable.
13716 (One_option::register_option): Do nothing if not registering options.
13717 Assert if same short option registered twice.
13718 (General_options::General_options): Turn off option registration when
13719 done constructing.
13720 (Command_line::Pre_options::Pre_options): New constructor.
13721
f773f3d2
CC
137222009-08-24 Cary Coutant <ccoutant@google.com>
13723
06a73cfe
CC
13724 * options.h (General_options::no_keep_memory): Remove incorrect
13725 short option.
f773f3d2 13726
a15af8e2
RW
137272009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13728
13729 * Makefile.am (am__skiplex, am__skipyacc): New.
13730 * Makefile.in: Regenerate.
13731
c462b41b
RW
137322009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13733
14ec8efd
RW
13734 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13735 (INCLUDES): ... this.
13736 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13737 (AM_CPPFLAGS): Renamed from ...
13738 (INCLUDE): ... this.
13739 * Makefile.in, testsuite/Makefile.in: Regenerate.
13740
81ecdfbb
RW
13741 * Makefile.in: Regenerate.
13742 * aclocal.m4: Likewise.
13743 * config.in: Likewise.
13744 * configure: Likewise.
13745 * testsuite/Makefile.in: Likewise.
13746
c462b41b
RW
13747 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13748 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13749 * Makefile.in: Regenerate.
13750 * testsuite/Makefile.in: Regenerate.
13751
2da73f13
CC
137522009-08-19 Cary Coutant <ccoutant@google.com>
13753
13754 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13755 symbols in shared libraries overridden by hidden or internal symbols
13756 in the main program.
13757
2db70501
CD
137582009-08-19 Chris Demetriou <cgd@google.com>
13759
13760 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13761 checking source file names in error messages.
13762
f733487b
DK
137632009-08-18 Doug Kwan <dougkwan@google.com>
13764
13765 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13766 an elcpp::Ehdr as parameter. Adjust call to set_target.
13767 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13768 an elfcpp::Ehdr as parameter.
13769 * object.cc (Object::set_target): Remove the version that looks up
13770 a target and sets it.
13771 (Sized_relobj::setup): Take a Target object instead of
13772 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13773 (make_elf_sized_object): Find target and ask target to
13774 make an ELF object.
13775 * object.h: (Object::set_target): Remove the version that looks up
13776 a target and sets it.
13777 (Sized_relobj::setup): Take a Target object instead of
13778 an elfcpp:Ehdr as parameter.
13779 * target.cc: Include dynobj.h.
13780 (Target::do_make_elf_object_implementation): New.
2e702c99 13781 (Target::do_make_elf_object): New.
f733487b
DK
13782 * target.h (Target::make_elf_object): New template declaration.
13783 (Target::do_make_elf_object): New method declarations.
13784 (Target::do_make_elf_object_implementation): New template declaration.
13785
cc70f101
ILT
137862009-08-14 Ian Lance Taylor <iant@google.com>
13787
13788 * gold.h (FUNCTION_NAME): Define.
13789 (gold_unreachable): Use FUNCTION_NAME.
13790
ef5e0cb1
ST
137912009-08-12 Sriraman Tallam <tmsriram@google.com>
13792
13793 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13794 symbol in the --keep-unique list is not found.
13795
48c187ce
ST
137962009-08-12 Sriraman Tallam <tmsriram@google.com>
13797
13798 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13799 been maked as --keep-unique.
13800 (Icf::unfold_section): New function.
13801 * icf.h (Icf::unfold_section): New function.
13802 * options.h (General_options::keep_unique): New option.
13803 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13804 * testsuite/Makefile.in: Regenerate.
13805 * testsuite/icf_keep_unique_test.sh: New file.
13806 * testsuite/icf_keep_unique_test.cc: New file.
13807
645afe0c
CC
138082009-08-12 Cary Coutant <ccoutant@google.com>
13809
13810 PR 10471
13811 * resolve.cc (Symbol_table::resolve): Check for references from
13812 dynamic objects to hidden and internal symbols.
13813 * testsuite/Makefile.am (hidden_test.sh): New test.
13814 * testsuite/Makefile.in: Regenerate.
13815 * testsuite/hidden_test.sh: New script.
13816 * testsuite/hidden_test_1.c: New test source.
13817 * testsuite/hidden_test_main.c: New test source.
13818
11af873f
DK
138192009-08-11 Doug Kwan <dougkwan@google.com>
13820
13821 * arm.cc: Update comments.
13822 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13823 segment to locate the .ARM.exidx section if present.
13824
b9f7d72d
DK
138252009-08-09 Doug Kwan <dougkwan@google.com>
13826
13827 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13828 patch.
13829
ddd3c53c
ST
138302009-08-07 Sriraman Tallam <tmsriram@google.com>
13831 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13832 compiler warnings.
13833
27721062
ST
138342009-08-06 Sriraman Tallam <tmsriram@google.com>
13835
13836 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13837 valid tls_segment only for non-debug-section relocations.
13838 * testsuite/Makefile.am: Add gc_tls_test.
13839 * testsuite/Makefile.in: Regenerate.
13840 * testsuite/gc_tls_test.cc: New file.
13841 * testsuite/gc_tls_test.sh: New file.
13842
ef15dade 138432009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13844
ef15dade
ST
13845 * icf.cc: New file.
13846 * icf.h: New file.
13847 * Makefile.am (CCFILES): Add icf.cc.
13848 (HFILES): Add icf.h
13849 * Makefile.in: Regenerate.
13850 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13851 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13852 section, symbol and addend information for the relocs.
13853 * gold.cc (queue_middle_tasks): Call identical code folding.
13854 * gold.h: Add defines for multimap.
13855 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13856 to the call of finalize_local_symbols.
13857 * main.cc (main): Create object of class Icf.
13858 * object.cc (Sized_relobj::do_layout): Allow this function to be
13859 called twice during icf.
13860 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13861 to sections marked as identical by icf.
13862 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13863 when available.
13864 (Sized_relobj::do_section_entsize): New function.
13865 * object.h (Object::section_entsize): New function.
13866 (Object::do_section_entsize): New pure virtual function.
13867 (Relobj::finalize_local_symbols): Add new parameter.
13868 (Relobj::do_section_entsize): New function.
13869 * options.h (General_options::icf): New option.
13870 (General_options::icf_iterations): New option.
13871 (General_options::print_icf_sections): New option.
13872 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13873 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13874 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13875 icf.
13876 * symtab.cc (Symbol_table::is_section_folded): New function.
13877 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13878 to sections marked as identical by icf.
13879 * symtab.h (Symbol_table::set_icf): New function.
13880 (Symbol_table::icf): New function.
13881 (Symbol_table::is_section_folded): New function.
13882 (Symbol_table::icf_): New data member.
13883 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13884 * testsuite/Makefile.am: Add commands to build icf_test.
13885 * testsuite/Makefile.in: Regenerate.
13886 * testsuite/icf_test.sh: New file.
13887 * testsuite/icf_test.cc: New file.
13888
c3b65ac4
CD
138892009-07-24 Chris Demetriou <cgd@google.com>
13890
13891 * layout.cc (is_compressible_debug_section): Fix incorrect
13892 comment about compressed section names.
13893
1caf2c51
ILT
138942009-07-20 Ian Lance Taylor <ian@airs.com>
13895
13896 PR 10419
13897 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13898
1ef4d87f
ILT
138992009-07-16 Ian Lance Taylor <iant@google.com>
13900
13901 PR 10400
13902 * layout.h: #include <map>.
13903 (class Kept_section): Change from struct to class. Add accessors
13904 and setters. Add section size to Comdat_group mapping. Change
13905 Comdat_group to std::map. Add is_comdat_ field. Add
13906 linkonce_size field in union.
13907 (class Layout): Update declaration of find_or_add_kept_section.
13908 Don't declare find_kept_object.
13909 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13910 parameter. Add object, shndx, is_comdat, and is_group_name
13911 parameters. Change all callers. Adjust for new Kept_section.
13912 (Layout::find_kept_object): Remove.
13913 * object.cc (Sized_relobj::include_section_group): Update use of
13914 Kept_section. Rename secnum to shndx. Only record
13915 Kept_comdat_section if sections are the same size.
13916 (Sized_relobj::include_linkonce_section): Update use of
13917 Kept_section. Only record Kept_comdat_section if sections are the
13918 same size. Set size of linkonce section.
13919 (Sized_relobj::map_to_kept_section): Update call to
13920 get_kept_comdat_section.
13921 * object.h (class Sized_relobj): Rename fields in
13922 Kept_comdat_section to drop trailing underscores; change object
13923 field to Relobj*. Change Kept_comdat_section_table to store
13924 struct rather than pointer.
13925 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13926 Add kept_object and kept_shndx parameters. Change all callers.
13927 (Sized_relobj::get_kept_comdat_section): Change return type to
13928 bool. Add kept_object and kept_shndx parameters. Change all
13929 callers.
13930 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13931 Layout::find_or_add_kept_section.
13932
37c3b7b0
ILT
139332009-07-09 Ian Lance Taylor <iant@google.com>
13934
13935 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13936 Reserve space in the hash table.
13937
98fa85cb
ILT
139382009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13939
13940 * fileread.cc (File_read::get_mtime): New method.
13941 * fileread.h (Timespec): New structure.
13942 (File_read::get_mtime): New method.
13943 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13944 Renamed from timestamp_nsec.
13945 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13946 Elf_Xword.
e1df38aa 13947 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13948 timestamp_nsec.
e1df38aa 13949 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13950 (Incremental_inputs::report_obejct): Save mtime; style fix.
13951 (Incremental_inputs::report_script): Save mtime; style fix.
13952 (Incremental_inputs::finalize_inputs): Style fix.
13953 (Incremental_inputs::finalize): Style fix.
13954 (Incremental_inputs::create_input_section_data): Store inputs
13955 mtime.
13956 * incremental.h (Incremental_inputs::report_script): Add mtime
13957 argument.
13958 (Incremental_inputs::Input_info::Input_info): Intialize only one
13959 union member.
13960 (Incremental_inputs::Input_info::archive): Move to nameless
13961 union.
13962 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13963 (Incremental_inputs::Input_info::script): Move to nameless union.
13964 (Incremental_inputs::mtime): New field.
13965 * script.cc (read_input_script): Pass file mtime to
13966 Incremental_input.
13967 * script.h (Script_info::inputs): Style fix.
13968
c9d70757
ILT
139692009-07-01 Ian Lance Taylor <ian@airs.com>
13970
13971 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13972 instead of 32.
13973
9c547ec3
ILT
139742009-06-24 Ian Lance Taylor <iant@google.com>
13975
13976 PR 10156
13977 * layout.cc (Layout::choose_output_section): If we find an
13978 existing section, update the flags.
13979 (Layout::create_notes): New function, broken out of
13980 Layout::finalize.
13981 (Layout::finalize): Don't create note sections.
13982 (Layout::create_note): Don't crash if linker script discards
13983 section.
13984 (Layout::create_gold_note): Likewise.
13985 (Layout::create_build_id): Likewise. Don't set
13986 after_input_sections on the section.
13987 (Layout::create_executable_stack_info): Remove target parameter.
13988 Change caller.
13989 * layout.h (class Layout): Declare create_notes. Update
13990 declaration of create_executable_stack_info.
13991 * gold.cc (queue_middle_tasks): Call create_notes.
13992 * output.cc (Output_section::update_flags_for_input_section): Move
13993 here from output.h. If SHF_ALLOC flag is newly set, mark address
13994 invalid.
13995 * output.h (Output_data::mark_address_invalid): New function.
13996 (class Output_section): Only declare, not define,
13997 update_flags_for_input_section. Remove set_flags.
13998
55458500
ILT
139992009-06-24 Ian Lance Taylor <iant@google.com>
14000
14001 * script-sections.cc (Output_section_definition::
14002 set_section_addresses): Rename shadowing local load_address to
14003 laddr.
14004
1307d6cd
ILT
140052009-06-24 Ian Lance Taylor <iant@google.com>
14006
14007 PR 10244
14008 * reloc.cc (relocate_sections): Skip empty relocation sections.
14009
ec3f783e
ILT
140102009-06-23 Ian Lance Taylor <iant@google.com>
14011
14012 PR 10156
14013 * layout.cc (Layout::create_note): Use choose_output_section
14014 rather than make_output_section.
14015
459c9f1c
ILT
140162009-06-23 Ian Lance Taylor <iant@google.com>
14017
14018 PR 10237
14019 * options.cc (General_options::parse_V): Set printed_version_.
14020 (General_options::General_options): Initialize printed_version_.
14021 * options.h (class General_options): Add printed_version_ field.
14022 * gold.cc (queue_initial_tasks): If there are no input files,
14023 don't give a fatal error if we printed the version information.
14024 (queue_middle_tasks): If using -r with a shared object, give a
14025 fatal error rather than an ordinary error.
14026
1518dc8f
ILT
140272009-06-23 Ian Lance Taylor <iant@google.com>
14028
14029 PR 10219
14030 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14031 (Layout::make_output_section): Set have_stabstr_section_ if we see
14032 a .stab*str section.
14033 (Layout::finalize): Call link_stabs_sections.
14034 (Layout::link_stabs_sections): New file.
14035 * layout.h (class Layout): Add have_stabstr_section_ field.
14036 Declare link_stabs_sections.
14037
3d857b98
DK
140382009-06-23 Doug Kwan <dougkwan@google.com>
14039
14040 * Makefile.am (libgold_a_LIBADD): New.
14041 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14042 * Makefile.in: Regenerate.
3d857b98
DK
14043 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14044 * configure: Regenerate.
14045 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14046 * fileread.cc: Include sys/state.h
14047 * gold.h: Declare memmem and strndup if found missing.
14048 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14049
0639a6f6
ILT
140502009-06-23 Ian Lance Taylor <iant@google.com>
14051
14052 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14053 * configure: Rebuild.
14054
8d63875c
ILT
140552009-06-23 Ian Lance Taylor <iant@google.com>
14056
14057 PR 10147
14058 * object.cc (Object::section_contents): Don't try to get a view if
14059 the section has length zero.
14060 (Object::handle_gnu_warning_section): If the section is empty, use
14061 the name of the section as the warning.
14062
f7c8a183
ILT
140632009-06-23 Ian Lance Taylor <iant@google.com>
14064
14065 PR 10133
14066 * stringpool.h (class Stringpool_template): Add optimize_ field.
14067 (Stringpool_template::set_optimize): New function.
14068 * stringpool.cc (Stringpool_template::Stringpool_template):
14069 Initialize optimize_ field.
14070 (Stringpool_template::set_string_offsets): Test local optimize
14071 fild rather than parameter.
14072 * layout.cc (Layout::Layout): Call set_optimize on the section
14073 name stringpool.
14074
e6a307ba
ILT
140752009-06-22 Ian Lance Taylor <iant@google.com>
14076
14077 PR 10030
14078 * yyscript.y: Parse TARGET.
14079 * script.cc (script_set_target): New function.
14080 * script-c.h (script_set_target): Declare.
14081 * options.cc (General_options::string_to_object_format): Rename
14082 from string_to_object_format in anonymous namespace. Change
14083 callers.
14084 * options.h (class General_options): Declare
14085 string_to_object_format.
14086
3ee173de
ILT
140872009-06-22 Ian Lance Taylor <iant@google.com>
14088
14089 * script-sections.cc (Script_sections::create_segments): Don't put
14090 program headers in a PT_LOAD segment if -n or -N.
14091
140922009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14093
14094 PR 10141
14095 * options.h (class General_options): Add -z lazy and -z now. Sort
14096 -z options into alphabetical order.
14097 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14098
cd6739a1 140992009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14100
14101 * layout.cc (Layout::make_output_section): Call
14102 Target::new_output_section.
14103 (Layout::attach_allocated_section_to_segment): Put large section
14104 sections in a separate load segment with the large segment flag
14105 set.
14106 (Layout::segment_precedes): Sort large data segments after other
14107 load segments.
14108 (align_file_offset): New static function.
14109 (Layout::set_segment_offsets): Use align_file_offset.
14110 * output.h (class Output_section): Add is_small_section_ and
14111 is_large_section_ fields.
14112 (Output_section::is_small_section): New function.
14113 (Output_section::set_is_small_section): New function.
14114 (Output_section::is_large_section): New function.
14115 (Output_section::set_is_large_section): New function.
14116 (Output_section::is_large_data_section): New function.
14117 (class Output_segment): Add is_large_data_segment_ field.
14118 (Output_segment::is_large_data_segment): New function.
14119 (Output_segment::set_is_large_data_segment): New function.
14120 * output.cc (Output_section::Output_section): Initialize new
14121 fields.
14122 (Output_segment::Output_segment): Likewise.
14123 (Output_segment::add_output_section): Add assertion that large
14124 data sections always go in large data segments. Force small data
14125 sections to the end of the list of data sections. Force small BSS
14126 sections to the start of the list of BSS sections. For large BSS
14127 sections to the end of the list of BSS sections.
14128 * symtab.h (class Symbol): Declare is_common_shndx.
14129 (Symbol::is_defined): Check Symbol::is_common_shndx.
14130 (Symbol::is_common): Likewise.
14131 (class Symbol_table): Define enum Commons_section_type. Update
14132 declarations. Add small_commons_ and large_commons_ fields.
14133 * symtab.cc (Symbol::is_common_shndx): New function.
14134 (Symbol_table::Symbol_table): Initialize new fields.
14135 (Symbol_table::add_from_object): Put small and large common
14136 symbols in the right list.
14137 (Symbol_table::sized_finalized_symbol): Check
14138 Symbol::is_common_shndx.
14139 (Symbol_table::sized_write_globals): Likewise.
14140 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14141 common symbol lists. Don't call do_allocate_commons_list if the
14142 list is empty.
14143 (Symbol_table::do_allocate_commons_list): Remove is_tls
14144 parameter. Add comons_section_type parameter. Change all
14145 callers. Handle small and large common symbols.
14146 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14147 Symbol::is_common_shndx.
14148 * resolve.cc (symbol_to_bits): Likewise.
14149 * target.h (Target::small_common_shndx): New function.
14150 (Target::small_common_section_flags): New function.
14151 (Target::large_common_shndx): New function.
14152 (Target::large_common_section_flags): New function.
14153 (Target::new_output_section): New function.
14154 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14155 small_common_section_flags, and large_common_section_flags
14156 fields.
14157 (Target::do_new_output_section): New virtual function.
14158 * arm.cc (Target_arm::arm_info): Initialize new fields.
14159 * i386.cc (Target_i386::i386_info): Likewise.
14160 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14161 Likewise.
14162 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14163 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14164 (Target_x86_64::do_new_output_section): New function.
14165 * configure.ac: Define conditional MCMODEL_MEDIUM.
14166 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14167 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14168 (large_LDFLAGS): Define.
14169 * testsuite/large.c: New file.
14170 * testsuite/testfile.cc (Target_test::test_target_info):
14171 Initialize new fields.
14172 * configure, testsuite/Makefile.in: Rebuild.
14173
bb04269c
DK
141742009-06-05 Doug Kwan <dougkwan@google.com>
14175
14176 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14177 * Makefile.in: Regenerate.
bb04269c
DK
14178 * i386.cc (class Target_i386): Define new virtual method to
14179 override do_is_local_label_name in parent.
14180 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14181 local symbols if --discard-locals or -X is given.
14182 * options.h (class General_options): Declare new options
14183 '--discard-locals' and '-X' for discarding locals.
14184 * target.h (class Target): Define new methods is_local_label_name.
14185 Declare new virtual method do_is_local_label_name.
14186 * target.cc: New file.
14187 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14188 (check_SCRIPTS): Add discard_locals_test.sh.
14189 (check_DATA): Add discard_local_tests.syms.
14190 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14191 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14192 * testsuite/Makefile.in: Regenerate.
14193 * testsuite/discard_locals_test.c: New file.
14194 * testsuite/discard_locals_test.sh: Same.
14195
805bb01c
DK
141962009-06-05 Doug Kwan <dougkwan@google.com>
14197
14198 * object.cc (Sized_relobj::Sized_relobj): Initialize
14199 discarded_eh_frame_shndx_ to -1U.
14200 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14201 section.
14202 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14203 a discarded .eh_frame section.
14204 (Sized_relobj::do_finalize_local_symbols): Ditto.
14205 * object.h (class Sized_relobj): Declare new member
14206 discarded_eh_frame_shndx_.
14207 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14208 (local_labels_test.o, local_labels_test): New rules.
14209 * testsuite/Makefile.in: Regenerate.
14210
1dcd334d
DK
142112009-06-04 Doug Kwan <dougkwan@google.com>
14212
14213 * layout.cc (Layout::section_name_mapping): Add mapping for
14214 special ARM sections.
14215
96d49306
DK
142162009-06-03 Doug Kwan <dougkwan@google.com>
14217
14218 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14219 (utils::has_overflow): Same.
14220
dff16297
ILT
142212009-06-03 Ian Lance Taylor <iant@google.com>
14222
14223 * layout.cc (Layout::section_name_mapping): New array, replacing
14224 Layout::linkonce_mapping.
14225 (Layout::section_name_mapping_count): New variable, replacing
14226 Layout::linkonce_mapping_count.
14227 (Layout::linkonce_output_name): Remove.
14228 (Layout::output_section_name): Rewrite.
14229 * layout.h (class Layout): Rename Linkonce_mapping to
14230 Section_name_mapping, linkonce_mapping to section_name_mapping,
14231 linkonce_mapping_count to section_name_mapping_count. Don't
14232 declare linkonce_output_name.
14233
c121c671
DK
142342009-06-03 Doug Kwan <dougkwan@google.com>
14235
14236 * gold/arm.cc (namespace utils): New.
14237 (Target_arm::reloc_is_non_pic): Define new method.
14238 (class Arm_relocate_functions): New.
14239 (Target_arm::Relocate::relocate): Handle relocation types used by
14240 Android.
14241
07800fab
ILT
142422009-06-03 Ian Lance Taylor <iant@google.com>
14243
14244 * arm.cc (Target_arm::scan::global): Use || instead of |.
14245
c121c671
DK
142462009-06-02 Doug Kwan <dougkwan@google.com>
14247
14248 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14249 issued_non_pic_error_.
14250 (class Target_arm::Scan): Declare new method check_non_pic.
14251 Define new method symbol_needs_plt_entry.
14252 Declare new data member issued_non_pic_error_.
14253 (class Target_arm::Relocate): Declare new method
14254 should_apply_static_reloc.
14255 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14256 (Target_arm::Scan::check_non_pic): Define new method.
14257 (Target_arm::Scan::local): Handle a small subset of reloc types used
14258 by Android.
14259 (Target_arm::Scan::local): Same.
14260 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14261
b19b0c6d
ILT
142622009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14263
14264 * incremental.cc (Incremental_inputs::report_command_line): Filter
14265 out --incremental-* options.
14266
94cdfcff
DK
142672009-05-29 Doug Kwan <dougkwan@google.com>
14268
14269 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14270 template class.
14271 (class Target_arm): Update comment.
14272 (Target_arm::Target_arm): Initialize new data members GOT_,
14273 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14274 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14275 and Target_arm::rel_dyn_section.
14276 Declare new_enum Target_arm::Got_type.
14277 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14278 and DYNBSS_.
14279 Update commments for member do_dynsym_value.
14280 (Target_arm::got_size, Target_arm::plt_section,
14281 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14282 new methods inside class defintion.
14283 (Target_arm::got_section): Define new method.
14284 (Target_arm::rel_dyn_section): Same.
14285 (Output_data_plt_arm): New template class.
14286 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14287 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14288 (Output_data_plt_arm::add_entry): Same.
14289 (Output_data_plt_arm::first_plt_entry): Define new
14290 static data member for PLT instruction template.
14291 (Output_data_plt_arm::plt_entry): Same.
14292 (Output_data_plt_arm::do_write): Define new method.
14293 (Target_arm::make_plt_entry): Same.
14294 (Target_arm::do_finalize_sections): Same.
14295 (Target_arm::do_dynsym_value): Same.
14296
4a657b0d
DK
142972009-05-28 Doug Kwan <dougkwan@google.com>
14298
14299 * Makefile.am (TARGETSOURCES): Add arm.cc.
14300 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14301 * Makefile.in: Regenerate.
14302 * arm.cc: New file.
14303 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14304
e7ae8c36
DK
143052009-05-26 Doug Kwan <dougkwan@google.com>
14306
14307 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14308 (General_options::check_excluded_libs): Strip off directories in
14309 archive name before matching like GNU ld does.
14310 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14311 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14312 (exclude_libs_test_LDFLAGS): Add linker option
14313 -Wl,--exclude-libs,libexclude_libs_test_3
14314 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14315 an explicit archive without using -l.
14316 (alt/libexclude_libs_test_3.a): New make rule.
14317 * testsuite/Makefile.in: Regenerate.
14318 * testsuite/exclude_libs_test.c : Declare lib3_default().
14319 (main): Call it.
14320 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14321 * exclude_libs_test_3.c: New file.
14322
f12e7348
NC
143232009-05-26 Nick Clifton <nickc@redhat.com>
14324
14325 * po/id.po: New Indonesian translation.
14326 * po/gold.pot: Updated template file.
14327
4daadc0d
ST
143282009-05-22 Sriraman Tallam <tmsriram@google.com>
14329
e1df38aa 14330 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14331 gc_comdat_test files. Add -Wl,--gc-sections to build
14332 gc_comdat_test.
14333 * testsuite/Makefile.in: Regenerate.
14334 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14335
531813ad
ST
143362009-05-21 Sriraman Tallam <tmsriram@google.com>
14337
14338 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14339 kept comdat section was garbage collected.
14340 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14341 * testsuite/Makefile.in: Regenerate.
14342 * testsuite/gc_comdat_test.sh: New file.
14343 * testsuite/gc_comdat_test_1.cc: New file.
14344 * testsuite/gc_comdat_test_2.cc: New file.
14345
65514900
CC
143462009-05-19 Doug Kwan <dougkwan@google.com>
14347
14348 * archive.cc (Archive::Archive): Move constructor from archive.h
14349 to here. Initialize no_export_.
14350 (Archive::get_elf_object_for_member): Set no_export flag of object.
14351 * archive.h (Archive::Archive): Move constructor body to
14352 archive.cc.
14353 (Archive::no_export): New method.
14354 (Archive::no_export_): New field.
14355 * object.h (Object::Object): Initialize no_export_ to false.
14356 (Object::no_export, Object::set_no_export): New methods.
14357 (Object::no_export_): New field.
14358 * options.cc (General_options::parse_exclude_libs): New method.
14359 (General_options::check_excluded_libs) Same.
14360 * options.h (exclude_libs): New option.
14361 (General_options::check_excluded_libs): New method declaration.
14362 (General_options::excluded_libs_): New field.
14363 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14364 default or protected visibility if an object has no-export flag set.
14365 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14366 (check_SCRIPTS): Add exclude_libs_test.sh.
14367 (check_DATA): Add exclude_libs_test.syms.
14368 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14369 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14370 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14371 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14372 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14373 libexclude_libs_test_2.a): New rules.
14374 * testsuite/Makefile.in: Regenerate.
14375 * testsuite/exclude_libs_test.c: New file.
14376 * testsuite/exclude_libs_test.sh: Ditto.
14377 * testsuite/exclude_libs_test_1.c: Ditto.
14378 * testsuite/exclude_libs_test_2.c: Ditto.
14379
1b77ea50
ILT
143802009-05-15 Ian Lance Taylor <iant@google.com>
14381
14382 * configure.ac: Check for declarations for cases where libiberty.h
14383 checks HAVE_DECL_xxx.
14384 * configure, config.in: Rebuild.
14385
072fe7ce
ILT
143862009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14387
14388 * gold.h (Incremental_argument_list): Remove (invalid) forward
14389 declaration.
14390 * incremental.cc (Incremental_inputs::report_achive): New method.
14391 (Incremental_inputs::report_object): New method.
14392 (Incremental_inputs::report_script): New method.
14393 (Incremental_inputs::finalize_inputs): New method.
14394 (Incremental_inputs::finalize): Call finalize_inputs().
14395 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14396 Create inputs entries.
14397 * incremental.h (Incremental_input_type): New enum.
14398 (Incremental_inputs::Incremental_input): Initialize new fields.
14399 (Incremental_inputs::report_inputs): New method.
14400 (Incremental_inputs::report_achive): New method.
14401 (Incremental_inputs::report_object): New method.
14402 (Incremental_inputs::report_script): New method.
14403 (Incremental_inputs::finalize_inputs): New method.
14404 (Incremental_inputs::Input_info): New struct.
14405 (Incremental_inputs::Input_info_map): New typedef.
14406 (Incremental_inputs::lock_): New field.
14407 (Incremental_inputs::Inputs_): New field.
14408 (Incremental_inputs::Inputs_map): New field.
14409 * main.cc (main): Call Incremental_input::report_inputs.
14410 * options.h (Input_argument_list): Typedef moved from
14411 Input_arguments.
14412 (Input_file_group::Files): Remove, use ::Input_argument_list.
14413 (Input_file_group::Input_argument_list): Remove, use
14414 ::Input_argument_list.
14415 * plugin.cc (Plugin_manager::add_input_file): Add error in
14416 incremental build.
14417 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14418 functions.
14419 * script.cc (read_input_script): Call
14420 Incremental_input::report_script.
14421 * script.h (Script_info): New class.
14422
b0481b0b
ILT
144232009-04-27 Ian Lance Taylor <iant@google.com>
14424
14425 * x86_64.cc (do_adjust_output_section): Set entsize to
14426 plt_entry_size.
14427
b22a5a41 144282009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14429
14430 * output.cc (Output_file::close): After short writes, continue
14431 writing from the correct offset in the buffer being written.
14432
40fde488
CD
144332009-04-23 Chris Demetriou <cgd@google.com>
14434
14435 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14436 * configure: Regenerate.
14437 * config.in: Regenerate.
14438 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14439 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14440
3ce2c28e
ILT
144412009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14442
14443 * incremental.cc (Incremental_inputs_header_data): Renamed from
14444 Incremental_input_header_data.
14445 (Incremental_inputs_header_data::data_size): New field.
14446 (Incremental_inputs_header_data::put_input_file_count): Renamed
14447 from input_file_count.
14448 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14449 from command_line_offset.
14450 (Incremental_inputs_header_data::put_reserved): Renamed from
14451 put_reserved.
14452 (Incremental_inputs_entry_data): Renamed from
14453 Incremental_input_entry_data.
14454 (Incremental_inputs_entry_data::data_size): New field.
14455 (Incremental_inputs::report_command_line): New method.
14456 (Incremental_inputs::finalize): New method.
14457 (Incremental_inputs::create_incremental_inputs_data): New method.
14458 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14459 * incremental.h: New file.
14460 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14461 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14462 incremental builds.
703d02da 14463 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14464 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14465 (Layout::create_incremental_info_sections): New method.
14466 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14467 * main.cc (main): Notify Incremental_input of the command line.
14468
e55bde5e
ILT
144692009-04-01 Ian Lance Taylor <iant@google.com>
14470 Mikolaj Zalewski <mikolajz@google.com>
14471
14472 * gold.h (reserve_unordered_map): Define, three versions, one for
14473 each version of Unordered_map.
14474 * layout.cc (Layout::Layout): Remove options parameter. Add
14475 number_of_input_files parameter. Don't initialize options_.
14476 Initialize number_of_input_files_ and resized_signatures_. Move
14477 sections_are_attached_.
14478 (Layout::layout_group): Reserve space for group_signatures_.
14479 (Layout::find_or_add_kept_section): Change name parameter to be a
14480 reference. Resize signatures_ map when it gets large enough.
14481 (Layout::layout_eh_frame): Use parameters->options() instead of
14482 this->options_.
14483 (Layout::make_output_section): Likewise.
14484 (Layout::attach_allocated_section_to_segment): Likewise.
14485 (Layout::finalize, Layout::create_executable_stack): Likewise.
14486 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14487 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14488 * layout.h (class Layout): Update declarations. Remove options_
14489 field. Add number_of_input_files_ and resized_signatures_
14490 fields. Move sections_are_attached_ field.
14491 * main.cc (main): Pass number of input files to Layout
14492 constructor. Don't pass options.
14493
154b857c
ILT
144942009-03-30 Ian Lance Taylor <iant@google.com>
14495
14496 * ffsll.c (ffsll): Correct implementation.
14497
2f35ab9b
ILT
144982009-03-27 Ian Lance Taylor <iant@google.com>
14499
fd03461a
ILT
14500 * ffsll.c: New file.
14501 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14502 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14503 * ftruncate.c (ftruncate): Declare before definition.
14504 * mremap.c (mremap): Likewise.
14505 * pread.c (pread): Likewise.
14506 * configure, Makefile.in, config.in: Rebuild.
14507
2f35ab9b
ILT
14508 * mremap.c: New file.
14509 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14510 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14511 (mremap): Declare if HAVE_MREMAP is not defined.
14512 * configure, Makefile.in, config.in: Rebuild.
14513
33aea2fd
CC
145142009-03-27 Cary Coutant <ccoutant@google.com>
14515
14516 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14517 position independent.
14518 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14519 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14520
6d479619
CC
145212009-03-24 Cary Coutant <ccoutant@google.com>
14522
14523 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14524 an executable.
14525 (needs_dynamic_reloc): Likewise.
14526
afc06bb8
ILT
145272009-03-24 Ian Lance Taylor <iant@google.com>
14528
14529 * yyscript.y (file_cmd): Recognize EXTERN.
14530 (extern_name_list, extern_name_list_body): New nonterminals.
14531 * script.cc (script_add_extern): Define.
14532 * script-c.h (script_add_extern): Declare.
14533
f6060a4d
ILT
145342009-03-24 Rafael Avila de Espindola <espindola@google.com>
14535
14536 * object.cc (is_elf_object): Define.
14537 * object.h (is_elf_object): Declare.
14538 * archive.cc (Archive::get_elf_object_for_member): Call
14539 is_elf_object.
33aea2fd 14540 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14541
26736d8e
ILT
145422009-03-24 Elliott Hughes <enh@google.com>
14543
14544 * output.cc (Output_file::map_anonymous): Define.
14545 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14546 try an anonymous one. Report the size if the mmap fails.
14547 * output.h (class Output_file): Declare map_anonymous.
14548
22fd9730
ILT
145492009-03-24 Ian Lance Taylor <iant@google.com>
14550
14551 * target-select.cc (instantiate_target): Don't acquire the lock if
14552 the instantiated_target_ field has already been set.
14553
cb010894
ILT
145542009-03-23 Ian Lance Taylor <iant@google.com>
14555
7f055c20
ILT
14556 * gold-threads.h (class Initialize_lock): Define.
14557 * gold-threads.cc (class Initialize_lock_once): Define.
14558 (initialize_lock_control): New static variable.
14559 (initialize_lock_pointer): New static variable.
14560 (initialize_lock_once): New static function.
14561 (Initialize_lock::Initialize_lock): Define.
14562 (Initialize_lock::initialize): Define.
14563 * target-select.h: Include "gold-threads.h".
14564 (class Target_selector): Add lock_ and initialize_lock_ fields.
14565 Don't define instantiate_target, just declare it.
14566 * target-select.cc (Target_selector::Target_selector): Initialize
14567 new fields.
14568 (Target_selector::instantiate_target): Define.
14569 * descriptors.h: Include "gold-threads.h".
14570 (class Descriptors): Add initialize_lock_ field.
14571 * descriptors.cc (Descriptors::Descriptors): Initialize new
14572 field.
14573 (Descriptors::open): Use initialize_lock_ field
14574 * errors.h (class Errors): Add initialize_lock_ field.
14575 * errors.cc (Errors::Errors): Initialize new field.
14576 (Errors::initialize_lock): Use initialize_lock_ field.
14577 * powerpc.cc (class Target_selector_powerpc): Remove
14578 instantiated_target_ field. In do_recognize call
14579 instantiate_target rather than do_instantiate_target. In
14580 do_instantiate_target just allocate a new target.
14581 * sparc.cc (class Target_selector_sparc): Likewise.
14582
36959681
ILT
14583 * freebsd.h: New file.
14584 * i386.cc: Include "freebsd.h".
14585 (Target_i386): Derive from Target_freebsd rather than
14586 Sized_target.
14587 (Target_selector_i386): Derive from Target_selector_freebsd rather
14588 than Target_selector.
14589 * x86_64.cc: Include "freebsd.h".
14590 (Target_x86_64): Derive from Target_freebsd rather than
14591 Sized_target.
14592 (Target_selector_x86_64): Derive from Target_selector_freebsd
14593 rather than Target_selector.
14594 * target.h (class Target): Add adjust_elf_header and
14595 do_adjust_elf_header.
14596 * output.cc (Output_file_header:: do_sized_write): Call target
14597 adjust_elf_header routine.
14598 * configure.tgt: Set targ_osabi.
14599 * configure.ac: Define GOLD_DEFAULT_OSABI.
14600 * parameters.cc (Parameters::default_target): Pass
14601 GOLD_DEFAULT_OSABI to select_target.
14602 * target-select.h (class Target_selector): Make instantiate_target
14603 protected rather than private.
14604 * Makefile.am (HFILES): Add freebsd.h.
14605 * configure, Makefile.in, config.in: Rebuild.
14606
cb010894
ILT
14607 * merge.cc (do_add_input_section): Correct pend value. Change
14608 message about last entry not being null terminated from error to
14609 warning.
14610
0e879927
ILT
146112009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14612
14613 * incremental.cc: New file.
14614 * Makefile.am (CCFILES): Add incremental.cc.
14615 * Makefile.in: Rebuild.
14616
41105937
PP
146172009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14618
14619 * layout.cc (Layout::output_section_name): Preserve names
14620 of '.note.' sections.
e1df38aa 14621
60439920
ILT
146222009-03-19 Ian Lance Taylor <iant@google.com>
14623
14624 * descriptors.cc (Descriptors::open): Check that the options are
14625 valid before using them.
14626
0d371ad3
ILT
146272009-03-18 Ian Lance Taylor <iant@google.com>
14628
14629 * script-sections.h: Include <list>.
14630 (class Script_sections): Change Sections_elements from std::vector
14631 to std::list. Typedef public Elements_iterator. Add
14632 orphan_section_placement_, data_segment_align_start_, and
14633 saw_data_segment_align_ fields. Remove data_segment_align_index_
14634 field.
14635 * script-sections.cc (class Orphan_section_placement): New class.
14636 (class Sections_element): Add virtual functions is_relro and
14637 orphan_section_init. Remove virtual function place_orphan_here.
14638 (class Output_section_definition): Add is_relro and
14639 orphan_section_init. Remove place_orphan_here.
14640 (class Orphan_output_section): Likewise.
14641 (Script_sections::Script_sections): Update for field changes.
14642 (Script_sections::data_segment_align): Set saw_data_segment_align_
14643 and data_segment_align_start_, not data_segment_align_index.
14644 (Script_sections::data_segment_relro_end): Check
14645 saw_data_segment_align_. Use data_segment_align_start_ rather
14646 than data_segment_align_index_.
14647 (Script_sections::place_orphan): Rewrite to use
14648 Orphan_section_placement.
14649
9201d894
ILT
146502009-03-17 Ian Lance Taylor <iant@google.com>
14651
9c5b8369
ILT
14652 * archive.cc (Archive::add_symbols): Check for a version attached
14653 to the symbol name in the archive map.
14654 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14655 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14656 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14657 (ver_test_11.a): New target.
14658 * testsuite/Makefile.in: Rebuild.
14659
9201d894
ILT
14660 * configure.ac: Check for chsize and posix_fallocate. Replace
14661 ftruncate.
14662 * ftruncate.c: New file, from gnulib.
14663 * output.cc (posix_fallocate): Define dummy version if not
14664 HAVE_POSIX_FALLOCATE.
14665 (Output_file::map): Call posix_fallocate rather than lseek and
14666 write.
14667 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14668 * configure, Makefile.in, config.in: Rebuild.
14669
ef4ab7a8 146702009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14671
ef4ab7a8
PP
14672 * layout.h (Layout::create_note): Add section_name parameter.
14673 * layout.cc (Layout::create_note): Likewise.
14674 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14675
8c500701
ILT
146762009-03-17 Ian Lance Taylor <iant@google.com>
14677
e85b18e1
ILT
14678 * descriptors.cc: Include "options.h".
14679 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14680 (Descriptors::open): Always use O_CLOEXEC when opening a new
14681 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14682 then set FD_CLOEXEC.
14683
9efe6174
ILT
14684 * sparc.cc (class Target_sparc): Add has_got_section.
14685 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14686 make sure we have a GOT section.
14687
14688 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14689 (Target_sparc::Scan::local): Likewise.
14690 (Target_sparc::Scan::global): Likewise.
14691 (Target_sparc::Relocate::relocate): Likewise.
14692 (Target_sparc::Relocate::relocate_tls): Likewise.
14693
8c500701
ILT
14694 * symtab.cc (Symbol_table::define_default_version): New function,
14695 broken out of add_from_object.
14696 (Symbol_table::add_from_object): Call define_default_version.
14697 (Symbol_table::define_special_symbol): Add resolve_oldsym
14698 parameter. Change all callers. If the version for a symbol comes
14699 from a version script, resolve it with the symbol with the same
14700 name with no version. Also add the symbol without a version if
14701 appropriate.
14702 (do_define_in_output_data): If resolving with oldsym, don't delete
14703 sym.
14704 (do_define_in_output_segment): Likewise.
14705 (do_define_as_constant): Likewise.
14706 * symtab.h (class Symbol_table): Update declarations.
14707
f1ed28fb
ILT
147082009-03-13 Ian Lance Taylor <iant@google.com>
14709
15f8229b
ILT
14710 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14711 (Read_symbols::requeue): New function.
14712 (Read_symbols::do_read_symbols): If make_elf_object fails because
14713 the target type is not configured, and the file was searched for,
14714 issue a warning and retry with the next directory.
14715 (Add_symbols::run): If the file has an incompatible format, and
14716 it was searched for, requeue the Read_symbols task. On error,
14717 release the object.
14718 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14719 dirindex parameter to constructor. Change all callers. Declare
14720 incompatible_warning and requeue.
14721 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14722 input_argument_ and input_group_ fields. Add them to
14723 constructor. Change all callers.
14724 (class Read_script): Add dirindex_ field. Add it to constructor.
14725 Change all callers.
14726 * archive.cc (Archive::setup): Remove input_objects parameter.
14727 Change all callers.
14728 (Archive::get_file_and_offset): Likewise.
14729 (Archive::read_all_symbols): Likewise.
14730 (Archive::read_symbols): Likewise.
14731 (Archive::get_elf_object_for_member): Remove input_objects
14732 parameter. Add punconfigured parameter. Change all callers.
14733 (Archive::add_symbols): Change return type to bool. Check return
14734 value of include_member.
14735 (Archive::include_all_members): Likewise.
14736 (Archive::include_member): Change return type to bool. Return
14737 false if first included object has incompatible target. Set
14738 included_member_ field.
14739 (Add_archive_symbols::run): If add_symbols returns false, requeue
14740 Read_symbols task.
14741 * archive.h (class Archive): Add included_member_ field.
14742 Initialize it in constructor. Add input_file and searched_for
14743 methods. Update declarations.
14744 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14745 input_argument_ fields. Add them to constructor. Change all
14746 callers.
14747 * script.cc: Include "target-select.h".
14748 (class Parser_closure): Add skip_on_incompatible_target_ and
14749 found_incompatible_target_ fields. Add
14750 skip_on_incompatible_target parameter to constructor. Change all
14751 callers. Add methods skip_on_incompatible_target,
14752 clear_skip_on_incompatible_target, found_incompatible_target, and
14753 set_found_incompatible_target.
14754 (read_input_script): Add dirindex parameter. Change all callers.
14755 If parser finds an incompatible target, requeue Read_symbols
14756 task.
14757 (script_set_symbol): Clear skip_on_incompatible_target in
14758 closure.
14759 (script_add_assertion, script_parse_option): Likewise.
14760 (script_start_sections, script_add_phdr): Likewise.
14761 (script_check_output_format): New function.
14762 * script.h (read_input_script): Update declaration.
14763 * script-c.h (script_check_output_format): Declare.
14764 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14765 (ignore_cmd): Remove OUTPUT_FORMAT.
14766 * fileread.cc (Input_file::Input_file): Add explicit this.
14767 (Input_file::will_search_for): New function.
14768 (Input_file::open): Add pindex parameter. Change all callers.
14769 * fileread.h (class Input_file): Add input_file_argument method.
14770 Declare will_search_for. Update declarations.
14771 * object.cc (make_elf_object): Add punconfigured parameter.
14772 Change all callers.
14773 * object.h (class Object): Make input_file public. Add
14774 searched_for method.
14775 (make_elf_object): Update declaration.
14776 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14777 restart search.
14778 * dirsearch.h (class Dirsearch): Update declaration.
14779 * options.h (class General_options): Add --warn-search-mismatch.
14780 * parameters.cc (Parameters::is_compatible_target): New function.
14781 * parameters.h (class Parameters): Declare is_compatible_target.
14782 * workqueue.cc (Workqueue::add_blocker): New function.
14783 * workqueue.h (class Workqueue): Declare add_blocker.
14784
f1ed28fb
ILT
14785 * fileread.cc (Input_file::open): Remove options parameter.
14786 Change all callers.
14787 (Input_file::open_binary): Likewise.
14788 * script.cc (read_input_script): Likewise.
14789 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14790 options parameter from constructor. Change all callers.
14791 (class Read_script): Likewise.
14792 * fileread.h (class Input_file): Update declarations.
14793 * script.h (read_input_script): Update declaration.
14794
34dd024a
NC
147952009-03-10 Nick Clifton <nickc@redhat.com>
14796
14797 * po/es.po: New Spanish translation.
14798
6d71b17c
CC
147992009-03-06 Cary Coutant <ccoutant@google.com>
14800
14801 * options.cc (parse_short_option): Keep dash_z from registering itself.
14802
031cdbed
ILT
148032009-03-03 Ian Lance Taylor <iant@google.com>
14804
14805 PR 9918
14806 * target-reloc.h (relocate_section): Pass output_section to
14807 relocate.
14808 * i386.cc (Target_i386::should_apply_static_reloc): Add
14809 output_section parameter. Change all callers.
14810 (Target_i386::Relocate::relocate): Add output_section parameter.
14811 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14812 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14813 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14814 * testsuite/two_file_shared.sh: New script.
14815 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14816 (check_DATA): Add two_file_shared.dbg.
14817 (two_file_shared.dbg): New target.
14818 * testsuite/Makefile.in: Rebuild.
14819
15d5fa16
ILT
148202009-03-01 Ian Lance Taylor <iant@google.com>
14821
14822 * configure.ac: Check for byteswap.h.
14823 * configure: Rebuild.
14824 * config.in: Rebuild.
14825
8a4c0b0d
ILT
148262009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14827
14828 * layout.cc (Layout::find_or_add_kept_section): New function.
14829 (Layout::add_comdat): Removed.
14830 * layout.h (struct Kept_section): Move out of class Layout.
14831 Remove trailing underscores from field names. Add group_sections
14832 field. Rename group_ field to is_group. Change all uses.
14833 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14834 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14835 comdat_groups_ field.
14836 (Sized_relobj::include_section_group): Use
14837 find_or_add_kept_section and Kept_section::group_sections.
14838 (Sized_relobj::include_linkonce_section): Likewise.
14839 * object.cc (class Sized_relobj): Don't define Comdat_group or
14840 Comdat_group_table. Remove find_comdat_group and
14841 add_comdat_group. Remove comdat_groups_ field.
14842 * plugin.cc (include_comdat_group): Use
14843 Layout::find_or_add_kept_section.
14844
b4ecf66b
ILT
148452009-02-28 Ian Lance Taylor <iant@google.com>
14846
14359ca0
ILT
14847 * README: --gc-sections and map files are now supported. Document
14848 some build requirements.
14849
b4ecf66b
ILT
14850 PR 6992
14851 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14852 relocatable link set the value of the section symbol to zero.
14853 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14854 relocatable link don't include the section address in the local
14855 symbol value.
14856
0602e05a
ILT
148572009-02-27 Ian Lance Taylor <iant@google.com>
14858
fd9d194f
ILT
14859 PR 6811
14860 * options.h (class Search_directory): Add is_system_directory.
14861 (class General_options): Declare is_in_system_directory.
14862 * options.cc (get_relative_sysroot): Make static.
14863 (get_default_sysroot): Make static.
14864 (General_optoins::is_in_system_directory): New function.
14865 * fileread.cc (Input_file::is_in_system_directory): New function.
14866 * fileread.h (class Input_file): Declare is_in_system_directory.
14867 * object.h (class Object): Add is_in_system_directory.
14868 (class Input_objects): Remove system_library_directory_ field.
14869 * object.cc (Input_objects::add_object): Don't set
14870 system_library_directory_.
14871 (input_objects::found_in_system_library_directory): Remove.
14872 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14873 parameter. Change all callers.
14874 (Symbol_table::sized_write_globals): Likewise.
14875 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14876 Call Object::is_in_system_directory.
14877 * symtab.h (class Symbol_table): Update declarations.
14878
61edd21f
ILT
14879 PR 5990
14880 * descriptors.h (Open_descriptor): Add is_on_stack field.
14881 * descriptors.cc (Descriptors::open): If the descriptor is on the
14882 top of the stack, remove it. Initialize is_on_stack field.
14883 (Descriptors::release): Only add pod to stack if it is not on the
14884 stack already.
14885 (Descriptors::close_some_descriptor): Clear stack_next and
14886 is_on_stack fields.
14887
e29e076a
ILT
14888 PR 7091
14889 * output.cc (Output_section::find_starting_output_address): Rename
14890 from starting_output_address; add PADDR parameter; change return
14891 type.
14892 * output.h (class Output_section): Declare
14893 find_starting_output_address instead of starting_output_address.
14894 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14895 section symbol for which we can't find a merge section.
14896
0602e05a
ILT
14897 PR 9836
14898 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14899 hidden or internal, force the symbol to be local.
14900 * resolve.cc (Symbol::override_visibility): Define.
14901 (Symbol::override_base): Use override_visibility.
14902 (Symbol_table::resolve): Likewise.
14903 (Symbol::override_base_with_special): Likewise.
14904 (Symbol_table::override_with_special): If the visibility is hidden
14905 or internal, force the symbol to be local.
14906 * symtab.h (class Symbol): Add set_visibility and
14907 override_visibility.
14908 * testsuite/ver_test_1.sh: New file.
14909 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14910 (check_DATA): Add ver_test_1.syms.
14911 (ver_test_1.syms): New target.
14912 * testsuite/Makefile.in: Rebuild.
14913
401a9a73
CC
149142009-02-25 Cary Coutant <ccoutant@google.com>
14915
14916 * layout.cc (Layout::choose_output_section): Don't rename sections
14917 when using a linker script that has a SECTIONS clause.
14918 * Makefile.in: Regenerate.
14919
14920 * testsuite/Makefile.am (script_test_5.sh): New test case.
14921 * testsuite/Makefile.in: Regenerate.
14922 * testsuite/script_test_5.cc: New file.
14923 * testsuite/script_test_5.sh: New file.
14924 * testsuite/script_test_5.t: New file.
14925
f488e4b0
CC
149262009-02-13 Rafael Avila de Espindola <espindola@google.com>
14927
14928 * archive.cc (Archive::include_member): Update calls to add_symbols.
14929 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14930 the Layout argument.
14931 * dynobj.h (do_add_symbols): Add the Layout argument.
14932 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14933 Layout argument.
14934 * object.h (Object::add_symbols): Add the Layout argument.
14935 (Object::do_add_symbols): Add the Layout argument.
14936 (Sized_relobj::do_add_symbols): Add the Layout argument.
14937 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14938 Unify the two versions.
14939 (Add_plugin_symbols): Remove.
14940 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14941 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14942 (Add_plugin_symbols): Remove.
14943 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14944 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14945 (Add_symbols::run): Make it work with Pulginobj.
14946
89dd1680
ILT
149472009-02-06 Ian Lance Taylor <iant@google.com>
14948
14949 * object.cc (Sized_relobj::do_layout): Make info message start
14950 with lower case letter.
14951
266d0a74
ILT
149522009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14953
602b464e
ILT
14954 * binary.cc: Fix file comment.
14955
266d0a74
ILT
14956 * options.h (enum Incremental_disposition): Define.
14957 (class General_options): Add new options: --incremental,
14958 --incremental_changed, --incremental_unchanged,
14959 --incremental_unknown. Add incremental_disposition_ and
14960 implicit_incremental_ fields.
14961 (General_options::incremental_disposition): New function.
14962 (class Position_dependent_options): Add incremental_disposition
14963 option.
14964 (Position_dependent_options::copy_from_options): Set incremental
14965 dispositions.
14966 * options.cc (General_options::parse_incremental_changed): New
14967 function.
2e702c99
RM
14968 (General_options::parse_incremental_unchanged): New function.
14969 (General_options::parse_incremental_unknown): New function.
14970 (General_options::General_options): Initialize new fields
266d0a74 14971 incremental_disposition_ and implicit_incremental_.
2e702c99 14972 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14973 without --incremental.
14974
f073bbf7
CD
149752009-02-06 Chris Demetriou <cgd@google.com>
14976
14977 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14978 pointer and to report location as the file name associated with
14979 the symbol.
14980 (gold_undefined_symbol_at_location): New function to replace the
14981 old gold_undefined_symbol functionality.
14982 * target-reloc.h (relocate_section): Update to use
14983 gold_undefined_symbol_at_location.
14984 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14985 Call gold_undefined_symbol function rather than gold_error.
14986 * errors.h (Errors::undefined_symbol): Take location as a
14987 string, rather than calculating it from a relocation.
14988 * errors.cc (Errors::fatal): Print "fatal error:" before the
14989 formatted message.
14990 (Errors::error, Errors::error_at_location): Print "error: "
14991 before the formatted message.
14992 (Errors::undefined_symbol): Take location as a string, rather
14993 than calculating it from a relocation.
14994 (gold_undefined_symbol_at_location): New function akin to
14995 old gold_undefined_symbol, calculates location from relocation.
14996 (gold_undefined_symbol): Change to take only a Symbol pointer
14997 and to report location as the file name associated with the symbol.
14998 * testsuite/debug_msg.sh: Update for changed error messages.
14999 * testsuite/undef_symbol.sh: Likewise.
15000
8e94a90c
ILT
150012009-02-04 Duncan Sands <baldrick@free.fr>
15002
15003 PR 9812
15004 * reduced_debug_output.h
15005 (Output_reduced_debug_abbrev_section::failed): Use format for
15006 gold_warning.
15007 (Output_reduced_debug_info_section::faild): Likewise.
15008
88a0e15b
ILT
150092009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15010
15011 * script.cc (Lazy_demangler): New class.
2e702c99 15012 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15013 symbol only once.
15014
5efc7cd2
CC
150152009-01-29 Cary Coutant <ccoutant@google.com>
15016
15017 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15018 to __tls_get_addr.
15019 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15020
e0ebcf42
ILT
150212009-01-28 Ian Lance Taylor <iant@google.com>
15022
5efc7cd2 15023 * version.cc (version_string): Bump to 1.9.
75fe7426 15024
e0ebcf42
ILT
15025 * gold.h: Include <cstring> and <stdint.h>.
15026 * version.cc: Include <cstdio>.
15027 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15028 warning.
15029 * reduced_debug_output.cc (insert_into_vector): Rename from
15030 Insert_into_vector; change all callers. Use Swap_unaligned to
15031 avoid aliasing issue; remove union since it is unnecessary.
15032
8e2813be 150332009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15034
15035 * Makefile.am (CCFILES): Add gc.cc.
15036 (HFILES): Add gc.h.
15037 * Makefile.in: Regenerate.
15038 * gold.cc (Gc_runner): New class.
15039 (queue_initial_tasks): Call garbage collection related tasks
15040 when corresponding options are invoked.
15041 (queue_middle_gc_tasks): New function.
15042 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15043 processed early before laying out sections during garbage collection.
15044 * gold.h (queue_middle_gc_tasks): New function.
15045 (is_prefix_of): Move from "layout.cc".
15046 * i386.cc (Target_i386::gc_process_relocs): New function.
15047 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15048 * main.cc (main): Create object of class "Garbage_collection".
15049 * object.cc (Relobj::copy_symbols_data): New function.
15050 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15051 (Sized_relobj::do_layout): Allow this function to be called twice
15052 during garbage collection and defer layout of section during the
6d03d481
ST
15053 first call.
15054 * object.h (Relobj::get_symbols_data): New function.
15055 (Relobj::is_section_name_included): New function.
15056 (Relobj::copy_symbols_data): New function.
15057 (Relobj::set_symbols_data): New function.
15058 (Relobj::get_relocs_data): New function.
15059 (Relobj::set_relocs_data): New function.
15060 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15061 (Relobj::gc_process_relocs): New function.
15062 (Relobj::do_gc_process_relocs): New pure virtual function.
15063 (Relobj::sd_): New data member.
15064 (Sized_relobj::is_output_section_offset_invalid): New function.
15065 (Sized_relobj::do_gc_process_relocs): New function.
15066 * options.h (General_options::gc_sections): Modify to not be a no-op.
15067 (General_options::print_gc_sections): New option.
15068 * plugin.cc (Plugin_finish::run): Remove function call to
15069 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15070 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15071 * reloc.cc (Read_relocs::run): Add task to process relocs and
15072 determine unreferenced sections when doing garbage collection.
15073 (Gc_process_relocs): New class.
15074 (Sized_relobj::do_gc_process_relocs): New function.
15075 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15076 sections that are garbage collected.
15077 * reloc.h (Gc_process_relocs): New class.
15078 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15079 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15080 symbols whose corresponding sections are garbage collected.
15081 (Symbol_table::Symbol_table): Add new parameter for the garbage
15082 collection object.
15083 (Symbol_table::gc_mark_undef_symbols): New function.
15084 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15085 (Symbol_table::gc_mark_dyn_syms): New function.
15086 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15087 as garbage.
15088 (Symbol_table::add_from_object): Likewise.
15089 (Symbol_table::add_from_relobj): When building shared objects, do not
15090 treat externally visible symbols as garbage.
15091 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15092 table information for static and relocatable links.
15093 * symtab.h (Symbol_table::set_gc): New function.
15094 (Symbol_table::gc): New function.
15095 (Symbol_table::gc_mark_undef_symbols): New function.
15096 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15097 (Symbol_table::gc_mark_dyn_syms): New function.
15098 (Symbol_table::gc_): New data member.
e1df38aa 15099 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15100 function.
15101 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15102 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15103
3b293544
CF
151042009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15105
15106 * options.h (General_options::gc_sections): Define as a no-op for now.
15107 (General_options::no_keep_memory): Ditto.
15108 (General_options::Bshareable): Define.
15109 * options.cc (General_options::finalize): Honor -Bshareable.
15110
83d22aa8
AS
151112009-01-20 Andreas Schwab <schwab@suse.de>
15112
15113 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15114 read the value in the contents, since we don't use it. Use the
15115 template endianness when writing.
15116 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15117
cd536b21
AS
151182009-01-19 Andreas Schwab <schwab@suse.de>
15119
15120 * configure.tgt (powerpc64-*): Fix targ_obj.
15121
99e9a495
ILT
151222009-01-15 Ian Lance Taylor <iant@google.com>
15123
15124 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15125 local symbols when stripping all symbols.
15126
bbbfea06
CC
151272009-01-14 Cary Coutant <ccoutant@google.com>
15128
99e9a495 15129 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15130
0f7c0701
CC
151312009-01-14 Cary Coutant <ccoutant@google.com>
15132
15133 * archive.cc (Archive::get_elf_object_for_member): Remove call
15134 to File_read::claim_for_plugin.
15135 * descriptors.cc (Descriptors::open): Remove reference to
15136 is_claimed.
15137 (Descriptors::claim_for_plugin): Remove.
15138 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15139 (Descriptors::is_claimed): Remove.
15140 (claim_descriptor_for_plugin): Remove.
15141 * fileread.cc (File_read::claim_for_plugin): Remove.
15142 * fileread.h (File_read::claim_for_plugin): Remove.
15143 (File_read::descriptor): Reopen descriptor if necessary.
15144 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15145 (Plugin_manager::all_symbols_read): Add task parameter. Change
15146 all callers.
15147 (Plugin_manager::get_input_file): New function.
15148 (Plugin_manager::release_input_file): New function.
15149 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15150 corresponding data member.
15151 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15152 and pass to base constructor. Change all callers.
15153 (get_input_file, release_input_file): New functions.
15154 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15155 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15156 (Plugin_manager::all_symbols_read): Add task parameter.
15157 (Plugin_manager::get_input_file): New function.
15158 (Plugin_manager::release_input_file): New function.
15159 (Plugin_manager::task_): New data member.
15160 (Pluginobj::Pluginobj): Add filesize parameter.
15161 (Pluginobj::filename): New function.
15162 (Pluginobj::descriptor): New function.
15163 (Pluginobj::filesize): New function.
15164 (Pluginobj::filesize_): New data member.
15165 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15166 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15167 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15168
15169 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15170 with archive libraries.
15171 * testsuite/Makefile.in: Regenerate.
15172 * testsuite/plugin_test.c (struct sym_info): New type.
15173 (get_input_file, release_input_file): New static variables.
15174 (onload): Capture new transfer vector entries.
15175 (claim_file_hook): Stop reading at end of file according to filesize.
15176 Factor out parsing of readelf output into separate function.
15177 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15178 APIs and get the source file name from the symbol table. Convert
15179 source file name to corresponding object file name. Print info
15180 message when adding new input files.
15181 (parse_readelf_line): New function.
15182 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15183 * testsuite/plugin_test_2.sh: Likewise.
15184 * testsuite/plugin_test_3.sh: Likewise.
15185 * testsuite/plugin_test_4.sh: New test case.
15186
62a6d109
ILT
151872009-01-07 Ian Lance Taylor <iant@google.com>
15188
15189 * version.cc (version_string): Bump to 1.8.
15190
483620e8
CC
151912008-12-23 Cary Coutant <ccoutant@google.com>
15192
15193 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15194 * plugin.cc (Plugin_manager::finish): Rename as
15195 layout_deferred_objects. Move cleanup to separate function.
15196 (Plugin_manager::cleanup): New function.
15197 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15198 separately.
15199 * plugin.h (Plugin_manager::finish): Rename as
15200 layout_deferred_objects.
15201 (Plugin_manager::cleanup): New function.
15202 (Plugin_manager::cleanup_done): New field.
15203
d66a9eb3
CC
152042008-12-23 Cary Coutant <ccoutant@google.com>
15205
15206 * plugin.cc (is_visible_from_outside): New function.
15207 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15208 so we don't return "IR only" status for exported symbols or -r links.
15209
15210 * testsuite/Makefile.am (plugin_test_3): New test case.
15211 * testsuite/Makefile.in: Regenerate.
15212 * testsuite/plugin_test_3.sh: New file.
15213
5995b570
CC
152142008-12-22 Cary Coutant <ccoutant@google.com>
15215
15216 * object.cc (Sized_relobj::layout_section): New function.
15217 (Sized_relobj::do_layout): Defer layout of input sections until after
15218 plugin has provided replacement files.
15219 (Sized_relobj::do_layout_deferred_sections): New function.
15220 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15221 (Relobj::layout_deferred_sections): New function.
15222 (Relobj::do_layout_deferred_sections): New function.
15223 (Sized_relobj::do_layout_deferred_sections): New function.
15224 (Sized_relobj::layout_section): New function.
15225 (Sized_relobj::Deferred_layout): New structure.
15226 (Sized_relobj::deferred_layout_): New field.
15227 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15228 Change all callers. Layout deferred sections.
15229 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15230 references.
15231 (Plugin_hook::run): Move code from do_plugin_hook inline.
15232 (Plugin_hook::do_plugin_hook): Remove.
15233 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15234 (Plugin_manager::finish): Renamed, was cleanup.
15235 (Plugin_manager::should_defer_layout): New function.
15236 (Plugin_manager::add_deferred_layout_object): New function.
15237 (Plugin_manager::Deferred_layout_list): New type.
15238 (Plugin_manager::deferred_layout_objects_): New field.
15239 (Plugin_hook::do_plugin_hook): Remove.
15240
ee769c88
ILT
152412008-12-17 Ian Lance Taylor <iant@google.com>
15242
15243 * options.h (class General_options): Add --no case for
15244 --export-dynamic.
15245
abc8dcba
CC
152462008-12-16 Cary Coutant <ccoutant@google.com>
15247
15248 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15249 vector.
15250 (Plugin_manager::claim_file): Create plugin object even if
15251 plugin did not call the add_symbols callback.
15252 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15253 asking for more symbols than were added.
15254 * testsuite/Makefile.am (plugin_test_1): Add test case with
15255 no global symbols.
15256 (empty.syms): New target.
15257 * testsuite/Makefile.in: Regenerate.
15258 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15259 message. Don't call add_symbols if no globals.
15260 (all_symbols_read_hook): Don't provide replacement for empty
15261 claimed file.
15262
b0074644
ILT
152632008-12-12 Ian Lance Taylor <iant@google.com>
15264
68943102
ILT
15265 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15266 r_type == 0 for a local symbol with r_sym == 0.
15267 (scan_relocatable_relocs): Pass r_sym to
15268 local_non_section_strategy.
15269 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15270 r_sym parameter.
15271
b0074644
ILT
15272 * configure.ac: Update test for TLS descriptors: they are
15273 supported as of glibc 2.9.
15274 * configure: Rebuild.
15275
c2508178
ILT
152762008-12-11 Ian Lance Taylor <iant@google.com>
15277
15278 PR 7091
15279 * target-reloc.h (Default_scan_relocatable_relocs): For each
15280 function, map r_type == 0 to RELOC_DISCARD.
15281
2756a258
CC
152822008-12-10 Cary Coutant <ccoutant@google.com>
15283
15284 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15285 object to override a kept COMDAT group from a plugin object.
15286
bb6f53d3
ILT
152872008-12-09 Ian Lance Taylor <iant@google.com>
15288
fbc558e1
ILT
15289 PR 7088
15290 * yyscript.y (file_cmd): Handle INPUT.
15291
bb6f53d3
ILT
15292 * testsuite/initpri1.c: Change all declarations to be full
15293 prototypes by adding void, to avoid compiler warnings.
15294
4674ecfc
CC
152952008-12-05 Rafael Avila de Espindola <espindola@google.com>
15296
15297 * options.cc (General_options::parse_plugin_opt): New.
15298 (General_options::add_plugin): The argument now is just the filename.
15299 (General_options::add_plugin_option): New.
15300 * options.h (plugin_opt): New.
15301 (add_plugin): Change argument name.
15302 (add_plugin_option): New.
15303 * plugin.cc (Plugin::load): Don't parse the plugin option.
15304 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15305 (Plugin::add_option): New.
15306 (Plugin::args_): Change type.
15307 (Plugin::filename_): New.
15308 (Plugin_manager::add_plugin_option): New.
15309 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15310 * testsuite/Makefile.in: Regenerate.
15311
fd06b4aa
CC
153122008-12-05 Cary Coutant <ccoutant@google.com>
15313
15314 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15315 Handle --strip-lto-sections option.
15316 * options.h (strip_lto_sections): New option.
15317
6c52134c
CC
153182008-12-01 Cary Coutant <ccoutant@google.com>
15319
15320 * plugin.cc (ld_plugin_message): Change format parameter to const.
15321 Fix mismatch between new[] and delete.
15322
a45248e0
CC
153232008-11-14 Cary Coutant <ccoutant@google.com>
15324
15325 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15326 instead of -1U.
15327
c82fbeee
CS
153282008-11-05 Craig Silverstein <csilvers@google.com>
15329
15330 * options.cc (General_options::parse_dynamic_list): New function.
15331 * options.h (General_options): New flags dynamic_list,
15332 dynamic_list_data, dynamic_list_cpp_new, and
15333 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15334 (General_options::in_dynamic_list): New function.
15335 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15336 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15337 (Lex::can_continue_name): Likewise.
15338 (yylex): Likewise.
15339 (read_script_file): New parameter script_options.
15340 (read_dynamic_list): New function.
15341 (Script_options::define_dynamic_list): New function.
15342 (dynamic_list_keyword_parsecodes): New variable.
15343 (dynamic_list_keywords): New variable.
15344 * script.h (Script_options::define_dynamic_list): New function
15345 prototype.
15346 (read_dynamic_list): New function prototype.
15347 * symtab.cc (strprefix): New macro.
15348 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15349 dynamic_list_data, dynamic_list_cpp_new, and
15350 dynamic_list_cpp_typeinfo.
15351 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15352 (dynamic_list_expr): New rule.
15353 (dynamic_list_nodes): Likewise.
15354 (dynamic_list_node): Likewise.
15355 * testsuite/Makefile.am (dynamic_list): New test.
15356 * testsuite/Makefile.in: Regenerated.
15357 * testsuite/dynamic_list.t: New file.
15358 * testsuite/dynamic_list.sh: New file.
15359
e0bb29a5
CS
153602008-11-05 Craig Silverstein <csilvers@google.com>
15361
15362 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15363 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15364 (t11_last): Likewise.
15365 * testsuite/ver_test_6.c (main): Likewise.
15366
4e1e25e0
CC
153672008-10-07 Cary Coutant <ccoutant@google.com>
15368
15369 * options.c (General_options::finalize): Add check for -static and
15370 -shared.
15371 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15372 is not empty.
15373
92f03fcb
CC
153742008-10-02 Cary Coutant <ccoutant@google.com>
15375
15376 * plugin.cc (make_sized_plugin_object): Fix conditional
15377 compilation to work when not all targets are enabled.
15378
fbd8a257
CC
153792008-09-29 Cary Coutant <ccoutant@google.com>
15380
15381 * archive.cc (Archive::get_file_and_offset): Use filename instead
15382 of name to get library path.
15383 (Archive::include_member): Unlock external member of a thin archive.
15384
15385 * testsuite/Makefile.am (TEST_AR): New variable.
15386 (thin_archive_test_1): New test.
15387 (thin_archive_test_2): New test.
81636b3f
CC
15388 * testsuite/Makefile.in: Regenerate.
15389 * testsuite/thin_archive_main.cc: New file.
15390 * testsuite/thin_archive_test_1.cc: New file.
15391 * testsuite/thin_archive_test_2.cc: New file.
15392 * testsuite/thin_archive_test_3.cc: New file.
15393 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15394
eff45813
CC
153952008-09-29 Cary Coutant <ccoutant@google.com>
15396
15397 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15398 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15399 instead of -1U.
15400 (Sized_relobj::do_finalize_local_symbols): Likewise.
15401 (Sized_relobj::map_to_kept_section): Likewise.
15402 * object.h (Sized_relobj::invalid_address): New constant.
15403 (Sized_relobj::do_output_section_offset): Check for invalid_address
15404 and return -1ULL.
15405 * output.cc (Output_reloc::local_section_offset): Use constant
15406 invalid_address instead of -1U.
15407 (Output_reloc::get_address): Likewise.
15408 (Output_section::output_address): Change -1U to -1ULL.
15409 * output.h (Output_reloc::invalid_address): New constant.
15410 * reloc.cc (Sized_relobj::write_sections): Use constant
15411 invalid_address instead of -1U.
15412 (Sized_relobj::relocate_sections): Likewise.
15413 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15414 values for merge sections.
15415 * target-reloc.h (relocate_for_relocatable): Use constant
15416 invalid_address instead of -1U.
15417
89fc3421
CC
154182008-09-19 Cary Coutant <ccoutant@google.com>
15419
15420 Add plugin functionality for link-time optimization (LTO).
15421 * configure.ac (plugins): Add --enable-plugins option.
15422 * configure: Regenerate.
15423 * config.in: Regenerate.
15424 * Makefile.am (LIBDL): New variable.
15425 (CCFILES): Add plugin.cc.
15426 (HFILES): Add plugin.h.
15427 (ldadd_var): Add LIBDL.
15428 * Makefile.in: Regenerate.
15429
15430 * archive.cc: Include "plugin.h".
15431 (Archive::setup): Don't preread archive symbols when using a plugin.
15432 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15433 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15434 files.
15435 (Archive::include_member): Add symbols from plugin objects.
15436 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15437 * descriptors.cc (Descriptors::open): Check for file descriptors
15438 abandoned by plugins.
15439 (Descriptors::claim_for_plugin): New function.
15440 * descriptors.h (Descriptors::claim_for_plugin): New function.
15441 (Open_descriptor::is_claimed): New field.
15442 (claim_descriptor_for_plugin): New function.
15443 * fileread.cc (File_read::claim_for_plugin): New function.
15444 * fileread.h (File_read::claim_for_plugin): New function.
15445 (File_read::descriptor): New function.
15446 * gold.cc: Include "plugin.h".
15447 (queue_initial_tasks): Add task to call plugin hooks for generating
15448 new object files.
15449 * main.cc: Include "plugin.h".
15450 (main): Load plugin libraries.
15451 * object.h (Pluginobj): Declare.
15452 (Object::pluginobj): New function.
15453 (Object::do_pluginobj): New function.
15454 (Object::set_target): New function.
15455 * options.cc: Include "plugin.h".
15456 (General_options::parse_plugin): New function.
15457 (General_options::General_options): Initialize plugins_ field.
15458 (General_options::add_plugin): New function.
15459 * options.h (Plugin_manager): Declare.
15460 (General_options): Add --plugin option.
15461 (General_options::has_plugins): New function.
15462 (General_options::plugins): New function.
15463 (General_options::add_plugin): New function.
15464 (General_options::plugins_): New field.
15465 * plugin.cc: New file.
15466 * plugin.h: New file.
15467 * readsyms.cc: Include "plugin.h".
15468 (Read_symbols::do_read_symbols): Check for archive before checking
15469 for ELF file. Call plugin hooks to claim files.
15470 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15471 from a real object file; force override when processing replacement
15472 files.
15473 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15474 (Symbol::init_base_object): Likewise.
15475 (Symbol::init_base_output_data): Likewise.
15476 (Symbol::init_base_output_segment): Likewise.
15477 (Symbol::init_base_constant): Likewise.
15478 (Symbol::init_base_undefined): Likewise.
15479 (Symbol::output_section): Assert that object is not a plugin.
15480 (Symbol_table::add_from_pluginobj): New function.
15481 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15482 undefined.
15483 (Symbol_table::sized_write_globals): Likewise.
15484 (Symbol_table::add_from_pluginobj): Instantiate template.
15485 * symtab.h (Sized_pluginobj): Declare.
15486 (Symbol::in_real_elf): New function.
15487 (Symbol::set_in_real_elf): New function.
15488 (Symbol::in_real_elf_): New field.
15489 (Symbol_table::add_from_pluginobj): New function.
15490
15491 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15492 (LIBDL): New variable.
15493 (LDADD): Add LIBDL.
15494 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15495 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15496 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15497 (MOSTLYCLEANFILES): Likewise.
15498 * testsuite/Makefile.in: Regenerate.
15499 * testsuite/plugin_test.c: New file.
15500 * testsuite/plugin_test_1.sh: New file.
15501 * testsuite/plugin_test_2.sh: New file.
15502
de31bda5
ILT
155032008-09-16 Ian Lance Taylor <iant@google.com>
15504
9c2d0ef9
ILT
15505 * target-reloc.h (relocate_section): Check whether a symbol is
15506 defined by the ABI before reporting an undefined symbol error.
15507 * target.h (Target::is_defined_by_abi): Make parameter const.
15508 (Target::do_is_defined_by_abi): Likewise.
15509 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15510 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15511 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15512 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15513 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15514 * testsuite/Makefile.in: Rebuild.
15515
de31bda5
ILT
15516 * fileread.cc (make_view): Add casts to avoid warning.
15517
9fa33bee
AO
155182008-09-16 Alexandre Oliva <aoliva@redhat.com>
15519
15520 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15521 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15522
183fd0e3
AO
155232008-09-16 Alexandre Oliva <aoliva@redhat.com>
15524
15525 * options.h (General_options::output_is_executable): New.
15526 (General_options::output_is_pie): New.
15527 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15528 for shared libraries.
15529 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15530
7be8330a
CD
155312008-09-11 Chris Demetriou <cgd@google.com>
15532
15533 * options.h (origin): New -z option.
15534 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15535 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15536 in DT_FLAGS_1.
15537
a9caad02
CC
155382008-09-05 Cary Coutant <ccoutant@google.com>
15539
15540 * fileread.cc (File_read::make_view): Add check for attempt to map
15541 beyond end of file.
15542
ae6dce4d
CC
155432008-09-05 Cary Coutant <ccoutant@google.com>
15544
15545 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15546 explicit instantiations.
15547
d7ab2a47
KVH
155482008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15549
15550 PR gold/6858
15551 * options.cc (General_options::finalize): Allow undefined symbols
15552 in shlibs if linking -shared.
15553
15554 PR gold/6859
15555 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15556 symbols as not needing a dynsym entry.
15557
1e52a9c1
CS
155582008-08-20 Craig Silverstein <csilvers@google.com>
15559
15560 * fileread.cc (File_read::open): Do not lock the file unless it
15561 was successfully opened.
15562
d85c80a3
CC
155632008-08-14 Cary Coutant <ccoutant@google.com>
15564
15565 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15566 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15567 * testsuite/tls_test.cc (struct int128): 128-bit struct
15568 for testing TLS relocs with non-zero addend.
15569 (v12): New TLS variable.
15570 (t12): New test.
15571 (t_last): Add check for v12.
15572 * testsuite/tls_test.h (t12): New function.
15573 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15574
2d924fd9
ILT
155752008-08-13 Ian Lance Taylor <iant@google.com>
15576
15577 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15578 set tls_segment_ or relro_segment_.
15579 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15580 when appropriate.
15581 * output.h (Output_section::clear_is_relro): New function.
15582 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15583 sections specially even when output_data_ is empty.
15584 (Output_segment::maximum_alignment): When first section is relro,
15585 only force alignment for PT_LOAD segments.
15586 * script.cc (script_data_segment_align): New function.
15587 (script_data_segment_relro_end): New function.
15588 * script-c.h (script_data_segment_align): Declare.
15589 (script_data_segment_relro_end): Declare.
15590 * script-sections.h (class Script_sections): Declare
15591 data_segment_align and data_segment_relro_end. Add fields
15592 segment_align_index_ and saw_relro_end_.
15593 * script-sections.cc (class Sections_element): Add set_is_relro
15594 virtual function. Add new bool* parameter to place_orphan_here.
15595 Add get_output_section virtual function.
15596 (class Output_section_definition): Add set_is_relro. Add new
15597 bool* parameter to place_orphan_here. Add get_output_section.
15598 Add is_relro_ field.
15599 (Output_section_definition::Output_section_definition): Initialize
15600 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15601 and is_relro_ fields.
15602 (Output_section_definition::place_orphan_here): Add is_relro
15603 parameter.
15604 (Output_section_definition::set_section_addresses): Set relro for
15605 output section.
15606 (Output_section_definition::alternate_constraint): Likewise.
15607 (class Orphan_output_section): Add new bool* parameter to
15608 place_orphan_here. Add get_output_section.
15609 (Orphan_output_section::place_orphan_here): Add is_relro
15610 parameter.
15611 (Script_sections::Script_sections): Initialize
15612 data_segment_align_index_ and saw_relro_end_.
15613 (Script_sections::data_segment_align): New function.
15614 (Script_sections::data_segment_relro_end): New function.
15615 (Script_sections::place_orphan): Set or clear is_relro.
15616 (Script_sections::set_section_addresses): Force alignment of first
15617 TLS section.
15618 * yyscript.y (exp): Call script_data_segment_align and
15619 script_data_segment_relro_end.
15620 * testsuite/relro_script_test.t: New file.
15621 * testsuite/relro_test.cc (using_script): Declare.
15622 (t1, t2): Test using_script.
15623 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15624 (relro_script_test_SOURCES): Define.
15625 (relro_script_test_DEPENDENCIES): Define.
15626 (relro_script_test_LDFLAGS): Define.
15627 (relro_script_test_LDADD): Define.
15628 (relro_script_test.so): New target.
15629 * testsuite/Makefile.in: Rebuild.
15630
f827c9a9
CC
156312008-08-06 Cary Coutant <ccoutant@google.com>
15632
15633 * archive.cc (Archive::total_archives, Archive::total_members)
15634 (Archive::total_members_loaded): New variables.
15635 (Archive::setup): Add parameter. Add option to preread
15636 archive symbols.
15637 (Archive::read_armap): Add counter.
15638 (Archive::get_file_and_offset): New function.
15639 (Archive::get_elf_object_for_member): New function.
15640 (Archive::read_all_symbols): New function.
15641 (Archive::read_symbols): New function.
15642 (Archive::add_symbols): Add counters.
15643 (Archive::include_all_members): Use armap to find members if it's
15644 already built.
15645 (Archive::include_member): Skip reading symbols if already read.
15646 Factored code into Archive::get_file_and_offset and
15647 Archive::get_elf_object_for_member. Changed call to
15648 Mapfile::report_include_archive_member.
15649 (Archive::print_stats): New function.
15650 * archive.h: Declare Object and Read_symbols_data classes.
15651 (Archive::Archive): Add initializers for new members.
15652 (Archive::setup): Add parameter.
15653 (Archive::print_stats): New function.
15654 (Archive::total_archives, Archive::total_members)
15655 (Archive::total_members_loaded): New variables.
15656 (Archive::get_file_and_offset): New function.
15657 (Archive::get_elf_object_for_member): New function.
15658 (Archive::read_all_symbols): New function.
15659 (Archive::read_symbols): New function.
15660 (Archive::Archive_member): New class.
15661 (Archive::members_): New member.
15662 (Archive::num_members_): New member.
15663 * main.cc: Include archive.h.
15664 (main): Call Archive::print_stats.
15665 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15666 archive parameter; member_name is now the fully-decorated name.
15667 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15668 * options.h: (General_options): Add --preread-archive-symbols option.
15669 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15670 Archive::setup.
15671
de4c45bd
ILT
156722008-08-04 Ian Lance Taylor <iant@google.com>
15673
15674 * symtab.h (Symbol::use_plt_offset): New function.
15675 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15676 * powerpc.cc (Relocate::relocate): Likewise.
15677 * sparc.cc (Relocate::relocate): Likewise.
15678 * x86_64.cc (Relocate::relocate): Likewise.
15679 * testsuite/weak_plt.sh: New test.
15680 * testsuite/weak_plt_main.cc: New test.
15681 * testsuite/weak_plt_shared.cc: New test.
15682 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15683 (check_PROGRAMS): Add weak_plt.
15684 (check_DATA): Add weak_plt_shared.so.
15685 (weak_plt_main_pic.o, weak_plt): New targets.
15686 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15687 * testsuite/Makefile.in: Rebuild.
15688
15689 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15690 gcctestdir/ld.
15691 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15692 * testsuite/Makefile.in: Rebuild.
15693
323ee3f4
AM
156942008-08-04 Alan Modra <amodra@bigpond.net.au>
15695
15696 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15697 * Makefile.in: Regenerate.
15698 * po/POTFILES.in: Regenerate.
15699
7c07ecec
ILT
157002008-07-29 Ian Lance Taylor <iant@google.com>
15701
15702 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15703 symbols before other symbols.
15704 * testsuite/script_test_2.cc (test_addr): Declare.
15705 (test_addr_alias): Declare.
15706 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15707 values.
7c07ecec
ILT
15708 * testsuite/script_test_2.t: Define test_addr_alias and
15709 test_addr.
15710
5778530e
ILT
157112008-07-24 Ian Lance Taylor <iant@google.com>
15712
2a00e4fb
ILT
15713 PR 5990
15714 * descriptors.cc: New file.
15715 * descriptors.h: New file.
15716 * gold-threads.h (class Hold_optional_lock): New class.
15717 * fileread.cc: Include "descriptors.h".
15718 (File_read::~File_read): Release descriptor rather than closing
15719 it.
15720 (File_read::open) [file]: Call open_descriptor rather than open.
15721 Set is_descriptor_opened_.
15722 (File_read::open) [memory]: Assert that descriptor is not open.
15723 (File_read::reopen_descriptor): New function.
15724 (File_read::release): Release descriptor.
15725 (File_read::do_read): Make non-const. Reopen descriptor.
15726 (File_read::read): Make non-const.
15727 (File_read::make_view): Reopen descriptor.
15728 (File_read::do_readv): Likewise.
15729 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15730 Update declarations.
15731 * layout.cc: Include "descriptors.h".
15732 (Layout::create_build_id): Use open_descriptor rather than open.
15733 * output.cc: Include "descriptors.h".
15734 (Output_file::open): Use open_descriptor rather than open.
15735 * archive.cc (Archive::const_iterator): Change Archive to be
15736 non-const.
15737 (Archive::begin, Archive::end): Make non-const.
15738 (Archive::count_members): Likewise.
15739 * archive.h (class Archive): Update declarations.
15740 * object.h (Object::read): Make non-const.
15741 * Makefile.am (CCFILES): Add descriptors.cc.
15742 (HFILES): Add descriptors.h.
15743 * Makefile.in: Rebuild.
15744
801647d1
ILT
15745 PR 6716
15746 * gold.h: Always include <clocale>. Add Solaris workarounds
15747 following code in binutils/sysdep.h.
15748
5edd166e
ILT
15749 PR 6048
15750 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15751 this->eh_frame_hdr_ is NULL before using it.
15752
c89ad728
ILT
15753 * dynobj.cc (Versions::Versions): Update comment.
15754
aa86f06b
ILT
15755 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15756 the base version name.
15757
5778530e
ILT
15758 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15759 array size plus one.
15760 (Stringpool_template::set_string_offsets): Subtract one from key
15761 before using it as an array index.
15762 (Stringpool_template::get_offset_with_length): Likewise.
15763 (Stringpool_template::write_to_buffer): Likewise.
15764 * stringpool.h (Stringpool_template::get_offset_from_key):
15765 Likewise.
15766
057ead22
ILT
157672008-07-23 Ian Lance Taylor <iant@google.com>
15768
7f649c59
ILT
15769 PR 6658
15770 * object.h (Merged_symbol_value::value): Do our best to handle a
15771 negative addend.
15772
057ead22
ILT
15773 PR 6647
15774 * script.cc (Version_script_info::get_versions): Don't add empty
15775 version tag to return value.
15776 (Version_script_info::get_symbol_version_helper): Change return
15777 type to bool. Add pversion parameter. Change all callers.
15778 (script_register_vers_node): Don't require a non-NULL tag.
15779 * script.h (class Version_script_info): Update declarations.
15780 (Version_script_info::get_symbol_version): Change return type to
15781 bool. Add version parameter. Change all callers.
15782 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15783 handling. Handle an empty version from a version script.
15784 (Symbol_table::define_special_symbol): Likewise.
15785 * testsuite/ver_test_10.script: New file.
15786 * testsuite/ver_test_10.sh: New file.
15787 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15788 (check_DATA): Add ver_test_10.syms.
15789 (ver_test_10.syms, ver_test_10.so): New target.
15790 * testsuite/Makefile.in: Rebuild.
15791
58e54ac2
CD
157922008-07-23 Simon Baldwin <simonb@google.com>
15793
15794 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15795 to zero for undefined symbols from dynamic libraries.
15796
95d14cd3
ILT
157972008-07-23 Ian Lance Taylor <iant@google.com>
15798
15799 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15800 Change all callers.
15801 * symtab.h (class Symbol_table): Update declaration.
15802 * testsuite/ver_test_9.cc: New file.
15803 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15804 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15805 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15806 (ver_test_9.so, ver_test_9.o): New targets.
15807 * testsuite/Makefile.in: Rebuild.
15808
92de84a6
ILT
158092008-07-22 Ian Lance Taylor <iant@google.com>
15810
34810851
ILT
15811 * options.h (class General_options): Define --check-sections.
15812 * layout.cc (Layout::set_segment_offsets): Handle
15813 --check-sections.
15814
af6156ef
ILT
15815 * options.h (class General_options): Define -n/--nmagic and
15816 -N/--omagic.
15817 * options.cc (General_options::finalize): For -n/--nmagic or
15818 -N/--omagic, set -static.
15819 * layout.cc (Layout::attach_allocated_section_to_segment): If
15820 -N/--omagic, don't put read-only and read-write sections in
15821 different segments.
15822 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15823 finding a read-only segment.
15824 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15825 don't set the minimum segment alignment to the common page size,
15826 and don't set the file offset to the address modulo the page size.
15827 * script-sections.cc (Script_sections::create_segments): If
15828 -n/--omagic, don't put read-only and read-write sections in
15829 different segments.
15830
92de84a6
ILT
15831 * cref.cc: New file.
15832 * cref.h: New file.
15833 * options.h (class General_options): Add --print-symbol-counts.
15834 * main.cc (main): Issue defined symbol report if requested.
15835 * archive.cc (Archive::interpret_header): Make into a const member
15836 function.
15837 (Archive::add_symbols): Call Input_objects::archive_start and
15838 archive_stop.
15839 (Archive::const_iterator): Define new class.
15840 (Archive::begin, Archive::end): New functions.
15841 (Archive::include_all_members): Rewrite to use iterator.
15842 (Archive::count_members): New function.
15843 * archive.h (class Archive): Update declarations.
15844 (Archive::filename): New function.
15845 * object.cc: Include "cref.h".
15846 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15847 (Sized_relobj::do_get_global_symbol_counts): New function.
15848 (Input_objects::add_object): Add object to cross-referencer.
15849 (Input_objects::archive_start): New function.
15850 (Input_objects::archive_stop): New function.
15851 (Input_objects::print_symbol_counts): New function.
15852 * object.h: Declare Cref and Archive.
15853 (Object::get_global_symbol_counts): New function.
15854 (Object::do_get_global_symbol_counts): New pure virtual function.
15855 (class Sized_relobj): Add defined_count_ field. Update
15856 declarations.
15857 (class Input_objects): Add cref_ field. Update constructor.
15858 Update declarations.
15859 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15860 defined_count_.
15861 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15862 symbol counts.
15863 (Sized_dynobj::do_get_global_symbol_counts): New function.
15864 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15865 defined_count_. Update declarations. Define Symbols typedef.
15866 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15867 parameter. Change all callers.
15868 (Symbol_table::add_from_dynobj): Add sympointers and defined
15869 parameters. Change all callers.
15870 * symtab.h (class Symbol_table): Update declarations.
15871 * Makefile.am (CCFILES): Add cref.cc.
15872 (HFILES): Add cref.h.
15873 * Makefile.in: Rebuild.
15874
3f7c5e1d
CD
158752008-07-22 Simon Baldwin <simonb@google.com>
15876
15877 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15878 to zero when writing undefined symbols.
15879
e0b64032
ILT
158802008-07-22 Ian Lance Taylor <iant@google.com>
15881
15882 * output.cc (Output_section::add_input_section): Don't try to
15883 merge empty merge sections.
15884
096b02cf
CS
158852008-07-21 Craig Silverstein <csilvers@google.com>
15886
15887 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15888 Include symbol version in error message.
cd536b21 15889
1d1f116d
CD
158902008-07-20 Chris Demetriou <cgd@google.com>
15891
cd536b21 15892 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15893 (RANDOM_SEED_CFLAGS): New substituted variable.
15894 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15895 * configure: Rebuild.
15896 * Makefile.in: Likewise.
15897 * testsuite/Makefile.in: Likewise.
15898
a18f591e
ILT
158992008-07-18 Ian Lance Taylor <iant@google.com>
15900
15901 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15902 where we see NAME/NULL and NAME/VERSION as separate symbols.
15903 * testsuite/ver_test_main.cc (main): Call t4.
15904 (t4, t4_2a): Define.
15905 * testsuite/ver_test_2.cc (t4_2): Define.
15906 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15907 * testsuite/ver_test_4.cc (t4_2a): Define.
15908 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15909 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15910
c6e3f6ed
ILT
159112008-07-17 Ian Lance Taylor <iant@google.com>
15912
15913 * dynobj.cc (Versions::add_def): If we give an error about a
15914 missing version, go ahead and create the version anyhow.
15915
ef9beddf
ILT
159162008-07-10 Ian Lance Taylor <iant@google.com>
15917
15918 Handle output sections with more than 0x7fffffff bytes.
15919 * object.h (class Relobj): Change map_to_output_ to
15920 output_sections_, and just keep a section pointer. Change all
15921 uses. Move comdat group support to Sized_relobj.
15922 (Relobj::is_section_specially_mapped): Remove.
15923 (Relobj::output_section): Remove poff parameter. Change all
15924 callers.
15925 (Relobj::output_section_offset): New function.
15926 (Relobj::set_section_offset): Rewrite.
15927 (Relobj::map_to_output): Remove.
15928 (Relobj::output_sections): New function.
15929 (Relobj::do_output_section_offset): New pure virtual function.
15930 (Relobj::do_set_section_offset): Likewise.
15931 (class Sized_relobj): Add section_offsets_ field. Add comdat
15932 group support from Relobj. Update declarations.
15933 (Sized_relobj::get_output_section_offset): New function.
15934 (Sized_relobj::do_output_section_offset): New function.
15935 (Sized_relobj::do_set_section_offset): New function.
15936 * object.cc (Relobj::output_section_address): Remove.
15937 (Sized_relobj::Sized_relobj): Initialize new fields.
15938 (Sized_relobj::include_section_group): Cast find_kept_object to
15939 Sized_relobj.
15940 (Sized_relobj::include_linkonce_section): Likewise.
15941 (Sized_relobj::do_layout): Use separate arrays for output section
15942 and output offset.
15943 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15944 output_sections.
15945 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15946 output_sections and section_offsets.
15947 (Sized_relobj::write_local_symbols): Likewise.
15948 (map_to_kept_section): Compute output address directly.
15949 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15950 output_sections and section_offsets.
15951 (Sized_relobj::write_sections): Likewise.
15952 (Sized_relobj::relocate_sections): Likewise.
15953 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15954 * output.h (class Output_reloc): Update declarations. Change
15955 u2_.relobj to Sized_relobj*.
15956 (class Output_data_reloc): Change add functions to use
15957 Sized_relobj*.
15958 * output.cc (Output_reloc::Output_reloc): Change relobj to
15959 Sized_relobj*.
15960 (Output_reloc::local_section_offset): Change return type to
15961 Elf_Addr. Use get_output_section_offset.
15962 (Output_reloc::get_address): Likewise.
15963 (Output_section::is_input_address_mapped): Don't call
15964 is_section_specially_mapped.
15965 (Output_section::output_offset): Likewise.
15966 (Output_section::output_address): Likewise.
15967 (Output_section::starting_output_address): Likewise.
15968 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15969 parameter to Sized_relobj*.
15970 (Copy_relocs::need_copy_reloc): Likewise.
15971 (Copy_relocs::save): Likewise.
15972 * copy-relocs.h (class Copy_relocs): Update declarations.
15973 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15974 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15975 * target-reloc.h (relocate_for_relocatable): Change
15976 offset_in_output_section type to Elf_Addr. Change code that uses
15977 it as well.
15978 * layout.cc (Layout::layout): Always set *off.
15979 * mapfile.cc (Mapfile::print_input_section): Use
15980 output_section_offset.
15981 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15982 Sized_relobj*.
15983 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15984 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15985 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15986
5cb66f97
ILT
159872008-07-03 Ian Lance Taylor <iant@google.com>
15988
15989 * layout.cc (Layout::include_section): Do not discard unrecognized
15990 SHT_STRTAB sections.
15991
afe47622
CS
159922008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15993
15994 * script.cc (Lex::can_continue_name): Make '?' allowable in
15995 version-script names.
15996 * testsuite/version_script.map: Change glob pattern to use '?'
15997
5adf9721
ILT
159982008-06-30 Manish Singh <yosh@gimp.org>
15999
16000 PR 6585
16001 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16002 Correct typo.
16003
e6fde208
ILT
160042008-06-30 Ian Lance Taylor <iant@google.com>
16005
16006 PR 6660
16007 PR 6682
16008 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16009 versions]: Don't try to read the value in the contents, since we
16010 don't use it. Use the template endianness when writing.
16011
3f2e6a2d
CC
160122008-06-25 Cary Coutant <ccoutant@google.com>
16013
16014 * fileread.cc (File_read::make_view): Assert on zero-length view.
16015 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16016 symbol table when there are no symbols to read.
16017
c43d3a48
CS
160182008-06-23 Craig Silverstein <csilvers@google.com>
16019
16020 * version.cc (version_string): Bump to 1.7
16021
5f494ea0
CS
160222008-06-18 Craig Silverstein <csilvers@google.com>
16023
16024 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16025 constant 0xFFFF to type Valtype.
16026 (Powerpc_relocate_functions::rel16_ha): Likewise.
16027
c42e122e
ILT
160282008-06-17 Ian Lance Taylor <iant@google.com>
16029
f34787f8
ILT
16030 * output.h (Output_section::Input_section): Initialize p2align_ to
16031 zero for Output_section_data constructors.
16032 (Output_section::Input_section::addralign): If not an input
16033 section, return the alignment of the Output_section_data.
16034 * testsuite/copy_test.cc: New file.
16035 * testsuite/copy_test_1.cc: New file.
16036 * testsuite/copy_test_2.cc: New file.
16037 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16038 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16039 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16040 (copy_test_1_pic.o, copy_test_1.so): New targets.
16041 (copy_test_2_pic.o, copy_test_2.so): New targets.
16042 * testsuite/Makefile.in: Rebuild.
16043
c42e122e
ILT
16044 * script-sections.cc (Script_sections::place_orphan): Initialize
16045 local variable exact.
16046
ce3ac18a
DE
160472008-06-13 David Edelsohn <edelsohn@gnu.org>
16048
16049 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16050
42cacb20
DE
160512008-06-12 David Edelsohn <edelsohn@gnu.org>
16052 David S. Miller <davem@davemloft.net>
16053
16054 * powerpc.cc: New file.
16055 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16056 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16057 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16058 * Makefile.in: Rebuild.
16059
7b308235
ILT
160602008-06-09 Ian Lance Taylor <iant@google.com>
16061
16062 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16063 <exception>.
16064 (throwing, orig_terminate): New static variables.
16065 (terminate_handler): New static function.
16066 (t2): Set terminate handler.
16067
f0b886e3
ILT
160682008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16069
16070 PR 6584
cd536b21 16071 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16072 alignment.
16073
3e90f135
CC
160742008-05-30 Cary Coutant <ccoutant@google.com>
16075
16076 * archive.cc (Archive::include_all_members) Correct to step
16077 over symbol table and extended name table in thin archives.
16078
e09ad04a
ILT
160792008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16080
16081 PR 6407
16082 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16083 calculation.
16084
62b01cb5
ILT
160852008-05-28 Caleb Howe <cshowe@google.com>
16086
16087 * reduced_debug_output.cc: New file.
16088 * reduced_debug_output.h: New file.
92de84a6 16089 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16090 * options.cc (General_options::finalize): Add strip_debug_non_line
16091 to the strip heirarchy.
16092 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16093 fields.
16094 * layout.cc: Include "reduced_debug_output.h".
16095 (Layout::Layout): Initialize new fields.
16096 (line_only_debug_sections): New static array.
16097 (is_lines_only_debug_sections): New static inline function.
16098 (Layout::include_section): Handle --strip-debug-non-line.
16099 (Layout::make_output_section): If --strip-debug-non-line, build
16100 new output sections for .debug_abbrev and .debug_info.
16101 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16102 gold. Warn about possible overflow.
16103 (read_signed_LEB_128): Likewise.
16104 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16105 (read_signed_LEB_128): Declare.
16106 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16107 (HFILES): Add reduced_debug_output.h.
16108 * Makefile.in: Rebuild.
16109
7d9e3d98
ILT
161102008-05-21 Ian Lance Taylor <iant@google.com>
16111
16112 * mapfile.cc: New file.
16113 * mapfile.h: New file.
16114 * options.h (class General_options): Add -M/--print-map and -Map.
16115 * options.cc (General_options::finalize): Make -M equivalent to
16116 -Map -.
16117 * main.cc: Include <cstdio> and "mapfile.h".
16118 (main): Open mapfile if requested.
16119 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16120 constructor. Change caller.
16121 (queue_initial_tasks): Add mapfile parameter. Change caller.
16122 (queue_middle_tasks): Likewise.
16123 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16124 declarations.
16125 * archive.cc: Include "mapfile.h".
16126 (Archive::add_symbols): Add mapfile parameter. Change all
16127 callers. Pass mapfile, symbol, and reason to include_member.
16128 (Archive::include_all_members): Add mapfile parameter. Change all
16129 callers.
16130 (Archive::include_member): Add mapfile, sym, and why parameters.
16131 Change all callers. Report inclusion to map file.
16132 * archive.h: Include "fileread.h".
16133 (class Archive): Update declarations.
16134 (Archive::file): New const method.
16135 (class Add_archive_symbols): Add mapfile_ field. Update
16136 constructor. Change all callers.
16137 * readsyms.h (class Read_symbols): Likewise.
16138 (class Finish_group): Likewise.
16139 (class Read_script): Likewise.
16140 * common.cc: Include "mapfile.h".
16141 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16142 all callers.
16143 (Symbol_table::do_allocate_commons): Likewise.
16144 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16145 symbol allocation to mapfile.
16146 * common.h (class Allocate_commons_task): Add mapfile_ field.
16147 Update constructor. Change all callers.
16148 * symtab.h (class Symbol_table): Update declarations.
16149 * layout.cc: Include "mapfile.h".
16150 (Layout_task_runner::run): Print information to mapfile.
16151 (Layout::create_gold_note): Change Output_data_fixed_space to
16152 Output_data_zero_fill.
16153 (Layout::create_build_id): Likewise.
16154 (Layout::print_to_mapfile): New function.
16155 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16156 constructor. Change caller.
16157 (class Layout): Declare print_to_mapfile.
16158 * output.cc (Output_section::Input_section::print_to_mapfile): New
16159 function.
16160 (Output_section::add_input_section): If producing a map, always
16161 add to input_sections_ list.
16162 (Output_section::do_print_to_mapfile): New function.
16163 (Output_segment::print_sections_to_mapfile): New function.
16164 (Output_segment::print_section_list_to_mapfile): New function.
16165 * output.h: Include "mapfile.h".
16166 (Output_data::print_to_mapfile): New function.
16167 (Output_data::do_print_to_mapfile): New virtual function.
16168 (Output_segment_headers::do_print_to_mapfile): New function.
16169 (Output_file_header::do_print_to_mapfile): New function.
16170 (Output_data_const::do_print_to_mapfile): New function.
16171 (class Output_data_const_buffer): Add map_name_ field. Update
16172 constructor. Change all callers. Add do_print_to_mapfile
16173 function.
16174 (class Output_data_fixed_space): Likewise.
16175 (class Output_data_space): Likewise.
16176 (class Output_data_zero_fill): New class.
16177 (Output_data_strtab::do_print_to_mapfile): New function.
16178 (Output_data_reloc_base::do_print_to_mapfile): New function.
16179 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16180 (Output_data_group::do_print_to_mapfile): New function.
16181 (Output_data_got::do_print_to_mapfile): New function.
16182 (Output_data_dynamic::do_print_to_mapfile): New function.
16183 (Output_symtab_xindex::do_print_to_mapfile): New function.
16184 (class Output_section): Declare do_print_to_mapflie. Declare
16185 print_to_mapfile in Input_section.
16186 (class Output_segment): Declare new functions.
16187 * object.h (Sized_relobj::symbol_count): New function.
16188 * script-sections.cc
16189 (Output_section_element_dot_assignment::set_section_addresses):
16190 Change Output_data_fixed_space to Output_data_zero_fill.
16191 (Output_data_expression::do_print_to_mapfile): New function.
16192 * script.cc (read_input_script): Add mapfile parameter. Change
16193 all callers.
16194 * script.h (read_input_script): Update declaration.
16195 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16196 (Eh_frame::do_print_to_mapfile): New function.
16197 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16198 (Output_merge_string::do_print_to_mapfile): New function.
16199 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16200 function.
16201 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16202 function.
16203 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16204 function.
16205 * Makefile.am (CCFILES): Add mapfile.cc.
16206 (HFILES): Add mapfile.h.
16207 * Makefile.in: Rebuild.
16208
9f1d377b
ILT
162092008-05-19 Ian Lance Taylor <iant@google.com>
16210
16211 * options.h (class General_options): Add -z relro.
16212 * layout.cc (Layout::Layout): Initialize relro_segment_.
16213 (Layout::add_output_section_data): Return the output section.
16214 (Layout::make_output_section): Rcognize relro sections and mark
16215 them appropriately.
16216 (Layout::attach_allocated_section_to_segment): Put relro sections
16217 in a PT_GNU_RELRO segment.
16218 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16219 section as relro.
16220 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16221 PT_TLS segments.
16222 (Layout::linkonce_mapping): Map d.rel.ro.local to
16223 .data.rel.ro.local.
16224 (Layout::output_section_name): Us .data.rel.ro.local for any
16225 section which begins with that.
16226 * layout.h (class Layout): Update add_output_section_data
16227 declaration. Add relro_segment_ field.
16228 * output.cc (Output_section::Output_section): Initialize is_relro_
16229 and is_relro_local_ fields.
16230 (Output_segment::add_output_section): Group relro sections.
16231 (Output_segment::is_first_section_relro): New function.
16232 (Output_segment::maximum_alignment): If there is a relro section,
16233 align the segment to the common page size.
16234 (Output_segment::set_section_addresses): Track whether we are
16235 looking at relro sections. If the last section is a relro
16236 section, align to the common page size.
16237 (Output_segment::set_section_list_addresses): Add in_relro
16238 parameter. Change all callers. Align to the page size when
16239 moving from relro to non-relro section.
16240 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16241 segment.
16242 * output.h (class Output_section): Add is_relro_ and
16243 is_relro_local_ fields.
16244 (Output_section::is_relro): New function.
16245 (Output_section::set_is_relro): New function.
16246 (Output_section::is_relro_local): New function.
16247 (Output_section::set_is_relro_local): New function.
16248 (class Output_segment): Update declarations.
16249 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16250 * sparc.cc (Target_sparc::got_section): Likewise.
16251 * x86_64.cc (Target_x86_64::got_section): Likewise.
16252 * testsuite/relro_test_main.cc: New file.
16253 * testsuite/relro_test.cc: New file.
16254 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16255 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16256 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16257 (relro_test.so, relro_test_pic.o): New targets.
16258 * testsuite/Makefile.in: Rebuild.
16259
a984ee1d
ILT
162602008-05-16 Ian Lance Taylor <iant@google.com>
16261
01676dcd
ILT
16262 * output.cc (Output_segment::add_output_section): Remove front
16263 parameter.
16264 * output.h (class Output_segment): Remove
16265 add_initial_output_section and overloaded add_output_section.
16266 Update declaration of remaining add_output_section.
16267 * layout.cc (Layout::create_interp): Call add_output_section
16268 rather than add_initial_output_section.
16269 (Layout::finish_dynamic_section): Likewise.
16270
497897f9
ILT
16271 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16272 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16273 know the dynamic type.
16274 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16275 field. Initialize it in constructor.
16276 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16277 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16278 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16279 reloc.
16280
a984ee1d
ILT
16281 * output.cc (Output_reloc::get_address): Change return type to
16282 Elf_Addr.
16283 * output.h (class Output_reloc): Update get_address declaration.
16284 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16285 for section addresses.
16286
55ba0940
ILT
162872008-05-09 Ian Lance Taylor <iant@google.com>
16288
16289 PR 6493
16290 * gold.cc (gold_nomem): Use return value of write.
16291
75517b77
ILT
162922008-05-08 Ian Lance Taylor <iant@google.com>
16293
16294 * symtab.c (Symbol::init_base_output_data): Add version
16295 parameter. Change all callers.
16296 (Symbol::init_base_output_segment): Likewise.
16297 (Symbol::init_base_constant): Likewise.
16298 (Symbol::init_base_undefined): Likewise.
16299 (Sized_symbol::init_output_data): Likewise.
16300 (Sized_symbol::init_output_segment): Likewise.
16301 (Sized_symbol::init_constant): Likewise.
16302 (Sized_symbol::init_undefined): Likewise.
16303 (Symbol_table::do_define_in_output_data): If the new symbol has a
16304 version, mark it as the default.
16305 (Symbol_table::do_define_in_output_segment): Likewise.
16306 (Symbol_table::do_define_as_constant): Likewise.
16307 * symtab.h (class Symbol): Update declarations.
16308 (class Sized_symbol): Likewise.
16309 * resolve.cc (Symbol::override_version): New function.
c42e122e 16310 (Symbol::override_base): Call override_version.
75517b77
ILT
16311 (Symbol::override_base_with_special): Likewise.
16312 * testsuite/ver_script_8.script: New file.
16313 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16314 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16315 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16316 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16317
f1f70eae
ILT
163182008-05-06 Ian Lance Taylor <iant@google.com>
16319
f3e9c5c5
ILT
16320 PR 6049
16321 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16322 functions.
16323 (class General_options): Remove existing --undefined, and add
16324 --no-undefined instead. Add new --undefined as synonym for -u.
16325 * archive.cc (Archive::add_symbols): Check whether symbol was
16326 named with -u.
16327 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16328 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16329 all uses. Add IS_UNDEFINED. Update declarations to split
16330 different versions of init_base. Declare init_base_undefined.
16331 (Symbol::is_defined): Handle IS_UNDEFINED.
16332 (Symbol::is_undefined): Likewise.
16333 (Symbol::is_weak_undefined): Call is_undefined.
16334 (Symbol::is_absolute): Handle IS_CONSTANT.
16335 (class Sized_symbol): Update declarations to split different
16336 versions of init. Declare init_undefined.
16337 (class Symbol_table): Declare new functions.
16338 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16339 Change all callers.
16340 (Symbol::init_base_output_data): Likewise.
16341 (Symbol::init_base_output_segment): Likewise.
16342 (Symbol::init_base_constant): Likewise.
16343 (Symbol::init_base_undefined): New function.
16344 (Sized_symbol::init_object): Rename from init. Change all
16345 callers.
16346 (Sized_symbol::init_output_data): Likewise.
16347 (Sized_symbol::init_output_segment): Likewise.
16348 (Sized_symbol::init_constant): Likewise.
16349 (Sized_symbol::init_undefined): New function.
16350 (Symbol_table::add_undefined_symbols_from_command_line): New
16351 function.
16352 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16353 function.
16354 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16355 (Symbol::output_section): Likewise.
16356 (Symbol::set_output_section): Likewise.
16357 (Symbol_table::sized_finalize_symbol): Likewise.
16358 (Symbol_table::sized_write_globals): Likewise.
16359 * resolve.cc (Symbol_table::should_override): Likewise.
16360 (Symbol::override_base_with_special): Likewise.
16361
8bdcdf2c
ILT
16362 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16363 symbol, change it to have default visibility.
16364 * testsuite/protected_1.cc: New file.
16365 * testsuite/protected_2.cc: New file.
16366 * testsuite/protected_3.cc: New file.
16367 * testsuite/protected_main_1.cc: New file.
16368 * testsuite/protected_main_2.cc: New file.
16369 * testsuite/protected_main_3.cc: New file.
16370 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16371 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16372 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16373 (protected_1.so): New target.
16374 (protected_1_pic.o, protected_2_pic.o): New targets.
16375 (protected_3_pic.o): New target.
16376 (check_PROGRAMS): Add protected_2.
16377 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16378 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16379 * testsuite/Makefile.in: Rebuild.
16380
2b706932
ILT
16381 * options.h (DEFINE_var): Add set_user_set_##varname__.
16382 (DEFINE_bool_alias): New macro.
16383 (class General_options): Define -Bstatic using DEFINE_bool_alias
16384 rather than DEFINE_special. Add --undefined as an alias for -z
16385 defs.
16386 * options.cc (General_options::parse_Bstatic): Remove.
16387
d82a5bcc
ILT
16388 * options.h (class General_options): Add --fatal-warnings.
16389 * main.cc (main): Implement --fatal-warnings.
16390 * errors.h (Errors::warning_count): New function.
16391
f1f70eae
ILT
16392 * options.h (class General_options): Add -Bsymbolic-functions.
16393 * symtab.h (Symbol::is_preemptible): Check for
16394 -Bsymbolic-functions.
16395
8825ac63
ILT
163962008-05-05 Ian Lance Taylor <iant@google.com>
16397
d98bc257
ILT
16398 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16399 as noVARNAME rather than no-VARNAME.
16400 (class General_options): Add option -z combreloc.
16401 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16402 get_address.
16403 (Output_reloc::sort_before) [SHT_REL]: New function.
16404 (Output_reloc::sort_before) [SHT_RELA]: New function.
16405 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16406 Sort_relocs_comparison.
16407 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16408 parameter. Change all callers.
16409 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16410 sort_relocs parameter. Change all callers.
16411 * output.cc (Output_reloc::get_address): New function, broken out
16412 of write_rel.
16413 (Output_reloc::write_rel): Call it.
16414 (Output_reloc::compare): New function.
16415 (Output_data_reloc_base::do_write): Optionally sort relocs.
16416
60b2b4e7
ILT
16417 * configure.ac: If targ_extra_obj is set, link it in.
16418 * configure.tgt: Initialize all variables.
16419 (x86_64*): Set targ_extra_obj and targ_extra_size.
16420 * configure: Rebuild.
16421
8825ac63
ILT
16422 * object.cc (Sized_relobj::include_section_group): Adjust section
16423 indexes read from group data. Build vector to pass to
16424 layout_group.
16425 * layout.cc (Layout::layout_group): Add flags and shndxes
16426 parameters. Remove contents parameter. Change caller. Update
16427 explicit instantiations.
16428 * layout.h (class Layout): Update layout_group declaration.
16429 * output.cc (Output_data_group::Output_data_group): Add flags and
16430 input_shndxes parameters. Remove contents parameter. Change
16431 caller.
16432 (Output_data_group::do_write): Change input_sections_ to
16433 input_shndxes_.
16434 * output.h (class Output_data_group): Update constructor
16435 declaration. Rename input_sections_ to input_shndxes_.
16436 * testsuite/many_sections_test.cc: Add template.
16437
e94cf127
CC
164382008-04-30 Cary Coutant <ccoutant@google.com>
16439
4418b2d5
CC
16440 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16441
e94cf127
CC
16442 * layout.cc (Layout::include_section): Refactored check for debug
16443 info section.
16444 (Layout::add_comdat): Add new parameters. Change type
16445 of signature parameter. Add object and shndx to signatures table.
16446 (Layout::find_kept_object): New function.
16447 * layout.h: Include <cstring>.
16448 (Layout::is_debug_info_section): New function.
16449 (Layout::add_comdat): Add new parameters.
16450 (Layout::find_kept_object): New function.
16451 (Layout::Kept_section): New struct.
16452 (Layout::Signatures): Change type of map range.
16453 * object.cc (Relobj::output_section_address): New function.
16454 (Sized_relobj::include_section_group): Add new parameters. Change
16455 calls to Layout::add_comdat. Change to build table of kept comdat
16456 groups and table mapping discarded sections to kept sections.
16457 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16458 (Sized_relobj::do_layout): Change calls to include_section_group and
16459 include_linkonce_section.
16460 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16461 value to zero when section is discarded.
16462 (Sized_relobj::map_to_kept_section): New function.
16463 * object.h (Relobj::output_section_address): New function.
16464 (Relobj::Comdat_group): New type.
16465 (Relobj::find_comdat_group): New function.
16466 (Relobj::Comdat_group_table): New type.
16467 (Relobj::Kept_comdat_section): New type.
16468 (Relobj::Kept_comdat_section_table): New type.
16469 (Relobj::add_comdat_group): New function.
16470 (Relobj::set_kept_comdat_section): New function.
16471 (Relobj::get_kept_comdat_section): New function.
16472 (Relobj::comdat_groups_): New field.
16473 (Relobj::kept_comdat_sections_): New field.
16474 (Symbol_value::input_value): Update comment.
16475 (Sized_relobj::map_to_kept_section) New function.
16476 (Sized_relobj::include_linkonce_section): Add new parameter.
16477 * target-reloc.h (Comdat_behavior): New type.
16478 (get_comdat_behavior): New function.
16479 (relocate_section): Add code to map a discarded section to the
16480 corresponding kept section when applying a relocation.
16481
e4e5049b
CS
164822008-04-30 Craig Silverstein <csilvers@google.com>
16483
16484 * dwarf_reader.cc (next_generation_count): New static var.
16485 (Addr2line_cache_entry): New struct.
16486 (addr2line_cache): New static var.
16487 (Dwarf_line_info::one_addr2line): Added caching.
16488 (Dwarf_line_info::clear_addr2line_cache): New function.
16489 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16490 cache-size parameter.
16491 (Dwarf_line_info::one_addr2line_cache): New function.
16492 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16493 new cache-size argument to one_addr2line(), and clear cache.
16494
d09e9154
CC
164952008-04-28 Cary Coutant <ccoutant@google.com>
16496
16497 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16498 R_386_PC8 relocations.
16499
7ef73768
ILT
165002008-04-23 Ian Lance Taylor <iant@google.com>
16501
55438702
ILT
16502 * object.cc (Sized_relobj::include_section_group): Check for
16503 invalid section group.
16504
c165fb93
ILT
16505 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16506 header size.
16507
7ef73768
ILT
16508 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16509 than read for file header.
16510 * archive.cc (Archive::include_member): Likewise.
16511
6194aaab
L
165122008-04-23 Paolo Bonzini <bonzini@gnu.org>
16513
16514 * aclocal.m4: Regenerate.
16515 * configure: Regenerate.
16516
d491d34e
ILT
165172008-04-19 Ian Lance Taylor <iant@google.com>
16518
5ea2bac6
ILT
16519 * version.cc (version_string): Bump to 1.6.
16520
7bc3e21a
ILT
16521 * testsuite/Makefile.am (many_sections_r_test): New target.
16522 (many_sections_r_test_SOURCES): Remove.
16523 (many_sections_r_test_DEPENDENCIES): Remove.
16524 (many_sections_r_test_LDFLAGS): Remove.
16525 (many_sections_r_test_LDADD): Remove.
16526
7fcd3aa9
ILT
16527 * object.cc (Sized_relobj::do_add_symbols): Always pass
16528 local_symbol_count_ to add_from_relobj.
16529
4c94d6ae
ILT
16530 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16531 every thousand variables.
16532 * testsuite/Makefile.in: Rebuild.
16533
d491d34e
ILT
16534 * object.cc (Xindex::initialize_symtab_xindex): New function.
16535 (Xindex::read_symtab_xindex): New function.
16536 (Xindex::sym_xindex_to_shndx): New function.
16537 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16538 available.
16539 (Sized_relobj::do_initialize_xindex): New function.
16540 (Sized_relobj::do_read_symbols): Adjust section links.
16541 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16542 parameter. Change all callers.
16543 (Sized_relobj::include_section_group): Adjust section links and
16544 symbol section indexes.
16545 (Sized_relobj::do_layout): Adjust section links.
16546 (Sized_relobj::do_count_local_symbols): Adjust section links and
16547 symbol section indexes.
16548 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16549 ordinary and special symbols.
16550 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16551 dynsym_xindex parameters. Change all callers. Adjust section
16552 links. Use SHN_XINDEX when needed.
16553 (Sized_relobj::get_symbol_location_info): Adjust section links.
16554 Don't get fooled by special symbols.
16555 * object.h (class Xindex): Define.
16556 (class Object): Add xindex_ parameter. Declare virtual functoin
16557 do_initialize_xindex.
16558 (Object::adjust_sym_shndx): New function.
16559 (Object::set_xindex): New protected function.
16560 (class Symbol_value): Add is_ordinary_shndx_ field.
16561 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16562 (Symbol_value::value): Assert ordinary section.
16563 (Symbol_value::initialize_input_to_output_map): Likewise.
16564 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16565 Change all callers.
16566 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16567 all callers.
16568 (class Sized_relobj): Update declarations.
16569 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16570 parameter. Change all callers.
16571 (Sized_relobj::adjust_shndx): New function.
16572 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16573 field.
16574 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16575 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16576 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16577 (Sized_dynobj::read_dynsym_section): Adjust section links.
16578 (Sized_dynobj::read_dynamic): Likewise.
16579 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16580 section links.
16581 (Sized_dynobj::do_initialize_xindex): New function.
16582 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16583 do_initialize_xindex.
16584 (Sized_dynobj::adjust_shndx): New function.
16585 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16586 dynsym_xindex_ fields.
16587 (Layout::finalize): Add a call to set_section_indexes before
16588 creating the symtab sections.
16589 (Layout::set_section_indexes): Don't do anything if the section
16590 already has a section index.
16591 (Layout::create_symtab_sections): Add shnum parameter. Change
16592 caller. Create .symtab_shndx section if needed.
16593 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16594 caller.
16595 (Layout::allocated_output_section_count): New function.
16596 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16597 needed.
16598 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16599 fields. Update declarations.
16600 (Layout::symtab_xindex): New function.
16601 (Layout::dynsym_xindex): New function.
16602 (class Write_symbols_task): Add layout_ field.
16603 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16604 Change caller.
16605 * output.cc (Output_section_headers::Output_section_headers): Add
16606 shstrtab_section parameter. Change all callers.
16607 (Output_section_headers::do_sized_write): Store overflow values
16608 for section count and section string table section index in
16609 section header zero.
16610 (Output_file_header::do_sized_write): Check for overflow of
16611 section count and section string table section index.
16612 (Output_symtab_xindex::do_write): New function.
16613 (Output_symtab_xindex::endian_do_write): New function.
16614 * output.h (class Output_section_headers): Add shstrtab_section_.
16615 Update declarations.
16616 (class Output_symtab_xindex): Define.
16617 (Output_section::has_out_shndx): New function.
16618 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16619 field.
16620 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16621 Change all callers.
16622 (Sized_symbol::init): Likewise.
16623 (Symbol::output_section): Check for ordinary symbol.
16624 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16625 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16626 callers.
16627 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16628 Change all callers. Simplify handling of symbols from sections
16629 not included in the link.
16630 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16631 distinction.
16632 (Weak_alias_sorter::operator()): Assert that symbols are
16633 ordinary.
16634 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16635 distinction.
16636 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16637 parameters. Change all callers.
16638 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16639 symbol distinction. Use SHN_XINDEX when needed.
16640 (Symbol_table::write_section_symbol): Add symtab_xindex
16641 parameter. Change all callers.
16642 (Symbol_table::sized_write_section_symbol): Likewise. Use
16643 SHN_XINDEX when needed.
16644 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16645 declarations.
16646 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16647 (Symbol::is_defined): Check is_ordinary.
16648 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16649 (Symbol::is_absolute, Symbol::is_common): Likewise.
16650 (class Sized_symbol): Update declarations.
16651 (class Symbol_table): Update declarations.
16652 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16653 parameters. Change all callers.
16654 (Sized_symbol::override): Likewise.
16655 (Symbol_table::override): Likewise.
16656 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16657 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16658 is_ordinary, and orig_st_shndx parameters. Change all callers.
16659 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16660 to be in an ordinary section.
16661 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16662 object and is_ordinary parameters. Change all callers.
16663 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16664 Change all callers. Don't add undefined or non-ordinary symbols
16665 to reloc_map_.
16666 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16667 Change all callers.
16668 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16669 declarations.
16670 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16671 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16672 (Sized_relobj::relocate_sections): Likewise.
16673 * target-reloc.h (scan_relocs): Adjust section symbol index.
16674 (scan_relocatable_relocs): Likewise.
16675 * i386.cc (Scan::local): Check for ordinary symbols.
16676 * sparc.cc (Scan::local): Likewise.
16677 * x86_64.cc (Scan::local): Likewise.
16678 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16679 to symbol_section_and_value.
16680 * testsuite/many_sections_test.cc: New file.
16681 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16682 (check_PROGRAMS): Add many_sections_test.
16683 (many_sections_test_SOURCES): Define.
16684 (many_sections_test_DEPENDENCIES): Define.
16685 (many_sections_test_LDFLAGS): Define.
16686 (BUILT_SOURCES): Add many_sections_define.h.
16687 (many_sections_define.h): New target.
16688 (BUILT_SOURCES): Add many_sections_check.h.
16689 (many_sections_check.h): New target.
16690 (check_PROGRAMS): Add many_sections_r_test.
16691 (many_sections_r_test_SOURCES): Define.
16692 (many_sections_r_test_DEPENDENCIES): Define.
16693 (many_sections_r_test_LDFLAGS): Define.
16694 (many_sections_r_test_LDADD): Define.
16695 (many_sections_r_test.o): New target.
16696 * testsuite/Makefile.in: Rebuild.
16697
c5818ff1
CC
166982008-04-17 Cary Coutant <ccoutant@google.com>
16699
16700 * errors.cc (Errors::info): New function.
16701 (gold_info): New function.
16702 * errors.h (Errors::info): New function.
16703 * gold.h (gold_info): New function.
16704 * object.cc (Input_objects::add_object): Print trace output.
16705 * options.cc (options::parse_set): New function.
16706 (General_options::parse_wrap): Deleted.
16707 (General_options::General_options): Deleted initializer.
16708 * options.h (options::String_set): New typedef.
16709 (options::parse_set): New function.
16710 (DEFINE_set): New macro.
16711 (General_options::wrap): Changed to use DEFINE_set. Changed
16712 callers of any_wrap_symbols and is_wrap_symbol.
16713 (General_options::trace, General_options::trace_symbol):
16714 New options.
16715 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16716 (General_options::wrap_symbols_): Deleted.
16717 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16718
b5be4a7c
DM
167192008-04-17 David S. Miller <davem@davemloft.net>
16720
16721 * options.cc (General_options::parse_V): New function.
16722 * options.h: Add entries for -V and -Qy.
16723
155a0dd7
ILT
167242008-04-17 Ian Lance Taylor <iant@google.com>
16725
16726 * common.cc (Symbol_table::allocate_commons): Remove options
16727 parameter. Change caller.
16728 (Symbol_table::do_allocate_commons): Remove options parameter.
16729 Change caller. Just call do_allocate_commons_list twice.
16730 (Symbol_table::do_allocate_commons_list): New function, broken out
16731 of do_allocate_commons.
16732 * common.h (class Allocate_commons_task): Remove options_ field.
16733 Update constructor.
16734 * symtab.cc (Symbol_table::Symbol_table): Initialize
16735 tls_commons_.
16736 (Symbol_table::add_from_object): Put TLS common symbols on
16737 tls_commons_ list.
16738 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16739 which are IN_OUTPUT_DATA.
16740 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16741 allocate_commons and do_allocate_commons declarations. Declare
16742 do_allocate_commons_list.
16743 * gold.cc (queue_middle_tasks): Update creation of
16744 Allocate_commons_task to not pass options.
16745 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16746 (TLS_TEST_C_FLAGS): New variable.
16747 (tls_test_c_pic.o): New target.
16748 (tls_test_shared.so): Link in tls_test_c_pic.o.
16749 (tls_test_c_pic_ie.o): New target.
16750 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16751 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16752 (tls_test_c.o): New target.
16753 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16754 (tls_pic_test_LDADD): Likewise.
16755 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16756 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16757 (tls_test_c_gnu2.o): New target.
16758 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16759 tls_test_c_gnu2.o.
16760 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16761 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16762 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16763 * testsuite/tls_test.cc: Include "config.h".
16764 (t_last): Call t11_last.
16765 * testsuite/tls_test.h (t11, t11_last): Declare.
16766 * testsuite/tls_test_c.c: New file.
16767 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16768 * configure.ac: Check for OpenMP support.
16769 * configure, config.in, Makefile.in: Rebuild.
16770 * testsuite/Makefile.in: Rebuild.
16771
edfbb029
CC
167722008-04-16 Cary Coutant <ccoutant@google.com>
16773
16774 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16775 (Target_i386::tls_base_symbol_defined_): New field.
16776 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16777 (Target_i386::Scan::global): Likewise.
16778 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16779 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16780 (Target_x86_64::tls_base_symbol_defined_): New field.
16781 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16782 (Target_x86_64::Scan::global): Likewise.
16783
f3c69fca
CC
167842008-04-16 Cary Coutant <ccoutant@google.com>
16785
16786 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16787 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16788 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16789 building shared libraries.
16790 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16791 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16792 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16793 * testsuite/Makefile.in: Rebuild.
16794 * testsuite/weak_undef.h: New file.
16795 * testsuite/weak_undef_file1.cc: Add extra test cases.
16796 * testsuite/weak_undef_file2.cc: Likewise.
16797 * testsuite/weak_undef_test.cc: Likewise.
16798
7c414435
DM
167992008-04-16 David S. Miller <davem@davemloft.net>
16800
32b769e1
DM
16801 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16802 Add issued_non_pic_error_ field. Declare check_non_pic.
16803 (Target_sparc::Scan::check_non_pic): New function.
16804 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16805 (Target_sparc::Scan::global): Likewise.
16806
11936fb1
DM
16807 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16808 * configure: Rebuild.
16809
7c414435
DM
16810 * options.h (DEFINE_enable): New macro.
16811 (new_dtags): New enable option.
16812 (initfirst, interpose, loadfltr, nodefaultlib,
16813 nodelete, nodlopen, nodump): New -z options.
16814 * layout.cc (Layout:finish_dynamic_section): If new
16815 dtags enabled, emit DT_RUNPATH. Also, emit a
16816 DT_FLAGS_1 containing any specified -z flags.
16817
85c7bf8b
ILT
168182008-04-16 Ian Lance Taylor <iant@google.com>
16819
12c0daef
ILT
16820 * copy-relocs.cc: New file.
16821 * copy-relocs.h: New file.
16822 * reloc.cc: Remove Copy_relocs code.
16823 * reloc.h: Likewise.
16824 * reloc-types.h (struct Reloc_types) [both versions]: Add
16825 get_reloc_addend_noerror.
16826 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16827 variants of add_global which take an addend which must be zero.
16828 * i386.cc: Include "copy-relocs.h".
16829 (class Target_i386): Change type of copy_relocs_ to variable,
16830 update initializer.
16831 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16832 Change all callers.
16833 (Target_i386::do_finalize_sections): Change handling of
16834 copy_relocs_.
16835 * sparc.cc: Include "copy-relocs.h".
16836 (class Target_sparc): Change type of copy_relocs_ to variable,
16837 update initializer.
16838 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16839 Change all callers.
16840 (Target_sparc::do_finalize_sections): Change handling of
16841 copy_relocs_.
16842 * x86_64.cc: Include "copy-relocs.h".
16843 (class Target_x86_64): Change type of copy_relocs_ to variable,
16844 update initializer.
16845 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16846 class. Change all callers.
16847 (Target_x86_64::do_finalize_sections): Change handling of
16848 copy_relocs_.
16849 * Makefile.am (CCFILES): Add copy-relocs.cc.
16850 (HFILES): Add copy-relocs.h.
16851
4f4995b6
ILT
16852 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16853
85c7bf8b
ILT
16854 * testsuite/script_test_4.sh: Permit leading zeroes.
16855
4f2a9edd
ILT
168562008-04-15 Ian Lance Taylor <iant@google.com>
16857
e6188289
ILT
16858 * script-sections.cc (Script_sections::create_segments): Use
16859 header_size_adjustment even when there is enough room for the
16860 headers.
16861 * testsuite/script_test_4.sh: New file.
16862 * testsuite/script_test_4.t: New file.
16863 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16864 (check_DATA): Add script_test_4.stdout.
16865 (MOSTLYCLEANFILES): Likewise.
16866 (script_test_4): New target.
16867 (script_test_4.stdout): New target.
16868 * testsuite/Makefile.in: Rebuild.
16869
4f2a9edd
ILT
16870 * sparc.cc: Add definitions for Output_data_plt_sparc class
16871 constants.
16872
f5314dd5
DM
168732008-04-14 David S. Miller <davem@davemloft.net>
16874
16875 * sparc.cc: New file.
16876 * Makefile.am (TARGETSOURCES): Add sparc.cc
16877 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16878 * configure.tgt: Document targ_extra_size and
16879 targ_extra_big_endian. Add entries for sparc-* and
16880 sparc64-*.
16881 * configure.ac: Handle targ_extra_size and
16882 targ_extra_big_endian.
16883 * Makefile.in: Rebuild.
16884 * configure: Likewise.
16885 * po/POTFILES.in: Likewise.
16886 * po/gold.pot: Likewise.
16887
154e0e9a
ILT
168882008-04-14 Ian Lance Taylor <iant@google.com>
16889
16890 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16891 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16892 in the name/type/flags to section mapping. Don't call
16893 allocate_output_section.
16894 (Layout::choose_output_section): Change parameter from adjust_name
16895 to is_input_section. Don't permit input sections after sections
16896 are attached to segments. Don't call allocate_output_section.
16897 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16898 not write_enable_output_section.
16899 (Layout::make_output_section): Don't push to
16900 unattached_section_list_ nor call attach_to_segment. Call
16901 attach_section_to_segment if sections are attached.
16902 (Layout::attach_sections_to_segments): New function.
16903 (Layout::attach_section_to_segment): New function.
16904 (Layout::attach_allocated_section_to_segment): Rename from
16905 attach_to_segment. Remove flags parameter.
16906 (Layout::allocate_output_section): Remove function.
16907 (Layout::write_enable_output_section): Remove function.
16908 * layout.h (class Layout): Update for above changes. Add new
16909 field sections_are_attached_.
16910 * output.h (Output_section::update_flags_for_input_section): New
16911 function.
16912 * output.cc (Output_section::add_input_section): Call
16913 update_flags_for_input_section.
16914 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16915
009a67a2
CC
169162008-04-11 Cary Coutant <ccoutant@google.com>
16917
16918 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16919 thought unnecessary.
16920 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16921
759b1a24
ILT
169222008-04-11 Ian Lance Taylor <iant@google.com>
16923
16924 * output.h (class Output_section_data): Remove inline definition
16925 of set_addralign.
16926 * output.cc (Output_section_data::set_addralign): New function.
16927
c2b45e22
CC
169282008-04-11 Cary Coutant <ccoutant@google.com>
16929
16930 Add support for TLS descriptors for i386 and x86_64.
16931 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16932 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16933 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16934 GOT_TYPE_TLS_DESC.
16935 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16936 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16937 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16938 relocations.
16939 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16940 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16941 Fix problem with initial-exec relocations.
16942 (Target_i386::Relocate::relocate_tls): Likewise.
16943 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16944 relaxation.
16945 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16946 support for section-plus-offset dynamic table entries.
16947 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16948 (Output_data_dynamic::Dynamic_entry): Add support for
16949 section-plus-offset dynamic table entries.
16950 (Output_data_dynamic::Classification): Likewise.
16951 (Output_data_dynamic::classification_): Renamed offset_.
16952 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16953 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16954 (Target_x86_64::make_plt_section): New function.
16955 (Target_x86_64::reserve_tlsdesc_entries): New function.
16956 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16957 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16958 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16959 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16960 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16961 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16962 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16963 add extra PLT entry for TLS descriptors.
16964 (Output_data_plt_x86_64::got_): New field.
16965 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16966 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16967 fields.
16968 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16969 descriptors.
16970 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16971 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16972 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16973 R_386_TLS_DESC_CALL relocations.
16974 (Target_x86_64::Scan::global): Likewise.
16975 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16976 for TLS descriptors.
16977 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16978 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16979 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16980 GD-to-IE relaxation.
16981 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16982 and TLS_DESCRIPTORS.
16983 * Makefile.in: Rebuild.
16984 * configure: Rebuild.
16985 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16986 (tls_test_shared2.so): New target.
16987 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16988 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16989 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16990 (tls_shared_gd_to_ie_test_LDADD): New variable.
16991 (tls_shared_gnu2_gd_to_ie_test): New target.
16992 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16993 New targets.
16994 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16995 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16996 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16997 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16998 (tls_shared_gnu2_test): New target.
16999 (tls_test_gnu2_shared.so): New target.
17000 (tls_shared_gnu2_test_SOURCES): New variable.
17001 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17002 (tls_shared_gnu2_test_LDFLAGS): New variable.
17003 (tls_shared_gnu2_test_LDADD): New variable.
17004 * testsuite/Makefile.in: Rebuild.
17005 * testsuite/Makefile.
17006
83bfb6b7
ILT
170072008-04-11 Ian Lance Taylor <iant@google.com>
17008
17009 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17010 justsyms.t.
17011 * testsuite/Makefile.in: Rebuild.
17012
17013 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17014 long.
17015 * testsuite/script_test_2.cc (main): Adjust test.
17016
706e1f5e
ILT
170172008-04-11 David S. Miller <davem@davemloft.net>
17018 Ian Lance Taylor <iant@google.com>
17019
17020 * options.h (General_options): Add entries for '-Y' and
17021 '-relax'.
17022 * options.cc (General_options:finalize): If -Y was used, add those
17023 entries to the library path instead of the default "/lib" and
17024 "/usr/lib".
17025
7c98e6bb
DM
170262008-04-11 David S. Miller <davem@davemloft.net>
17027
17028 * testsuite/justsyms.t: Start at 0x100.
17029 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17030 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17031 long.
17032 * testsuite/script_test_2.cc: Adjust string and section length
17033 checks.
7c98e6bb 17034
99a37bfd
ILT
170352008-04-09 Ian Lance Taylor <iant@google.com>
17036
2cefc357
ILT
17037 PR gold/5996
17038 * script-sections.cc (Sections_element::allocate_to_segment): Add
17039 orphan parameter.
17040 (Output_section_definition::allocate_to_segment): Likewise.
17041 (Orphan_output_section::allocate_to_segment): Likewise.
17042 (Script_sections::attach_sections_using_phdrs_clause): Don't
17043 propagate non-PT_LOAD segments to orphan sections.
17044 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17045 readelf rather than objdump.
17046 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17047 .interp section and PT_INTERP segment are the same size.
17048 * testsuite/Makefile.in: Rebuild.
17049
99a37bfd
ILT
17050 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17051 aliases for symbols defined in the same object.
17052 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17053 (weak_alias_test_SOURCES): New variable.
17054 (weak_alias_test_DEPENDENCIES): New variable.
17055 (weak_alias_test_LDFLAGS): New variable.
17056 (weak_alias_test_LDADD): New variable.
17057 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17058 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17059 (weak_alias_test_3.o): New target.
17060 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17061 * testsuite/weak_alias_test_main.cc: New file.
17062 * testsuite/weak_alias_test_1.cc: New file.
17063 * testsuite/weak_alias_test_2.cc: New file.
17064 * testsuite/weak_alias_test_3.cc: New file.
17065
780e49c5
ILT
170662008-04-08 Ian Lance Taylor <iant@google.com>
17067
cdb0b8f5
ILT
17068 * options.h (class General_options): Add --noinhibit-exec option.
17069 * main.cc (main): Check --noinhibit-exec.
17070
0864d551
ILT
17071 * options.h (class General_options): Define --wrap as a special
17072 option. Add wrap_symbols_ field.
17073 (General_options::any_wrap_symbols): New function.
17074 (General_options::is_wrap_symbol): New function.
17075 * options.cc (General_options::parse_wrap): New function.
17076 (General_options::General_options): Initialize wrap_symbols_.
17077 * symtab.cc (Symbol_table::wrap_symbol): New function.
17078 (Symbol_table::add_from_object): Handle --wrap.
17079 * symtab.h (class Symbol_table): Declare wrap_symbol.
17080 * target.h (Target::wrap_char): New function.
17081 (Target::Target_info): Add wrap_char field.
17082 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17083 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17084 * testsuite/testfile.cc (Target_test::test_target_info):
17085 Likewise.
17086
789aa6de
ILT
17087 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17088 there is one.
17089
2c38906f
ILT
17090 * layout.h (class Layout): Add added_eh_frame_data_ field.
17091 * layout.cc (Layout::Layout): Initialize new field.
17092 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17093 output section until we find a section we merged successfully.
17094 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17095 that the size be non-zero.
17096
780e49c5
ILT
17097 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17098 qualifier.
17099
7fcd0256
ILT
171002008-04-08 Craig Silverstein <csilvers@google.com>
17101
17102 * configure.ac: Export new conditional variable HAVE_ZLIB.
17103 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17104 on HAVE_ZLIB.
17105 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17106 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17107
6835af53
ILT
171082008-04-07 Ian Lance Taylor <iant@google.com>
17109
e24f324c
ILT
17110 * version.cc (version_string): Set to "1.5".
17111
a036edd8
ILT
17112 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17113 Add issued_non_pic_error_ field. Declare check_non_pic.
17114 (Target_x86_64::Scan::check_non_pic): New function.
17115 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17116 (Target_x86_64::Scan::global): Likewise.
17117
624f8810
ILT
17118 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17119 addend parameter. Change caller. Handle merge sections.
17120 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17121 Address to Addend. Don't add in the result of
17122 local_section_offset, pass down the addend and use the returned
17123 value.
17124 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17125 Update declarations of local_section_offset and symbol_value.
17126 * testsuite/two_file_test_1.cc (t18): New function.
17127 * testsuite/two_file_test_2.cc (f18): New function.
17128 * testsuite/two_file_test_main.cc (main): Call t18.
17129 * testsuite/two_file_test.h (t18, f18): Declare.
17130
6835af53
ILT
17131 * configure.ac: Don't test for objdump, c++filt, or readelf.
17132 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17133 conditionals.
17134 (TEST_READELF): New variable.
17135 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17136 (check_PROGRAMS): Add two_file_strip_test.
17137 (two_file_strip_test): New target.
17138 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17139 (two_file_same_shared_strip_test_SOURCES): New variable.
17140 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17141 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17142 (two_file_same_shared_strip_test_LDADD): New variable.
17143 (two_file_shared_strip.so): New target.
17144 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17145 (ver_test_5.syms, ver_test_7.syms): Likewise.
17146 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17147 (strip_test_3.stdout): Use TEST_OBJDUMP.
17148 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17149
86925eef
CC
171502008-04-04 Cary Coutant <ccoutant@google.com>
17151
17152 * symtab.h (Symbol::is_weak_undefined): New function.
17153 (Symbol::is_strong_undefined): New function.
17154 (Symbol::is_absolute): New function.
17155 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17156 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17157 absolute symbols.
17158 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17159 (weak_undef_test): New target.
17160 * testsuite/Makefile.in: Rebuild.
17161 * testsuite/weak_undef_file1.cc: New file.
17162 * testsuite/weak_undef_file2.cc: New file.
17163 * testsuite/weak_undef_test.cc: New file.
17164
126f3ece
ILT
171652008-04-03 Craig Silverstein <csilvers@google.com>
17166
17167 * compressed_output.h (class Output_compressed_section): Use
17168 unsigned buffer.
17169 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17170 add zlib header.
17171 (zlib_compressed_suffix): Removed.
17172 (Output_compressed_section::set_final_data_size): Use unsigned
17173 buffers.
17174 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17175 Fix linker invocation.
17176 (flagstest_o_specialfile_and_compress_debug_sections):
17177 Likewise.
17178 * testsuite/Makefile.in: Regenerated.
17179
deae2a14
DM
171802008-04-02 David S. Miller <davem@davemloft.net>
17181
17182 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17183 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17184
70752818
ILT
171852008-04-02 Craig Silverstein <csilvers@google.com>
17186
17187 * TODO: New file.
17188
39d0cb0e
ILT
171892008-04-02 Ian Lance Taylor <iant@google.com>
17190
17191 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17192 parameters. Update for new key type to views_. Change all
17193 callers.
17194 (File_read::read): Adjust for byteshift in returned view.
17195 (File_read::add_view): New function, broken out of
17196 find_and_make_view.
17197 (File_read::make_view): New function, broken out of
17198 find_and_make_view.
17199 (File_read::find_or_make_view): Add offset and aligned
17200 parameters. Rewrite accordingly. Change all callers.
17201 (File_read::get_view): Add offset and aligned parameters. Adjust
17202 for byteshift in return value.
17203 (File_read::get_lasting_view): Likewise.
17204 * fileread.h (class File_read): Update declarations.
17205 (class File_read::View): Add byteshift_ field. Add byteshift to
17206 constructor. Add byteshift method.
17207 * archive.h (Archive::clear_uncached_views): New function.
17208 (Archive::get_view): Add aligned parameter. Change all callers.
17209 * object.h (Object::get_view): Add aligned parameter. Change all
17210 callers.
17211 (Object::get_lasting_view): Likewise.
17212
17213 * fileread.cc (File_read::release): Don't call clear_views if
17214 there are multiple objects.
17215 * fileread.h (File_read::clear_uncached_views): New function.
17216 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17217 on the archive.
17218
a1207466
CC
172192008-03-31 Cary Coutant <ccoutant@google.com>
17220
17221 Add thin archive support.
17222 * archive.cc (Archive::armagt): New const.
17223 (Archive::setup): Remove task parameter and calls to unlock.
17224 (Archive::unlock_nested_archives): New function.
17225 (Archive::read_header): Add nested_off parameter. Change
17226 all callers.
17227 (Archive::interpret_header): Likewise.
17228 (Archive::include_all_members): Change to handle thin
17229 archives.
17230 (Archive::include_member): Likewise.
17231 * archive.h (Archive::Archive): Add new parameters and
17232 initializers.
17233 (Archive::armagt): New const.
17234 (Archive::setup): Remove task parameter.
17235 (Archive::unlock_nested_archives): New function.
17236 (Archive::read_header): Add nested_off parameter.
17237 (Archive::interpret_header): Likewise.
17238 (Archive::Nested_archive_table): New typedef.
17239 (Archive::is_thin_archive_): New field.
17240 (Archive::nested_archives_): New field.
17241 (Archive::options_): New field.
17242 (Archive::dirpath_): New field.
17243 (Archive::task_): New field.
17244 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17245 for thin archives. Pass additional parameters to
17246 Archive::Archive. Unlock the archive file after calling
17247 Archive::setup.
cd536b21 17248
479f6503
ILT
172492008-03-29 Ian Lance Taylor <iant@google.com>
17250
686c8caf
ILT
17251 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17252 version symbol to be local.
17253 * testsuite/ver_test_4.sh: New file.
17254 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17255 (check_DATA): Add ver_test_4.syms.
17256 (ver_test_4.syms): New target.
17257 * testsuite/Makefile.in: Rebuild.
17258
ab794b6b
ILT
17259 * output.cc
17260 (Output_section::Input_section_sort_entry::has_priority): New
17261 function.
17262 (Output_section::Input_section_sort_entry::match_file_name): New
17263 function.
17264 (Output_section::Input_section_sort_entry::match_section_name):
17265 Remove.
17266 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17267 Remove.
17268 (Output_section::Input_section_sort_entry::match_section_file):
17269 Remove.
17270 (Output_section::Input_section_sort_compare::operator()): Rewrite
17271 using new Input_section_sort_entry functions. Sort crtbegin and
17272 crtend first. Sort sections with no priority before sections with
17273 a priority.
17274 * testsuite/initpri1.c (d3): Check j != 4.
17275 (cd5): New constructor/destructor function.
17276 (main): Check j != 2.
17277
479f6503
ILT
17278 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17279 new symbol when resolving, don't call set_is_default.
17280 * testsuite/ver_test_7.cc: New file.
17281 * testsuite/ver_test_7.sh: New file.
17282 * testsuite/Makefile.am (ver_test_7.so): New target.
17283 (ver_test_7.o): New target.
17284 (check_SCRIPTS): Add ver_test_7.sh.
17285 (check_DATA): Add ver_test_7.syms.
17286 (ver_test_7.syms): New target.
17287
2fd32231
ILT
172882008-03-28 Ian Lance Taylor <iant@google.com>
17289
17290 * layout.cc (Layout::layout): If we see an input section with a
17291 name that needs sorting, set the must_sort flag for the output
17292 section.
17293 (Layout::make_output_section): If the name of the output section
17294 indicates that it might require sorting, set the may_sort flag.
17295 * output.h (Output_section::may_sort_attached_input_sections): New
17296 function.
17297 (Output_section::set_may_sort_attached_input_sections): New
17298 function.
17299 (Output_section::must_sort_attached_input_sections): New
17300 function.
17301 (Output_section::set_must_sort_attached_input_sections): New
17302 function.
17303 (class Output_section): Declare Input_section_sort_entry. Define
17304 Input_section_sort_compare. Declare
17305 sort_attached_input_sections. Add new fields:
17306 may_sort_attached_input_sections_,
17307 must_sort_attached_input_sections_,
17308 attached_input_sections_are_sorted_.
17309 * output.cc (Output_section::Output_section): Initialize new
17310 fields.
17311 (Output_section::add_input_section): Add an entry to
17312 input_sections_ if may_sort or must_sort are true.
17313 (Output_section::set_final_data_size): Call
17314 sort_attached_input_sections if necessary.
17315 (Output_section::Input_section_sort_entry): Define new class.
17316 (Output_section::Input_section_sort_compare::operator()): New
17317 function.
17318 (Output_section::sort_attached_input_sections): New function.
17319 * configure.ac: Check whether the compiler supports constructor
17320 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17321 * testsuite/initpri1.c: New file.
17322 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17323 CONSTRUCTOR_PRIORITY.
17324 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17325 (initpri1_LDFLAGS): New variable.
17326 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17327
18e6b24e
ILT
173282008-03-27 Ian Lance Taylor <iant@google.com>
17329
49bdd526
ILT
17330 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17331 * testsuite/common_test_1.c: New file.
17332 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17333 (common_test_1_SOURCES): New variable.
17334 (common_test_1_DEPENDENCIES): New variable.
17335 (common_test_1_LDFLAGS): New variable.
17336
18e6b24e
ILT
17337 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17338 and commons_ correctly when NAME/VERSION does not override
17339 NAME/NULL.
17340 * testsuite/ver_test_6.c: New file.
17341 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17342 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17343 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17344
04bf7072
ILT
173452008-03-26 Ian Lance Taylor <iant@google.com>
17346
5871526f
ILT
17347 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17348 of an undefined symbol from a version script.
17349 * testsuite/Makefile.am (ver_test_5.so): New target.
17350 (ver_test_5.o): New target.
17351 (check_SCRIPTS): Add ver_test_5.sh.
17352 (check_DATA): Add ver_test_5.syms.
17353 (ver_test_5.syms): New target.
17354 * testsuite/ver_test_5.cc: New file.
17355 * testsuite/ver_test_5.script: New file.
17356 * testsuite/ver_test_5.sh: New file.
17357 * Makefile.in, testsuite/Makefile.in: Rebuild.
17358
04bf7072
ILT
17359 PR gold/5986
17360 Fix problems building gold with gcc 4.3.0.
17361 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17362 (gold_error_at_location, gold_warning_at_location): Use it.
17363 * configure.ac: Check whether we can compile and use a template
17364 function with a printf attribute.
17365 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17366 when jumping over bytes.
17367 * object.cc: Instantiate Object::read_section_data.
17368 * debug.h: Include <cstring>
17369 * dwarf_reader.cc: Include <algorithm>
17370 * main.cc: Include <cstring>.
17371 * options.cc: Include <cstring>.
17372 * output.cc: Include <cstring>.
17373 * script.cc: Include <cstring>.
17374 * script.h: Include <string>.
17375 * symtab.cc: Include <cstring> and <algorithm>.
17376 * target-select.cc: Include <cstring>.
17377 * version.cc: Include <string>.
17378 * testsuite/testmain.cc: Include <cstdlib>.
17379 * configure, config.in: Rebuild.
17380
874c5b28
ILT
173812008-03-25 Ian Lance Taylor <iant@google.com>
17382
819d6c3a
ILT
17383 * options.cc: Include "../bfd/bfdver.h".
17384 (options::help): Print bug reporting address.
17385
f4b2c6f5
ILT
17386 * version.cc (print_version): Adjust output for current value of
17387 BFD_VERSION_STRING.
17388
17389 * NEWS: New file.
17390
e96caa79
ILT
17391 * options.cc (options::help): Print list of supported targets.
17392 * target-select.h: Include <vector>.
17393 (class Target_selector): Make machine_, size_, and is_big_endian_
17394 fields const. Add bfd_name_ and instantiated_target_ fields.
17395 (Target_selector::Target_selector): Add bfd_name parameter.
17396 (Target_selector::recognize): Make non-virtual, call
17397 do_recognize.
17398 (Target_selector::recognize_by_name): Make non-virtual, call
17399 do_recognize_by_name.
17400 (Target_selector::supported_names): New function.
17401 (Target_selector::bfd_name): New function.
17402 (Target_selector::do_instantiate_target): New pure virtual
17403 function.
17404 (Target_selector::do_recognize): New virtual function.
17405 (Target_selector::do_recognize_by_name): New virtual function.
17406 (Target_selector::instantiate_target): New private function.
17407 (supported_target_names): Declare.
17408 * target-select.cc (Target_selector::Target_selector): Update for
17409 new parameter and fields.
17410 (select_target_by_name): Check that the name matches before
17411 calling recognize_by_name.
17412 (supported_target_names): New function.
17413 * i386.cc (class Target_selector_i386): Update Target_selector
17414 constructor call. Remove recognize and recognize_by_name. Add
17415 do_instantiate_target.
17416 * x86_64.cc (class Target_selector_x86_64): Likewise.
17417 * testsuite/testfile.cc (class Target_selector_test): Update for
17418 changes to Target_selector.
17419
874c5b28
ILT
17420 * README: Rewrite, with some notes on unsupported features.
17421
0a65a3a7
CC
174222008-03-24 Cary Coutant <ccoutant@google.com>
17423
17424 * i386.cc (Target_i386::Got_type): New enum declaration.
17425 (Target_i386::Scan::local): Updated callers of Output_data_got
17426 member functions.
17427 (Target_i386::Scan::global): Likewise.
17428 (Target_i386::Relocate::relocate): Likewise.
17429 (Target_i386::Relocate::relocate_tls): Likewise.
17430 * object.h (Got_offset_list): New class.
17431 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17432 (Sized_relobj::local_got_offset): Likewise.
17433 (Sized_relobj::set_local_got_offset): Likewise.
17434 (Sized_relobj::local_has_tls_got_offset): Removed.
17435 (Sized_relobj::local_tls_got_offset): Removed.
17436 (Sized_relobj::set_local_tls_got_offset): Removed.
17437 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17438 * output.cc (Output_data_got::add_global): Added got_type parameter.
17439 (Output_data_got::add_global_with_rel): Likewise.
17440 (Output_data_got::add_global_with_rela): Likewise.
17441 (Output_data_got::add_global_pair_with_rel): New function.
17442 (Output_data_got::add_global_pair_with_rela): New function.
17443 (Output_data_got::add_local): Added got_type parameter.
17444 (Output_data_got::add_local_with_rel): Likewise.
17445 (Output_data_got::add_local_with_rela): Likewise.
17446 (Output_data_got::add_local_pair_with_rel): New function.
17447 (Output_data_got::add_local_pair_with_rela): New function.
17448 (Output_data_got::add_global_tls): Removed.
17449 (Output_data_got::add_global_tls_with_rel): Removed.
17450 (Output_data_got::add_global_tls_with_rela): Removed.
17451 (Output_data_got::add_local_tls): Removed.
17452 (Output_data_got::add_local_tls_with_rel): Removed.
17453 (Output_data_got::add_local_tls_with_rela): Removed.
17454 * output.h (Output_data_got::add_global): Added got_type parameter.
17455 (Output_data_got::add_global_with_rel): Likewise.
17456 (Output_data_got::add_global_with_rela): Likewise.
17457 (Output_data_got::add_global_pair_with_rel): New function.
17458 (Output_data_got::add_global_pair_with_rela): New function.
17459 (Output_data_got::add_local): Added got_type parameter.
17460 (Output_data_got::add_local_with_rel): Likewise.
17461 (Output_data_got::add_local_with_rela): Likewise.
17462 (Output_data_got::add_local_pair_with_rel): New function.
17463 (Output_data_got::add_local_pair_with_rela): New function.
17464 (Output_data_got::add_global_tls): Removed.
17465 (Output_data_got::add_global_tls_with_rel): Removed.
17466 (Output_data_got::add_global_tls_with_rela): Removed.
17467 (Output_data_got::add_local_tls): Removed.
17468 (Output_data_got::add_local_tls_with_rel): Removed.
17469 (Output_data_got::add_local_tls_with_rela): Removed.
17470 * resolve.cc (Symbol::override_base_with_special): Removed
17471 reference to has_got_offset_ field.
17472 * symtab.cc (Symbol::init_fields): Replaced initialization
17473 of got_offset_ with got_offsets_. Removed initialization
17474 of has_got_offset_
53fcba31 17475 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17476 (Symbol::got_offset): Likewise.
17477 (Symbol::set_got_offset): Likewise.
17478 (Symbol::has_tls_got_offset): Removed.
17479 (Symbol::tls_got_offset): Removed.
17480 (Symbol::set_tls_got_offset): Removed.
17481 (Symbol::got_offset_): Removed.
17482 (Symbol::tls_mod_got_offset_): Removed.
17483 (Symbol::tls_pair_got_offset_): Removed.
17484 (Symbol::got_offsets_): New field.
17485 (Symbol::has_got_offset): Removed.
17486 (Symbol::has_tls_mod_got_offset): Removed.
17487 (Symbol::has_tls_pair_got_offset): Removed.
17488 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17489 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17490 member functions.
17491 (Target_x86_64::Scan::global): Likewise.
17492 (Target_x86_64::Relocate::relocate): Likewise.
17493 (Target_x86_64::Relocate::relocate_tls): Likewise.
17494
bd52eafb
BE
174952008-03-25 Ben Elliston <bje@au.ibm.com>
17496
17497 * yyscript.y: Fix spelling error in comment.
17498
8b105e34
ILT
174992008-03-24 Ian Lance Taylor <iant@google.com>
17500
8ed814a9
ILT
17501 * options.h (class General_options): Define build_id option.
17502 * layout.h (class Layout): Declare write_build_id, create_note,
17503 create_build_id. Add build_id_note_ member.
17504 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17505 "libiberty.h", "md5.h", "sha1.h".
17506 (Layout::Layout): Initialize eh_frame_data_,
17507 eh_frame_hdr_section_, and build_id_note_.
17508 (Layout::finalize): Call create_build_id.
17509 (Layout::create_note): New function, broken out of
17510 Layout::create_gold_note.
17511 (Layout::create_gold_note): Call create_note.
17512 (Layout::create_build_id): New function.
17513 (Layout::write_build_id): New function.
17514 (Close_task_runner::run): Call write_build_id.
17515
8b105e34
ILT
17516 * x86_64.cc: Correct license to GPLv3.
17517
086a1841
ILT
175182008-03-23 Ian Lance Taylor <iant@google.com>
17519
17520 * options.cc: Include "demangle.h".
17521 (parse_optional_string): New function.
17522 (parse_long_option): Handle takes_optional_argument.
17523 (parse_short_option): Update dash_z initializer. Handle
17524 takes_optional_argument.
17525 (General_options::General_options): Initialize do_demangle_.
17526 (General_options::finalize): Set do_demangle_. Handle demangling
17527 style.
17528 * options.h (parse_optional_string): Declare.
17529 (struct One_option): Add optional_arg field. Update constructor.
17530 Update call constructor calls. Add takes_optional_argument
17531 function.
17532 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17533 (DEFINE_optional_string): Define.
17534 (General_options::demangle): Change from DEFINE_bool to
17535 DEFINE_optional_string.
17536 (General_options::no_demangle): New function.
17537 (General_options::do_demangle): New function.
17538 (General_options::set_do_demangle): New function.
17539 (General_options::execstack_status_): Move definition to end of
17540 class definition.
17541 (General_options::static_): Likewise.
17542 (General_options::do_demangle_): New field.
17543 * object.cc (big_endian>::get_symbol_location_info): Call
17544 Options::do_demangle, not Options::demangle.
17545 * symtab.cc (demangle): Likewise.
17546
cbb93e63
ILT
175472008-03-22 Ian Lance Taylor <iant@google.com>
17548
17549 * gold.h: Include <cstddef> and <sys/types.h>
17550 * options.h: Include <cstring>.
17551
ec531623
ILT
175522008-03-21 Ian Lance Taylor <iant@google.com>
17553
17554 * Added source code to GNU binutils.
752937aa 17555\f
b90efa5b 17556Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17557
17558Copying and distribution of this file, with or without modification,
17559are permitted in any medium without royalty provided the copyright
17560notice and this notice are preserved.
17561
17562Local Variables:
17563mode: change-log
17564left-margin: 8
17565fill-column: 74
17566version-control: never
17567End:
This page took 1.10831 seconds and 4 git commands to generate.